Skip to content

Commit

Permalink
(fix) exclude router on certain chains
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtality committed Jul 29, 2024
1 parent e98d888 commit 7e565d4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/connectors/uniswap/uniswap.lp.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,22 @@ export class UniswapLPHelper {
throw new Error('Unsupported chain');
}
this.chainId = this.chain.chainId;

this._alphaRouter = null;
if (this.chainId !== 11155111 && this.chainId !== 8453) {
const excluded_chainIds = [
11155111, // sepolia
8453, // base
56, // binance-smart-chain
42220, // celo
43114, // avalanche
];
if (this.chainId in excluded_chainIds) {
this._alphaRouter = new AlphaRouter({
chainId: this.chainId,
provider: this.chain.provider,
});
}

this._factory = UniswapConfig.config.uniswapV3FactoryAddress(chain, network);
this._router =
UniswapConfig.config.uniswapV3SmartOrderRouterAddress(chain, network);
Expand Down

0 comments on commit 7e565d4

Please sign in to comment.