Documentation
    Preparing search index...
    • Performs a complete swap operation

      This function orchestrates the entire swap process including:

      • Quote retrieval from aggregator
      • Transaction building with service fees
      • Referral tracking

      Parameters

      • address: string

        User's wallet address

      • txb: Transaction

        Transaction object to build

      • fromCoinAddress: string

        Source coin address

      • toCoinAddress: string

        Target coin address

      • coin: TransactionResult

        Input coin for the swap

      • amountIn: string | number | bigint

        Amount to swap

      • minAmountOut: number

        Minimum output amount

      • OptionalapiKey: string

        API key for aggregator access

      • swapOptions: SwapOptions = ...

        Swap configuration options

      Returns Promise<TransactionResult>

      Transaction result representing the output coin