Skip to content

TODO: Implement rebalance_until_target() for multi-mint support #20

@shroominic

Description

@shroominic

TODO Location

sixty_nuts/wallet.py:1588

Priority

🔴 High Priority - Core functionality for multi-mint operations

Current Code

async def rebalance_until_target(self, target_mint: str, total_needed: int) -> None:
    """Rebalance until the target mint has at least the total needed."""
    raise NotImplementedError("Not implemented")  # TODO: Implement

What needs to be done

  • Implement automatic rebalancing between mints to ensure a target mint has sufficient balance
  • Transfer proofs from other mints to the target mint until it has at least total_needed amount
  • Handle Lightning payment infrastructure requirements for cross-mint transfers
  • Optimize transfers to minimize fees

Implementation approach

  1. Check current balance at target mint
  2. Calculate deficit amount
  3. Select source mints with available balance
  4. Use transfer_balance_to_mint() to move funds
  5. Handle partial transfers if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions