Documentation
    Preparing search index...
    • Builds a swap transaction from a quote

      This function constructs a complete swap transaction based on a quote from the aggregator. It handles service fees, multiple routes, and ensures proper transaction structure.

      Parameters

      • userAddress: string

        User's wallet address

      • txb: Transaction

        Transaction object to build

      • minAmountOut: number

        Minimum output amount (slippage protection)

      • coinIn: TransactionResult

        Input coin for the swap

      • quote: Quote

        Quote from the aggregator

      • referral: number = 0

        Referral ID for tracking

      • ifPrint: boolean = true

        Whether to print debug information

      • OptionalapiKey: string

        API key for aggregator access

      • OptionalswapOptions: SwapOptions

        Swap configuration options

      Returns Promise<TransactionResult>

      Transaction result representing the output coin