Skip to content

Commit

Permalink
fix: update paraswap token list fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Lu committed Oct 30, 2024
1 parent 641841d commit 59dce0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quiet-chefs-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

update paraswap token list fetching
2 changes: 1 addition & 1 deletion src/logics/paraswap-v5/logic.swap-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class SwapTokenLogic
try {
const resp = await axios.get(tokenListUrl);
let data = resp.data;
if ((resp.headers['content-type'] as string).includes('text/plain')) {
if ((resp.headers['content-type'] as string).includes('text/plain') && typeof data === 'string') {
data = JSON.parse(data);
}
tokenLists.push(data);
Expand Down

0 comments on commit 59dce0c

Please sign in to comment.