From 0475e22e04bc8d30300bb27e47fbd77926303376 Mon Sep 17 00:00:00 2001 From: Nikolai Evseev <65676073+evseevnn@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:23:03 +0100 Subject: [PATCH] Fixed Shibaswap multiple chains support --- src/connectors/shibaswap/shibaswap.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/connectors/shibaswap/shibaswap.ts b/src/connectors/shibaswap/shibaswap.ts index 9034c4464c..016ea2a0f6 100644 --- a/src/connectors/shibaswap/shibaswap.ts +++ b/src/connectors/shibaswap/shibaswap.ts @@ -28,10 +28,11 @@ import { import { percentRegexp } from '../../services/config-manager-v2'; import { logger } from '../../services/logger'; import { getAddress } from 'ethers/lib/utils'; +import { Ethereum } from '../../chains/ethereum/ethereum'; export class Shibaswap implements Uniswapish { private static _instances: { [name: string]: Shibaswap }; - private chain: Shibarium; + private chain: Shibarium | Ethereum; private _router: string; private _routerAbi: ContractInterface; private _gasLimitEstimate: number; @@ -42,8 +43,10 @@ export class Shibaswap implements Uniswapish { private constructor(chain: string, network: string) { const config = ShibaswapConfig.config; - if (['shibarium', 'ethereum'].includes(chain)) { + if (chain === 'shibarium') { this.chain = Shibarium.getInstance(network); + } else if (chain === 'ethereum') { + this.chain = Ethereum.getInstance(network); } else { throw new Error('unsupported chain'); }