1
+ export type Asset = {
2
+ addresses : { [ chainId :string ] : `0x${string } `| `0x${string } `[ ] } ,
3
+ symbol : string ,
4
+ description : string ,
5
+ website : string ,
6
+ color : string ,
7
+ }
8
+
9
+ export const assets : Asset [ ] = [
10
+ {
11
+ addresses : {
12
+ "137" : [ "0x2791bca1f2de4661ed88a30c99a7a9449aa84174" , "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359" , ] ,
13
+ "8453" : [ "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA" , "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" , ] ,
14
+ } ,
15
+ symbol : 'USDC' ,
16
+ description :
17
+ "USDC is a fully-reserved stablecoin, which is a type of cryptocurrency, or digital asset." ,
18
+ website : "https://www.circle.com/en/usdc" ,
19
+ color : "#3b87df" ,
20
+ } ,
21
+ {
22
+ addresses : {
23
+ "137" : "0xc2132d05d31c914a87c6611c10748aeb04b58e8f" ,
24
+ "8453" : "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2" ,
25
+ } ,
26
+ symbol : "USDT" ,
27
+ description :
28
+ "Tether (USDT) is a cryptocurrency with a value meant to mirror the value of the U.S. dollar." ,
29
+ website : "https://tether.to/en/" ,
30
+ color : "#5bc7af" ,
31
+ } ,
32
+ {
33
+ addresses : {
34
+ "137" : "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063" ,
35
+ "8453" : "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb" ,
36
+ } ,
37
+ symbol : "DAI" ,
38
+ description :
39
+ "DAI is an algorithmic stablecoin issued by MakerDAO, an Ethereum-based protocol, that seeks to maintain an exact ratio of one-to-one with the U.S. dollar." ,
40
+ website : "https://makerdao.com/" ,
41
+ color : "#f3ba42" ,
42
+ } ,
43
+ {
44
+ addresses : {
45
+ "137" : "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" ,
46
+ } ,
47
+ symbol : "WMATIC" ,
48
+ description :
49
+ "WMATIC is a wrapped version of MATIC that enables it to be easily used within DeFi." ,
50
+ website : "https://polygon.technology/" ,
51
+ color : "#9663ee" ,
52
+ } ,
53
+ {
54
+ addresses : {
55
+ "137" : "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619" ,
56
+ "8453" : "0x4200000000000000000000000000000000000006" ,
57
+ } ,
58
+ symbol : "WETH" ,
59
+ description :
60
+ "WETH is an ERC-20 token that represents 1 Ether (ETH)" ,
61
+ website : "https://weth.io/" ,
62
+ color : "#6372a2" ,
63
+ } ,
64
+ {
65
+ addresses : {
66
+ "137" : "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6" ,
67
+ } ,
68
+ symbol : "WBTC" ,
69
+ description :
70
+ "WBTC is an ERC-20 token on the EVM blockchains that is pegged to Bitcoin (BTC). WBTC is backed one-to-one with Bitcoin." ,
71
+ website : "https://wbtc.network/" ,
72
+ color : "#f0a051" ,
73
+ } ,
74
+ {
75
+ addresses : {
76
+ "137" : "0xc4ce1d6f5d98d65ee25cf85e9f2e9dcfee6cb5d6" ,
77
+ "8453" : "0x417Ac0e078398C154EdFadD9Ef675d30Be60Af93" ,
78
+ } ,
79
+ symbol : "crvUSD" ,
80
+ description :
81
+ "crvUSD is a collateralized-debt-position (CDP) stablecoin pegged to the US Dollar" ,
82
+ website : "https://crvusd.curve.fi/" ,
83
+ color : "#397949" ,
84
+ } ,
85
+ {
86
+ addresses : {
87
+ "8453" : "0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22" ,
88
+ } ,
89
+ symbol : "cbETH" ,
90
+ description : "Coinbase Wrapped Staked ETH (“cbETH”) is a utility token that represents ETH staked through Coinbase." ,
91
+ website : "https://www.coinbase.com/cbeth" ,
92
+ color : "#2151f5" ,
93
+ } ,
94
+ ]
95
+
96
+ export const getAsset = ( chainId : string , tokenAddress : `0x${string } `) : Asset | undefined => {
97
+ for ( const asset of assets ) {
98
+ const chainAddresses = asset . addresses [ chainId ]
99
+ if ( chainAddresses ) {
100
+ if ( Array . isArray ( chainAddresses ) ) {
101
+ for ( const address of chainAddresses ) {
102
+ if ( address . toLowerCase ( ) == tokenAddress . toLowerCase ( ) ) {
103
+ return asset
104
+ }
105
+ }
106
+ } else {
107
+ if ( chainAddresses . toLowerCase ( ) == tokenAddress . toLowerCase ( ) ) {
108
+ return asset
109
+ }
110
+ }
111
+ }
112
+ }
113
+ return undefined
114
+ }
0 commit comments