Result of creating a swap quote.

interface CreateSwapQuoteResult {
    blockNumber: bigint;
    execute: (
        options?: ExecuteSwapQuoteOptions,
    ) => Promise<ExecuteSwapQuoteResult>;
    fees: SwapFees;
    fromAmount: bigint;
    fromToken: `0x${string}`;
    issues: SwapIssues;
    liquidityAvailable: true;
    minToAmount: bigint;
    network: EvmSwapsNetwork;
    permit2?: { eip712: EIP712Message };
    toAmount: bigint;
    toToken: `0x${string}`;
    transaction?: {
        data: `0x${string}`;
        gas: bigint;
        gasPrice: bigint;
        to: `0x${string}`;
        value: bigint;
    };
}

Properties

blockNumber: bigint

The block number at which the liquidity conditions were examined.

execute: (options?: ExecuteSwapQuoteOptions) => Promise<ExecuteSwapQuoteResult>

Execute the swap using the quote.

Type declaration

fees: SwapFees

The estimated fees for the swap.

fromAmount: bigint

The amount to send in atomic units of the token.

fromToken: `0x${string}`

The token to send (source token).

issues: SwapIssues

Potential issues discovered during validation.

liquidityAvailable: true

Whether liquidity is available for the swap.

minToAmount: bigint

The minimum amount to receive after slippage in atomic units of the token.

The network for which this swap quote was created.

permit2?: { eip712: EIP712Message }

Permit2 data if required for the swap.

Type declaration

toAmount: bigint

The amount to receive in atomic units of the token.

toToken: `0x${string}`

The token to receive (destination token).

transaction?: {
    data: `0x${string}`;
    gas: bigint;
    gasPrice: bigint;
    to: `0x${string}`;
    value: bigint;
}

The transaction to execute the swap.

Type declaration

  • data: `0x${string}`

    The transaction data.

  • gas: bigint

    The gas limit for the transaction.

  • gasPrice: bigint

    The gas price for the transaction in Wei.

  • to: `0x${string}`

    The contract address to send the transaction to.

  • value: bigint

    The value to send with the transaction in Wei.