CDP SDK TypeScript - v1.31.0
    Preparing search index...

    Interface CreateSwapQuoteResult

    Result of creating a swap quote.

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

    Properties

    liquidityAvailable: true

    Whether liquidity is available for the swap.

    network: EvmSwapsNetwork

    The network for which this swap quote was created.

    toToken: `0x${string}`

    The token to receive (destination token).

    fromToken: `0x${string}`

    The token to send (source token).

    fromAmount: bigint

    The amount to send in atomic units of the token.

    toAmount: bigint

    The amount to receive in atomic units of the token.

    minToAmount: bigint

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

    blockNumber: bigint

    The block number at which the liquidity conditions were examined.

    fees: SwapFees

    The estimated fees for the swap.

    issues: SwapIssues

    Potential issues discovered during validation.

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

    The transaction to execute the swap.

    Type declaration

    • to: `0x${string}`

      The contract address to send the transaction to.

    • data: `0x${string}`

      The transaction data.

    • value: bigint

      The value to send with the transaction in Wei.

    • gas: bigint

      The gas limit for the transaction.

    • gasPrice: bigint

      The gas price for the transaction in Wei.

    permit2?: { eip712: EIP712Message }

    Permit2 data if required for the swap.

    Type declaration

    • eip712: EIP712Message

      EIP-712 typed data for signing.

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

    Execute the swap using the quote.

    Type declaration