diff --git a/data/evm-contract-map/evm-contract-map.json b/data/evm-contract-map/evm-contract-map.json index a052b7e..3be94ba 100644 --- a/data/evm-contract-map/evm-contract-map.json +++ b/data/evm-contract-map/evm-contract-map.json @@ -1114,5 +1114,32 @@ "decimals": 18, "coingeckoId": "arbitrum", "chainId": "0xa4b1" + }, + "0x50c5725949a6f0c72e6c4a641f24049a917db0cb": { + "name": "Dai Stablecoin", + "logo": "dai.png", + "erc20": true, + "symbol": "DAI", + "decimals": 18, + "coingeckoId": "dai", + "chainId": "0x2105" + }, + "0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22": { + "name": "Coinbase Wrapped Staked ETH", + "logo": "cbeth.png", + "erc20": true, + "symbol": "cbETH", + "decimals": 18, + "coingeckoId": "coinbase-wrapped-staked-eth", + "chainId": "0x2105" + }, + "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca": { + "name": "USD Base Coin", + "logo": "usdc.png", + "erc20": true, + "symbol": "USDbC", + "decimals": 6, + "coingeckoId": "bridged-usd-coin-base", + "chainId": "0x2105" } } diff --git a/data/evm-contract-map/images/base.png b/data/evm-contract-map/images/base.png new file mode 100644 index 0000000..c322398 Binary files /dev/null and b/data/evm-contract-map/images/base.png differ diff --git a/data/evm-contract-map/images/cbeth.png b/data/evm-contract-map/images/cbeth.png new file mode 100644 index 0000000..0becabe Binary files /dev/null and b/data/evm-contract-map/images/cbeth.png differ diff --git a/data/evm-contract-map/images/usdbc.png b/data/evm-contract-map/images/usdbc.png new file mode 100644 index 0000000..8e9019d Binary files /dev/null and b/data/evm-contract-map/images/usdbc.png differ diff --git a/package.json b/package.json index e6d8405..bb6c364 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "token-lists", - "version": "1.10.0", + "version": "1.10.1", "description": "Manages custom token lists for Brave Wallet", "dependencies": { "@metamask/contract-metadata": "git+https://git@github.com/MetaMask/contract-metadata.git", diff --git a/scripts/util.cjs b/scripts/util.cjs index c89af02..9d758ee 100644 --- a/scripts/util.cjs +++ b/scripts/util.cjs @@ -404,25 +404,13 @@ const generateMainnetTokenList = async (fullTokenList) => { }, {}) } -const generateDappLists = async () => { +const generateDappListsForChain = async (chain) => { const dappRadarProjectId = process.env.DAPP_RADAR_PROJECT_ID const dappRadarApiKey = process.env.DAPP_RADAR_API_KEY - const chains = [ - 'solana', - 'ethereum', - 'polygon', - 'binance-smart-chain', - 'optimism', - 'aurora', - 'avalanche', - 'fantom', - ] const metric = 'uaw' const range = '30d' - const top = 100 - const dappLists = {} - for (let chain of chains) { + for (const top of [100, 50, 25, 10]) { const url = `https://api.dappradar.com/${dappRadarProjectId}/dapps/top/${metric}?chain=${chain}&range=${range}&top=${top}` const response = await fetch(url, { headers: { @@ -431,7 +419,8 @@ const generateDappLists = async () => { }) if (!response.ok) { - throw new Error(`Error fetching dApps for ${chain}: ${response.status} ${response.statusText}`) + console.error(`Error: [chain=${chain} top=${top}] ${response.status} ${response.statusText}`) + continue } const dapps = await response.json() @@ -444,11 +433,30 @@ const generateDappLists = async () => { // Replace 'binance-smart-chain' with 'binance_smart_chain' so it plays well // with the browser JSON parser. - if (chain === 'binance-smart-chain') { + if (chain === 'binance-smart-chain') { chain = 'binance_smart_chain' } - dappLists[chain] = dapps + return dapps + } + + throw new Error(`Error fetching dApps for ${chain}`) +} + +const generateDappLists = async () => { + const chains = [ + 'solana', + 'ethereum', + 'polygon', + 'binance-smart-chain', + 'optimism', + 'aurora', + 'avalanche', + 'fantom', + ] + const dappLists = {} + for (let chain of chains) { + dappLists[chain] = await generateDappListsForChain(chain) } return dappLists