Abstract Readonly Abstract bridgeContains bridge provider's type used in route.
Readonly Abstract feeSwap fee information.
Readonly Abstract fromToken to sell with input amount.
Readonly Abstract isTrue, if provider is aggregator.
Readonly Abstract onContains on-chain providers' type used in route.
Promotions array.
Readonly Abstract toToken to get with output amount.
Readonly Abstract toMinimum amount of output token user will get in Eth units.
Readonly Abstract typeType of calculated cross-chain trade.
Abstract approveSends approve transaction with connected wallet.
Transaction options.
Optional checkNeedApprove: booleanIf true, first allowance is checked.
Optional amount: BigNumber | "infinity"Amount of tokens in approval window in spending cap field
Abstract encodeBuilds transaction config, with encoded data.
Encode transaction options.
Abstract encodeBuild encoded approve transaction config.
Encoded approve transaction config.
Address of the smart-contract corresponding to the token.
Wallet or contract address to approve.
Token amount to approve in wei.
Optional options: BasicTransactionOptionsAdditional options.
Abstract getAbstract getAbstract swapSends swap transaction with connected wallet. If user has not enough allowance, then approve transaction will be called first.
const onConfirm = (hash: string) => console.log(hash);
const receipt = await trade.swap({ onConfirm });
Optional options: SwapTransactionOptionsTransaction options.
Generated using TypeDoc
Abstract class for all cross-chain providers' trades.