diff --git a/source/pool/package.json b/source/pool/package.json index 8384d8536..40627ec36 100644 --- a/source/pool/package.json +++ b/source/pool/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@airswap/constants": "4.1.6", - "@airswap/metadata": "4.1.11", + "@airswap/metadata": "4.1.12", "@airswap/types": "4.1.1", "@airswap/utils": "4.1.8", "prompt-confirm": "^2.0.4" diff --git a/tools/libraries/tsconfig.json b/tools/libraries/tsconfig.json index 3271011f0..e03a119e1 100644 --- a/tools/libraries/tsconfig.json +++ b/tools/libraries/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "lib": ["es2021", "dom"], + "lib": ["dom"], "outDir": "./build" } } diff --git a/tools/metadata/index.ts b/tools/metadata/index.ts index 110118e6b..d182724c3 100644 --- a/tools/metadata/index.ts +++ b/tools/metadata/index.ts @@ -1,4 +1,3 @@ -import axios from 'axios' import { ethers } from 'ethers' import { TokenInfo, @@ -44,7 +43,7 @@ export async function getKnownTokens( const promises = await Promise.allSettled( tokenlists[chainId].map(async (url) => { try { - const { data } = await axios.get(url) + const data = await (await fetch(url)).json() if (data.tokens) { return data.tokens } @@ -262,12 +261,12 @@ export async function getCollectionTokenInfo( } } -async function fetchMetaData(uri: string) { - if (validUrl.isUri(uri)) { - if (uri.startsWith('ipfs')) { - uri = `https://cloudflare-ipfs.com/${uri.replace('://', '/')}` +async function fetchMetaData(url: string) { + if (validUrl.isUri(url)) { + if (url.startsWith('ipfs')) { + url = `https://cloudflare-ipfs.com/${url.replace('://', '/')}` } - const { data } = await axios.get(uri) + const data = await (await fetch(url)).json() if (typeof data === 'string') try { return JSON.parse(data) diff --git a/tools/metadata/package.json b/tools/metadata/package.json index fd8598491..f5bcbf6e3 100644 --- a/tools/metadata/package.json +++ b/tools/metadata/package.json @@ -1,6 +1,6 @@ { "name": "@airswap/metadata", - "version": "4.1.11", + "version": "4.1.12", "description": "AirSwap: Token Metadata for Developers", "repository": { "type": "git", @@ -25,7 +25,6 @@ "@airswap/wrapper": "4.1.5", "@openzeppelin/contracts": "^4.8.3", "@uniswap/token-lists": "^1.0.0-beta.24", - "axios": "^1.6.0", "ethers": "^5.6.9", "valid-url": "^1.0.9" }, diff --git a/tools/metadata/tsconfig.json b/tools/metadata/tsconfig.json index 383e0d4e9..e03a119e1 100644 --- a/tools/metadata/tsconfig.json +++ b/tools/metadata/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./build", - "lib": ["ES2020.Promise"] + "lib": ["dom"], + "outDir": "./build" } } diff --git a/tsconfig.json b/tsconfig.json index 2453de23d..460030d53 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "ESNext", - "module": "commonjs", - "moduleResolution": "nodenext", + "module": "NodeNext", + "moduleResolution": "NodeNext", "esModuleInterop": true, "resolveJsonModule": true, "sourceMap": true, diff --git a/yarn.lock b/yarn.lock index f3d285223..6588ce503 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2762,7 +2762,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== -axios@^1.0.0, axios@^1.6.0: +axios@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==