Readonly
feeReadonly
fromToken to sell with input amount.
Readonly
gasGas fee info, including gas limit and gas price.
Readonly
pathReadonly
permit2Filled if approve goes through permit2 contract
Readonly
providerReadonly
slippageReadonly
toToken to get with output amount.
Readonly
typeReadonly
useTrue, if trade must be swapped through on-chain proxy contract.
Price impact, based on tokens' usd prices.
Minimum amount of output token user can get.
Sends approve transaction with connected wallet.
Transaction options.
If true, first allowance is checked.
Amount of tokens in approval window in spending cap field
Builds transaction config, with encoded data.
Encode transaction options.
Builds 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.
Additional options.
Encodes trade to swap it directly through dex contract.
Encode options.
Sends 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 });
Transaction options.
Static
getGenerated using TypeDoc
Abstract class for all instant trade providers' trades.