@libid/contracts 0.18.1 → 0.19.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/README.md +22 -11
- package/dist/abis/bindErrors.d.ts +4 -0
- package/dist/abis/bindErrors.d.ts.map +1 -1
- package/dist/abis/bindErrors.js +5 -0
- package/dist/abis/bindErrors.js.map +1 -1
- package/dist/abis/ceremonyProofVerifier.d.ts +0 -10
- package/dist/abis/ceremonyProofVerifier.d.ts.map +1 -1
- package/dist/abis/ceremonyProofVerifier.js +0 -13
- package/dist/abis/ceremonyProofVerifier.js.map +1 -1
- package/dist/abis/handleEscrow.d.ts +20 -20
- package/dist/abis/handleEscrow.js +25 -25
- package/dist/abis/handleEscrow.js.map +1 -1
- package/dist/abis/identityRegistry.d.ts +77 -33
- package/dist/abis/identityRegistry.d.ts.map +1 -1
- package/dist/abis/identityRegistry.js +97 -42
- package/dist/abis/identityRegistry.js.map +1 -1
- package/dist/calls/identityRegistry.d.ts +1 -0
- package/dist/calls/identityRegistry.d.ts.map +1 -1
- package/dist/calls/identityRegistry.js +6 -0
- package/dist/calls/identityRegistry.js.map +1 -1
- package/dist/identity/resolve.d.ts +5 -1
- package/dist/identity/resolve.d.ts.map +1 -1
- package/dist/identity/resolve.js +5 -5
- package/dist/identity/resolve.js.map +1 -1
- package/package.json +1 -1
- package/src/abis/bindErrors.ts +5 -0
- package/src/abis/ceremonyProofVerifier.ts +0 -13
- package/src/abis/handleEscrow.ts +25 -25
- package/src/abis/identityRegistry.ts +97 -42
- package/src/calls/identityRegistry.ts +7 -0
- package/src/identity/resolve.ts +17 -7
|
@@ -84,6 +84,21 @@ export const identityRegistryAbi = [
|
|
|
84
84
|
"name": "handle",
|
|
85
85
|
"type": "string",
|
|
86
86
|
"internalType": "string"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "primary",
|
|
90
|
+
"type": "bool",
|
|
91
|
+
"internalType": "bool"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "feeAmount",
|
|
95
|
+
"type": "uint256",
|
|
96
|
+
"internalType": "uint256"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "feeReceiver",
|
|
100
|
+
"type": "address",
|
|
101
|
+
"internalType": "address"
|
|
87
102
|
}
|
|
88
103
|
],
|
|
89
104
|
"outputs": [],
|
|
@@ -107,6 +122,16 @@ export const identityRegistryAbi = [
|
|
|
107
122
|
"name": "payload",
|
|
108
123
|
"type": "bytes",
|
|
109
124
|
"internalType": "bytes"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "feeAmount",
|
|
128
|
+
"type": "uint256",
|
|
129
|
+
"internalType": "uint256"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "feeReceiver",
|
|
133
|
+
"type": "address",
|
|
134
|
+
"internalType": "address"
|
|
110
135
|
}
|
|
111
136
|
],
|
|
112
137
|
"outputs": [],
|
|
@@ -325,6 +350,30 @@ export const identityRegistryAbi = [
|
|
|
325
350
|
],
|
|
326
351
|
"stateMutability": "view"
|
|
327
352
|
},
|
|
353
|
+
{
|
|
354
|
+
"type": "function",
|
|
355
|
+
"name": "primaryHandleOf",
|
|
356
|
+
"inputs": [
|
|
357
|
+
{
|
|
358
|
+
"name": "holder",
|
|
359
|
+
"type": "address",
|
|
360
|
+
"internalType": "address"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
"outputs": [
|
|
364
|
+
{
|
|
365
|
+
"name": "platformId",
|
|
366
|
+
"type": "bytes32",
|
|
367
|
+
"internalType": "bytes32"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "handle",
|
|
371
|
+
"type": "string",
|
|
372
|
+
"internalType": "string"
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
"stateMutability": "view"
|
|
376
|
+
},
|
|
328
377
|
{
|
|
329
378
|
"type": "function",
|
|
330
379
|
"name": "proofVerifier",
|
|
@@ -369,30 +418,6 @@ export const identityRegistryAbi = [
|
|
|
369
418
|
"outputs": [],
|
|
370
419
|
"stateMutability": "nonpayable"
|
|
371
420
|
},
|
|
372
|
-
{
|
|
373
|
-
"type": "function",
|
|
374
|
-
"name": "publishedHandleOf",
|
|
375
|
-
"inputs": [
|
|
376
|
-
{
|
|
377
|
-
"name": "holder",
|
|
378
|
-
"type": "address",
|
|
379
|
-
"internalType": "address"
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
"name": "platformId",
|
|
383
|
-
"type": "bytes32",
|
|
384
|
-
"internalType": "bytes32"
|
|
385
|
-
}
|
|
386
|
-
],
|
|
387
|
-
"outputs": [
|
|
388
|
-
{
|
|
389
|
-
"name": "",
|
|
390
|
-
"type": "string",
|
|
391
|
-
"internalType": "string"
|
|
392
|
-
}
|
|
393
|
-
],
|
|
394
|
-
"stateMutability": "view"
|
|
395
|
-
},
|
|
396
421
|
{
|
|
397
422
|
"type": "function",
|
|
398
423
|
"name": "quoteBind",
|
|
@@ -535,6 +560,24 @@ export const identityRegistryAbi = [
|
|
|
535
560
|
],
|
|
536
561
|
"stateMutability": "view"
|
|
537
562
|
},
|
|
563
|
+
{
|
|
564
|
+
"type": "function",
|
|
565
|
+
"name": "reveal",
|
|
566
|
+
"inputs": [
|
|
567
|
+
{
|
|
568
|
+
"name": "platformId",
|
|
569
|
+
"type": "bytes32",
|
|
570
|
+
"internalType": "bytes32"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"name": "handle",
|
|
574
|
+
"type": "string",
|
|
575
|
+
"internalType": "string"
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"outputs": [],
|
|
579
|
+
"stateMutability": "nonpayable"
|
|
580
|
+
},
|
|
538
581
|
{
|
|
539
582
|
"type": "function",
|
|
540
583
|
"name": "setProofVerifier",
|
|
@@ -564,13 +607,7 @@ export const identityRegistryAbi = [
|
|
|
564
607
|
{
|
|
565
608
|
"type": "function",
|
|
566
609
|
"name": "unpublish",
|
|
567
|
-
"inputs": [
|
|
568
|
-
{
|
|
569
|
-
"name": "platformId",
|
|
570
|
-
"type": "bytes32",
|
|
571
|
-
"internalType": "bytes32"
|
|
572
|
-
}
|
|
573
|
-
],
|
|
610
|
+
"inputs": [],
|
|
574
611
|
"outputs": [],
|
|
575
612
|
"stateMutability": "nonpayable"
|
|
576
613
|
},
|
|
@@ -669,12 +706,6 @@ export const identityRegistryAbi = [
|
|
|
669
706
|
"type": "bytes32",
|
|
670
707
|
"indexed": true,
|
|
671
708
|
"internalType": "bytes32"
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
"name": "handle",
|
|
675
|
-
"type": "string",
|
|
676
|
-
"indexed": false,
|
|
677
|
-
"internalType": "string"
|
|
678
709
|
}
|
|
679
710
|
],
|
|
680
711
|
"anonymous": false
|
|
@@ -706,19 +737,38 @@ export const identityRegistryAbi = [
|
|
|
706
737
|
},
|
|
707
738
|
{
|
|
708
739
|
"type": "event",
|
|
709
|
-
"name": "
|
|
740
|
+
"name": "HandleRevealed",
|
|
710
741
|
"inputs": [
|
|
711
742
|
{
|
|
712
|
-
"name": "
|
|
713
|
-
"type": "
|
|
743
|
+
"name": "platformId",
|
|
744
|
+
"type": "bytes32",
|
|
714
745
|
"indexed": true,
|
|
715
|
-
"internalType": "
|
|
746
|
+
"internalType": "bytes32"
|
|
716
747
|
},
|
|
717
748
|
{
|
|
718
|
-
"name": "
|
|
749
|
+
"name": "handleNode",
|
|
719
750
|
"type": "bytes32",
|
|
720
751
|
"indexed": true,
|
|
721
752
|
"internalType": "bytes32"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "handle",
|
|
756
|
+
"type": "string",
|
|
757
|
+
"indexed": false,
|
|
758
|
+
"internalType": "string"
|
|
759
|
+
}
|
|
760
|
+
],
|
|
761
|
+
"anonymous": false
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
"type": "event",
|
|
765
|
+
"name": "HandleUnpublished",
|
|
766
|
+
"inputs": [
|
|
767
|
+
{
|
|
768
|
+
"name": "holder",
|
|
769
|
+
"type": "address",
|
|
770
|
+
"indexed": true,
|
|
771
|
+
"internalType": "address"
|
|
722
772
|
}
|
|
723
773
|
],
|
|
724
774
|
"anonymous": false
|
|
@@ -1030,6 +1080,11 @@ export const identityRegistryAbi = [
|
|
|
1030
1080
|
}
|
|
1031
1081
|
]
|
|
1032
1082
|
},
|
|
1083
|
+
{
|
|
1084
|
+
"type": "error",
|
|
1085
|
+
"name": "PrimaryWithoutHandle",
|
|
1086
|
+
"inputs": []
|
|
1087
|
+
},
|
|
1033
1088
|
{
|
|
1034
1089
|
"type": "error",
|
|
1035
1090
|
"name": "ReentrancyGuardReentrantCall",
|
|
@@ -63,6 +63,13 @@ export function publish(to: Address, ...args: IdentityRegistryArgs<'publish'>):
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
export function reveal(to: Address, ...args: IdentityRegistryArgs<'reveal'>): Call {
|
|
67
|
+
return {
|
|
68
|
+
to,
|
|
69
|
+
data: encodeFunctionData({ abi: identityRegistryAbi, functionName: 'reveal', args }),
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
export function setProofVerifier(
|
|
67
74
|
to: Address,
|
|
68
75
|
...args: IdentityRegistryArgs<'setProofVerifier'>
|
package/src/identity/resolve.ts
CHANGED
|
@@ -106,15 +106,25 @@ export async function resolveHandle(
|
|
|
106
106
|
return (await resolveHandleAndId(reader, platformId, handle, zeroHash)).holder
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/// The handle
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
/// The one handle a holder shows as its name, and the platform it is on.
|
|
110
|
+
export interface PrimaryHandle {
|
|
111
|
+
platformId: `0x${string}`
|
|
112
|
+
/// Folded, as the holder disclosed it.
|
|
113
|
+
handle: string
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/// The handle to show for a holder, on whichever platform, or `null`.
|
|
117
|
+
/// Forward-checked on chain: none once the stored handle resolves somewhere else.
|
|
118
|
+
export async function primaryHandleOf(
|
|
112
119
|
reader: RegistryReader,
|
|
113
120
|
holder: Address,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
): Promise<PrimaryHandle | null> {
|
|
122
|
+
const [platformId, handle] = await read<readonly [`0x${string}`, string]>(
|
|
123
|
+
reader,
|
|
124
|
+
'primaryHandleOf',
|
|
125
|
+
[holder],
|
|
126
|
+
)
|
|
127
|
+
return handle.length === 0 ? null : { platformId, handle }
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
/// One identity a holder proved, as the holder's list reports it.
|