From 75faa481ec53e482f1c440be342bb79a3460b6a4 Mon Sep 17 00:00:00 2001 From: Shresth Agrawal Date: Fri, 22 Apr 2022 16:23:23 +0200 Subject: [PATCH 1/2] getDexKeySpecial special handling for getAdapters --- src/dex/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dex/index.ts b/src/dex/index.ts index d88bbdd1..d3b9a387 100644 --- a/src/dex/index.ts +++ b/src/dex/index.ts @@ -238,9 +238,9 @@ export class DexAdapterService { return side === SwapSide.SELL ? this.sellAdapters : this.buyAdapters; } - getDexKeySpecial(dexKey: string) { + getDexKeySpecial(dexKey: string, isAdapters: boolean = false) { dexKey = dexKey.toLowerCase(); - if (/^paraswappool(.*)/i.test(dexKey)) return 'zerox'; + if (!isAdapters && /^paraswappool(.*)/i.test(dexKey)) return 'zerox'; else if ('uniswapforkoptimized' === dexKey) { if (!this.uniswapV2Alias) throw new Error( @@ -252,7 +252,7 @@ export class DexAdapterService { } getAdapter(dexKey: string, side: SwapSide) { - const specialDexKey = this.getDexKeySpecial(dexKey); + const specialDexKey = this.getDexKeySpecial(dexKey, true); return side === SwapSide.SELL ? this.sellAdapters[specialDexKey] : this.buyAdapters[specialDexKey]; From c2d82ebc7789e8a788ae6cb73fa52bb45869703c Mon Sep 17 00:00:00 2001 From: Shresth Agrawal Date: Fri, 22 Apr 2022 16:35:58 +0200 Subject: [PATCH 2/2] 2.0.22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8087e3fa..a8290102 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@paraswap/dex-lib", - "version": "2.0.21", + "version": "2.0.22", "main": "build/index.js", "types": "build/index.d.ts", "repository": "https://github.com/paraswap/paraswap-dex-lib",