Readonly dexReadonly 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 slippageReadonly toToken to get with output amount.
Readonly useTrue, if trade must be swapped through on-chain proxy contract.
Readonly wrappedPrice impact, based on tokens' usd prices.
Minimum amount of output token user can get.
Type of instant trade provider.
Static typeSends 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 estimateStatic estimateGenerated using TypeDoc
Abstract class for all instant trade providers' trades.