@daimo/pay-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/src/token.ts ADDED
@@ -0,0 +1,599 @@
1
+ import { getAddress, zeroAddress } from "viem";
2
+
3
+ export type Token = {
4
+ chainId: number;
5
+ token: string;
6
+ name?: string;
7
+ symbol: string;
8
+ decimals: number;
9
+ logoURI?: string;
10
+ };
11
+
12
+ export enum TokenLogo {
13
+ ETH = "https://pay.daimo.com/chain-logos/ethereum.png",
14
+ USDC = "https://assets.coingecko.com/coins/images/6319/large/usdc.png",
15
+ EURC = "https://assets.coingecko.com/coins/images/26045/large/euro.png",
16
+ USDT = "https://pay.daimo.com/coin-logos/usdt.png",
17
+ DAI = "https://pay.daimo.com/coin-logos/dai.png",
18
+ POL = "https://assets.coingecko.com/coins/images/4713/large/polygon.png",
19
+ AVAX = "https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png",
20
+ BNB = "https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",
21
+ SOL = "https://solana.com/src/img/branding/solanaLogoMark.png",
22
+ WLD = "https://assets.coingecko.com/coins/images/31069/large/worldcoin.jpeg",
23
+ USDB = "https://assets.coingecko.com/coins/images/35595/large/65c67f0ebf2f6a1bd0feb13c_usdb-icon-yellow.png",
24
+ BLAST = "https://assets.coingecko.com/coins/images/35494/large/Blast.jpg",
25
+ WBTC = "https://s2.coinmarketcap.com/static/img/coins/128x128/3717.png",
26
+ MNT = "https://assets.coingecko.com/coins/images/30980/large/Mantle-Logo-mark.png",
27
+ }
28
+
29
+ //
30
+ // Arbitrum
31
+ //
32
+
33
+ export const arbitrumETH = nativeETH(42161);
34
+
35
+ export const arbitrumWETH: Token = {
36
+ chainId: 42161,
37
+ token: getAddress("0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"),
38
+ decimals: 18,
39
+ name: "Wrapped Ether",
40
+ symbol: "WETH",
41
+ logoURI: TokenLogo.ETH,
42
+ };
43
+
44
+ export const arbitrumUSDC: Token = {
45
+ chainId: 42161,
46
+ token: getAddress("0xaf88d065e77c8cC2239327C5EDb3A432268e5831"),
47
+ name: "USD Coin",
48
+ symbol: "USDC",
49
+ decimals: 6,
50
+ logoURI: TokenLogo.USDC,
51
+ };
52
+
53
+ export const arbitrumAxlUSDC: Token = {
54
+ chainId: 42161,
55
+ token: getAddress("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
56
+ decimals: 6,
57
+ name: "Axelar Wrapped USDC",
58
+ symbol: "axlUSDC",
59
+ logoURI: TokenLogo.USDC,
60
+ };
61
+
62
+ export const arbitrumDAI: Token = {
63
+ chainId: 42161,
64
+ token: getAddress("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
65
+ decimals: 18,
66
+ name: "Dai Stablecoin",
67
+ symbol: "DAI",
68
+ logoURI: TokenLogo.DAI,
69
+ };
70
+
71
+ export const arbitrumUSDT: Token = {
72
+ chainId: 42161,
73
+ token: getAddress("0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9"),
74
+ decimals: 6,
75
+ name: "Tether USD",
76
+ symbol: "USDT",
77
+ logoURI: TokenLogo.USDT,
78
+ };
79
+
80
+ export const arbitrumUSDCe: Token = {
81
+ chainId: 42161,
82
+ token: getAddress("0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8"),
83
+ decimals: 6,
84
+ name: "Bridged USD Coin",
85
+ symbol: "USDCe",
86
+ logoURI: TokenLogo.USDC,
87
+ };
88
+
89
+ //
90
+ // Base Mainnet
91
+ //
92
+
93
+ export const baseETH = nativeETH(8453);
94
+
95
+ export const baseWETH: Token = {
96
+ chainId: 8453,
97
+ token: getAddress("0x4200000000000000000000000000000000000006"),
98
+ decimals: 18,
99
+ name: "Wrapped Ether",
100
+ symbol: "WETH",
101
+ logoURI: TokenLogo.ETH,
102
+ };
103
+
104
+ export const baseUSDC: Token = {
105
+ chainId: 8453,
106
+ token: getAddress("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"),
107
+ name: "USD Coin",
108
+ symbol: "USDC",
109
+ decimals: 6,
110
+ logoURI: TokenLogo.USDC,
111
+ };
112
+
113
+ export const baseEURC: Token = {
114
+ chainId: 8453,
115
+ token: getAddress("0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42"),
116
+ decimals: 6,
117
+ name: "EURC",
118
+ symbol: "EURC",
119
+ logoURI: TokenLogo.EURC,
120
+ };
121
+
122
+ export const baseUSDbC: Token = {
123
+ chainId: 8453,
124
+ token: getAddress("0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA"),
125
+ name: "Bridged USD Coin", // USDbC has a bad name & logo on CoinGecko
126
+ symbol: "USDbC",
127
+ decimals: 6,
128
+ logoURI: `https://daimo.com/assets/foreign-coin-logos/USDbC.png`,
129
+ };
130
+
131
+ export const baseDAI: Token = {
132
+ chainId: 8453,
133
+ token: getAddress("0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"),
134
+ name: "Dai Stablecoin",
135
+ symbol: "DAI",
136
+ decimals: 18,
137
+ logoURI: TokenLogo.DAI,
138
+ };
139
+
140
+ export const baseUSDT: Token = {
141
+ chainId: 8453,
142
+ token: getAddress("0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2"),
143
+ name: "Tether USD",
144
+ symbol: "USDT",
145
+ decimals: 6,
146
+ logoURI: TokenLogo.USDT,
147
+ };
148
+
149
+ export const baseAxlUSDC: Token = {
150
+ chainId: 8453,
151
+ token: getAddress("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
152
+ decimals: 6,
153
+ name: "Axelar Wrapped USDC",
154
+ symbol: "axlUSDC",
155
+ logoURI: TokenLogo.USDC,
156
+ };
157
+
158
+ //
159
+ // Blast
160
+ //
161
+
162
+ export const blastETH = nativeETH(81457);
163
+
164
+ export const blastWETH: Token = {
165
+ chainId: 81457,
166
+ token: getAddress("0x4300000000000000000000000000000000000004"),
167
+ decimals: 18,
168
+ name: "Wrapped Ether",
169
+ symbol: "WETH",
170
+ logoURI: TokenLogo.ETH,
171
+ };
172
+
173
+ export const blastUSDB: Token = {
174
+ chainId: 81457,
175
+ token: getAddress("0x4300000000000000000000000000000000000003"),
176
+ decimals: 18,
177
+ name: "USDB",
178
+ symbol: "USDB",
179
+ logoURI: TokenLogo.USDB,
180
+ };
181
+
182
+ //
183
+ // BNB Smart Chain
184
+ //
185
+
186
+ export const bscBNB = nativeToken({
187
+ chainId: 56,
188
+ name: "BNB",
189
+ symbol: "BNB",
190
+ logoURI: TokenLogo.BNB,
191
+ });
192
+
193
+ export const bscWBNB: Token = {
194
+ chainId: 56,
195
+ token: getAddress("0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"),
196
+ decimals: 18,
197
+ name: "Wrapped BNB",
198
+ symbol: "WBNB",
199
+ logoURI: TokenLogo.BNB,
200
+ };
201
+
202
+ export const bscAxlUSDC: Token = {
203
+ chainId: 56,
204
+ token: getAddress("0x4268B8F0B87b6Eae5d897996E6b845ddbD99Adf3"),
205
+ decimals: 6,
206
+ name: "Axelar Wrapped USDC",
207
+ symbol: "axlUSDC",
208
+ logoURI: TokenLogo.USDC,
209
+ };
210
+
211
+ export const bscUSDC: Token = {
212
+ chainId: 56,
213
+ token: getAddress("0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"),
214
+ decimals: 18,
215
+ name: "Binance-Peg USD Coin",
216
+ symbol: "USDC",
217
+ logoURI: TokenLogo.USDC,
218
+ };
219
+
220
+ export const bscUSDT: Token = {
221
+ chainId: 56,
222
+ token: getAddress("0x55d398326f99059fF775485246999027B3197955"),
223
+ decimals: 18,
224
+ name: "Tether USD",
225
+ symbol: "USDT",
226
+ logoURI: TokenLogo.USDT,
227
+ };
228
+
229
+ //
230
+ // Ethereum
231
+ //
232
+
233
+ export const ethereumETH = nativeETH(1);
234
+
235
+ export const ethereumWETH: Token = {
236
+ chainId: 1,
237
+ token: getAddress("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"),
238
+ decimals: 18,
239
+ name: "Wrapped Ether",
240
+ symbol: "WETH",
241
+ logoURI: TokenLogo.ETH,
242
+ };
243
+
244
+ export const ethereumUSDC: Token = {
245
+ chainId: 1,
246
+ token: getAddress("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
247
+ decimals: 6,
248
+ name: "USD Coin",
249
+ symbol: "USDC",
250
+ logoURI: TokenLogo.USDC,
251
+ };
252
+
253
+ export const ethereumDAI: Token = {
254
+ chainId: 1,
255
+ token: getAddress("0x6B175474E89094C44Da98b954EedeAC495271d0F"),
256
+ decimals: 18,
257
+ name: "Dai Stablecoin",
258
+ symbol: "DAI",
259
+ logoURI: TokenLogo.DAI,
260
+ };
261
+
262
+ export const ethereumUSDT: Token = {
263
+ chainId: 1,
264
+ token: getAddress("0xdAC17F958D2ee523a2206206994597C13D831ec7"),
265
+ decimals: 6,
266
+ name: "Tether USD",
267
+ symbol: "USDT",
268
+ logoURI: TokenLogo.USDT,
269
+ };
270
+
271
+ export const ethereumEURC: Token = {
272
+ chainId: 1,
273
+ token: getAddress("0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c"),
274
+ decimals: 6,
275
+ name: "EURC",
276
+ symbol: "EURC",
277
+ logoURI: TokenLogo.EURC,
278
+ };
279
+
280
+ //
281
+ // Linea
282
+ //
283
+
284
+ export const lineaETH = nativeETH(59144);
285
+
286
+ export const lineaWETH: Token = {
287
+ chainId: 59144,
288
+ token: getAddress("0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f"),
289
+ decimals: 18,
290
+ name: "Wrapped Ether",
291
+ symbol: "WETH",
292
+ logoURI: TokenLogo.ETH,
293
+ };
294
+
295
+ export const lineaBridgedUSDC: Token = {
296
+ chainId: 59144,
297
+ token: getAddress("0x176211869cA2b568f2A7D4EE941E073a821EE1ff"),
298
+ decimals: 6,
299
+ name: "USD Coin",
300
+ symbol: "USDC.e",
301
+ logoURI: TokenLogo.USDC,
302
+ };
303
+
304
+ export const lineaAxlUSDC: Token = {
305
+ chainId: 59144,
306
+ token: getAddress("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
307
+ decimals: 6,
308
+ name: "Axelar Wrapped USDC",
309
+ symbol: "axlUSDC",
310
+ logoURI: TokenLogo.USDC,
311
+ };
312
+
313
+ export const lineaDAI: Token = {
314
+ chainId: 59144,
315
+ token: getAddress("0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5"),
316
+ decimals: 18,
317
+ name: "Dai Stablecoin",
318
+ symbol: "DAI",
319
+ logoURI: TokenLogo.DAI,
320
+ };
321
+
322
+ //
323
+ // Mantle
324
+ //
325
+
326
+ export const mantleMNT = nativeToken({
327
+ chainId: 5000,
328
+ name: "Mantle",
329
+ symbol: "MNT",
330
+ logoURI: TokenLogo.MNT,
331
+ });
332
+
333
+ export const mantleWMNT: Token = {
334
+ chainId: 5000,
335
+ token: getAddress("0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8"),
336
+ decimals: 18,
337
+ name: "Wrapped Mantle",
338
+ symbol: "WMNT",
339
+ logoURI: TokenLogo.MNT,
340
+ };
341
+
342
+ export const mantleBridgedUSDC: Token = {
343
+ chainId: 5000,
344
+ token: getAddress("0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9"),
345
+ decimals: 6,
346
+ name: "USD Coin",
347
+ symbol: "USDC",
348
+ logoURI: TokenLogo.USDC,
349
+ };
350
+
351
+ export const mantleUSDT: Token = {
352
+ chainId: 5000,
353
+ token: getAddress("0x201eba5cc46d216ce6dc03f6a759e8e766e956ae"),
354
+ decimals: 6,
355
+ name: "Tether USD",
356
+ symbol: "USDT",
357
+ logoURI: TokenLogo.USDT,
358
+ };
359
+
360
+ export const mantleAxlUSDC: Token = {
361
+ chainId: 5000,
362
+ token: getAddress("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
363
+ decimals: 6,
364
+ name: "Axelar Wrapped USDC",
365
+ symbol: "axlUSDC",
366
+ logoURI: TokenLogo.USDC,
367
+ };
368
+
369
+ //
370
+ // Optimism
371
+ //
372
+
373
+ export const optimismETH = nativeETH(10);
374
+
375
+ export const optimismWETH: Token = {
376
+ chainId: 10,
377
+ token: getAddress("0x4200000000000000000000000000000000000006"),
378
+ decimals: 18,
379
+ name: "Wrapped Ether",
380
+ symbol: "WETH",
381
+ logoURI: TokenLogo.ETH,
382
+ };
383
+
384
+ export const optimismUSDC: Token = {
385
+ chainId: 10,
386
+ token: getAddress("0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"),
387
+ decimals: 6,
388
+ name: "USD Coin",
389
+ symbol: "USDC",
390
+ logoURI: TokenLogo.USDC,
391
+ };
392
+
393
+ export const optimismAxlUSDC: Token = {
394
+ chainId: 10,
395
+ token: getAddress("0xEB466342C4d449BC9f53A865D5Cb90586f405215"),
396
+ decimals: 6,
397
+ name: "Axelar Wrapped USDC",
398
+ symbol: "axlUSDC",
399
+ logoURI: TokenLogo.USDC,
400
+ };
401
+
402
+ export const optimismDAI: Token = {
403
+ chainId: 10,
404
+ token: getAddress("0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"),
405
+ decimals: 18,
406
+ name: "Dai Stablecoin",
407
+ symbol: "DAI",
408
+ logoURI: TokenLogo.DAI,
409
+ };
410
+
411
+ export const optimismUSDT: Token = {
412
+ chainId: 10,
413
+ token: getAddress("0x94b008aA00579c1307B0EF2c499aD98a8ce58e58"),
414
+ decimals: 6,
415
+ name: "Tether USD",
416
+ symbol: "USDT",
417
+ logoURI: TokenLogo.USDT,
418
+ };
419
+
420
+ export const optimismUSDCe: Token = {
421
+ chainId: 10,
422
+ token: getAddress("0x7F5c764cBc14f9669B88837ca1490cCa17c31607"),
423
+ decimals: 6,
424
+ name: "Bridged USD Coin",
425
+ symbol: "USDCe",
426
+ logoURI: TokenLogo.USDC,
427
+ };
428
+
429
+ //
430
+ // Polygon
431
+ //
432
+
433
+ export const polygonPOL = nativeToken({
434
+ chainId: 137,
435
+ name: "Polygon",
436
+ symbol: "POL",
437
+ logoURI: TokenLogo.POL,
438
+ });
439
+
440
+ export const polygonWPOL: Token = {
441
+ chainId: 137,
442
+ token: getAddress("0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"),
443
+ decimals: 18,
444
+ name: "Wrapped Polygon",
445
+ symbol: "WPOL",
446
+ logoURI: TokenLogo.POL,
447
+ };
448
+
449
+ export const polygonWETH: Token = {
450
+ chainId: 137,
451
+ token: getAddress("0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"),
452
+ decimals: 18,
453
+ name: "Wrapped Ether",
454
+ symbol: "WETH",
455
+ logoURI: TokenLogo.ETH,
456
+ };
457
+
458
+ export const polygonUSDC: Token = {
459
+ chainId: 137,
460
+ token: getAddress("0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359"),
461
+ decimals: 6,
462
+ name: "USD Coin",
463
+ symbol: "USDC",
464
+ logoURI: TokenLogo.USDC,
465
+ };
466
+
467
+ export const polygonAxlUSDC: Token = {
468
+ chainId: 137,
469
+ token: getAddress("0x750e4C4984a9e0f12978eA6742Bc1c5D248f40ed"),
470
+ decimals: 6,
471
+ name: "Axelar Wrapped USDC",
472
+ symbol: "axlUSDC",
473
+ logoURI: TokenLogo.USDC,
474
+ };
475
+
476
+ export const polygonDAI: Token = {
477
+ chainId: 137,
478
+ token: getAddress("0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063"),
479
+ decimals: 18,
480
+ name: "Dai Stablecoin",
481
+ symbol: "DAI",
482
+ logoURI: TokenLogo.DAI,
483
+ };
484
+
485
+ export const polygonUSDT: Token = {
486
+ chainId: 137,
487
+ token: getAddress("0xc2132D05D31c914a87C6611C10748AEb04B58e8F"),
488
+ decimals: 6,
489
+ name: "Tether USD",
490
+ symbol: "USDT",
491
+ logoURI: TokenLogo.USDT,
492
+ };
493
+
494
+ export const polygonUSDCe: Token = {
495
+ chainId: 137,
496
+ token: getAddress("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"),
497
+ decimals: 6,
498
+ name: "Bridged USD Coin",
499
+ symbol: "USDCe",
500
+ logoURI: TokenLogo.USDC,
501
+ };
502
+
503
+ //
504
+ // Solana
505
+ //
506
+
507
+ export const solanaSOL = nativeToken({
508
+ chainId: 501,
509
+ name: "Solana",
510
+ symbol: "SOL",
511
+ logoURI: TokenLogo.SOL,
512
+ token: "11111111111111111111111111111111",
513
+ decimals: 9,
514
+ });
515
+
516
+ export const solanaWSOL: Token = {
517
+ chainId: 501,
518
+ token: "So11111111111111111111111111111111111111112",
519
+ decimals: 9,
520
+ name: "Wrapped SOL",
521
+ symbol: "WSOL",
522
+ logoURI: TokenLogo.SOL,
523
+ };
524
+
525
+ export const solanaUSDC: Token = {
526
+ chainId: 501,
527
+ token: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
528
+ decimals: 6,
529
+ name: "USD Coin",
530
+ symbol: "USDC",
531
+ logoURI: TokenLogo.USDC,
532
+ };
533
+
534
+ //
535
+ // Worldchain
536
+ //
537
+
538
+ export const worldchainETH = nativeETH(480);
539
+
540
+ export const worldchainWETH: Token = {
541
+ chainId: 480,
542
+ token: getAddress("0x4200000000000000000000000000000000000006"),
543
+ decimals: 18,
544
+ name: "Wrapped Ether",
545
+ symbol: "WETH",
546
+ logoURI: TokenLogo.ETH,
547
+ };
548
+
549
+ export const worldchainUSDCe: Token = {
550
+ chainId: 480,
551
+ token: getAddress("0x79A02482A880bCE3F13e09Da970dC34db4CD24d1"),
552
+ decimals: 6,
553
+ name: "Bridged USD Coin",
554
+ symbol: "USDCe",
555
+ logoURI: TokenLogo.USDC,
556
+ };
557
+
558
+ export const worldchainWLD: Token = {
559
+ chainId: 480,
560
+ token: getAddress("0x2cFc85d8E48F8EAB294be644d9E25C3030863003"),
561
+ decimals: 18,
562
+ name: "Worldcoin",
563
+ symbol: "WLD",
564
+ logoURI: TokenLogo.WLD,
565
+ };
566
+
567
+ function nativeETH(chainId: number): Token {
568
+ return nativeToken({
569
+ chainId,
570
+ name: "Ether",
571
+ symbol: "ETH",
572
+ logoURI: TokenLogo.ETH,
573
+ });
574
+ }
575
+
576
+ function nativeToken({
577
+ chainId,
578
+ name,
579
+ symbol,
580
+ logoURI,
581
+ token = zeroAddress,
582
+ decimals = 18,
583
+ }: {
584
+ chainId: number;
585
+ name: string;
586
+ symbol: string;
587
+ logoURI: string;
588
+ token?: string;
589
+ decimals?: number;
590
+ }): Token {
591
+ return {
592
+ chainId,
593
+ token,
594
+ name,
595
+ decimals,
596
+ symbol,
597
+ logoURI,
598
+ };
599
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@tsconfig/node20/tsconfig.json",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "resolveJsonModule": true,
6
+ "sourceMap": true,
7
+ "outDir": "dist",
8
+ "declaration": true,
9
+ "esModuleInterop": true
10
+ },
11
+ "include": ["src/**/*.ts"]
12
+ }