Skip to content

Commit

Permalink
fix: update uniswap v3 token list fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Lu committed Jan 15, 2025
1 parent f94b293 commit e56c6bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-flies-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

update uniswap v3 token list fetching
4 changes: 2 additions & 2 deletions src/logics/uniswap-v3/logic.swap-token.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -29,7 +28,8 @@ export class SwapTokenLogic
}

async getTokenList() {
const { data } = await axios.get<TokenList>('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<string, boolean> = { [this.nativeToken.address]: true };
const tokenList: SwapTokenLogicTokenList = [this.nativeToken];
Expand Down

0 comments on commit e56c6bb

Please sign in to comment.