computeSwapResultV2

pre-compute the swap result before user comfirm transaction.

Signature

computeSwapResultV2(options: ComputeSwapResultOptionsV2): Promise<Transaction>

Params

interface ComputeSwapResultOptionsV2 {
  pools: Array<{
    // Pool object ID
    pool: string;
    // swap from coinA to coinB
    a2b: boolean;
    amountSpecified: string | number 
  }>;
  // Operator's wallet address
  address: string;
  amountSpecifiedIsInput: boolean;
  tickStep?: number;
}

Examples

const swapResult = await sdk.trade.computeSwapResultV2({});

Last updated