Skip to content

Commit

Permalink
add fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Oct 2, 2023
1 parent 8c5ec8d commit 0c153db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/dex/dexalot/dexalot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
PairDataMap,
PriceDataMap,
DexalotRfqError,
DexalotAPIParameters,
RFQResponse,
RFQResponseError,
TokenAddrDataMap,
Expand Down Expand Up @@ -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<DexalotData> {
readonly isStatePollingDex = true;
Expand Down Expand Up @@ -895,14 +895,13 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
}

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,
});
Expand All @@ -915,7 +914,7 @@ export class Dexalot extends SimpleExchange implements IDex<DexalotData> {
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 },
Expand Down
8 changes: 8 additions & 0 deletions src/dex/dexalot/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { RequestHeaders } from '../../dex-helper';
import { Token } from '../../types';
import { Method } from '../../dex-helper/irequest-wrapper';

type RFQOrder = {
nonceAndMeta: string;
Expand Down Expand Up @@ -121,3 +122,10 @@ export type DexalotRateFetcherConfig = {
tokensCacheTTLSecs: number;
};
};

export type DexalotAPIParameters = {
url: string;
headers?: RequestHeaders;
params?: any;
method?: Method;
};

0 comments on commit 0c153db

Please sign in to comment.