Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base logo and tokens #76

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions data/evm-contract-map/evm-contract-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Binary file added data/evm-contract-map/images/base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/evm-contract-map/images/cbeth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/evm-contract-map/images/usdbc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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://[email protected]/MetaMask/contract-metadata.git",
Expand Down
42 changes: 25 additions & 17 deletions scripts/util.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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()
Expand All @@ -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
Expand Down