@0xsequence/wallet-primitives 3.0.0-beta.9 → 3.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/.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 +91 -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 +10 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +234 -9
- 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 +248 -10
- 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,
|
|
@@ -119,6 +128,7 @@ export const ChainId = {
|
|
|
119
128
|
SOMNIA: 5031,
|
|
120
129
|
|
|
121
130
|
// INCENTIV
|
|
131
|
+
INCENTIV: 24101,
|
|
122
132
|
INCENTIV_TESTNET_V2: 28802,
|
|
123
133
|
|
|
124
134
|
// KATANA
|
|
@@ -129,6 +139,15 @@ export const ChainId = {
|
|
|
129
139
|
|
|
130
140
|
// ARC
|
|
131
141
|
ARC_TESTNET: 5042002,
|
|
142
|
+
|
|
143
|
+
// HYPEREVM
|
|
144
|
+
HYPEREVM: 999,
|
|
145
|
+
|
|
146
|
+
// SONIC
|
|
147
|
+
SONIC: 146,
|
|
148
|
+
|
|
149
|
+
// BERACHAIN
|
|
150
|
+
BERACHAIN: 80094,
|
|
132
151
|
} as const
|
|
133
152
|
|
|
134
153
|
export type ChainId = (typeof ChainId)[keyof typeof ChainId]
|
|
@@ -150,7 +169,10 @@ export const ALL: Network[] = [
|
|
|
150
169
|
name: 'Ether',
|
|
151
170
|
decimals: 18,
|
|
152
171
|
},
|
|
153
|
-
|
|
172
|
+
contracts: {
|
|
173
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
174
|
+
ensUniversalResolver: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
|
|
175
|
+
},
|
|
154
176
|
},
|
|
155
177
|
{
|
|
156
178
|
chainId: ChainId.SEPOLIA,
|
|
@@ -168,6 +190,9 @@ export const ALL: Network[] = [
|
|
|
168
190
|
name: 'Sepolia Ether',
|
|
169
191
|
decimals: 18,
|
|
170
192
|
},
|
|
193
|
+
contracts: {
|
|
194
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
195
|
+
},
|
|
171
196
|
},
|
|
172
197
|
{
|
|
173
198
|
chainId: ChainId.POLYGON,
|
|
@@ -185,6 +210,9 @@ export const ALL: Network[] = [
|
|
|
185
210
|
name: 'POL',
|
|
186
211
|
decimals: 18,
|
|
187
212
|
},
|
|
213
|
+
contracts: {
|
|
214
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
215
|
+
},
|
|
188
216
|
},
|
|
189
217
|
{
|
|
190
218
|
chainId: ChainId.POLYGON_AMOY,
|
|
@@ -202,6 +230,9 @@ export const ALL: Network[] = [
|
|
|
202
230
|
name: 'Amoy POL',
|
|
203
231
|
decimals: 18,
|
|
204
232
|
},
|
|
233
|
+
contracts: {
|
|
234
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
235
|
+
},
|
|
205
236
|
},
|
|
206
237
|
{
|
|
207
238
|
chainId: ChainId.POLYGON_ZKEVM,
|
|
@@ -219,6 +250,9 @@ export const ALL: Network[] = [
|
|
|
219
250
|
name: 'Ether',
|
|
220
251
|
decimals: 18,
|
|
221
252
|
},
|
|
253
|
+
contracts: {
|
|
254
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
255
|
+
},
|
|
222
256
|
},
|
|
223
257
|
{
|
|
224
258
|
chainId: ChainId.BSC,
|
|
@@ -236,6 +270,9 @@ export const ALL: Network[] = [
|
|
|
236
270
|
name: 'BNB',
|
|
237
271
|
decimals: 18,
|
|
238
272
|
},
|
|
273
|
+
contracts: {
|
|
274
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
275
|
+
},
|
|
239
276
|
},
|
|
240
277
|
{
|
|
241
278
|
chainId: ChainId.BSC_TESTNET,
|
|
@@ -253,6 +290,9 @@ export const ALL: Network[] = [
|
|
|
253
290
|
name: 'Testnet BNB',
|
|
254
291
|
decimals: 18,
|
|
255
292
|
},
|
|
293
|
+
contracts: {
|
|
294
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
295
|
+
},
|
|
256
296
|
},
|
|
257
297
|
{
|
|
258
298
|
chainId: ChainId.OPTIMISM,
|
|
@@ -270,6 +310,9 @@ export const ALL: Network[] = [
|
|
|
270
310
|
name: 'Ether',
|
|
271
311
|
decimals: 18,
|
|
272
312
|
},
|
|
313
|
+
contracts: {
|
|
314
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
315
|
+
},
|
|
273
316
|
},
|
|
274
317
|
{
|
|
275
318
|
chainId: ChainId.OPTIMISM_SEPOLIA,
|
|
@@ -287,6 +330,9 @@ export const ALL: Network[] = [
|
|
|
287
330
|
name: 'Sepolia Ether',
|
|
288
331
|
decimals: 18,
|
|
289
332
|
},
|
|
333
|
+
contracts: {
|
|
334
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
335
|
+
},
|
|
290
336
|
},
|
|
291
337
|
{
|
|
292
338
|
chainId: ChainId.ARBITRUM,
|
|
@@ -304,6 +350,9 @@ export const ALL: Network[] = [
|
|
|
304
350
|
name: 'Ether',
|
|
305
351
|
decimals: 18,
|
|
306
352
|
},
|
|
353
|
+
contracts: {
|
|
354
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
355
|
+
},
|
|
307
356
|
},
|
|
308
357
|
{
|
|
309
358
|
chainId: ChainId.ARBITRUM_SEPOLIA,
|
|
@@ -321,6 +370,9 @@ export const ALL: Network[] = [
|
|
|
321
370
|
name: 'Sepolia Ether',
|
|
322
371
|
decimals: 18,
|
|
323
372
|
},
|
|
373
|
+
contracts: {
|
|
374
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
375
|
+
},
|
|
324
376
|
},
|
|
325
377
|
{
|
|
326
378
|
chainId: ChainId.ARBITRUM_NOVA,
|
|
@@ -338,6 +390,9 @@ export const ALL: Network[] = [
|
|
|
338
390
|
name: 'Ether',
|
|
339
391
|
decimals: 18,
|
|
340
392
|
},
|
|
393
|
+
contracts: {
|
|
394
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
395
|
+
},
|
|
341
396
|
},
|
|
342
397
|
{
|
|
343
398
|
chainId: ChainId.AVALANCHE,
|
|
@@ -355,6 +410,9 @@ export const ALL: Network[] = [
|
|
|
355
410
|
name: 'AVAX',
|
|
356
411
|
decimals: 18,
|
|
357
412
|
},
|
|
413
|
+
contracts: {
|
|
414
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
415
|
+
},
|
|
358
416
|
},
|
|
359
417
|
{
|
|
360
418
|
chainId: ChainId.AVALANCHE_TESTNET,
|
|
@@ -372,6 +430,9 @@ export const ALL: Network[] = [
|
|
|
372
430
|
name: 'Testnet AVAX',
|
|
373
431
|
decimals: 18,
|
|
374
432
|
},
|
|
433
|
+
contracts: {
|
|
434
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
435
|
+
},
|
|
375
436
|
},
|
|
376
437
|
{
|
|
377
438
|
chainId: ChainId.GNOSIS,
|
|
@@ -389,12 +450,15 @@ export const ALL: Network[] = [
|
|
|
389
450
|
name: 'XDAI',
|
|
390
451
|
decimals: 18,
|
|
391
452
|
},
|
|
453
|
+
contracts: {
|
|
454
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
455
|
+
},
|
|
392
456
|
},
|
|
393
457
|
{
|
|
394
458
|
chainId: ChainId.BASE,
|
|
395
459
|
type: NetworkType.MAINNET,
|
|
396
460
|
name: 'base',
|
|
397
|
-
title: 'Base
|
|
461
|
+
title: 'Base',
|
|
398
462
|
rpcUrl: getRpcUrl('base'),
|
|
399
463
|
logoUrl: getLogoUrl(ChainId.BASE),
|
|
400
464
|
blockExplorer: {
|
|
@@ -406,6 +470,9 @@ export const ALL: Network[] = [
|
|
|
406
470
|
name: 'Ether',
|
|
407
471
|
decimals: 18,
|
|
408
472
|
},
|
|
473
|
+
contracts: {
|
|
474
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
475
|
+
},
|
|
409
476
|
},
|
|
410
477
|
{
|
|
411
478
|
chainId: ChainId.BASE_SEPOLIA,
|
|
@@ -423,6 +490,9 @@ export const ALL: Network[] = [
|
|
|
423
490
|
name: 'Sepolia Ether',
|
|
424
491
|
decimals: 18,
|
|
425
492
|
},
|
|
493
|
+
contracts: {
|
|
494
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
495
|
+
},
|
|
426
496
|
},
|
|
427
497
|
{
|
|
428
498
|
chainId: ChainId.HOMEVERSE,
|
|
@@ -440,6 +510,9 @@ export const ALL: Network[] = [
|
|
|
440
510
|
name: 'OAS',
|
|
441
511
|
decimals: 18,
|
|
442
512
|
},
|
|
513
|
+
contracts: {
|
|
514
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
515
|
+
},
|
|
443
516
|
},
|
|
444
517
|
{
|
|
445
518
|
chainId: ChainId.HOMEVERSE_TESTNET,
|
|
@@ -457,6 +530,9 @@ export const ALL: Network[] = [
|
|
|
457
530
|
name: 'Testnet OAS',
|
|
458
531
|
decimals: 18,
|
|
459
532
|
},
|
|
533
|
+
contracts: {
|
|
534
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
535
|
+
},
|
|
460
536
|
},
|
|
461
537
|
{
|
|
462
538
|
chainId: ChainId.XAI,
|
|
@@ -474,6 +550,9 @@ export const ALL: Network[] = [
|
|
|
474
550
|
name: 'XAI',
|
|
475
551
|
decimals: 18,
|
|
476
552
|
},
|
|
553
|
+
contracts: {
|
|
554
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
555
|
+
},
|
|
477
556
|
},
|
|
478
557
|
{
|
|
479
558
|
chainId: ChainId.XAI_SEPOLIA,
|
|
@@ -491,6 +570,9 @@ export const ALL: Network[] = [
|
|
|
491
570
|
name: 'Sepolia XAI',
|
|
492
571
|
decimals: 18,
|
|
493
572
|
},
|
|
573
|
+
contracts: {
|
|
574
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
575
|
+
},
|
|
494
576
|
},
|
|
495
577
|
{
|
|
496
578
|
chainId: ChainId.B3,
|
|
@@ -508,6 +590,9 @@ export const ALL: Network[] = [
|
|
|
508
590
|
name: 'Ether',
|
|
509
591
|
decimals: 18,
|
|
510
592
|
},
|
|
593
|
+
contracts: {
|
|
594
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
595
|
+
},
|
|
511
596
|
},
|
|
512
597
|
{
|
|
513
598
|
chainId: ChainId.B3_SEPOLIA,
|
|
@@ -525,6 +610,9 @@ export const ALL: Network[] = [
|
|
|
525
610
|
name: 'Ether',
|
|
526
611
|
decimals: 18,
|
|
527
612
|
},
|
|
613
|
+
contracts: {
|
|
614
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
615
|
+
},
|
|
528
616
|
},
|
|
529
617
|
{
|
|
530
618
|
chainId: ChainId.APECHAIN,
|
|
@@ -542,6 +630,9 @@ export const ALL: Network[] = [
|
|
|
542
630
|
name: 'ApeCoin',
|
|
543
631
|
decimals: 18,
|
|
544
632
|
},
|
|
633
|
+
contracts: {
|
|
634
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
635
|
+
},
|
|
545
636
|
},
|
|
546
637
|
{
|
|
547
638
|
chainId: ChainId.APECHAIN_TESTNET,
|
|
@@ -559,6 +650,9 @@ export const ALL: Network[] = [
|
|
|
559
650
|
name: 'ApeCoin',
|
|
560
651
|
decimals: 18,
|
|
561
652
|
},
|
|
653
|
+
contracts: {
|
|
654
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
655
|
+
},
|
|
562
656
|
},
|
|
563
657
|
{
|
|
564
658
|
chainId: ChainId.BLAST,
|
|
@@ -576,6 +670,9 @@ export const ALL: Network[] = [
|
|
|
576
670
|
name: 'Ether',
|
|
577
671
|
decimals: 18,
|
|
578
672
|
},
|
|
673
|
+
contracts: {
|
|
674
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
675
|
+
},
|
|
579
676
|
},
|
|
580
677
|
{
|
|
581
678
|
chainId: ChainId.BLAST_SEPOLIA,
|
|
@@ -593,6 +690,9 @@ export const ALL: Network[] = [
|
|
|
593
690
|
name: 'Ether',
|
|
594
691
|
decimals: 18,
|
|
595
692
|
},
|
|
693
|
+
contracts: {
|
|
694
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
695
|
+
},
|
|
596
696
|
},
|
|
597
697
|
{
|
|
598
698
|
chainId: ChainId.TELOS,
|
|
@@ -610,6 +710,9 @@ export const ALL: Network[] = [
|
|
|
610
710
|
name: 'TLOS',
|
|
611
711
|
decimals: 18,
|
|
612
712
|
},
|
|
713
|
+
contracts: {
|
|
714
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
715
|
+
},
|
|
613
716
|
},
|
|
614
717
|
{
|
|
615
718
|
chainId: ChainId.TELOS_TESTNET,
|
|
@@ -627,6 +730,9 @@ export const ALL: Network[] = [
|
|
|
627
730
|
name: 'TLOS',
|
|
628
731
|
decimals: 18,
|
|
629
732
|
},
|
|
733
|
+
contracts: {
|
|
734
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
735
|
+
},
|
|
630
736
|
},
|
|
631
737
|
{
|
|
632
738
|
chainId: ChainId.SKALE_NEBULA,
|
|
@@ -644,6 +750,9 @@ export const ALL: Network[] = [
|
|
|
644
750
|
name: 'SKALE Fuel',
|
|
645
751
|
decimals: 18,
|
|
646
752
|
},
|
|
753
|
+
contracts: {
|
|
754
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
755
|
+
},
|
|
647
756
|
},
|
|
648
757
|
{
|
|
649
758
|
chainId: ChainId.SKALE_NEBULA_TESTNET,
|
|
@@ -661,6 +770,9 @@ export const ALL: Network[] = [
|
|
|
661
770
|
name: 'SKALE Fuel',
|
|
662
771
|
decimals: 18,
|
|
663
772
|
},
|
|
773
|
+
contracts: {
|
|
774
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
775
|
+
},
|
|
664
776
|
},
|
|
665
777
|
{
|
|
666
778
|
chainId: ChainId.SONEIUM,
|
|
@@ -678,6 +790,9 @@ export const ALL: Network[] = [
|
|
|
678
790
|
name: 'Ether',
|
|
679
791
|
decimals: 18,
|
|
680
792
|
},
|
|
793
|
+
contracts: {
|
|
794
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
795
|
+
},
|
|
681
796
|
},
|
|
682
797
|
{
|
|
683
798
|
chainId: ChainId.SONEIUM_MINATO,
|
|
@@ -695,6 +810,9 @@ export const ALL: Network[] = [
|
|
|
695
810
|
name: 'Ether',
|
|
696
811
|
decimals: 18,
|
|
697
812
|
},
|
|
813
|
+
contracts: {
|
|
814
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
815
|
+
},
|
|
698
816
|
},
|
|
699
817
|
{
|
|
700
818
|
chainId: ChainId.TOY_TESTNET,
|
|
@@ -712,6 +830,9 @@ export const ALL: Network[] = [
|
|
|
712
830
|
name: 'TOY',
|
|
713
831
|
decimals: 18,
|
|
714
832
|
},
|
|
833
|
+
contracts: {
|
|
834
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
835
|
+
},
|
|
715
836
|
},
|
|
716
837
|
{
|
|
717
838
|
chainId: ChainId.IMMUTABLE_ZKEVM,
|
|
@@ -729,6 +850,9 @@ export const ALL: Network[] = [
|
|
|
729
850
|
name: 'IMX',
|
|
730
851
|
decimals: 18,
|
|
731
852
|
},
|
|
853
|
+
contracts: {
|
|
854
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
855
|
+
},
|
|
732
856
|
},
|
|
733
857
|
{
|
|
734
858
|
chainId: ChainId.IMMUTABLE_ZKEVM_TESTNET,
|
|
@@ -746,6 +870,9 @@ export const ALL: Network[] = [
|
|
|
746
870
|
name: 'IMX',
|
|
747
871
|
decimals: 18,
|
|
748
872
|
},
|
|
873
|
+
contracts: {
|
|
874
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
875
|
+
},
|
|
749
876
|
},
|
|
750
877
|
{
|
|
751
878
|
chainId: ChainId.MOONBEAM,
|
|
@@ -763,6 +890,9 @@ export const ALL: Network[] = [
|
|
|
763
890
|
name: 'GLMR',
|
|
764
891
|
decimals: 18,
|
|
765
892
|
},
|
|
893
|
+
contracts: {
|
|
894
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
895
|
+
},
|
|
766
896
|
},
|
|
767
897
|
{
|
|
768
898
|
chainId: ChainId.MOONBASE_ALPHA,
|
|
@@ -780,6 +910,9 @@ export const ALL: Network[] = [
|
|
|
780
910
|
name: 'GLMR',
|
|
781
911
|
decimals: 18,
|
|
782
912
|
},
|
|
913
|
+
contracts: {
|
|
914
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
915
|
+
},
|
|
783
916
|
},
|
|
784
917
|
{
|
|
785
918
|
chainId: ChainId.ETHERLINK,
|
|
@@ -797,23 +930,29 @@ export const ALL: Network[] = [
|
|
|
797
930
|
name: 'Tez',
|
|
798
931
|
decimals: 18,
|
|
799
932
|
},
|
|
933
|
+
contracts: {
|
|
934
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
935
|
+
},
|
|
800
936
|
},
|
|
801
937
|
{
|
|
802
|
-
chainId: ChainId.
|
|
938
|
+
chainId: ChainId.ETHERLINK_SHADOWNET_TESTNET,
|
|
803
939
|
type: NetworkType.TESTNET,
|
|
804
|
-
name: 'etherlink-testnet',
|
|
805
|
-
title: 'Etherlink Testnet',
|
|
806
|
-
rpcUrl: getRpcUrl('etherlink-testnet'),
|
|
807
|
-
logoUrl: getLogoUrl(ChainId.
|
|
940
|
+
name: 'etherlink-shadownet-testnet',
|
|
941
|
+
title: 'Etherlink Shadownet Testnet',
|
|
942
|
+
rpcUrl: getRpcUrl('etherlink-shadownet-testnet'),
|
|
943
|
+
logoUrl: getLogoUrl(ChainId.ETHERLINK_SHADOWNET_TESTNET),
|
|
808
944
|
blockExplorer: {
|
|
809
|
-
name: 'Etherlink Testnet Explorer',
|
|
810
|
-
url: 'https://
|
|
945
|
+
name: 'Etherlink Shadownet Testnet Explorer',
|
|
946
|
+
url: 'https://shadownet.explorer.etherlink.com/',
|
|
811
947
|
},
|
|
812
948
|
nativeCurrency: {
|
|
813
949
|
symbol: 'XTZ',
|
|
814
950
|
name: 'Tez',
|
|
815
951
|
decimals: 18,
|
|
816
952
|
},
|
|
953
|
+
contracts: {
|
|
954
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
955
|
+
},
|
|
817
956
|
},
|
|
818
957
|
{
|
|
819
958
|
chainId: ChainId.MONAD,
|
|
@@ -831,6 +970,9 @@ export const ALL: Network[] = [
|
|
|
831
970
|
name: 'MON',
|
|
832
971
|
decimals: 18,
|
|
833
972
|
},
|
|
973
|
+
contracts: {
|
|
974
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
975
|
+
},
|
|
834
976
|
},
|
|
835
977
|
{
|
|
836
978
|
chainId: ChainId.MONAD_TESTNET,
|
|
@@ -848,6 +990,9 @@ export const ALL: Network[] = [
|
|
|
848
990
|
name: 'MON',
|
|
849
991
|
decimals: 18,
|
|
850
992
|
},
|
|
993
|
+
contracts: {
|
|
994
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
995
|
+
},
|
|
851
996
|
},
|
|
852
997
|
|
|
853
998
|
{
|
|
@@ -866,6 +1011,9 @@ export const ALL: Network[] = [
|
|
|
866
1011
|
name: 'SOMI',
|
|
867
1012
|
decimals: 18,
|
|
868
1013
|
},
|
|
1014
|
+
contracts: {
|
|
1015
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
1016
|
+
},
|
|
869
1017
|
},
|
|
870
1018
|
|
|
871
1019
|
{
|
|
@@ -884,6 +1032,30 @@ export const ALL: Network[] = [
|
|
|
884
1032
|
name: 'STT',
|
|
885
1033
|
decimals: 18,
|
|
886
1034
|
},
|
|
1035
|
+
contracts: {
|
|
1036
|
+
multicall3: SEQUENCE_MULTICALL3_ADDRESS,
|
|
1037
|
+
},
|
|
1038
|
+
},
|
|
1039
|
+
|
|
1040
|
+
{
|
|
1041
|
+
chainId: ChainId.INCENTIV,
|
|
1042
|
+
type: NetworkType.MAINNET,
|
|
1043
|
+
name: 'incentiv',
|
|
1044
|
+
title: 'Incentiv',
|
|
1045
|
+
rpcUrl: getRpcUrl('incentiv'),
|
|
1046
|
+
logoUrl: getLogoUrl(ChainId.INCENTIV),
|
|
1047
|
+
blockExplorer: {
|
|
1048
|
+
name: 'Incentiv Explorer',
|
|
1049
|
+
url: 'https://explorer.incentiv.io/',
|
|
1050
|
+
},
|
|
1051
|
+
nativeCurrency: {
|
|
1052
|
+
symbol: 'CENT',
|
|
1053
|
+
name: 'CENT',
|
|
1054
|
+
decimals: 18,
|
|
1055
|
+
},
|
|
1056
|
+
contracts: {
|
|
1057
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1058
|
+
},
|
|
887
1059
|
},
|
|
888
1060
|
|
|
889
1061
|
{
|
|
@@ -902,6 +1074,9 @@ export const ALL: Network[] = [
|
|
|
902
1074
|
name: 'TCENT',
|
|
903
1075
|
decimals: 18,
|
|
904
1076
|
},
|
|
1077
|
+
contracts: {
|
|
1078
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1079
|
+
},
|
|
905
1080
|
},
|
|
906
1081
|
|
|
907
1082
|
{
|
|
@@ -920,6 +1095,9 @@ export const ALL: Network[] = [
|
|
|
920
1095
|
name: 'ETH',
|
|
921
1096
|
decimals: 18,
|
|
922
1097
|
},
|
|
1098
|
+
contracts: {
|
|
1099
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1100
|
+
},
|
|
923
1101
|
},
|
|
924
1102
|
|
|
925
1103
|
{
|
|
@@ -938,6 +1116,9 @@ export const ALL: Network[] = [
|
|
|
938
1116
|
name: 'SAND',
|
|
939
1117
|
decimals: 18,
|
|
940
1118
|
},
|
|
1119
|
+
contracts: {
|
|
1120
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1121
|
+
},
|
|
941
1122
|
},
|
|
942
1123
|
|
|
943
1124
|
{
|
|
@@ -956,6 +1137,63 @@ export const ALL: Network[] = [
|
|
|
956
1137
|
name: 'USDC',
|
|
957
1138
|
decimals: 6,
|
|
958
1139
|
},
|
|
1140
|
+
contracts: {
|
|
1141
|
+
multicall3: DEFAULT_MULTICALL3_ADDRESS,
|
|
1142
|
+
},
|
|
1143
|
+
},
|
|
1144
|
+
|
|
1145
|
+
{
|
|
1146
|
+
chainId: ChainId.HYPEREVM,
|
|
1147
|
+
type: NetworkType.MAINNET,
|
|
1148
|
+
name: 'hyperevm',
|
|
1149
|
+
title: 'HyperEVM',
|
|
1150
|
+
rpcUrl: getRpcUrl('hyperevm'),
|
|
1151
|
+
logoUrl: getLogoUrl(ChainId.HYPEREVM),
|
|
1152
|
+
blockExplorer: {
|
|
1153
|
+
name: 'HyperEVM Explorer',
|
|
1154
|
+
url: 'https://www.hyperscan.com/',
|
|
1155
|
+
},
|
|
1156
|
+
nativeCurrency: {
|
|
1157
|
+
symbol: 'HYPE',
|
|
1158
|
+
name: 'HYPE',
|
|
1159
|
+
decimals: 18,
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
|
|
1163
|
+
{
|
|
1164
|
+
chainId: ChainId.BERACHAIN,
|
|
1165
|
+
type: NetworkType.MAINNET,
|
|
1166
|
+
name: 'berachain',
|
|
1167
|
+
title: 'Berachain',
|
|
1168
|
+
rpcUrl: getRpcUrl('berachain'),
|
|
1169
|
+
logoUrl: getLogoUrl(ChainId.BERACHAIN),
|
|
1170
|
+
blockExplorer: {
|
|
1171
|
+
name: 'Berachain Explorer',
|
|
1172
|
+
url: 'https://berascan.com/',
|
|
1173
|
+
},
|
|
1174
|
+
nativeCurrency: {
|
|
1175
|
+
symbol: 'BEAR',
|
|
1176
|
+
name: 'BEAR',
|
|
1177
|
+
decimals: 18,
|
|
1178
|
+
},
|
|
1179
|
+
},
|
|
1180
|
+
|
|
1181
|
+
{
|
|
1182
|
+
chainId: ChainId.SONIC,
|
|
1183
|
+
type: NetworkType.MAINNET,
|
|
1184
|
+
name: 'sonic',
|
|
1185
|
+
title: 'Sonic',
|
|
1186
|
+
rpcUrl: getRpcUrl('sonic'),
|
|
1187
|
+
logoUrl: getLogoUrl(ChainId.SONIC),
|
|
1188
|
+
blockExplorer: {
|
|
1189
|
+
name: 'Sonic Explorer',
|
|
1190
|
+
url: 'https://sonicscan.com/',
|
|
1191
|
+
},
|
|
1192
|
+
nativeCurrency: {
|
|
1193
|
+
symbol: 'S',
|
|
1194
|
+
name: 'Sonic',
|
|
1195
|
+
decimals: 18,
|
|
1196
|
+
},
|
|
959
1197
|
},
|
|
960
1198
|
]
|
|
961
1199
|
|
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
|
}
|