@0xtorch/evm 0.0.157 → 0.0.159

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.
Files changed (79) hide show
  1. package/.DS_Store +0 -0
  2. package/_cjs/chain/definitions/plasma.js +63 -0
  3. package/_cjs/chain/definitions/plasma.js.map +1 -0
  4. package/_cjs/chain/index.js +8 -3
  5. package/_cjs/chain/index.js.map +1 -1
  6. package/_cjs/explorer/blockscout/create.js +49 -24
  7. package/_cjs/explorer/blockscout/create.js.map +1 -1
  8. package/_cjs/explorer/etherscan/create.js +53 -26
  9. package/_cjs/explorer/etherscan/create.js.map +1 -1
  10. package/_cjs/explorer/etherscanV2/create.js +53 -26
  11. package/_cjs/explorer/etherscanV2/create.js.map +1 -1
  12. package/_cjs/explorer/moralis/create.js +15 -3
  13. package/_cjs/explorer/moralis/create.js.map +1 -1
  14. package/_cjs/index.js +8 -4
  15. package/_cjs/index.js.map +1 -1
  16. package/_esm/chain/definitions/plasma.js +58 -0
  17. package/_esm/chain/definitions/plasma.js.map +1 -0
  18. package/_esm/chain/index.js +1 -0
  19. package/_esm/chain/index.js.map +1 -1
  20. package/_esm/explorer/blockscout/create.js +53 -24
  21. package/_esm/explorer/blockscout/create.js.map +1 -1
  22. package/_esm/explorer/etherscan/create.js +57 -26
  23. package/_esm/explorer/etherscan/create.js.map +1 -1
  24. package/_esm/explorer/etherscanV2/create.js +57 -26
  25. package/_esm/explorer/etherscanV2/create.js.map +1 -1
  26. package/_esm/explorer/moralis/create.js +19 -3
  27. package/_esm/explorer/moralis/create.js.map +1 -1
  28. package/_esm/index.js +1 -1
  29. package/_esm/index.js.map +1 -1
  30. package/_types/chain/definitions/plasma.d.ts +18 -0
  31. package/_types/chain/definitions/plasma.d.ts.map +1 -0
  32. package/_types/chain/index.d.ts +1 -0
  33. package/_types/chain/index.d.ts.map +1 -1
  34. package/_types/chain/viemChains/chainVerse.d.ts +9 -0
  35. package/_types/chain/viemChains/chainVerse.d.ts.map +1 -1
  36. package/_types/chain/viemChains/defiVerse.d.ts +9 -0
  37. package/_types/chain/viemChains/defiVerse.d.ts.map +1 -1
  38. package/_types/chain/viemChains/geekVerse.d.ts +9 -0
  39. package/_types/chain/viemChains/geekVerse.d.ts.map +1 -1
  40. package/_types/chain/viemChains/gesoVerse.d.ts +9 -0
  41. package/_types/chain/viemChains/gesoVerse.d.ts.map +1 -1
  42. package/_types/chain/viemChains/homeVerse.d.ts +9 -0
  43. package/_types/chain/viemChains/homeVerse.d.ts.map +1 -1
  44. package/_types/chain/viemChains/hyperEvm.d.ts +9 -0
  45. package/_types/chain/viemChains/hyperEvm.d.ts.map +1 -1
  46. package/_types/chain/viemChains/mchVerse.d.ts +9 -0
  47. package/_types/chain/viemChains/mchVerse.d.ts.map +1 -1
  48. package/_types/chain/viemChains/saakuru.d.ts +9 -0
  49. package/_types/chain/viemChains/saakuru.d.ts.map +1 -1
  50. package/_types/chain/viemChains/tcgVerse.d.ts +9 -0
  51. package/_types/chain/viemChains/tcgVerse.d.ts.map +1 -1
  52. package/_types/explorer/blockscout/create.d.ts.map +1 -1
  53. package/_types/explorer/etherscan/create.d.ts.map +1 -1
  54. package/_types/explorer/etherscanV2/create.d.ts.map +1 -1
  55. package/_types/explorer/index.d.ts +1 -1
  56. package/_types/explorer/index.d.ts.map +1 -1
  57. package/_types/explorer/moralis/create.d.ts.map +1 -1
  58. package/_types/explorer/types.d.ts +9 -8
  59. package/_types/explorer/types.d.ts.map +1 -1
  60. package/_types/index.d.ts +1 -1
  61. package/_types/index.d.ts.map +1 -1
  62. package/_types/logic/analyzeTransaction/createActions/json/schema.d.ts +19285 -19285
  63. package/_types/types/erc1155.d.ts +2 -2
  64. package/_types/types/erc20.d.ts +2 -2
  65. package/_types/types/erc20.d.ts.map +1 -1
  66. package/_types/types/erc721.d.ts +2 -2
  67. package/_types/types/transactionDecoded.d.ts +16 -16
  68. package/_types/types/transactionDecoded.d.ts.map +1 -1
  69. package/_types/types/transactionDetail.d.ts +4 -4
  70. package/chain/definitions/plasma.ts +81 -0
  71. package/chain/index.ts +6 -0
  72. package/explorer/blockscout/create.ts +49 -21
  73. package/explorer/etherscan/create.ts +56 -23
  74. package/explorer/etherscanV2/create.ts +56 -23
  75. package/explorer/index.ts +1 -1
  76. package/explorer/moralis/create.ts +23 -4
  77. package/explorer/types.ts +13 -8
  78. package/index.ts +4 -0
  79. package/package.json +2 -2
