Interface SwapByRouteParams

Encodes a sendAsset into the routers calldata.

Param: messageVerifyGasCost

The cost to verify a message by the underlying messaging protocol. Can be found by calling the CCI on estimateAdditionalCost.

Param: priceOfDeliveryGas

What is the (wei) cost of gas on the destination chain? Can be found by getting the gas cost on the destination chain (in wei) and converting it into source chain (in wei).

Param: priceOfAckGas

What is the (wei) cost of gas on the source chain. Should be set slightly higher than base gas. (otherwise tx fails.)

Param: targetDelta

The estimated time to verify the message. Should be set slightly longer.

Param: refundGasTo

Who should the excess gas (on ack) be refunded to? !Set to an address! Which should likely to be the sender or origin of the transaction.

interface SwapByRouteParams {
    amount: bigint;
    channelId: string;
    fromAsset: string;
    fromChainId: string;
    messageVerifyGasCost: bigint;
    minOut: bigint;
    permitData?: PermitData;
    priceOfAckGas: bigint;
    priceOfDeliveryGas: bigint;
    refundGasTo: string;
    route: RouteDetails;
    targetDelta: bigint;
    toAccount: string;
    toAsset: string;
    toAssetIndex: number;
    toChainId: string;
    underwritingIncentive: undefined | bigint;
}

Hierarchy (view full)

Properties

amount: bigint
channelId: string
fromAsset: string
fromChainId: string
messageVerifyGasCost: bigint
minOut: bigint
permitData?: PermitData
priceOfAckGas: bigint
priceOfDeliveryGas: bigint
refundGasTo: string
targetDelta: bigint
toAccount: string
toAsset: string
toAssetIndex: number
toChainId: string
underwritingIncentive: undefined | bigint