From 0c153db9c58397b8ca81867147f8b61097013eed Mon Sep 17 00:00:00 2001 From: Alexander Burkut Date: Mon, 2 Oct 2023 13:00:18 +0300 Subject: [PATCH] add fixes --- src/dex/dexalot/dexalot.ts | 9 ++++----- src/dex/dexalot/types.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/dex/dexalot/dexalot.ts b/src/dex/dexalot/dexalot.ts index 6c0f3626c..9cda49839 100644 --- a/src/dex/dexalot/dexalot.ts +++ b/src/dex/dexalot/dexalot.ts @@ -28,6 +28,7 @@ import { PairDataMap, PriceDataMap, DexalotRfqError, + DexalotAPIParameters, RFQResponse, RFQResponseError, TokenAddrDataMap, @@ -60,7 +61,6 @@ import { BI_MAX_UINT256 } from '../../bigint-constants'; import { ethers } from 'ethers'; import BigNumber from 'bignumber.js'; import { Method } from '../../dex-helper/irequest-wrapper'; -import { SwaapV2APIParameters } from '../swaap-v2/types'; export class Dexalot extends SimpleExchange implements IDex { readonly isStatePollingDex = true; @@ -895,14 +895,13 @@ export class Dexalot extends SimpleExchange implements IDex { } const denormalizedToken = this.denormalizeToken(outputToken); - const wrappedToken = this.dexHelper.config.wrapETH(denormalizedToken); pairsByLiquidity.push({ exchange: this.dexKey, address: this.mainnetRFQAddress, connectorTokens: [{ - address: wrappedToken.address, - decimals: wrappedToken.decimals, + address: denormalizedToken.address, + decimals: denormalizedToken.decimals, }], liquidityUSD: pairs[pairName].liquidityUSD, }); @@ -915,7 +914,7 @@ export class Dexalot extends SimpleExchange implements IDex { return pairsByLiquidity.slice(0, limit); } - getAPIReqParams(endpoint: string, method: Method): SwaapV2APIParameters { + getAPIReqParams(endpoint: string, method: Method): DexalotAPIParameters { return { url: `${DEXALOT_API_URL}/${endpoint}`, headers: { 'x-apikey': this.dexalotAuthToken }, diff --git a/src/dex/dexalot/types.ts b/src/dex/dexalot/types.ts index dee55de3a..41bc53257 100644 --- a/src/dex/dexalot/types.ts +++ b/src/dex/dexalot/types.ts @@ -1,5 +1,6 @@ import { RequestHeaders } from '../../dex-helper'; import { Token } from '../../types'; +import { Method } from '../../dex-helper/irequest-wrapper'; type RFQOrder = { nonceAndMeta: string; @@ -121,3 +122,10 @@ export type DexalotRateFetcherConfig = { tokensCacheTTLSecs: number; }; }; + +export type DexalotAPIParameters = { + url: string; + headers?: RequestHeaders; + params?: any; + method?: Method; +};