@@ -59,7 +59,6 @@ export declare const erc1155TokenTransferSchema: z.ZodObject<{
59
59
  to: `0x${Lowercase<string>}`;
60
60
  value: bigint;
61
61
  tokenId: bigint;
62
- logIndex: number;
63
62
  token: {
64
63
  type: "Nft";
65
64
  id: string;
@@ -68,13 +67,13 @@ export declare const erc1155TokenTransferSchema: z.ZodObject<{
68
67
  image?: string | undefined;
69
68
  metadata?: string | undefined;
70
69
  };
70
+ logIndex: number;
71
71
  }, {
72
72
  address: string;
73
73
  from: string;
74
74
  to: string;
75
75
  value: string;
76
76
  tokenId: string;
77
- logIndex: number;
78
77
  token: {
79
78
  type: "Nft";
80
79
  id: string;
@@ -83,6 +82,7 @@ export declare const erc1155TokenTransferSchema: z.ZodObject<{
83
82
  image?: string | undefined;
84
83
  metadata?: string | undefined;
85
84
  };
85
+ logIndex: number;
86
86
  }>;
87
87
  export type Erc1155TokenTransfer = z.infer<typeof erc1155TokenTransferSchema>;
88
88
  export type Erc1155NftId = `evm_1155_${number}_${LowerHex}_${bigint}`;
@@ -200,7 +200,6 @@ export declare const erc20TokenTransferSchema: z.ZodObject<{
200
200
  from: `0x${Lowercase<string>}`;
201
201
  to: `0x${Lowercase<string>}`;
202
202
  value: bigint;
203
- logIndex: number;
204
203
  token: {
205
204
  symbol: string;
206
205
  address: `0x${Lowercase<string>}`;
@@ -220,12 +219,12 @@ export declare const erc20TokenTransferSchema: z.ZodObject<{
220
219
  priceDatasourceId?: string | undefined;
221
220
  };
222
221
  };
222
+ logIndex: number;
223
223
  }, {
224
224
  address: string;
225
225
  from: string;
226
226
  to: string;
227
227
  value: string;
228
- logIndex: number;
229
228
  token: {
230
229
  symbol: string;
231
230
  address: string;
@@ -245,6 +244,7 @@ export declare const erc20TokenTransferSchema: z.ZodObject<{
245
244
  priceDatasourceId?: string | undefined;
246
245
  };
247
246
  };
247
+ logIndex: number;
248
248
  }>;
249
249
  export type Erc20Token = z.infer<typeof erc20TokenSchema>;
250
250
  export type Erc20Transfer = z.infer<typeof erc20TransferSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"erc20.d.ts","sourceRoot":"","sources":["../../types/erc20.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;uBAU1B,CAAC;wBACU,CAAC;;uBAEV,CAAC;wBAGW,CAAC;;;;;;;;;;;;uBASU,CAAC;wBAA0C,CAAC;;;;;;;;;;;uBAAoQ,CAAC;wBAA0C,CAAC;;;;;;;;;;;;;;;;;uBAA5V,CAAC;wBAA0C,CAAC;;;;;;;;;;;;;;;;;uBAAoQ,CAAC;wBAA0C,CAAC;;;;EAnBtX,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;EAM9B,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;2BANlC,CAAC;4BACU,CAAC;;2BAEV,CAAC;4BAGW,CAAC;;;;;;;;;;;;2BASU,CAAC;4BAA0C,CAAC;;;;;;;;;;;2BAAoQ,CAAC;4BAA0C,CAAC;;;;;;;;;;;;;;;;;2BAA5V,CAAC;4BAA0C,CAAC;;;;;;;;;;;;;;;;;2BAAoQ,CAAC;4BAA0C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;2BAA5V,CAAC;4BAA0C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;2BAAoQ,CAAC;4BAA0C,CAAC;;;;;EAPtX,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CA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BAAmB,CAAC,CAAA;AAE/D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -54,7 +54,6 @@ export declare const erc721TokenTransferSchema: z.ZodObject<{
54
54
  from: `0x${Lowercase<string>}`;
55
55
  to: `0x${Lowercase<string>}`;
56
56
  tokenId: bigint;
57
- logIndex: number;
58
57
  token: {
59
58
  type: "Nft";
60
59
  id: string;
@@ -63,12 +62,12 @@ export declare const erc721TokenTransferSchema: z.ZodObject<{
63
62
  image?: string | undefined;
64
63
  metadata?: string | undefined;
65
64
  };
65
+ logIndex: number;
66
66
  }, {
67
67
  address: string;
68
68
  from: string;
69
69
  to: string;
70
70
  tokenId: string;
71
- logIndex: number;
72
71
  token: {
73
72
  type: "Nft";
74
73
  id: string;
@@ -77,6 +76,7 @@ export declare const erc721TokenTransferSchema: z.ZodObject<{
77
76
  image?: string | undefined;
78
77
  metadata?: string | undefined;
79
78
  };
79
+ logIndex: number;
80
80
  }>;
81
81
  export type Erc721TokenTransfer = z.infer<typeof erc721TokenTransferSchema>;
82
82
  export type Erc721NftId = `evm_721_${number}_${LowerHex}_${bigint}`;
@@ -217,7 +217,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
217
217
  from: `0x${Lowercase<string>}`;
218
218
  to: `0x${Lowercase<string>}`;
219
219
  value: bigint;
220
- logIndex: number;
221
220
  token: {
222
221
  symbol: string;
223
222
  address: `0x${Lowercase<string>}`;
@@ -237,12 +236,12 @@ export declare const transactionDecodedSchema: z.ZodObject<{
237
236
  priceDatasourceId?: string | undefined;
238
237
  };
239
238
  };
239
+ logIndex: number;
240
240
  }, {
241
241
  address: string;
242
242
  from: string;
243
243
  to: string;
244
244
  value: string;
245
- logIndex: number;
246
245
  token: {
247
246
  symbol: string;
248
247
  address: string;
@@ -262,6 +261,7 @@ export declare const transactionDecodedSchema: z.ZodObject<{
262
261
  priceDatasourceId?: string | undefined;
263
262
  };
264
263
  };
264
+ logIndex: number;
265
265
  }>, "many">;
266
266
  erc721Transfers: z.ZodArray<z.ZodObject<{
267
267
  address: z.ZodEffects<z.ZodString, `0x${Lowercase<string>}`, string>;
@@ -297,7 +297,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
297
297
  from: `0x${Lowercase<string>}`;
298
298
  to: `0x${Lowercase<string>}`;
299
299
  tokenId: bigint;
300
- logIndex: number;
301
300
  token: {
302
301
  type: "Nft";
303
302
  id: string;
@@ -306,12 +305,12 @@ export declare const transactionDecodedSchema: z.ZodObject<{
306
305
  image?: string | undefined;
307
306
  metadata?: string | undefined;
308
307
  };
308
+ logIndex: number;
309
309
  }, {
310
310
  address: string;
311
311
  from: string;
312
312
  to: string;
313
313
  tokenId: string;
314
- logIndex: number;
315
314
  token: {
316
315
  type: "Nft";
317
316
  id: string;
@@ -320,6 +319,7 @@ export declare const transactionDecodedSchema: z.ZodObject<{
320
319
  image?: string | undefined;
321
320
  metadata?: string | undefined;
322
321
  };
322
+ logIndex: number;
323
323
  }>, "many">;
324
324
  erc1155Transfers: z.ZodArray<z.ZodObject<{
325
325
  address: z.ZodEffects<z.ZodString, `0x${Lowercase<string>}`, string>;
@@ -357,7 +357,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
357
357
  to: `0x${Lowercase<string>}`;
358
358
  value: bigint;
359
359
  tokenId: bigint;
360
- logIndex: number;
361
360
  token: {
362
361
  type: "Nft";
363
362
  id: string;
@@ -366,13 +365,13 @@ export declare const transactionDecodedSchema: z.ZodObject<{
366
365
  image?: string | undefined;
367
366
  metadata?: string | undefined;
368
367
  };
368
+ logIndex: number;
369
369
  }, {
370
370
  address: string;
371
371
  from: string;
372
372
  to: string;
373
373
  value: string;
374
374
  tokenId: string;
375
- logIndex: number;
376
375
  token: {
377
376
  type: "Nft";
378
377
  id: string;
@@ -381,6 +380,7 @@ export declare const transactionDecodedSchema: z.ZodObject<{
381
380
  image?: string | undefined;
382
381
  metadata?: string | undefined;
383
382
  };
383
+ logIndex: number;
384
384
  }>, "many">;
385
385
  from: z.ZodObject<{
386
386
  chainId: z.ZodNumber;
@@ -469,7 +469,9 @@ export declare const transactionDecodedSchema: z.ZodObject<{
469
469
  abi?: string | undefined;
470
470
  };
471
471
  value: bigint;
472
+ hash: `0x${Lowercase<string>}`;
472
473
  chainId: number;
474
+ input: `0x${Lowercase<string>}`;
473
475
  status: "success" | "reverted";
474
476
  logs: {
475
477
  address: `0x${Lowercase<string>}`;
@@ -490,7 +492,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
490
492
  from: `0x${Lowercase<string>}`;
491
493
  to: `0x${Lowercase<string>}`;
492
494
  value: bigint;
493
- logIndex: number;
494
495
  token: {
495
496
  symbol: string;
496
497
  address: `0x${Lowercase<string>}`;
@@ -510,13 +511,13 @@ export declare const transactionDecodedSchema: z.ZodObject<{
510
511
  priceDatasourceId?: string | undefined;
511
512
  };
512
513
  };
514
+ logIndex: number;
513
515
  }[];
514
516
  erc721Transfers: {
515
517
  address: `0x${Lowercase<string>}`;
516
518
  from: `0x${Lowercase<string>}`;
517
519
  to: `0x${Lowercase<string>}`;
518
520
  tokenId: bigint;
519
- logIndex: number;
520
521
  token: {
521
522
  type: "Nft";
522
523
  id: string;
@@ -525,6 +526,7 @@ export declare const transactionDecodedSchema: z.ZodObject<{
525
526
  image?: string | undefined;
526
527
  metadata?: string | undefined;
527
528
  };
529
+ logIndex: number;
528
530
  }[];
529
531
  erc1155Transfers: {
530
532
  address: `0x${Lowercase<string>}`;
@@ -532,7 +534,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
532
534
  to: `0x${Lowercase<string>}`;
533
535
  value: bigint;
534
536
  tokenId: bigint;
535
- logIndex: number;
536
537
  token: {
537
538
  type: "Nft";
538
539
  id: string;
@@ -541,13 +542,12 @@ export declare const transactionDecodedSchema: z.ZodObject<{
541
542
  image?: string | undefined;
542
543
  metadata?: string | undefined;
543
544
  };
545
+ logIndex: number;
544
546
  }[];
545
- hash: `0x${Lowercase<string>}`;
546
547
  blockNumber: number;
547
548
  timestamp: number;
548
549
  effectiveGasPrice: bigint;
549
550
  gasUsed: bigint;
550
- input: `0x${Lowercase<string>}`;
551
551
  internalTransactions: {
552
552
  from: `0x${Lowercase<string>}`;
553
553
  value: bigint;
@@ -585,7 +585,9 @@ export declare const transactionDecodedSchema: z.ZodObject<{
585
585
  abi?: string | undefined;
586
586
  };
587
587
  value: string;
588
+ hash: string;
588
589
  chainId: number;
590
+ input: string;
589
591
  status: "success" | "reverted";
590
592
  logs: {
591
593
  address: string;
@@ -606,7 +608,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
606
608
  from: string;
607
609
  to: string;
608
610
  value: string;
609
- logIndex: number;
610
611
  token: {
611
612
  symbol: string;
612
613
  address: string;
@@ -626,13 +627,13 @@ export declare const transactionDecodedSchema: z.ZodObject<{
626
627
  priceDatasourceId?: string | undefined;
627
628
  };
628
629
  };
630
+ logIndex: number;
629
631
  }[];
630
632
  erc721Transfers: {
631
633
  address: string;
632
634
  from: string;
633
635
  to: string;
634
636
  tokenId: string;
635
- logIndex: number;
636
637
  token: {
637
638
  type: "Nft";
638
639
  id: string;
@@ -641,6 +642,7 @@ export declare const transactionDecodedSchema: z.ZodObject<{
641
642
  image?: string | undefined;
642
643
  metadata?: string | undefined;
643
644
  };
645
+ logIndex: number;
644
646
  }[];
645
647
  erc1155Transfers: {
646
648
  address: string;
@@ -648,7 +650,6 @@ export declare const transactionDecodedSchema: z.ZodObject<{
648
650
  to: string;
649
651
  value: string;
650
652
  tokenId: string;
651
- logIndex: number;
652
653
  token: {
653
654
  type: "Nft";
654
655
  id: string;
@@ -657,13 +658,12 @@ export declare const transactionDecodedSchema: z.ZodObject<{
657
658
  image?: string | undefined;
658
659
  metadata?: string | undefined;
659
660
  };
661
+ logIndex: number;
660
662
  }[];
661
- hash: string;
662
663
  blockNumber: number;
663
664
  timestamp: number;
664
665
  effectiveGasPrice: string;
665
666
  gasUsed: string;
666
- input: string;
667
667
  internalTransactions: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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAJ1O,CAAA;gCAGG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAC0L,CAAC;gCAA0C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAH9O,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -150,7 +150,9 @@ export declare const transactionDetailSchema: z.ZodObject<{
150
150
  }, "strip", z.ZodTypeAny, {
151
151
  from: `0x${Lowercase<string>}`;
152
152
  value: bigint;
153
+ hash: `0x${Lowercase<string>}`;
153
154
  chainId: number;
155
+ input: `0x${Lowercase<string>}`;
154
156
  status: "success" | "reverted";
155
157
  logs: {
156
158
  address: `0x${Lowercase<string>}`;
@@ -188,12 +190,10 @@ export declare const transactionDetailSchema: z.ZodObject<{
188
190
  tokenId: bigint;
189
191
  logIndex: number;
190
192
  }[];
191
- hash: `0x${Lowercase<string>}`;
192
193
  blockNumber: number;
193
194
  timestamp: number;
194
195
  effectiveGasPrice: bigint;
195
196
  gasUsed: bigint;
196
- input: `0x${Lowercase<string>}`;
197
197
  internalTransactions: {
198
198
  from: `0x${Lowercase<string>}`;
199
199
  value: bigint;
@@ -208,7 +208,9 @@ export declare const transactionDetailSchema: z.ZodObject<{
208
208
  }, {
209
209
  from: string;
210
210
  value: string;
211
+ hash: string;
211
212
  chainId: number;
213
+ input: string;
212
214
  status: "success" | "reverted";
213
215
  logs: {
214
216
  address: string;
@@ -246,12 +248,10 @@ export declare const transactionDetailSchema: z.ZodObject<{
246
248
  tokenId: string;
247
249
  logIndex: number;
248
250
  }[];
249
- hash: string;
250
251
  blockNumber: number;
251
252
  timestamp: number;
252
253
  effectiveGasPrice: string;
253
254
  gasUsed: string;
254
- input: string;
255
255
  internalTransactions: {
256
256
  from: string;
257
257
  value: string;
@@ -0,0 +1,81 @@
1
+ import { plasma } from 'viem/chains'
2
+ import { type Client, createClient } from '../../client'
3
+ import type { Explorer } from '../../explorer'
4
+ import { createEtherscanV2 } from '../../explorer'
5
+ import type { Chain } from '../types/chain'
6
+ import type { HttpRpc } from '../types/rpc'
7
+
8
+ export const createPlasmaChain = ({
9
+ explorerApiKey: apiKey,
10
+ explorerProxyUrl: proxyUrl,
11
+ explorerPageSize: pageSize,
12
+ }: {
13
+ explorerApiKey?: string
14
+ explorerProxyUrl?: string
15
+ explorerPageSize?: number
16
+ }) =>
17
+ createPlasmaChainCustom({
18
+ client: createClient({
19
+ chain: plasma,
20
+ httpRpcs: plasmaHttpRpcs,
21
+ }),
22
+ explorer: createEtherscanV2({
23
+ name: 'Plasmascan',
24
+ baseUrl: 'https://plasmascan.to',
25
+ chainId: 9745,
26
+ apiKey,
27
+ proxyUrl,
28
+ pageSize,
29
+ }),
30
+ })
31
+
32
+ type CreatePlasmaChainParameters = {
33
+ client: Client
34
+ explorer: Explorer
35
+ }
36
+
37
+ export const createPlasmaChainCustom = ({
38
+ client,
39
+ explorer,
40
+ }: CreatePlasmaChainParameters): Chain => ({
41
+ id: 9745,
42
+ network: 'plasma',
43
+ name: 'Plasma',
44
+ nativeToken: {
45
+ name: 'Plasma',
46
+ symbol: 'XPL',
47
+ decimals: 18,
48
+ currency: {
49
+ symbol: 'XPL',
50
+ type: 'CryptoCurrency',
51
+ id: 'plasma',
52
+ name: 'Plasma',
53
+ updatedAt: 0,
54
+ },
55
+ },
56
+ wrappedTokenAddresses: new Set([
57
+ '0x6100e367285b01f48d07953803a2d8dca5d19873',
58
+ ]),
59
+ explorer,
60
+ client,
61
+ blockTime: 1000,
62
+ coingeckoId: 'plasma',
63
+ defillamaId: undefined,
64
+ })
65
+
66
+ export const plasmaHttpRpcs: HttpRpc[] = [
67
+ {
68
+ url: 'https://plasma.drpc.org',
69
+ getLogsIsUsable: true,
70
+ getLogsMaxBlockRange: 10_000n,
71
+ },
72
+ {
73
+ url: 'https://rpc.plasma.to',
74
+ getLogsIsUsable: true,
75
+ getLogsMaxBlockRange: 10_000n,
76
+ },
77
+ ]
78
+
79
+ export const plasmaWebsocketRpcUrls: readonly string[] = [
80
+ 'wss://plasma.drpc.org',
81
+ ]
package/chain/index.ts CHANGED
@@ -220,6 +220,12 @@ export {
220
220
  optimismHttpRpcs,
221
221
  optimismWebsocketRpcUrls,
222
222
  } from './definitions/optimism'
223
+ export {
224
+ createPlasmaChain,
225
+ createPlasmaChainCustom,
226
+ plasmaHttpRpcs,
227
+ plasmaWebsocketRpcUrls,
228
+ } from './definitions/plasma'
223
229
  export {
224
230
  createPolygonPosChain,
225
231
  createPolygonPosChainCustom,
@@ -2,7 +2,7 @@ import type { Erc20Transfer, LowerHex } from '../../types'
2
2
  import type { InternalTransactionWithIndex } from '../../types/internalTransaction'
3
3
  import type { TransactionIndex } from '../../types/transactionIndex'
4
4
  import { createInternalTransactionId } from '../../utils/createInternalTransactionId'
5
- import type { Explorer, LogWithBlockNumber } from '../types'
5
+ import type { Explorer, HeadersInput, LogWithBlockNumber } from '../types'
6
6
  import { createBlockscoutClient } from './client'
7
7
  import { getBlockNumberByTimestamp } from './getBlockNumberByTimestamp'
8
8
  import { getContractCreatorAddressHashAndCreationTransactionHash } from './getContractCreatorAddressHashAndCreationTransactionHash'
@@ -13,6 +13,22 @@ import { getInternalTransactionsByTransactionHash } from './getInternalTransacti
13
13
  import { getTokenTransferEventsByAddress } from './getTokenTransferEventsByAddress'
14
14
  import { getTransactionsByAddress } from './getTransactionsByAddress'
15
15
 
16
+ /**
17
+ * Resolves headers from either a static object or a function that returns headers.
18
+ * This allows for dynamic header generation (e.g., refreshing auth tokens).
19
+ */
20
+ const resolveHeaders = async (
21
+ headers: HeadersInput,
22
+ ): Promise<Record<string, string> | undefined> => {
23
+ if (headers === undefined) {
24
+ return undefined
25
+ }
26
+ if (typeof headers === 'function') {
27
+ return await headers()
28
+ }
29
+ return headers
30
+ }
31
+
16
32
  type CreateBlockscoutParameters = {
17
33
  name: string
18
34
  baseUrl: string
@@ -45,12 +61,13 @@ export const createBlockscout = ({
45
61
  const endblock = toBlock
46
62
  const maxPageSize = 10_000
47
63
  while (true) {
64
+ const resolvedHeaders = await resolveHeaders(headers)
48
65
  const result = await getInternalTransactionsByAddressHash({
49
66
  client,
50
67
  address,
51
68
  startblock,
52
69
  endblock,
53
- headers,
70
+ headers: resolvedHeaders,
54
71
  })
55
72
  for (const transaction of result) {
56
73
  const id = createInternalTransactionId(transaction)
@@ -77,12 +94,13 @@ export const createBlockscout = ({
77
94
  const endblock = toBlock
78
95
  const maxPageSize = 10_000
79
96
  while (true) {
97
+ const resolvedHeaders = await resolveHeaders(headers)
80
98
  const result = await getTransactionsByAddress({
81
99
  client,
82
100
  address,
83
101
  startblock,
84
102
  endblock,
85
- headers,
103
+ headers: resolvedHeaders,
86
104
  })
87
105
  for (const index of result) {
88
106
  if (!indexes.has(index.hash)) {
@@ -109,13 +127,14 @@ export const createBlockscout = ({
109
127
  const endblock = toBlock
110
128
  const maxPageSize = 10_000
111
129
  while (true) {
130
+ const resolvedHeaders = await resolveHeaders(headers)
112
131
  const { indexes: resultIndexes, erc20Transfers: resultErc20Transfers } =
113
132
  await getTokenTransferEventsByAddress({
114
133
  client,
115
134
  address,
116
135
  startblock,
117
136
  endblock,
118
- headers,
137
+ headers: resolvedHeaders,
119
138
  })
120
139
  for (const index of resultIndexes) {
121
140
  if (!indexes.has(index.hash)) {
@@ -136,24 +155,30 @@ export const createBlockscout = ({
136
155
  erc20Transfers,
137
156
  }
138
157
  },
139
- getBlockNumberOfTimestamp: ({ timestamp, headers }) =>
140
- getBlockNumberByTimestamp({
158
+ getBlockNumberOfTimestamp: async ({ timestamp, headers }) => {
159
+ const resolvedHeaders = await resolveHeaders(headers)
160
+ return getBlockNumberByTimestamp({
141
161
  client,
142
162
  timestamp: Math.floor(timestamp / 1000),
143
- headers,
144
- }),
145
- getContract: ({ address, headers }) =>
146
- getContractSourceCodeForAVerifiedContract({
163
+ headers: resolvedHeaders,
164
+ })
165
+ },
166
+ getContract: async ({ address, headers }) => {
167
+ const resolvedHeaders = await resolveHeaders(headers)
168
+ return getContractSourceCodeForAVerifiedContract({
147
169
  client,
148
170
  address,
149
- headers,
150
- }),
151
- getContractCreations: ({ addresses, headers }) =>
152
- getContractCreatorAddressHashAndCreationTransactionHash({
171
+ headers: resolvedHeaders,
172
+ })
173
+ },
174
+ getContractCreations: async ({ addresses, headers }) => {
175
+ const resolvedHeaders = await resolveHeaders(headers)
176
+ return getContractCreatorAddressHashAndCreationTransactionHash({
153
177
  client,
154
178
  contractaddresses: addresses,
155
- headers,
156
- }),
179
+ headers: resolvedHeaders,
180
+ })
181
+ },
157
182
  getEventLogs: async ({
158
183
  address,
159
184
  topic0,
@@ -166,13 +191,14 @@ export const createBlockscout = ({
166
191
  const toBlock = toBlockParam ?? 'latest'
167
192
  const maxPageSize = 10_000
168
193
  while (true) {
194
+ const resolvedHeaders = await resolveHeaders(headers)
169
195
  const result = await getEventLogsByAddressAndTopic({
170
196
  client,
171
197
  address,
172
198
  topic0,
173
199
  fromBlock,
174
200
  toBlock,
175
- headers,
201
+ headers: resolvedHeaders,
176
202
  })
177
203
  logs.push(...result)
178
204
  if (result.length < maxPageSize) {
@@ -183,11 +209,13 @@ export const createBlockscout = ({
183
209
  }
184
210
  return logs
185
211
  },
186
- getInternalTransactionOfTransaction: ({ hash, headers }) =>
187
- getInternalTransactionsByTransactionHash({
212
+ getInternalTransactionOfTransaction: async ({ hash, headers }) => {
213
+ const resolvedHeaders = await resolveHeaders(headers)
214
+ return getInternalTransactionsByTransactionHash({
188
215
  client,
189
216
  txhash: hash,
190
- headers,
191
- }),
217
+ headers: resolvedHeaders,
218
+ })
219
+ },
192
220
  }
193
221
  }