Swap2CommonOptions
Defined in: protocols/swap2.ts:29
What every swap names: the tokens, the destination chain and who receives.
Properties
Section titled “Properties”fromToken
Section titled “fromToken”fromToken:
string
Defined in: protocols/swap2.ts:34
Token on the source chain: contract, mint or jetton address, or a catalog symbol such as
'USDC'.
fromTokenDecimals?
Section titled “fromTokenDecimals?”
optionalfromTokenDecimals?:number
Defined in: protocols/swap2.ts:40
Decimals of fromToken when it is a token the swap catalog does not list (named by its
contract or mint). Engines that accept unlisted tokens read it from the chain when it is left
out; listed tokens ignore it.
minAmountOut?
Section titled “minAmountOut?”
optionalminAmountOut?:number|bigint
Defined in: protocols/swap2.ts:55
Minimum acceptable destination amount, base units (overrides slippage when set).
recipient?
Section titled “recipient?”
optionalrecipient?:string
Defined in: protocols/swap2.ts:49
Who receives on the destination chain. Defaults to the swapping account’s address on that chain when the provider can derive it.
refundAddress?
Section titled “refundAddress?”
optionalrefundAddress?:string
Defined in: protocols/swap2.ts:51
Where a failed cross-chain swap sends the input back. Defaults to the source address.
slippage?
Section titled “slippage?”
optionalslippage?:number
Defined in: protocols/swap2.ts:53
Decimal, 0.01 = 1 %.
toChain?
Section titled “toChain?”
optionaltoChain?:string|number
Defined in: protocols/swap2.ts:44
Destination chain. Omitted = same-chain swap.
toToken
Section titled “toToken”toToken:
string
Defined in: protocols/swap2.ts:42
Token on the destination chain, in the same forms.