diff --git a/.changeset/quiet-chefs-grow.md b/.changeset/quiet-chefs-grow.md new file mode 100644 index 00000000..2064888b --- /dev/null +++ b/.changeset/quiet-chefs-grow.md @@ -0,0 +1,5 @@ +--- +'@protocolink/logics': patch +--- + +update paraswap token list fetching diff --git a/src/logics/paraswap-v5/logic.swap-token.ts b/src/logics/paraswap-v5/logic.swap-token.ts index 1eace382..b0b0fb83 100644 --- a/src/logics/paraswap-v5/logic.swap-token.ts +++ b/src/logics/paraswap-v5/logic.swap-token.ts @@ -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);