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 2e377b8
Show file tree
Hide file tree
Showing 2 changed files with 7 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
3 changes: 2 additions & 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,8 @@ 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 2e377b8

Please sign in to comment.