Skip to content

prepareSwapTransactions

See the full code here.

prepareSwapTransactions(
params: SwapParams,
userAddress: string,
slippageBps: number | bigint,
swapQuote: SwapQuote,
): Promise<SwapTransactions>

Returns

Returns a Promise that, when resolved, provides the necessary transactions to perform the swap.

type SwapTransactions = string[];

Parameters

Terminal window
# The set of parameters used for executing the swap
params: SwapParams
# The address performing the transaction
userAddress: string
# The slippage percentage to perform the transaction
slippageBps: number | bigint
# The object returned from fetchSwapQuote
swapQuote: SwapQuote