Abstract
Readonly
Abstract
feeReadonly
Abstract
fromToken to sell with input amount.
Readonly
Abstract
pathReadonly
Abstract
slippageReadonly
Abstract
toToken to get with output amount.
Price impact, based on tokens' usd prices.
Minimum amount of output token user can get.
Abstract
typeType of instant trade provider.
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
encodeBuilds 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
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 trades[TRADE_TYPE.UNISWAP_V2].swap({ onConfirm });
Optional
options: SwapTransactionOptionsTransaction options.
Generated using TypeDoc
Abstract class for all instant trade providers' trades.