@rozoai/intent-common 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/token.js ADDED
@@ -0,0 +1,852 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.polygonPOL = exports.optimismUSDCe = exports.optimismUSDT = exports.optimismDAI = exports.optimismAxlUSDC = exports.optimismUSDC = exports.optimismWETH = exports.optimismETH = exports.mantleAxlUSDC = exports.mantleUSDT = exports.mantleBridgedUSDC = exports.mantleWMNT = exports.mantleMNT = exports.lineaDAI = exports.lineaAxlUSDC = exports.lineaUSDC = exports.lineaWETH = exports.lineaETH = exports.ethereumEURC = exports.ethereumUSDT = exports.ethereumDAI = exports.ethereumUSDC = exports.ethereumWETH = exports.ethereumETH = exports.celoCUSD = exports.celoUSDT = exports.celoUSDC = exports.celoAxlUSDC = exports.celoCelo = exports.bscUSDT = exports.bscUSDC = exports.bscAxlUSDC = exports.bscWBNB = exports.bscBNB = exports.baseAxlUSDC = exports.baseUSDT = exports.baseDAI = exports.baseUSDbC = exports.baseEURC = exports.baseUSDC = exports.baseWETH = exports.baseETH = exports.arbitrumUSDCe = exports.arbitrumUSDT = exports.arbitrumDAI = exports.arbitrumAxlUSDC = exports.arbitrumUSDC = exports.arbitrumWETH = exports.arbitrumETH = exports.TokenLogo = void 0;
4
+ exports.knownTokens = exports.worldchainWLD = exports.worldchainUSDC = exports.worldchainWBTC = exports.worldchainWETH = exports.worldchainETH = exports.solanaUSDC = exports.solanaWSOL = exports.solanaSOL = exports.polygonUSDCe = exports.polygonUSDT = exports.polygonDAI = exports.polygonAxlUSDC = exports.polygonUSDC = exports.polygonWETH = exports.polygonWPOL = void 0;
5
+ exports.getKnownToken = getKnownToken;
6
+ exports.getChainNativeToken = getChainNativeToken;
7
+ exports.getChainWrappedNativeToken = getChainWrappedNativeToken;
8
+ exports.getChainNativeUSDC = getChainNativeUSDC;
9
+ exports.getChainAxlUSDC = getChainAxlUSDC;
10
+ exports.getChainBestUSDC = getChainBestUSDC;
11
+ exports.getChainDAI = getChainDAI;
12
+ exports.tokensEqual = tokensEqual;
13
+ exports.token = token;
14
+ const viem_1 = require("viem");
15
+ const assert_1 = require("./assert");
16
+ const chain_1 = require("./chain");
17
+ var TokenLogo;
18
+ (function (TokenLogo) {
19
+ TokenLogo["ETH"] = "https://pay.daimo.com/chain-logos/ethereum.png";
20
+ TokenLogo["WETH"] = "https://pay.daimo.com/coin-logos/weth.png";
21
+ TokenLogo["USDC"] = "https://pay.daimo.com/coin-logos/usdc.png";
22
+ TokenLogo["EURC"] = "https://pay.daimo.com/coin-logos/eurc.png";
23
+ TokenLogo["USDT"] = "https://pay.daimo.com/coin-logos/usdt.png";
24
+ TokenLogo["DAI"] = "https://pay.daimo.com/coin-logos/dai.png";
25
+ TokenLogo["POL"] = "https://pay.daimo.com/coin-logos/pol.png";
26
+ TokenLogo["AVAX"] = "https://pay.daimo.com/coin-logos/avax.png";
27
+ TokenLogo["BNB"] = "https://pay.daimo.com/coin-logos/bnb.png";
28
+ TokenLogo["SOL"] = "https://pay.daimo.com/coin-logos/sol.png";
29
+ TokenLogo["WLD"] = "https://pay.daimo.com/coin-logos/wld.jpeg";
30
+ TokenLogo["USDB"] = "https://pay.daimo.com/coin-logos/usdb.png";
31
+ TokenLogo["BLAST"] = "https://pay.daimo.com/coin-logos/blast.jpg";
32
+ TokenLogo["WBTC"] = "https://pay.daimo.com/coin-logos/wbtc.png";
33
+ TokenLogo["MNT"] = "https://pay.daimo.com/coin-logos/mnt.png";
34
+ TokenLogo["CELO"] = "https://pay.daimo.com/coin-logos/celo.png";
35
+ TokenLogo["cUSD"] = "https://pay.daimo.com/coin-logos/cusd.png";
36
+ })(TokenLogo || (exports.TokenLogo = TokenLogo = {}));
37
+ /* --------------------- Tokens Constants --------------------- */
38
+ //
39
+ // Arbitrum
40
+ //
41
+ exports.arbitrumETH = nativeETH(chain_1.arbitrum.chainId);
42
+ exports.arbitrumWETH = token({
43
+ chainId: chain_1.arbitrum.chainId,
44
+ token: (0, viem_1.getAddress)("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
45
+ decimals: 18,
46
+ name: "Wrapped Ether",
47
+ symbol: "WETH",
48
+ logoURI: TokenLogo.WETH,
49
+ });
50
+ exports.arbitrumUSDC = token({
51
+ chainId: chain_1.arbitrum.chainId,
52
+ token: (0, viem_1.getAddress)("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
53
+ name: "USD Coin",
54
+ symbol: "USDC",
55
+ fiatISO: "USD",
56
+ decimals: 6,
57
+ logoURI: TokenLogo.USDC,
58
+ });
59
+ exports.arbitrumAxlUSDC = token({
60
+ chainId: chain_1.arbitrum.chainId,
61
+ token: (0, viem_1.getAddress)("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
62
+ decimals: 6,
63
+ fiatISO: "USD",
64
+ name: "Axelar Wrapped USDC",
65
+ symbol: "axlUSDC",
66
+ logoURI: TokenLogo.USDC,
67
+ });
68
+ exports.arbitrumDAI = token({
69
+ chainId: chain_1.arbitrum.chainId,
70
+ token: (0, viem_1.getAddress)("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
71
+ decimals: 18,
72
+ fiatISO: "USD",
73
+ name: "Dai Stablecoin",
74
+ symbol: "DAI",
75
+ logoURI: TokenLogo.DAI,
76
+ });
77
+ exports.arbitrumUSDT = token({
78
+ chainId: chain_1.arbitrum.chainId,
79
+ token: (0, viem_1.getAddress)("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
80
+ decimals: 6,
81
+ fiatISO: "USD",
82
+ name: "Tether USD",
83
+ symbol: "USDT",
84
+ logoURI: TokenLogo.USDT,
85
+ });
86
+ exports.arbitrumUSDCe = token({
87
+ chainId: chain_1.arbitrum.chainId,
88
+ token: (0, viem_1.getAddress)("0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8"),
89
+ decimals: 6,
90
+ fiatISO: "USD",
91
+ name: "Bridged USD Coin",
92
+ symbol: "USDCe",
93
+ logoURI: TokenLogo.USDC,
94
+ });
95
+ const arbitrumTokens = [
96
+ exports.arbitrumETH,
97
+ exports.arbitrumWETH,
98
+ exports.arbitrumUSDC,
99
+ exports.arbitrumAxlUSDC,
100
+ exports.arbitrumDAI,
101
+ exports.arbitrumUSDT,
102
+ exports.arbitrumUSDCe,
103
+ ];
104
+ //
105
+ // Base Mainnet
106
+ //
107
+ exports.baseETH = nativeETH(chain_1.base.chainId);
108
+ exports.baseWETH = token({
109
+ chainId: chain_1.base.chainId,
110
+ token: (0, viem_1.getAddress)("0x4200000000000000000000000000000000000006"),
111
+ decimals: 18,
112
+ name: "Wrapped Ether",
113
+ symbol: "WETH",
114
+ logoURI: TokenLogo.WETH,
115
+ });
116
+ exports.baseUSDC = token({
117
+ chainId: chain_1.base.chainId,
118
+ token: (0, viem_1.getAddress)("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
119
+ name: "USD Coin",
120
+ symbol: "USDC",
121
+ fiatISO: "USD",
122
+ decimals: 6,
123
+ logoURI: TokenLogo.USDC,
124
+ });
125
+ exports.baseEURC = token({
126
+ chainId: chain_1.base.chainId,
127
+ token: (0, viem_1.getAddress)("0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42"),
128
+ decimals: 6,
129
+ fiatISO: "EUR",
130
+ name: "EURC",
131
+ symbol: "EURC",
132
+ logoURI: TokenLogo.EURC,
133
+ });
134
+ exports.baseUSDbC = token({
135
+ chainId: chain_1.base.chainId,
136
+ token: (0, viem_1.getAddress)("0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"),
137
+ name: "Bridged USD Coin", // USDbC has a bad name & logo on CoinGecko
138
+ symbol: "USDbC",
139
+ fiatISO: "USD",
140
+ decimals: 6,
141
+ logoURI: "https://pay.daimo.com/coin-logos/usdbc.png",
142
+ });
143
+ exports.baseDAI = token({
144
+ chainId: chain_1.base.chainId,
145
+ token: (0, viem_1.getAddress)("0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"),
146
+ name: "Dai Stablecoin",
147
+ symbol: "DAI",
148
+ fiatISO: "USD",
149
+ decimals: 18,
150
+ logoURI: TokenLogo.DAI,
151
+ });
152
+ exports.baseUSDT = token({
153
+ chainId: chain_1.base.chainId,
154
+ token: (0, viem_1.getAddress)("0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),
155
+ name: "Tether USD",
156
+ symbol: "USDT",
157
+ fiatISO: "USD",
158
+ decimals: 6,
159
+ logoURI: TokenLogo.USDT,
160
+ });
161
+ exports.baseAxlUSDC = token({
162
+ chainId: chain_1.base.chainId,
163
+ token: (0, viem_1.getAddress)("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
164
+ decimals: 6,
165
+ fiatISO: "USD",
166
+ name: "Axelar Wrapped USDC",
167
+ symbol: "axlUSDC",
168
+ logoURI: TokenLogo.USDC,
169
+ });
170
+ const baseTokens = [
171
+ exports.baseETH,
172
+ exports.baseWETH,
173
+ exports.baseUSDC,
174
+ exports.baseEURC,
175
+ exports.baseUSDbC,
176
+ exports.baseDAI,
177
+ exports.baseUSDT,
178
+ exports.baseAxlUSDC,
179
+ ];
180
+ //
181
+ // BNB Smart Chain
182
+ //
183
+ exports.bscBNB = nativeToken({
184
+ chainId: chain_1.bsc.chainId,
185
+ name: "BNB",
186
+ symbol: "BNB",
187
+ logoURI: TokenLogo.BNB,
188
+ });
189
+ exports.bscWBNB = token({
190
+ chainId: chain_1.bsc.chainId,
191
+ token: (0, viem_1.getAddress)("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"),
192
+ decimals: 18,
193
+ name: "Wrapped BNB",
194
+ symbol: "WBNB",
195
+ logoURI: TokenLogo.BNB,
196
+ });
197
+ exports.bscAxlUSDC = token({
198
+ chainId: chain_1.bsc.chainId,
199
+ token: (0, viem_1.getAddress)("0x4268B8F0B87b6Eae5d897996E6b845ddbD99Adf3"),
200
+ decimals: 6,
201
+ fiatISO: "USD",
202
+ name: "Axelar Wrapped USDC",
203
+ symbol: "axlUSDC",
204
+ logoURI: TokenLogo.USDC,
205
+ });
206
+ exports.bscUSDC = token({
207
+ chainId: chain_1.bsc.chainId,
208
+ token: (0, viem_1.getAddress)("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
209
+ decimals: 18,
210
+ fiatISO: "USD",
211
+ name: "USD Coin",
212
+ symbol: "USDC",
213
+ logoURI: TokenLogo.USDC,
214
+ });
215
+ exports.bscUSDT = token({
216
+ chainId: chain_1.bsc.chainId,
217
+ token: (0, viem_1.getAddress)("0x55d398326f99059fF775485246999027B3197955"),
218
+ decimals: 18,
219
+ fiatISO: "USD",
220
+ name: "Tether USD",
221
+ symbol: "USDT",
222
+ logoURI: TokenLogo.USDT,
223
+ });
224
+ const bscTokens = [exports.bscBNB, exports.bscWBNB, exports.bscAxlUSDC, exports.bscUSDC, exports.bscUSDT];
225
+ //
226
+ // Celo
227
+ //
228
+ // CELO functions as both a native token and an ERC-20 compatible token
229
+ exports.celoCelo = token({
230
+ chainId: chain_1.celo.chainId,
231
+ token: (0, viem_1.getAddress)("0x471EcE3750Da237f93B8E339c536989b8978a438"),
232
+ decimals: 18,
233
+ name: "Celo",
234
+ symbol: "CELO",
235
+ logoURI: TokenLogo.CELO,
236
+ });
237
+ exports.celoAxlUSDC = token({
238
+ chainId: chain_1.celo.chainId,
239
+ token: (0, viem_1.getAddress)("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
240
+ decimals: 6,
241
+ fiatISO: "USD",
242
+ name: "Axelar Wrapped USDC",
243
+ symbol: "axlUSDC",
244
+ logoURI: TokenLogo.USDC,
245
+ });
246
+ exports.celoUSDC = token({
247
+ chainId: chain_1.celo.chainId,
248
+ token: (0, viem_1.getAddress)("0xcebA9300f2b948710d2653dD7B07f33A8B32118C"),
249
+ decimals: 6,
250
+ fiatISO: "USD",
251
+ name: "USD Coin",
252
+ symbol: "USDC",
253
+ logoURI: TokenLogo.USDC,
254
+ });
255
+ exports.celoUSDT = token({
256
+ chainId: chain_1.celo.chainId,
257
+ token: (0, viem_1.getAddress)("0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e"),
258
+ decimals: 6,
259
+ fiatISO: "USD",
260
+ name: "Tether USD",
261
+ symbol: "USDT",
262
+ logoURI: TokenLogo.USDT,
263
+ });
264
+ exports.celoCUSD = token({
265
+ chainId: chain_1.celo.chainId,
266
+ token: (0, viem_1.getAddress)("0x765DE816845861e75A25fCA122bb6898B8B1282a"),
267
+ decimals: 18,
268
+ fiatISO: "USD",
269
+ name: "Celo Dollar",
270
+ symbol: "cUSD",
271
+ logoURI: TokenLogo.cUSD,
272
+ });
273
+ const celoTokens = [
274
+ exports.celoCelo,
275
+ exports.celoAxlUSDC,
276
+ exports.celoUSDC,
277
+ exports.celoUSDT,
278
+ exports.celoCUSD,
279
+ ];
280
+ //
281
+ // Ethereum
282
+ //
283
+ exports.ethereumETH = nativeETH(chain_1.ethereum.chainId);
284
+ exports.ethereumWETH = token({
285
+ chainId: chain_1.ethereum.chainId,
286
+ token: (0, viem_1.getAddress)("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
287
+ decimals: 18,
288
+ name: "Wrapped Ether",
289
+ symbol: "WETH",
290
+ logoURI: TokenLogo.WETH,
291
+ });
292
+ exports.ethereumUSDC = token({
293
+ chainId: chain_1.ethereum.chainId,
294
+ token: (0, viem_1.getAddress)("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
295
+ decimals: 6,
296
+ fiatISO: "USD",
297
+ name: "USD Coin",
298
+ symbol: "USDC",
299
+ logoURI: TokenLogo.USDC,
300
+ });
301
+ exports.ethereumDAI = token({
302
+ chainId: chain_1.ethereum.chainId,
303
+ token: (0, viem_1.getAddress)("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
304
+ decimals: 18,
305
+ fiatISO: "USD",
306
+ name: "Dai Stablecoin",
307
+ symbol: "DAI",
308
+ logoURI: TokenLogo.DAI,
309
+ });
310
+ exports.ethereumUSDT = token({
311
+ chainId: chain_1.ethereum.chainId,
312
+ token: (0, viem_1.getAddress)("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
313
+ decimals: 6,
314
+ fiatISO: "USD",
315
+ name: "Tether USD",
316
+ symbol: "USDT",
317
+ logoURI: TokenLogo.USDT,
318
+ });
319
+ exports.ethereumEURC = token({
320
+ chainId: chain_1.ethereum.chainId,
321
+ token: (0, viem_1.getAddress)("0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c"),
322
+ decimals: 6,
323
+ fiatISO: "EUR",
324
+ name: "EURC",
325
+ symbol: "EURC",
326
+ logoURI: TokenLogo.EURC,
327
+ });
328
+ const ethereumTokens = [
329
+ exports.ethereumETH,
330
+ exports.ethereumWETH,
331
+ exports.ethereumUSDC,
332
+ exports.ethereumEURC,
333
+ exports.ethereumDAI,
334
+ exports.ethereumUSDT,
335
+ ];
336
+ //
337
+ // Linea
338
+ //
339
+ exports.lineaETH = nativeETH(chain_1.linea.chainId);
340
+ exports.lineaWETH = token({
341
+ chainId: chain_1.linea.chainId,
342
+ token: (0, viem_1.getAddress)("0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f"),
343
+ decimals: 18,
344
+ name: "Wrapped Ether",
345
+ symbol: "WETH",
346
+ logoURI: TokenLogo.WETH,
347
+ });
348
+ exports.lineaUSDC = token({
349
+ chainId: chain_1.linea.chainId,
350
+ token: (0, viem_1.getAddress)("0x176211869cA2b568f2A7D4EE941E073a821EE1ff"),
351
+ decimals: 6,
352
+ fiatISO: "USD",
353
+ name: "USD Coin",
354
+ symbol: "USDC",
355
+ logoURI: TokenLogo.USDC,
356
+ });
357
+ exports.lineaAxlUSDC = token({
358
+ chainId: chain_1.linea.chainId,
359
+ token: (0, viem_1.getAddress)("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
360
+ decimals: 6,
361
+ fiatISO: "USD",
362
+ name: "Axelar Wrapped USDC",
363
+ symbol: "axlUSDC",
364
+ logoURI: TokenLogo.USDC,
365
+ });
366
+ exports.lineaDAI = token({
367
+ chainId: chain_1.linea.chainId,
368
+ token: (0, viem_1.getAddress)("0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5"),
369
+ decimals: 18,
370
+ fiatISO: "USD",
371
+ name: "Dai Stablecoin",
372
+ symbol: "DAI",
373
+ logoURI: TokenLogo.DAI,
374
+ });
375
+ const lineaTokens = [
376
+ exports.lineaETH,
377
+ exports.lineaWETH,
378
+ exports.lineaUSDC,
379
+ exports.lineaAxlUSDC,
380
+ exports.lineaDAI,
381
+ ];
382
+ //
383
+ // Mantle
384
+ //
385
+ exports.mantleMNT = nativeToken({
386
+ chainId: chain_1.mantle.chainId,
387
+ name: "Mantle",
388
+ symbol: "MNT",
389
+ logoURI: TokenLogo.MNT,
390
+ });
391
+ exports.mantleWMNT = token({
392
+ chainId: chain_1.mantle.chainId,
393
+ token: (0, viem_1.getAddress)("0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8"),
394
+ decimals: 18,
395
+ name: "Wrapped Mantle",
396
+ symbol: "WMNT",
397
+ logoURI: TokenLogo.MNT,
398
+ });
399
+ exports.mantleBridgedUSDC = token({
400
+ chainId: chain_1.mantle.chainId,
401
+ token: (0, viem_1.getAddress)("0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9"),
402
+ decimals: 6,
403
+ fiatISO: "USD",
404
+ name: "USD Coin",
405
+ symbol: "USDC",
406
+ logoURI: TokenLogo.USDC,
407
+ });
408
+ exports.mantleUSDT = token({
409
+ chainId: chain_1.mantle.chainId,
410
+ token: (0, viem_1.getAddress)("0x201eba5cc46d216ce6dc03f6a759e8e766e956ae"),
411
+ decimals: 6,
412
+ fiatISO: "USD",
413
+ name: "Tether USD",
414
+ symbol: "USDT",
415
+ logoURI: TokenLogo.USDT,
416
+ });
417
+ exports.mantleAxlUSDC = token({
418
+ chainId: chain_1.mantle.chainId,
419
+ token: (0, viem_1.getAddress)("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
420
+ decimals: 6,
421
+ fiatISO: "USD",
422
+ name: "Axelar Wrapped USDC",
423
+ symbol: "axlUSDC",
424
+ logoURI: TokenLogo.USDC,
425
+ });
426
+ const mantleTokens = [
427
+ exports.mantleMNT,
428
+ exports.mantleWMNT,
429
+ exports.mantleBridgedUSDC,
430
+ exports.mantleUSDT,
431
+ exports.mantleAxlUSDC,
432
+ ];
433
+ //
434
+ // Optimism
435
+ //
436
+ exports.optimismETH = nativeETH(chain_1.optimism.chainId);
437
+ exports.optimismWETH = token({
438
+ chainId: chain_1.optimism.chainId,
439
+ token: (0, viem_1.getAddress)("0x4200000000000000000000000000000000000006"),
440
+ decimals: 18,
441
+ name: "Wrapped Ether",
442
+ symbol: "WETH",
443
+ logoURI: TokenLogo.WETH,
444
+ });
445
+ exports.optimismUSDC = token({
446
+ chainId: chain_1.optimism.chainId,
447
+ token: (0, viem_1.getAddress)("0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"),
448
+ decimals: 6,
449
+ fiatISO: "USD",
450
+ name: "USD Coin",
451
+ symbol: "USDC",
452
+ logoURI: TokenLogo.USDC,
453
+ });
454
+ exports.optimismAxlUSDC = token({
455
+ chainId: chain_1.optimism.chainId,
456
+ token: (0, viem_1.getAddress)("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
457
+ decimals: 6,
458
+ fiatISO: "USD",
459
+ name: "Axelar Wrapped USDC",
460
+ symbol: "axlUSDC",
461
+ logoURI: TokenLogo.USDC,
462
+ });
463
+ exports.optimismDAI = token({
464
+ chainId: chain_1.optimism.chainId,
465
+ token: (0, viem_1.getAddress)("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
466
+ decimals: 18,
467
+ fiatISO: "USD",
468
+ name: "Dai Stablecoin",
469
+ symbol: "DAI",
470
+ logoURI: TokenLogo.DAI,
471
+ });
472
+ exports.optimismUSDT = token({
473
+ chainId: chain_1.optimism.chainId,
474
+ token: (0, viem_1.getAddress)("0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"),
475
+ decimals: 6,
476
+ fiatISO: "USD",
477
+ name: "Tether USD",
478
+ symbol: "USDT",
479
+ logoURI: TokenLogo.USDT,
480
+ });
481
+ exports.optimismUSDCe = token({
482
+ chainId: chain_1.optimism.chainId,
483
+ token: (0, viem_1.getAddress)("0x7F5c764cBc14f9669B88837ca1490cCa17c31607"),
484
+ decimals: 6,
485
+ fiatISO: "USD",
486
+ name: "Bridged USD Coin",
487
+ symbol: "USDCe",
488
+ logoURI: TokenLogo.USDC,
489
+ });
490
+ const optimismTokens = [
491
+ exports.optimismETH,
492
+ exports.optimismWETH,
493
+ exports.optimismUSDC,
494
+ exports.optimismAxlUSDC,
495
+ exports.optimismDAI,
496
+ exports.optimismUSDT,
497
+ exports.optimismUSDCe,
498
+ ];
499
+ //
500
+ // Polygon
501
+ //
502
+ exports.polygonPOL = nativeToken({
503
+ chainId: chain_1.polygon.chainId,
504
+ name: "Polygon",
505
+ symbol: "POL",
506
+ logoURI: TokenLogo.POL,
507
+ });
508
+ exports.polygonWPOL = token({
509
+ chainId: chain_1.polygon.chainId,
510
+ token: (0, viem_1.getAddress)("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"),
511
+ decimals: 18,
512
+ name: "Wrapped Polygon",
513
+ symbol: "WPOL",
514
+ logoURI: TokenLogo.POL,
515
+ });
516
+ exports.polygonWETH = token({
517
+ chainId: chain_1.polygon.chainId,
518
+ token: (0, viem_1.getAddress)("0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"),
519
+ decimals: 18,
520
+ name: "Wrapped Ether",
521
+ symbol: "WETH",
522
+ logoURI: TokenLogo.WETH,
523
+ });
524
+ exports.polygonUSDC = token({
525
+ chainId: chain_1.polygon.chainId,
526
+ token: (0, viem_1.getAddress)("0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"),
527
+ decimals: 6,
528
+ fiatISO: "USD",
529
+ name: "USD Coin",
530
+ symbol: "USDC",
531
+ logoURI: TokenLogo.USDC,
532
+ });
533
+ exports.polygonAxlUSDC = token({
534
+ chainId: chain_1.polygon.chainId,
535
+ token: (0, viem_1.getAddress)("0x750e4C4984a9e0f12978eA6742Bc1c5D248f40ed"),
536
+ decimals: 6,
537
+ fiatISO: "USD",
538
+ name: "Axelar Wrapped USDC",
539
+ symbol: "axlUSDC",
540
+ logoURI: TokenLogo.USDC,
541
+ });
542
+ exports.polygonDAI = token({
543
+ chainId: chain_1.polygon.chainId,
544
+ token: (0, viem_1.getAddress)("0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063"),
545
+ decimals: 18,
546
+ fiatISO: "USD",
547
+ name: "Dai Stablecoin",
548
+ symbol: "DAI",
549
+ logoURI: TokenLogo.DAI,
550
+ });
551
+ exports.polygonUSDT = token({
552
+ chainId: chain_1.polygon.chainId,
553
+ token: (0, viem_1.getAddress)("0xc2132D05D31c914a87C6611C10748AEb04B58e8F"),
554
+ decimals: 6,
555
+ fiatISO: "USD",
556
+ name: "Tether USD",
557
+ symbol: "USDT",
558
+ logoURI: TokenLogo.USDT,
559
+ });
560
+ exports.polygonUSDCe = token({
561
+ chainId: chain_1.polygon.chainId,
562
+ token: (0, viem_1.getAddress)("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"),
563
+ decimals: 6,
564
+ fiatISO: "USD",
565
+ name: "USD Coin (PoS)",
566
+ symbol: "USDCe",
567
+ logoURI: TokenLogo.USDC,
568
+ });
569
+ const polygonTokens = [
570
+ exports.polygonPOL,
571
+ exports.polygonWPOL,
572
+ exports.polygonWETH,
573
+ exports.polygonUSDC,
574
+ exports.polygonAxlUSDC,
575
+ exports.polygonDAI,
576
+ exports.polygonUSDT,
577
+ exports.polygonUSDCe,
578
+ ];
579
+ //
580
+ // Solana
581
+ //
582
+ exports.solanaSOL = nativeToken({
583
+ chainId: chain_1.solana.chainId,
584
+ name: "Solana",
585
+ symbol: "SOL",
586
+ logoURI: TokenLogo.SOL,
587
+ token: "11111111111111111111111111111111",
588
+ decimals: 9,
589
+ });
590
+ exports.solanaWSOL = token({
591
+ chainId: chain_1.solana.chainId,
592
+ token: "So11111111111111111111111111111111111111112",
593
+ decimals: 9,
594
+ name: "Wrapped SOL",
595
+ symbol: "WSOL",
596
+ logoURI: TokenLogo.SOL,
597
+ });
598
+ exports.solanaUSDC = token({
599
+ chainId: chain_1.solana.chainId,
600
+ token: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
601
+ decimals: 6,
602
+ fiatISO: "USD",
603
+ name: "USD Coin",
604
+ symbol: "USDC",
605
+ logoURI: TokenLogo.USDC,
606
+ });
607
+ const solanaTokens = [exports.solanaUSDC, exports.solanaWSOL, exports.solanaSOL];
608
+ //
609
+ // Worldchain
610
+ //
611
+ exports.worldchainETH = nativeETH(chain_1.worldchain.chainId);
612
+ exports.worldchainWETH = token({
613
+ chainId: chain_1.worldchain.chainId,
614
+ token: (0, viem_1.getAddress)("0x4200000000000000000000000000000000000006"),
615
+ decimals: 18,
616
+ name: "Wrapped Ether",
617
+ symbol: "WETH",
618
+ logoURI: TokenLogo.WETH,
619
+ });
620
+ exports.worldchainWBTC = token({
621
+ chainId: chain_1.worldchain.chainId,
622
+ token: (0, viem_1.getAddress)("0x03c7054bcb39f7b2e5b2c7acb37583e32d70cfa3"),
623
+ decimals: 8,
624
+ name: "Wrapped Bitcoin",
625
+ symbol: "WBTC",
626
+ logoURI: TokenLogo.WBTC,
627
+ });
628
+ exports.worldchainUSDC = token({
629
+ chainId: chain_1.worldchain.chainId,
630
+ token: (0, viem_1.getAddress)("0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"),
631
+ decimals: 6,
632
+ fiatISO: "USD",
633
+ name: "USD Coin",
634
+ symbol: "USDC",
635
+ logoURI: TokenLogo.USDC,
636
+ });
637
+ exports.worldchainWLD = token({
638
+ chainId: chain_1.worldchain.chainId,
639
+ token: (0, viem_1.getAddress)("0x2cFc85d8E48F8EAB294be644d9E25C3030863003"),
640
+ decimals: 18,
641
+ name: "Worldcoin",
642
+ symbol: "WLD",
643
+ logoURI: TokenLogo.WLD,
644
+ });
645
+ const worldchainTokens = [
646
+ exports.worldchainETH,
647
+ exports.worldchainWETH,
648
+ exports.worldchainWBTC,
649
+ exports.worldchainUSDC,
650
+ exports.worldchainWLD,
651
+ ];
652
+ const knownTokensByChain = new Map([
653
+ [chain_1.arbitrum.chainId, arbitrumTokens],
654
+ [chain_1.base.chainId, baseTokens],
655
+ [chain_1.bsc.chainId, bscTokens],
656
+ [chain_1.celo.chainId, celoTokens],
657
+ [chain_1.ethereum.chainId, ethereumTokens],
658
+ [chain_1.linea.chainId, lineaTokens],
659
+ [chain_1.mantle.chainId, mantleTokens],
660
+ [chain_1.optimism.chainId, optimismTokens],
661
+ [chain_1.polygon.chainId, polygonTokens],
662
+ [chain_1.solana.chainId, solanaTokens],
663
+ [chain_1.worldchain.chainId, worldchainTokens],
664
+ ]);
665
+ /**
666
+ * Common tokens, included for convenience.
667
+ *
668
+ * Rozo Pay supports payment in many more tokens. In general, the goal for
669
+ * Pay is to accept all tokens with DEX liquidity on any major chain.
670
+ */
671
+ exports.knownTokens = Array.from(knownTokensByChain.values()).flat();
672
+ /* --------------------- Tokens By Address --------------------- */
673
+ const tokensByChainAddr = new Map(exports.knownTokens.map((t) => [`${t.chainId}-${t.token}`, t]));
674
+ function getKnownToken(chainId, tokenAddress) {
675
+ return tokensByChainAddr.get(`${chainId}-${tokenAddress}`);
676
+ }
677
+ /* --------------------- Tokens By Type --------------------- */
678
+ var TokenType;
679
+ (function (TokenType) {
680
+ TokenType["NATIVE"] = "NATIVE";
681
+ TokenType["WRAPPED_NATIVE"] = "WRAPPED_NATIVE";
682
+ TokenType["NATIVE_USDC"] = "NATIVE_USDC";
683
+ TokenType["BRIDGED_USDC"] = "BRIDGED_USDC";
684
+ TokenType["AXL_USDC"] = "AXL_USDC";
685
+ TokenType["DAI"] = "DAI";
686
+ })(TokenType || (TokenType = {}));
687
+ const tokensByChainAndType = new Map([
688
+ [
689
+ chain_1.arbitrum.chainId,
690
+ {
691
+ [TokenType.NATIVE]: exports.arbitrumETH,
692
+ [TokenType.WRAPPED_NATIVE]: exports.arbitrumWETH,
693
+ [TokenType.NATIVE_USDC]: exports.arbitrumUSDC,
694
+ [TokenType.BRIDGED_USDC]: exports.arbitrumUSDCe,
695
+ [TokenType.AXL_USDC]: exports.arbitrumAxlUSDC,
696
+ [TokenType.DAI]: exports.arbitrumDAI,
697
+ },
698
+ ],
699
+ [
700
+ chain_1.base.chainId,
701
+ {
702
+ [TokenType.NATIVE]: exports.baseETH,
703
+ [TokenType.WRAPPED_NATIVE]: exports.baseWETH,
704
+ [TokenType.NATIVE_USDC]: exports.baseUSDC,
705
+ [TokenType.BRIDGED_USDC]: exports.baseUSDbC,
706
+ [TokenType.AXL_USDC]: exports.baseAxlUSDC,
707
+ [TokenType.DAI]: exports.baseDAI,
708
+ },
709
+ ],
710
+ [
711
+ chain_1.bsc.chainId,
712
+ {
713
+ [TokenType.NATIVE]: exports.bscBNB,
714
+ [TokenType.WRAPPED_NATIVE]: exports.bscWBNB,
715
+ [TokenType.BRIDGED_USDC]: exports.bscUSDC,
716
+ [TokenType.AXL_USDC]: exports.bscAxlUSDC,
717
+ },
718
+ ],
719
+ [
720
+ chain_1.celo.chainId,
721
+ {
722
+ // CELO functions as both a native token and an ERC-20 compatible token
723
+ [TokenType.NATIVE]: exports.celoCelo,
724
+ [TokenType.WRAPPED_NATIVE]: exports.celoCelo,
725
+ [TokenType.NATIVE_USDC]: exports.celoUSDC,
726
+ [TokenType.AXL_USDC]: exports.celoAxlUSDC,
727
+ },
728
+ ],
729
+ [
730
+ chain_1.ethereum.chainId,
731
+ {
732
+ [TokenType.NATIVE]: exports.ethereumETH,
733
+ [TokenType.WRAPPED_NATIVE]: exports.ethereumWETH,
734
+ [TokenType.NATIVE_USDC]: exports.ethereumUSDC,
735
+ [TokenType.DAI]: exports.ethereumDAI,
736
+ },
737
+ ],
738
+ [
739
+ chain_1.linea.chainId,
740
+ {
741
+ [TokenType.NATIVE]: exports.lineaETH,
742
+ [TokenType.WRAPPED_NATIVE]: exports.lineaWETH,
743
+ [TokenType.NATIVE_USDC]: exports.lineaUSDC,
744
+ [TokenType.AXL_USDC]: exports.lineaAxlUSDC,
745
+ [TokenType.DAI]: exports.lineaDAI,
746
+ },
747
+ ],
748
+ [
749
+ chain_1.mantle.chainId,
750
+ {
751
+ [TokenType.NATIVE]: exports.mantleMNT,
752
+ [TokenType.WRAPPED_NATIVE]: exports.mantleWMNT,
753
+ [TokenType.BRIDGED_USDC]: exports.mantleBridgedUSDC,
754
+ [TokenType.AXL_USDC]: exports.mantleAxlUSDC,
755
+ },
756
+ ],
757
+ [
758
+ chain_1.optimism.chainId,
759
+ {
760
+ [TokenType.NATIVE]: exports.optimismETH,
761
+ [TokenType.WRAPPED_NATIVE]: exports.optimismWETH,
762
+ [TokenType.NATIVE_USDC]: exports.optimismUSDC,
763
+ [TokenType.BRIDGED_USDC]: exports.optimismUSDCe,
764
+ [TokenType.AXL_USDC]: exports.optimismAxlUSDC,
765
+ [TokenType.DAI]: exports.optimismDAI,
766
+ },
767
+ ],
768
+ [
769
+ chain_1.polygon.chainId,
770
+ {
771
+ [TokenType.NATIVE]: exports.polygonPOL,
772
+ [TokenType.WRAPPED_NATIVE]: exports.polygonWPOL,
773
+ [TokenType.NATIVE_USDC]: exports.polygonUSDC,
774
+ [TokenType.BRIDGED_USDC]: exports.polygonUSDCe,
775
+ [TokenType.AXL_USDC]: exports.polygonAxlUSDC,
776
+ [TokenType.DAI]: exports.polygonDAI,
777
+ },
778
+ ],
779
+ [
780
+ chain_1.solana.chainId,
781
+ {
782
+ [TokenType.NATIVE]: exports.solanaSOL,
783
+ [TokenType.WRAPPED_NATIVE]: exports.solanaWSOL,
784
+ [TokenType.NATIVE_USDC]: exports.solanaUSDC,
785
+ },
786
+ ],
787
+ [
788
+ chain_1.worldchain.chainId,
789
+ {
790
+ [TokenType.NATIVE]: exports.worldchainETH,
791
+ [TokenType.WRAPPED_NATIVE]: exports.worldchainWETH,
792
+ [TokenType.NATIVE_USDC]: exports.worldchainUSDC,
793
+ },
794
+ ],
795
+ ]);
796
+ function getChainNativeToken(chainId) {
797
+ return (0, assert_1.assertNotNull)(tokensByChainAndType.get(chainId)?.[TokenType.NATIVE], () => `missing native token for chainId ${chainId}`);
798
+ }
799
+ function getChainWrappedNativeToken(chainId) {
800
+ return (0, assert_1.assertNotNull)(tokensByChainAndType.get(chainId)?.[TokenType.WRAPPED_NATIVE], () => `missing wrapped native token for chainId ${chainId}`);
801
+ }
802
+ function getChainNativeUSDC(chainId) {
803
+ return tokensByChainAndType.get(chainId)?.[TokenType.NATIVE_USDC];
804
+ }
805
+ function getChainAxlUSDC(chainId) {
806
+ return tokensByChainAndType.get(chainId)?.[TokenType.AXL_USDC];
807
+ }
808
+ /** Returns native USDC when available, otherwise bridged USDC. */
809
+ function getChainBestUSDC(chainId) {
810
+ const t = tokensByChainAndType.get(chainId);
811
+ return t?.[TokenType.NATIVE_USDC] ?? t?.[TokenType.BRIDGED_USDC];
812
+ }
813
+ function getChainDAI(chainId) {
814
+ return tokensByChainAndType.get(chainId)?.[TokenType.DAI];
815
+ }
816
+ /** Returns true if two tokens are equal (same chain and token address). */
817
+ function tokensEqual(a, b) {
818
+ return a.chainId === b.chainId && a.token === b.token;
819
+ }
820
+ /* --------------------- Native Token Utils --------------------- */
821
+ function nativeETH(chainId) {
822
+ return nativeToken({
823
+ chainId,
824
+ name: "Ether",
825
+ symbol: "ETH",
826
+ logoURI: TokenLogo.ETH,
827
+ });
828
+ }
829
+ function nativeToken({ chainId, name, symbol, logoURI, token = viem_1.zeroAddress, decimals = 18, }) {
830
+ return {
831
+ chainId,
832
+ token,
833
+ name,
834
+ decimals,
835
+ symbol,
836
+ logoURI,
837
+ logoSourceURI: logoURI,
838
+ };
839
+ }
840
+ function token({ chainId, token, name, symbol, decimals, fiatISO, logoURI, }) {
841
+ return {
842
+ chainId,
843
+ token,
844
+ name,
845
+ symbol,
846
+ decimals,
847
+ fiatISO,
848
+ logoURI,
849
+ logoSourceURI: logoURI,
850
+ };
851
+ }
852
+ //# sourceMappingURL=token.js.map