Skip to content

Commit

Permalink
swapTx/fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Velenir committed Sep 10, 2024
1 parent 1a200a5 commit 82b2e8f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/methods/swap/swapTx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ContractMethod, API_URL, DEFAULT_VERSION } from '../../constants';
import { constructSearchString } from '../../helpers/misc';
import type { ConstructFetchInput, SwapApiResponse } from '../../types';
import { noramalizeRateOptions } from './helpers/normalizeRateOptions';
import { normalizeRateOptions } from './helpers/normalizeRateOptions';

/**
* Types for transaction parameters.
Expand Down Expand Up @@ -30,18 +30,13 @@ type SwapQueryParams = {
/**
* @description **SELL** or **BUY**. Default: `SELL`.
*/
side?: 'SELL' | 'BUY';
side: 'SELL' | 'BUY';

/**
* @description Network ID. (Mainnet - 1, Optimism - 10, BSC - 56, Polygon - 137, Fantom - 250, zkEVM - 1101, Base - 8453, Arbitrum - 42161, Avalanche - 43114). Default: `1`.
*/
network?: number;

/**
* @description If provided, **others** object is filled in the response with price quotes from other exchanges _(if available for comparison)_. Default: `false`.
*/
otherExchangePrices?: boolean;

/**
* @description Comma Separated List of DEXs to include. **Supported DEXs:** Uniswap, Kyber, Bancor, AugustusRFQ, Oasis, Compound, Fulcrum, 0x, MakerDAO, Chai, Aave, Aave2, MultiPath, MegaPath, Curve, Curve3, Saddle, IronV2, BDai, idle, Weth, Beth, UniswapV2, Balancer, 0xRFQt, SushiSwap, LINKSWAP, Synthetix, DefiSwap, Swerve, CoFiX, Shell, DODOV1, DODOV2, OnChainPricing, PancakeSwap, PancakeSwapV2, ApeSwap, Wbnb, acryptos, streetswap, bakeryswap, julswap, vswap, vpegswap, beltfi, ellipsis, QuickSwap, COMETH, Wmatic, Nerve, Dfyn, UniswapV3, Smoothy, PantherSwap, OMM1, OneInchLP, CurveV2, mStable, WaultFinance, MDEX, ShibaSwap, CoinSwap, SakeSwap, JetSwap, Biswap, BProtocol eg: `UniswapV3,0x`.
*/
Expand Down Expand Up @@ -88,9 +83,9 @@ type SwapQueryParams = {
partnerAddress?: string;

/**
* @description Allowed slippage percentage represented in basis points. _Eg:_ for **2.5%** slippage, set the value to **2.5 \* 100 = 250**; for 10% = 1000. Slippage could be passed instead of `destAmount` when **side=SELL** or `srcAmount` when **side=BUY**. `Min: 0; Max: 10000`.
* @description Allowed slippage percentage represented in basis points. _Eg:_ for **2.5%** slippage, set the value to **2.5 \* 100 = 250**; for 10% = 1000.
*/
slippage?: number;
slippage: number;

/**
* @description Destination Token Decimals. (Can be omitted if Token Symbol is used in `destToken`).
Expand Down Expand Up @@ -165,7 +160,8 @@ type SwapTxInputFields =
| 'side'
| 'srcDecimals'
| 'destDecimals'
| 'userAddress';
| 'userAddress'
| 'slippage';
type SwapTxInputListFields =
| 'includeDEXS'
| 'excludeDEXS'
Expand Down

0 comments on commit 82b2e8f

Please sign in to comment.