@cfxlabsinc/b2b-services
    Preparing search index...

    Signs the outflows that debit a ledger account. An account on an imported key keeps its MOVEUSD at its PDA (mintfx credits) and at the key's own Solana addresses (external deposits). When the PDA is short, the transaction first moves the shortfall into the PDA from those addresses, account index order. Either way it is one wallet-api request: PAYER and MINTFX_AUTHORITY, plus the imported wallet's walletId when a top-up draws on its addresses.

    Index
    instance: (...args: []) => SolanaLedgerAccountDebitService = ...

    The process default: MINTFX_ENV read at each call.

    • message, an outflow of amount from ledgerAccountId, signed in one wallet-api request under reference: PAYER and MINTFX_AUTHORITY, and with a top-up prepended, every imported address it draws on by walletId.

      Parameters

      Returns Promise<
          | {
              ok: true;
              value: Readonly<
                  { messageBytes: TransactionMessageBytes; signatures: SignaturesMap },
              > & TransactionWithLifetime;
          }
          | { error: LedgerAccountDebitSignError; ok: false },
      >

    • The top-up amount leaving ledgerAccountId needs. None for an account whose primary is its PDA (decided from the database, no chain read), nor when the PDA covers amount. A primary key beside the PDA is an import's or a migrated MoveMoney wallet's. The shortfall is drawn from the key's Solana addresses in account index order, one transferChecked each. When they cannot cover it, none is added and the mintfx instruction fails as insufficient funds, unless the account's other-chain MOVEUSD would: that refuses here.

      Parameters

      • __namedParameters: { amount: Value; ledgerAccountId: string; payer: Address }

      Returns Promise<
          | { ok: true; value: LedgerAccountTopUp }
          | { error: FundsOnAnotherChainError; ok: false },
      >