interface CommonSwapResponse {
    blockNumber: string;
    fees: CommonSwapResponseFees;
    fromAmount: string;
    fromToken: string;
    issues: CommonSwapResponseIssues;
    liquidityAvailable: boolean;
    minToAmount: string;
    toAmount: string;
    toToken: string;
}

Properties

blockNumber: string

The block number at which the liquidity conditions were examined.

^[1-9]\d*$

The estimated fees for the swap.

fromAmount: string

The amount of the fromToken that will be sent in this swap, in atomic units of the fromToken. For example, 1000000000000000000 when sending ETH equates to 1 ETH, 1000000 when sending USDC equates to 1 USDC, etc.

^(0|[1-9]\d*)$

fromToken: string

The 0x-prefixed contract address of the token that will be sent.

^0x[a-fA-F0-9]{40}$

An object containing potential issues discovered during validation that could prevent the swap from being executed successfully.

liquidityAvailable: boolean

Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false.

minToAmount: string

The minimum amount of the toToken that must be received for the swap to succeed, in atomic units of the toToken. For example, 1000000000000000000 when receiving ETH equates to 1 ETH, 1000000 when receiving USDC equates to 1 USDC, etc. This value is influenced by the slippageBps parameter.

^(0|[1-9]\d*)$

toAmount: string

The amount of the toToken that will be received in atomic units of the toToken. For example, 1000000000000000000 when receiving ETH equates to 1 ETH, 1000000 when receiving USDC equates to 1 USDC, etc.

^(0|[1-9]\d*)$

toToken: string

The 0x-prefixed contract address of the token that will be received.

^0x[a-fA-F0-9]{40}$