@0xsequence/wallet-primitives 3.0.0-beta.9 → 3.0.0
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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-lint.log +4 -0
- package/.turbo/turbo-test.log +28 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +85 -0
- package/dist/attestation.d.ts +15 -3
- package/dist/attestation.d.ts.map +1 -1
- package/dist/attestation.js +1 -1
- package/dist/attestation.js.map +1 -1
- package/dist/config.d.ts +40 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -7
- package/dist/config.js.map +1 -1
- package/dist/extensions/recovery.d.ts +4 -4
- package/dist/extensions/recovery.d.ts.map +1 -1
- package/dist/extensions/recovery.js +2 -2
- package/dist/extensions/recovery.js.map +1 -1
- package/dist/network.d.ts +9 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +212 -8
- package/dist/network.js.map +1 -1
- package/dist/payload.d.ts.map +1 -1
- package/dist/payload.js.map +1 -1
- package/dist/signature.d.ts.map +1 -1
- package/dist/signature.js +8 -6
- package/dist/signature.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/eslint.config.js +12 -0
- package/package.json +7 -5
- package/src/attestation.ts +16 -4
- package/src/config.ts +62 -20
- package/src/extensions/recovery.ts +7 -8
- package/src/network.ts +226 -9
- package/src/payload.ts +1 -1
- package/src/signature.ts +10 -8
- package/src/utils.ts +2 -2
- package/test/address.test.ts +9 -9
- package/test/attestation.test.ts +1 -1
- package/test/config.test.ts +1 -1
- package/test/passkeys.test.ts +3 -10
- package/test/payload.test.ts +2 -7
- package/test/precondition.test.ts +6 -8
- package/test/signature.test.ts +11 -17
- package/test/utils.test.ts +4 -4
- package/eslint.config.mjs +0 -4
package/src/network.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { Address } from 'ox'
|
|
2
|
+
|
|
3
|
+
const DEFAULT_MULTICALL3_ADDRESS: Address.Address = '0xcA11bde05977b3631167028862bE2a173976CA11'
|
|
4
|
+
const SEQUENCE_MULTICALL3_ADDRESS: Address.Address = '0xae96419a81516f063744206d4b5E36f3168280f8'
|
|
5
|
+
|
|
1
6
|
export enum NetworkType {
|
|
2
7
|
MAINNET = 'mainnet',
|
|
3
8
|
TESTNET = 'testnet',
|
|
@@ -21,8 +26,11 @@ export interface Network {
|
|
|
21
26
|
name: string
|
|
22
27
|
decimals: number
|
|
23
28
|
}
|
|
24
|
-
ensAddress?: string
|
|
25
29
|
deprecated?: true
|
|
30
|
+
contracts?: {
|
|
31
|
+
multicall3?: Address.Address
|
|
32
|
+
ensUniversalResolver?: Address.Address
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
export const ChainId = {
|
|
@@ -105,6 +113,7 @@ export const ChainId = {
|
|
|
105
113
|
// ETHERLINK
|
|
106
114
|
ETHERLINK: 42793,
|
|
107
115
|
ETHERLINK_TESTNET: 128123,
|
|
116
|
+
ETHERLINK_SHADOWNET_TESTNET: 127823,
|
|
108
117
|
|
|
109
118
|
// MOONBEAM
|
|
110
119
|
MOONBEAM: 1284,
|
|
@@ -129,6 +138,15 @@ export const ChainId = {
|
|
|
129
138
|
|
|
130
139
|
// ARC
|
|
131
140
|
ARC_TESTNET: 5042002,
|
|
141
|
+
|
|
142
|
+
// HYPEREVM
|
|
143
|
+
HYPEREVM: 999,
|
|
144
|
+
|
|
145
|
+
// SONIC
|
|
146
|
+
SONIC: 146,
|
|
147
|
+
|
|
148
|
+
// BERACHAIN
|
|
149
|
+
BERACHAIN: 80094,
|
|
132
150
|
} as const
|
|
133
151
|
|
|
134
152
|
export type ChainId = (typeof ChainId)[keyof typeof ChainId]
|
|
@@ -150,7 +168,10 @@ export const ALL: Network[] = [
|
|
|
150
168
|
name: 'Ether',
|
|
151
169
|
decimals: 18,
|
|
152
170
|
},
|
|
153
|
-
|
|
171
|
+
contracts: {
|
|
172
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
173
|
+
ensUniversalResolver: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
|
|
174
|
+
},
|
|
154
175
|
},
|
|
155
176
|
{
|
|
156
177
|
chainId: ChainId.SEPOLIA,
|
|
@@ -168,6 +189,9 @@ export const ALL: Network[] = [
|
|
|
168
189
|
name: 'Sepolia Ether',
|
|
169
190
|
decimals: 18,
|
|
170
191
|
},
|
|
192
|
+
contracts: {
|
|
193
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
194
|
+
},
|
|
171
195
|
},
|
|
172
196
|
{
|
|
173
197
|
chainId: ChainId.POLYGON,
|
|
@@ -185,6 +209,9 @@ export const ALL: Network[] = [
|
|
|
185
209
|
name: 'POL',
|
|
186
210
|
decimals: 18,
|
|
187
211
|
},
|
|
212
|
+
contracts: {
|
|
213
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
214
|
+
},
|
|
188
215
|
},
|
|
189
216
|
{
|
|
190
217
|
chainId: ChainId.POLYGON_AMOY,
|
|
@@ -202,6 +229,9 @@ export const ALL: Network[] = [
|
|
|
202
229
|
name: 'Amoy POL',
|
|
203
230
|
decimals: 18,
|
|
204
231
|
},
|
|
232
|
+
contracts: {
|
|
233
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
234
|
+
},
|
|
205
235
|
},
|
|
206
236
|
{
|
|
207
237
|
chainId: ChainId.POLYGON_ZKEVM,
|
|
@@ -219,6 +249,9 @@ export const ALL: Network[] = [
|
|
|
219
249
|
name: 'Ether',
|
|
220
250
|
decimals: 18,
|
|
221
251
|
},
|
|
252
|
+
contracts: {
|
|
253
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
254
|
+
},
|
|
222
255
|
},
|
|
223
256
|
{
|
|
224
257
|
chainId: ChainId.BSC,
|
|
@@ -236,6 +269,9 @@ export const ALL: Network[] = [
|
|
|
236
269
|
name: 'BNB',
|
|
237
270
|
decimals: 18,
|
|
238
271
|
},
|
|
272
|
+
contracts: {
|
|
273
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
274
|
+
},
|
|
239
275
|
},
|
|
240
276
|
{
|
|
241
277
|
chainId: ChainId.BSC_TESTNET,
|
|
@@ -253,6 +289,9 @@ export const ALL: Network[] = [
|
|
|
253
289
|
name: 'Testnet BNB',
|
|
254
290
|
decimals: 18,
|
|
255
291
|
},
|
|
292
|
+
contracts: {
|
|
293
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
294
|
+
},
|
|
256
295
|
},
|
|
257
296
|
{
|
|
258
297
|
chainId: ChainId.OPTIMISM,
|
|
@@ -270,6 +309,9 @@ export const ALL: Network[] = [
|
|
|
270
309
|
name: 'Ether',
|
|
271
310
|
decimals: 18,
|
|
272
311
|
},
|
|
312
|
+
contracts: {
|
|
313
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
314
|
+
},
|
|
273
315
|
},
|
|
274
316
|
{
|
|
275
317
|
chainId: ChainId.OPTIMISM_SEPOLIA,
|
|
@@ -287,6 +329,9 @@ export const ALL: Network[] = [
|
|
|
287
329
|
name: 'Sepolia Ether',
|
|
288
330
|
decimals: 18,
|
|
289
331
|
},
|
|
332
|
+
contracts: {
|
|
333
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
334
|
+
},
|
|
290
335
|
},
|
|
291
336
|
{
|
|
292
337
|
chainId: ChainId.ARBITRUM,
|
|
@@ -304,6 +349,9 @@ export const ALL: Network[] = [
|
|
|
304
349
|
name: 'Ether',
|
|
305
350
|
decimals: 18,
|
|
306
351
|
},
|
|
352
|
+
contracts: {
|
|
353
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
354
|
+
},
|
|
307
355
|
},
|
|
308
356
|
{
|
|
309
357
|
chainId: ChainId.ARBITRUM_SEPOLIA,
|
|
@@ -321,6 +369,9 @@ export const ALL: Network[] = [
|
|
|
321
369
|
name: 'Sepolia Ether',
|
|
322
370
|
decimals: 18,
|
|
323
371
|
},
|
|
372
|
+
contracts: {
|
|
373
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
374
|
+
},
|
|
324
375
|
},
|
|
325
376
|
{
|
|
326
377
|
chainId: ChainId.ARBITRUM_NOVA,
|
|
@@ -338,6 +389,9 @@ export const ALL: Network[] = [
|
|
|
338
389
|
name: 'Ether',
|
|
339
390
|
decimals: 18,
|
|
340
391
|
},
|
|
392
|
+
contracts: {
|
|
393
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
394
|
+
},
|
|
341
395
|
},
|
|
342
396
|
{
|
|
343
397
|
chainId: ChainId.AVALANCHE,
|
|
@@ -355,6 +409,9 @@ export const ALL: Network[] = [
|
|
|
355
409
|
name: 'AVAX',
|
|
356
410
|
decimals: 18,
|
|
357
411
|
},
|
|
412
|
+
contracts: {
|
|
413
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
414
|
+
},
|
|
358
415
|
},
|
|
359
416
|
{
|
|
360
417
|
chainId: ChainId.AVALANCHE_TESTNET,
|
|
@@ -372,6 +429,9 @@ export const ALL: Network[] = [
|
|
|
372
429
|
name: 'Testnet AVAX',
|
|
373
430
|
decimals: 18,
|
|
374
431
|
},
|
|
432
|
+
contracts: {
|
|
433
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
434
|
+
},
|
|
375
435
|
},
|
|
376
436
|
{
|
|
377
437
|
chainId: ChainId.GNOSIS,
|
|
@@ -389,6 +449,9 @@ export const ALL: Network[] = [
|
|
|
389
449
|
name: 'XDAI',
|
|
390
450
|
decimals: 18,
|
|
391
451
|
},
|
|
452
|
+
contracts: {
|
|
453
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
454
|
+
},
|
|
392
455
|
},
|
|
393
456
|
{
|
|
394
457
|
chainId: ChainId.BASE,
|
|
@@ -406,6 +469,9 @@ export const ALL: Network[] = [
|
|
|
406
469
|
name: 'Ether',
|
|
407
470
|
decimals: 18,
|
|
408
471
|
},
|
|
472
|
+
contracts: {
|
|
473
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
474
|
+
},
|
|
409
475
|
},
|
|
410
476
|
{
|
|
411
477
|
chainId: ChainId.BASE_SEPOLIA,
|
|
@@ -423,6 +489,9 @@ export const ALL: Network[] = [
|
|
|
423
489
|
name: 'Sepolia Ether',
|
|
424
490
|
decimals: 18,
|
|
425
491
|
},
|
|
492
|
+
contracts: {
|
|
493
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
494
|
+
},
|
|
426
495
|
},
|
|
427
496
|
{
|
|
428
497
|
chainId: ChainId.HOMEVERSE,
|
|
@@ -440,6 +509,9 @@ export const ALL: Network[] = [
|
|
|
440
509
|
name: 'OAS',
|
|
441
510
|
decimals: 18,
|
|
442
511
|
},
|
|
512
|
+
contracts: {
|
|
513
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
514
|
+
},
|
|
443
515
|
},
|
|
444
516
|
{
|
|
445
517
|
chainId: ChainId.HOMEVERSE_TESTNET,
|
|
@@ -457,6 +529,9 @@ export const ALL: Network[] = [
|
|
|
457
529
|
name: 'Testnet OAS',
|
|
458
530
|
decimals: 18,
|
|
459
531
|
},
|
|
532
|
+
contracts: {
|
|
533
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
534
|
+
},
|
|
460
535
|
},
|
|
461
536
|
{
|
|
462
537
|
chainId: ChainId.XAI,
|
|
@@ -474,6 +549,9 @@ export const ALL: Network[] = [
|
|
|
474
549
|
name: 'XAI',
|
|
475
550
|
decimals: 18,
|
|
476
551
|
},
|
|
552
|
+
contracts: {
|
|
553
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
554
|
+
},
|
|
477
555
|
},
|
|
478
556
|
{
|
|
479
557
|
chainId: ChainId.XAI_SEPOLIA,
|
|
@@ -491,6 +569,9 @@ export const ALL: Network[] = [
|
|
|
491
569
|
name: 'Sepolia XAI',
|
|
492
570
|
decimals: 18,
|
|
493
571
|
},
|
|
572
|
+
contracts: {
|
|
573
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
574
|
+
},
|
|
494
575
|
},
|
|
495
576
|
{
|
|
496
577
|
chainId: ChainId.B3,
|
|
@@ -508,6 +589,9 @@ export const ALL: Network[] = [
|
|
|
508
589
|
name: 'Ether',
|
|
509
590
|
decimals: 18,
|
|
510
591
|
},
|
|
592
|
+
contracts: {
|
|
593
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
594
|
+
},
|
|
511
595
|
},
|
|
512
596
|
{
|
|
513
597
|
chainId: ChainId.B3_SEPOLIA,
|
|
@@ -525,6 +609,9 @@ export const ALL: Network[] = [
|
|
|
525
609
|
name: 'Ether',
|
|
526
610
|
decimals: 18,
|
|
527
611
|
},
|
|
612
|
+
contracts: {
|
|
613
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
614
|
+
},
|
|
528
615
|
},
|
|
529
616
|
{
|
|
530
617
|
chainId: ChainId.APECHAIN,
|
|
@@ -542,6 +629,9 @@ export const ALL: Network[] = [
|
|
|
542
629
|
name: 'ApeCoin',
|
|
543
630
|
decimals: 18,
|
|
544
631
|
},
|
|
632
|
+
contracts: {
|
|
633
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
634
|
+
},
|
|
545
635
|
},
|
|
546
636
|
{
|
|
547
637
|
chainId: ChainId.APECHAIN_TESTNET,
|
|
@@ -559,6 +649,9 @@ export const ALL: Network[] = [
|
|
|
559
649
|
name: 'ApeCoin',
|
|
560
650
|
decimals: 18,
|
|
561
651
|
},
|
|
652
|
+
contracts: {
|
|
653
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
654
|
+
},
|
|
562
655
|
},
|
|
563
656
|
{
|
|
564
657
|
chainId: ChainId.BLAST,
|
|
@@ -576,6 +669,9 @@ export const ALL: Network[] = [
|
|
|
576
669
|
name: 'Ether',
|
|
577
670
|
decimals: 18,
|
|
578
671
|
},
|
|
672
|
+
contracts: {
|
|
673
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
674
|
+
},
|
|
579
675
|
},
|
|
580
676
|
{
|
|
581
677
|
chainId: ChainId.BLAST_SEPOLIA,
|
|
@@ -593,6 +689,9 @@ export const ALL: Network[] = [
|
|
|
593
689
|
name: 'Ether',
|
|
594
690
|
decimals: 18,
|
|
595
691
|
},
|
|
692
|
+
contracts: {
|
|
693
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
694
|
+
},
|
|
596
695
|
},
|
|
597
696
|
{
|
|
598
697
|
chainId: ChainId.TELOS,
|
|
@@ -610,6 +709,9 @@ export const ALL: Network[] = [
|
|
|
610
709
|
name: 'TLOS',
|
|
611
710
|
decimals: 18,
|
|
612
711
|
},
|
|
712
|
+
contracts: {
|
|
713
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
714
|
+
},
|
|
613
715
|
},
|
|
614
716
|
{
|
|
615
717
|
chainId: ChainId.TELOS_TESTNET,
|
|
@@ -627,6 +729,9 @@ export const ALL: Network[] = [
|
|
|
627
729
|
name: 'TLOS',
|
|
628
730
|
decimals: 18,
|
|
629
731
|
},
|
|
732
|
+
contracts: {
|
|
733
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
734
|
+
},
|
|
630
735
|
},
|
|
631
736
|
{
|
|
632
737
|
chainId: ChainId.SKALE_NEBULA,
|
|
@@ -644,6 +749,9 @@ export const ALL: Network[] = [
|
|
|
644
749
|
name: 'SKALE Fuel',
|
|
645
750
|
decimals: 18,
|
|
646
751
|
},
|
|
752
|
+
contracts: {
|
|
753
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
754
|
+
},
|
|
647
755
|
},
|
|
648
756
|
{
|
|
649
757
|
chainId: ChainId.SKALE_NEBULA_TESTNET,
|
|
@@ -661,6 +769,9 @@ export const ALL: Network[] = [
|
|
|
661
769
|
name: 'SKALE Fuel',
|
|
662
770
|
decimals: 18,
|
|
663
771
|
},
|
|
772
|
+
contracts: {
|
|
773
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
774
|
+
},
|
|
664
775
|
},
|
|
665
776
|
{
|
|
666
777
|
chainId: ChainId.SONEIUM,
|
|
@@ -678,6 +789,9 @@ export const ALL: Network[] = [
|
|
|
678
789
|
name: 'Ether',
|
|
679
790
|
decimals: 18,
|
|
680
791
|
},
|
|
792
|
+
contracts: {
|
|
793
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
794
|
+
},
|
|
681
795
|
},
|
|
682
796
|
{
|
|
683
797
|
chainId: ChainId.SONEIUM_MINATO,
|
|
@@ -695,6 +809,9 @@ export const ALL: Network[] = [
|
|
|
695
809
|
name: 'Ether',
|
|
696
810
|
decimals: 18,
|
|
697
811
|
},
|
|
812
|
+
contracts: {
|
|
813
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
814
|
+
},
|
|
698
815
|
},
|
|
699
816
|
{
|
|
700
817
|
chainId: ChainId.TOY_TESTNET,
|
|
@@ -712,6 +829,9 @@ export const ALL: Network[] = [
|
|
|
712
829
|
name: 'TOY',
|
|
713
830
|
decimals: 18,
|
|
714
831
|
},
|
|
832
|
+
contracts: {
|
|
833
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
834
|
+
},
|
|
715
835
|
},
|
|
716
836
|
{
|
|
717
837
|
chainId: ChainId.IMMUTABLE_ZKEVM,
|
|
@@ -729,6 +849,9 @@ export const ALL: Network[] = [
|
|
|
729
849
|
name: 'IMX',
|
|
730
850
|
decimals: 18,
|
|
731
851
|
},
|
|
852
|
+
contracts: {
|
|
853
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
854
|
+
},
|
|
732
855
|
},
|
|
733
856
|
{
|
|
734
857
|
chainId: ChainId.IMMUTABLE_ZKEVM_TESTNET,
|
|
@@ -746,6 +869,9 @@ export const ALL: Network[] = [
|
|
|
746
869
|
name: 'IMX',
|
|
747
870
|
decimals: 18,
|
|
748
871
|
},
|
|
872
|
+
contracts: {
|
|
873
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
874
|
+
},
|
|
749
875
|
},
|
|
750
876
|
{
|
|
751
877
|
chainId: ChainId.MOONBEAM,
|
|
@@ -763,6 +889,9 @@ export const ALL: Network[] = [
|
|
|
763
889
|
name: 'GLMR',
|
|
764
890
|
decimals: 18,
|
|
765
891
|
},
|
|
892
|
+
contracts: {
|
|
893
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
894
|
+
},
|
|
766
895
|
},
|
|
767
896
|
{
|
|
768
897
|
chainId: ChainId.MOONBASE_ALPHA,
|
|
@@ -780,6 +909,9 @@ export const ALL: Network[] = [
|
|
|
780
909
|
name: 'GLMR',
|
|
781
910
|
decimals: 18,
|
|
782
911
|
},
|
|
912
|
+
contracts: {
|
|
913
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
914
|
+
},
|
|
783
915
|
},
|
|
784
916
|
{
|
|
785
917
|
chainId: ChainId.ETHERLINK,
|
|
@@ -797,23 +929,29 @@ export const ALL: Network[] = [
|
|
|
797
929
|
name: 'Tez',
|
|
798
930
|
decimals: 18,
|
|
799
931
|
},
|
|
932
|
+
contracts: {
|
|
933
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
934
|
+
},
|
|
800
935
|
},
|
|
801
936
|
{
|
|
802
|
-
chainId: ChainId.
|
|
937
|
+
chainId: ChainId.ETHERLINK_SHADOWNET_TESTNET,
|
|
803
938
|
type: NetworkType.TESTNET,
|
|
804
|
-
name: 'etherlink-testnet',
|
|
805
|
-
title: 'Etherlink Testnet',
|
|
806
|
-
rpcUrl: getRpcUrl('etherlink-testnet'),
|
|
807
|
-
logoUrl: getLogoUrl(ChainId.
|
|
939
|
+
name: 'etherlink-shadownet-testnet',
|
|
940
|
+
title: 'Etherlink Shadownet Testnet',
|
|
941
|
+
rpcUrl: getRpcUrl('etherlink-shadownet-testnet'),
|
|
942
|
+
logoUrl: getLogoUrl(ChainId.ETHERLINK_SHADOWNET_TESTNET),
|
|
808
943
|
blockExplorer: {
|
|
809
|
-
name: 'Etherlink Testnet Explorer',
|
|
810
|
-
url: 'https://
|
|
944
|
+
name: 'Etherlink Shadownet Testnet Explorer',
|
|
945
|
+
url: 'https://shadownet.explorer.etherlink.com/',
|
|
811
946
|
},
|
|
812
947
|
nativeCurrency: {
|
|
813
948
|
symbol: 'XTZ',
|
|
814
949
|
name: 'Tez',
|
|
815
950
|
decimals: 18,
|
|
816
951
|
},
|
|
952
|
+
contracts: {
|
|
953
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
954
|
+
},
|
|
817
955
|
},
|
|
818
956
|
{
|
|
819
957
|
chainId: ChainId.MONAD,
|
|
@@ -831,6 +969,9 @@ export const ALL: Network[] = [
|
|
|
831
969
|
name: 'MON',
|
|
832
970
|
decimals: 18,
|
|
833
971
|
},
|
|
972
|
+
contracts: {
|
|
973
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
974
|
+
},
|
|
834
975
|
},
|
|
835
976
|
{
|
|
836
977
|
chainId: ChainId.MONAD_TESTNET,
|
|
@@ -848,6 +989,9 @@ export const ALL: Network[] = [
|
|
|
848
989
|
name: 'MON',
|
|
849
990
|
decimals: 18,
|
|
850
991
|
},
|
|
992
|
+
contracts: {
|
|
993
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
994
|
+
},
|
|
851
995
|
},
|
|
852
996
|
|
|
853
997
|
{
|
|
@@ -866,6 +1010,9 @@ export const ALL: Network[] = [
|
|
|
866
1010
|
name: 'SOMI',
|
|
867
1011
|
decimals: 18,
|
|
868
1012
|
},
|
|
1013
|
+
contracts: {
|
|
1014
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
1015
|
+
},
|
|
869
1016
|
},
|
|
870
1017
|
|
|
871
1018
|
{
|
|
@@ -884,6 +1031,9 @@ export const ALL: Network[] = [
|
|
|
884
1031
|
name: 'STT',
|
|
885
1032
|
decimals: 18,
|
|
886
1033
|
},
|
|
1034
|
+
contracts: {
|
|
1035
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
1036
|
+
},
|
|
887
1037
|
},
|
|
888
1038
|
|
|
889
1039
|
{
|
|
@@ -902,6 +1052,9 @@ export const ALL: Network[] = [
|
|
|
902
1052
|
name: 'TCENT',
|
|
903
1053
|
decimals: 18,
|
|
904
1054
|
},
|
|
1055
|
+
contracts: {
|
|
1056
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1057
|
+
},
|
|
905
1058
|
},
|
|
906
1059
|
|
|
907
1060
|
{
|
|
@@ -920,6 +1073,9 @@ export const ALL: Network[] = [
|
|
|
920
1073
|
name: 'ETH',
|
|
921
1074
|
decimals: 18,
|
|
922
1075
|
},
|
|
1076
|
+
contracts: {
|
|
1077
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1078
|
+
},
|
|
923
1079
|
},
|
|
924
1080
|
|
|
925
1081
|
{
|
|
@@ -938,6 +1094,9 @@ export const ALL: Network[] = [
|
|
|
938
1094
|
name: 'SAND',
|
|
939
1095
|
decimals: 18,
|
|
940
1096
|
},
|
|
1097
|
+
contracts: {
|
|
1098
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1099
|
+
},
|
|
941
1100
|
},
|
|
942
1101
|
|
|
943
1102
|
{
|
|
@@ -956,7 +1115,65 @@ export const ALL: Network[] = [
|
|
|
956
1115
|
name: 'USDC',
|
|
957
1116
|
decimals: 6,
|
|
958
1117
|
},
|
|
1118
|
+
contracts: {
|
|
1119
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1120
|
+
},
|
|
959
1121
|
},
|
|
1122
|
+
|
|
1123
|
+
{
|
|
1124
|
+
chainId: ChainId.HYPEREVM,
|
|
1125
|
+
type: NetworkType.MAINNET,
|
|
1126
|
+
name: 'hyperevm',
|
|
1127
|
+
title: 'HyperEVM',
|
|
1128
|
+
rpcUrl: getRpcUrl('hyperevm'),
|
|
1129
|
+
logoUrl: getLogoUrl(ChainId.HYPEREVM),
|
|
1130
|
+
blockExplorer: {
|
|
1131
|
+
name: 'HyperEVM Explorer',
|
|
1132
|
+
url: 'https://www.hyperscan.com/',
|
|
1133
|
+
},
|
|
1134
|
+
nativeCurrency: {
|
|
1135
|
+
symbol: 'HYPE',
|
|
1136
|
+
name: 'HYPE',
|
|
1137
|
+
decimals: 18,
|
|
1138
|
+
},
|
|
1139
|
+
},
|
|
1140
|
+
|
|
1141
|
+
{
|
|
1142
|
+
chainId: ChainId.BERACHAIN,
|
|
1143
|
+
type: NetworkType.MAINNET,
|
|
1144
|
+
name: 'berachain',
|
|
1145
|
+
title: 'Berachain',
|
|
1146
|
+
rpcUrl: getRpcUrl('berachain'),
|
|
1147
|
+
logoUrl: getLogoUrl(ChainId.BERACHAIN),
|
|
1148
|
+
blockExplorer: {
|
|
1149
|
+
name: 'Berachain Explorer',
|
|
1150
|
+
url: 'https://berascan.com/',
|
|
1151
|
+
},
|
|
1152
|
+
nativeCurrency: {
|
|
1153
|
+
symbol: 'BEAR',
|
|
1154
|
+
name: 'BEAR',
|
|
1155
|
+
decimals: 18,
|
|
1156
|
+
},
|
|
1157
|
+
},
|
|
1158
|
+
|
|
1159
|
+
{
|
|
1160
|
+
chainId: ChainId.SONIC,
|
|
1161
|
+
type: NetworkType.MAINNET,
|
|
1162
|
+
name: 'sonic',
|
|
1163
|
+
title: 'Sonic',
|
|
1164
|
+
rpcUrl: getRpcUrl('sonic'),
|
|
1165
|
+
logoUrl: getLogoUrl(ChainId.SONIC),
|
|
1166
|
+
blockExplorer: {
|
|
1167
|
+
name: 'Sonic Explorer',
|
|
1168
|
+
url: 'https://sonicscan.com/',
|
|
1169
|
+
},
|
|
1170
|
+
nativeCurrency: {
|
|
1171
|
+
symbol: 'S',
|
|
1172
|
+
name: 'Sonic',
|
|
1173
|
+
decimals: 18,
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
|
+
|
|
960
1177
|
]
|
|
961
1178
|
|
|
962
1179
|
function getRpcUrl(networkName: string): string {
|
package/src/payload.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbiFunction, AbiParameters, Address, Bytes, Hash, Hex } from 'ox'
|
|
2
2
|
import { getSignPayload } from 'ox/TypedData'
|
|
3
3
|
import { EXECUTE_USER_OP, RECOVER_SAPIENT_SIGNATURE } from './constants.js'
|
|
4
|
-
import { Attestation
|
|
4
|
+
import { Attestation } from './index.js'
|
|
5
5
|
import { minBytesFor } from './utils.js'
|
|
6
6
|
import { UserOperation } from 'ox/erc4337'
|
|
7
7
|
|
package/src/signature.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbiFunction, AbiParameters, Address, Bytes, Hash, Hex, Provider, Secp256k1
|
|
1
|
+
import { AbiFunction, AbiParameters, Address, Bytes, Hash, Hex, Provider, Secp256k1 } from 'ox'
|
|
2
2
|
import {
|
|
3
3
|
Config,
|
|
4
4
|
Leaf,
|
|
@@ -22,7 +22,7 @@ import { RECOVER_SAPIENT_SIGNATURE, RECOVER_SAPIENT_SIGNATURE_COMPACT, IS_VALID_
|
|
|
22
22
|
import { wrap, decode } from './erc-6492.js'
|
|
23
23
|
import { fromConfigUpdate, hash, Parented } from './payload.js'
|
|
24
24
|
import { minBytesFor, packRSY, unpackRSY } from './utils.js'
|
|
25
|
-
import { Constants
|
|
25
|
+
import { Constants } from './index.js'
|
|
26
26
|
|
|
27
27
|
export const FLAG_SIGNATURE_HASH = 0
|
|
28
28
|
export const FLAG_ADDRESS = 1
|
|
@@ -618,7 +618,7 @@ export function fillLeaves(
|
|
|
618
618
|
export function encodeChainedSignature(signatures: RawSignature[]): Uint8Array {
|
|
619
619
|
let flag = 0x01
|
|
620
620
|
|
|
621
|
-
|
|
621
|
+
const sigForCheckpointer = signatures[signatures.length - 1]
|
|
622
622
|
|
|
623
623
|
if (sigForCheckpointer?.configuration.checkpointer) {
|
|
624
624
|
flag |= 0x40
|
|
@@ -723,7 +723,7 @@ export function encodeTopology(
|
|
|
723
723
|
const isBranching = isNode(topology[1]!) || isRawNode(topology[1]!)
|
|
724
724
|
|
|
725
725
|
if (isBranching) {
|
|
726
|
-
|
|
726
|
+
const encoded1Size = minBytesFor(BigInt(encoded1.length))
|
|
727
727
|
if (encoded1Size > 15) {
|
|
728
728
|
throw new Error('Branch too large')
|
|
729
729
|
}
|
|
@@ -799,7 +799,7 @@ export function encodeTopology(
|
|
|
799
799
|
} else if (topology.signature.type === 'erc1271') {
|
|
800
800
|
let flag = FLAG_SIGNATURE_ERC1271 << 4
|
|
801
801
|
|
|
802
|
-
|
|
802
|
+
const bytesForSignatureSize = minBytesFor(BigInt(topology.signature.data.length))
|
|
803
803
|
if (bytesForSignatureSize > 3) {
|
|
804
804
|
throw new Error('Signature too large')
|
|
805
805
|
}
|
|
@@ -826,7 +826,7 @@ export function encodeTopology(
|
|
|
826
826
|
let flag = (topology.signature.type === 'sapient' ? FLAG_SIGNATURE_SAPIENT : FLAG_SIGNATURE_SAPIENT_COMPACT) << 4
|
|
827
827
|
|
|
828
828
|
const signatureBytes = Bytes.fromHex(topology.signature.data)
|
|
829
|
-
|
|
829
|
+
const bytesForSignatureSize = minBytesFor(BigInt(signatureBytes.length))
|
|
830
830
|
if (bytesForSignatureSize > 3) {
|
|
831
831
|
throw new Error('Signature too large')
|
|
832
832
|
}
|
|
@@ -1218,7 +1218,7 @@ async function recoverTopology(
|
|
|
1218
1218
|
weight: topology.weight,
|
|
1219
1219
|
}
|
|
1220
1220
|
|
|
1221
|
-
default:
|
|
1221
|
+
default: {
|
|
1222
1222
|
const provider = 'provider' in options!.provider ? options!.provider.provider : options!.provider
|
|
1223
1223
|
const block = 'block' in options!.provider ? options!.provider.block : undefined
|
|
1224
1224
|
|
|
@@ -1254,6 +1254,7 @@ async function recoverTopology(
|
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
+
}
|
|
1257
1258
|
}
|
|
1258
1259
|
|
|
1259
1260
|
case 'sapient':
|
|
@@ -1264,7 +1265,7 @@ async function recoverTopology(
|
|
|
1264
1265
|
case 'assume-valid':
|
|
1265
1266
|
throw new Error(`unable to validate sapient signer ${topology.signature.address} signature`)
|
|
1266
1267
|
|
|
1267
|
-
default:
|
|
1268
|
+
default: {
|
|
1268
1269
|
const provider = 'provider' in options!.provider ? options!.provider.provider : options!.provider
|
|
1269
1270
|
const block = 'block' in options!.provider ? options!.provider.block : undefined
|
|
1270
1271
|
|
|
@@ -1298,6 +1299,7 @@ async function recoverTopology(
|
|
|
1298
1299
|
},
|
|
1299
1300
|
weight: topology.weight,
|
|
1300
1301
|
}
|
|
1302
|
+
}
|
|
1301
1303
|
}
|
|
1302
1304
|
}
|
|
1303
1305
|
} else if (isRawNestedLeaf(topology)) {
|
package/src/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bytes } from 'ox'
|
|
2
2
|
|
|
3
3
|
export function minBytesFor(val: bigint): number {
|
|
4
4
|
return Math.ceil(val.toString(16).length / 2)
|
|
@@ -7,7 +7,7 @@ export function minBytesFor(val: bigint): number {
|
|
|
7
7
|
// ERC-2098
|
|
8
8
|
export function packRSY({ r, s, yParity }: { r: bigint; s: bigint; yParity: number }): Bytes.Bytes {
|
|
9
9
|
const rBytes = Bytes.padLeft(Bytes.fromNumber(r), 32)
|
|
10
|
-
|
|
10
|
+
const sBytes = Bytes.padLeft(Bytes.fromNumber(s), 32)
|
|
11
11
|
if (yParity % 2 === 1) {
|
|
12
12
|
sBytes[0]! |= 0x80
|
|
13
13
|
}
|