function swap(
uint256 fromTokenAmount,
SwapInfo[] calldata swapInfos,
SwapInfo[] calldata targetChainSwapInfo,
address receiver
)
ABI of contract could be found in this file.
Following are introductions of each parameter of the swap
function.
amount of token that a client swaps from
array of
SwapInfo
, containing information of each step on source chain.SwapInfo
would be explained in the last.
array of
SwapInfo
, containing information of each step on target chain.
address of the user that receives asset on target chain
struct SwapInfo { uint8 chainId; address dex; IERC20 fromToken; IERC20 toToken; bytes swapData; }
ID of the chain that this swapInfo would be performed on. For example, if a client attempts to swap from ETH to BSC,
chain_id
of swapInfos would be1
; ones oftargetChainSwapInfos
would be56
.The "to" address of the swap action.
The token planned to be swapped from of the swap action.
The token planned to be swapped for of the swap action.
The calldata that would be sent to
dex
.