Skip to content
docs

Swap2CommonOptions

Defined in: protocols/swap2.ts:29

What every swap names: the tokens, the destination chain and who receives.

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'.


optional fromTokenDecimals?: 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.


optional minAmountOut?: number | bigint

Defined in: protocols/swap2.ts:55

Minimum acceptable destination amount, base units (overrides slippage when set).


optional recipient?: 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.


optional refundAddress?: string

Defined in: protocols/swap2.ts:51

Where a failed cross-chain swap sends the input back. Defaults to the source address.


optional slippage?: number

Defined in: protocols/swap2.ts:53

Decimal, 0.01 = 1 %.


optional toChain?: string | number

Defined in: protocols/swap2.ts:44

Destination chain. Omitted = same-chain swap.


toToken: string

Defined in: protocols/swap2.ts:42

Token on the destination chain, in the same forms.