From e56c6bbbf94d05505f848c273f7f70fd07aa7920 Mon Sep 17 00:00:00 2001 From: Bob Lu Date: Wed, 15 Jan 2025 11:47:47 +0800 Subject: [PATCH] fix: update uniswap v3 token list fetching --- .changeset/four-flies-beam.md | 5 +++++ src/logics/uniswap-v3/logic.swap-token.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/four-flies-beam.md diff --git a/.changeset/four-flies-beam.md b/.changeset/four-flies-beam.md new file mode 100644 index 00000000..9a00a640 --- /dev/null +++ b/.changeset/four-flies-beam.md @@ -0,0 +1,5 @@ +--- +'@protocolink/logics': patch +--- + +update uniswap v3 token list fetching \ No newline at end of file diff --git a/src/logics/uniswap-v3/logic.swap-token.ts b/src/logics/uniswap-v3/logic.swap-token.ts index efacf150..cd4a4638 100644 --- a/src/logics/uniswap-v3/logic.swap-token.ts +++ b/src/logics/uniswap-v3/logic.swap-token.ts @@ -1,7 +1,6 @@ import { FeeAmount, computePoolAddress } from '@uniswap/v3-sdk'; import { Token } from '@uniswap/sdk-core'; import { TokenList } from '@uniswap/token-lists'; -import { axios } from 'src/utils'; import * as common from '@protocolink/common'; import * as core from '@protocolink/core'; import { getConfig, supportedChainIds } from './configs'; @@ -29,7 +28,8 @@ export class SwapTokenLogic } async getTokenList() { - const { data } = await axios.get('https://gateway.ipfs.io/ipns/tokens.uniswap.org'); + const response = await fetch('https://gateway.ipfs.io/ipns/tokens.uniswap.org', { method: 'GET' }); + const data: TokenList = await response.json(); const tmp: Record = { [this.nativeToken.address]: true }; const tokenList: SwapTokenLogicTokenList = [this.nativeToken];