@libid/contracts 0.22.0 → 0.23.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.
Files changed (66) hide show
  1. package/README.md +12 -5
  2. package/dist/abis/bindErrors.d.ts +80 -0
  3. package/dist/abis/bindErrors.d.ts.map +1 -1
  4. package/dist/abis/bindErrors.js +109 -1
  5. package/dist/abis/bindErrors.js.map +1 -1
  6. package/dist/abis/ceremonyPayloads.d.ts +3 -3
  7. package/dist/abis/ceremonyPayloads.js +3 -3
  8. package/dist/abis/ceremonyPayloads.js.map +1 -1
  9. package/dist/abis/googleJwtRoots.d.ts +11 -7
  10. package/dist/abis/googleJwtRoots.d.ts.map +1 -1
  11. package/dist/abis/googleJwtRoots.js +14 -8
  12. package/dist/abis/googleJwtRoots.js.map +1 -1
  13. package/dist/abis/identityRegistry.d.ts +50 -0
  14. package/dist/abis/identityRegistry.d.ts.map +1 -1
  15. package/dist/abis/identityRegistry.js +64 -0
  16. package/dist/abis/identityRegistry.js.map +1 -1
  17. package/dist/abis/index.d.ts +1 -0
  18. package/dist/abis/index.d.ts.map +1 -1
  19. package/dist/abis/index.js +1 -0
  20. package/dist/abis/index.js.map +1 -1
  21. package/dist/abis/referralSplitter.d.ts +380 -0
  22. package/dist/abis/referralSplitter.d.ts.map +1 -0
  23. package/dist/abis/referralSplitter.js +494 -0
  24. package/dist/abis/referralSplitter.js.map +1 -0
  25. package/dist/calls/identityRegistry.d.ts +1 -0
  26. package/dist/calls/identityRegistry.d.ts.map +1 -1
  27. package/dist/calls/identityRegistry.js +7 -0
  28. package/dist/calls/identityRegistry.js.map +1 -1
  29. package/dist/calls/index.d.ts +1 -0
  30. package/dist/calls/index.d.ts.map +1 -1
  31. package/dist/calls/index.js +1 -0
  32. package/dist/calls/index.js.map +1 -1
  33. package/dist/calls/referralSplitter.d.ts +14 -0
  34. package/dist/calls/referralSplitter.d.ts.map +1 -0
  35. package/dist/calls/referralSplitter.js +42 -0
  36. package/dist/calls/referralSplitter.js.map +1 -0
  37. package/dist/ceremony/profiles.d.ts +21 -0
  38. package/dist/ceremony/profiles.d.ts.map +1 -1
  39. package/dist/ceremony/profiles.js +31 -1
  40. package/dist/ceremony/profiles.js.map +1 -1
  41. package/dist/payloads.d.ts +12 -10
  42. package/dist/payloads.d.ts.map +1 -1
  43. package/dist/payloads.js +21 -16
  44. package/dist/payloads.js.map +1 -1
  45. package/dist/platforms/handle.d.ts +1 -0
  46. package/dist/platforms/handle.d.ts.map +1 -1
  47. package/dist/platforms/handle.js +2 -1
  48. package/dist/platforms/handle.js.map +1 -1
  49. package/dist/platforms/platforms.d.ts +3 -0
  50. package/dist/platforms/platforms.d.ts.map +1 -1
  51. package/dist/platforms/platforms.js +15 -1
  52. package/dist/platforms/platforms.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/abis/bindErrors.ts +109 -1
  55. package/src/abis/ceremonyPayloads.ts +3 -3
  56. package/src/abis/googleJwtRoots.ts +14 -8
  57. package/src/abis/identityRegistry.ts +64 -0
  58. package/src/abis/index.ts +1 -0
  59. package/src/abis/referralSplitter.ts +496 -0
  60. package/src/calls/identityRegistry.ts +12 -0
  61. package/src/calls/index.ts +1 -0
  62. package/src/calls/referralSplitter.ts +73 -0
  63. package/src/ceremony/profiles.ts +33 -1
  64. package/src/payloads.ts +31 -23
  65. package/src/platforms/handle.ts +9 -1
  66. package/src/platforms/platforms.ts +15 -1
@@ -137,6 +137,54 @@ export const identityRegistryAbi = [
137
137
  "outputs": [],
138
138
  "stateMutability": "payable"
139
139
  },
140
+ {
141
+ "type": "function",
142
+ "name": "bindWithFeeCall",
143
+ "inputs": [
144
+ {
145
+ "name": "platformId",
146
+ "type": "bytes32",
147
+ "internalType": "bytes32"
148
+ },
149
+ {
150
+ "name": "verifierVersion",
151
+ "type": "uint16",
152
+ "internalType": "uint16"
153
+ },
154
+ {
155
+ "name": "payload",
156
+ "type": "bytes",
157
+ "internalType": "bytes"
158
+ },
159
+ {
160
+ "name": "handle",
161
+ "type": "string",
162
+ "internalType": "string"
163
+ },
164
+ {
165
+ "name": "primary",
166
+ "type": "bool",
167
+ "internalType": "bool"
168
+ },
169
+ {
170
+ "name": "feeAmount",
171
+ "type": "uint256",
172
+ "internalType": "uint256"
173
+ },
174
+ {
175
+ "name": "feeReceiver",
176
+ "type": "address",
177
+ "internalType": "address"
178
+ },
179
+ {
180
+ "name": "feeData",
181
+ "type": "bytes",
182
+ "internalType": "bytes"
183
+ }
184
+ ],
185
+ "outputs": [],
186
+ "stateMutability": "payable"
187
+ },
140
188
  {
141
189
  "type": "function",
142
190
  "name": "digestSpent",
@@ -947,6 +995,17 @@ export const identityRegistryAbi = [
947
995
  "name": "FailedCall",
948
996
  "inputs": []
949
997
  },
998
+ {
999
+ "type": "error",
1000
+ "name": "FeeCallRefused",
1001
+ "inputs": [
1002
+ {
1003
+ "name": "receiver",
1004
+ "type": "address",
1005
+ "internalType": "address"
1006
+ }
1007
+ ]
1008
+ },
950
1009
  {
951
1010
  "type": "error",
952
1011
  "name": "FeeTransferFailed",
@@ -995,6 +1054,11 @@ export const identityRegistryAbi = [
995
1054
  "name": "InvalidInitialization",
996
1055
  "inputs": []
997
1056
  },
1057
+ {
1058
+ "type": "error",
1059
+ "name": "NoFee",
1060
+ "inputs": []
1061
+ },
998
1062
  {
999
1063
  "type": "error",
1000
1064
  "name": "NoHandle",
package/src/abis/index.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  export { identityRegistryAbi } from './identityRegistry.js'
4
4
  export { handleResolverAbi } from './handleResolver.js'
5
5
  export { handleEscrowAbi } from './handleEscrow.js'
6
+ export { referralSplitterAbi } from './referralSplitter.js'
6
7
  export { notaryServiceAbi } from './notaryService.js'
7
8
  export { ceremonyProofVerifierAbi } from './ceremonyProofVerifier.js'
8
9
  export { googleJwtRootsAbi } from './googleJwtRoots.js'
@@ -0,0 +1,496 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/ReferralSplitter.sol/ReferralSplitter.json
3
+
4
+ import type { Abi } from 'viem'
5
+
6
+ export const referralSplitterAbi = [
7
+ {
8
+ "type": "constructor",
9
+ "inputs": [
10
+ {
11
+ "name": "registry",
12
+ "type": "address",
13
+ "internalType": "contract IIdentityRegistry"
14
+ },
15
+ {
16
+ "name": "escrow",
17
+ "type": "address",
18
+ "internalType": "contract HandleEscrow"
19
+ },
20
+ {
21
+ "name": "owner_",
22
+ "type": "address",
23
+ "internalType": "address"
24
+ },
25
+ {
26
+ "name": "treasury_",
27
+ "type": "address",
28
+ "internalType": "address"
29
+ },
30
+ {
31
+ "name": "shareBps_",
32
+ "type": "uint16",
33
+ "internalType": "uint16"
34
+ },
35
+ {
36
+ "name": "fee_",
37
+ "type": "uint256",
38
+ "internalType": "uint256"
39
+ }
40
+ ],
41
+ "stateMutability": "nonpayable"
42
+ },
43
+ {
44
+ "type": "function",
45
+ "name": "ESCROW",
46
+ "inputs": [],
47
+ "outputs": [
48
+ {
49
+ "name": "",
50
+ "type": "address",
51
+ "internalType": "contract HandleEscrow"
52
+ }
53
+ ],
54
+ "stateMutability": "view"
55
+ },
56
+ {
57
+ "type": "function",
58
+ "name": "REGISTRY",
59
+ "inputs": [],
60
+ "outputs": [
61
+ {
62
+ "name": "",
63
+ "type": "address",
64
+ "internalType": "contract IIdentityRegistry"
65
+ }
66
+ ],
67
+ "stateMutability": "view"
68
+ },
69
+ {
70
+ "type": "function",
71
+ "name": "acceptOwnership",
72
+ "inputs": [],
73
+ "outputs": [],
74
+ "stateMutability": "nonpayable"
75
+ },
76
+ {
77
+ "type": "function",
78
+ "name": "fee",
79
+ "inputs": [],
80
+ "outputs": [
81
+ {
82
+ "name": "",
83
+ "type": "uint256",
84
+ "internalType": "uint256"
85
+ }
86
+ ],
87
+ "stateMutability": "view"
88
+ },
89
+ {
90
+ "type": "function",
91
+ "name": "onBindFee",
92
+ "inputs": [
93
+ {
94
+ "name": "binder",
95
+ "type": "address",
96
+ "internalType": "address"
97
+ },
98
+ {
99
+ "name": "platformId",
100
+ "type": "bytes32",
101
+ "internalType": "bytes32"
102
+ },
103
+ {
104
+ "name": "handleNode",
105
+ "type": "bytes32",
106
+ "internalType": "bytes32"
107
+ },
108
+ {
109
+ "name": "sessionId",
110
+ "type": "bytes32",
111
+ "internalType": "bytes32"
112
+ },
113
+ {
114
+ "name": "feeData",
115
+ "type": "bytes",
116
+ "internalType": "bytes"
117
+ }
118
+ ],
119
+ "outputs": [
120
+ {
121
+ "name": "",
122
+ "type": "bytes4",
123
+ "internalType": "bytes4"
124
+ }
125
+ ],
126
+ "stateMutability": "payable"
127
+ },
128
+ {
129
+ "type": "function",
130
+ "name": "owner",
131
+ "inputs": [],
132
+ "outputs": [
133
+ {
134
+ "name": "",
135
+ "type": "address",
136
+ "internalType": "address"
137
+ }
138
+ ],
139
+ "stateMutability": "view"
140
+ },
141
+ {
142
+ "type": "function",
143
+ "name": "pendingOwner",
144
+ "inputs": [],
145
+ "outputs": [
146
+ {
147
+ "name": "",
148
+ "type": "address",
149
+ "internalType": "address"
150
+ }
151
+ ],
152
+ "stateMutability": "view"
153
+ },
154
+ {
155
+ "type": "function",
156
+ "name": "renounceOwnership",
157
+ "inputs": [],
158
+ "outputs": [],
159
+ "stateMutability": "pure"
160
+ },
161
+ {
162
+ "type": "function",
163
+ "name": "setFee",
164
+ "inputs": [
165
+ {
166
+ "name": "fee_",
167
+ "type": "uint256",
168
+ "internalType": "uint256"
169
+ }
170
+ ],
171
+ "outputs": [],
172
+ "stateMutability": "nonpayable"
173
+ },
174
+ {
175
+ "type": "function",
176
+ "name": "setShare",
177
+ "inputs": [
178
+ {
179
+ "name": "shareBps_",
180
+ "type": "uint16",
181
+ "internalType": "uint16"
182
+ }
183
+ ],
184
+ "outputs": [],
185
+ "stateMutability": "nonpayable"
186
+ },
187
+ {
188
+ "type": "function",
189
+ "name": "setTreasury",
190
+ "inputs": [
191
+ {
192
+ "name": "treasury_",
193
+ "type": "address",
194
+ "internalType": "address"
195
+ }
196
+ ],
197
+ "outputs": [],
198
+ "stateMutability": "nonpayable"
199
+ },
200
+ {
201
+ "type": "function",
202
+ "name": "shareBps",
203
+ "inputs": [],
204
+ "outputs": [
205
+ {
206
+ "name": "",
207
+ "type": "uint16",
208
+ "internalType": "uint16"
209
+ }
210
+ ],
211
+ "stateMutability": "view"
212
+ },
213
+ {
214
+ "type": "function",
215
+ "name": "transferOwnership",
216
+ "inputs": [
217
+ {
218
+ "name": "newOwner",
219
+ "type": "address",
220
+ "internalType": "address"
221
+ }
222
+ ],
223
+ "outputs": [],
224
+ "stateMutability": "nonpayable"
225
+ },
226
+ {
227
+ "type": "function",
228
+ "name": "treasury",
229
+ "inputs": [],
230
+ "outputs": [
231
+ {
232
+ "name": "",
233
+ "type": "address",
234
+ "internalType": "address"
235
+ }
236
+ ],
237
+ "stateMutability": "view"
238
+ },
239
+ {
240
+ "type": "event",
241
+ "name": "FeeSet",
242
+ "inputs": [
243
+ {
244
+ "name": "fee",
245
+ "type": "uint256",
246
+ "indexed": false,
247
+ "internalType": "uint256"
248
+ }
249
+ ],
250
+ "anonymous": false
251
+ },
252
+ {
253
+ "type": "event",
254
+ "name": "OwnershipTransferStarted",
255
+ "inputs": [
256
+ {
257
+ "name": "previousOwner",
258
+ "type": "address",
259
+ "indexed": true,
260
+ "internalType": "address"
261
+ },
262
+ {
263
+ "name": "newOwner",
264
+ "type": "address",
265
+ "indexed": true,
266
+ "internalType": "address"
267
+ }
268
+ ],
269
+ "anonymous": false
270
+ },
271
+ {
272
+ "type": "event",
273
+ "name": "OwnershipTransferred",
274
+ "inputs": [
275
+ {
276
+ "name": "previousOwner",
277
+ "type": "address",
278
+ "indexed": true,
279
+ "internalType": "address"
280
+ },
281
+ {
282
+ "name": "newOwner",
283
+ "type": "address",
284
+ "indexed": true,
285
+ "internalType": "address"
286
+ }
287
+ ],
288
+ "anonymous": false
289
+ },
290
+ {
291
+ "type": "event",
292
+ "name": "Referred",
293
+ "inputs": [
294
+ {
295
+ "name": "referrerNode",
296
+ "type": "bytes32",
297
+ "indexed": true,
298
+ "internalType": "bytes32"
299
+ },
300
+ {
301
+ "name": "binder",
302
+ "type": "address",
303
+ "indexed": true,
304
+ "internalType": "address"
305
+ },
306
+ {
307
+ "name": "sessionId",
308
+ "type": "bytes32",
309
+ "indexed": true,
310
+ "internalType": "bytes32"
311
+ },
312
+ {
313
+ "name": "referrerPlatformId",
314
+ "type": "bytes32",
315
+ "indexed": false,
316
+ "internalType": "bytes32"
317
+ },
318
+ {
319
+ "name": "platformId",
320
+ "type": "bytes32",
321
+ "indexed": false,
322
+ "internalType": "bytes32"
323
+ },
324
+ {
325
+ "name": "handleNode",
326
+ "type": "bytes32",
327
+ "indexed": false,
328
+ "internalType": "bytes32"
329
+ },
330
+ {
331
+ "name": "fee",
332
+ "type": "uint256",
333
+ "indexed": false,
334
+ "internalType": "uint256"
335
+ },
336
+ {
337
+ "name": "share",
338
+ "type": "uint256",
339
+ "indexed": false,
340
+ "internalType": "uint256"
341
+ },
342
+ {
343
+ "name": "outcome",
344
+ "type": "uint8",
345
+ "indexed": false,
346
+ "internalType": "enum ReferralSplitter.Outcome"
347
+ }
348
+ ],
349
+ "anonymous": false
350
+ },
351
+ {
352
+ "type": "event",
353
+ "name": "ShareSet",
354
+ "inputs": [
355
+ {
356
+ "name": "shareBps",
357
+ "type": "uint16",
358
+ "indexed": false,
359
+ "internalType": "uint16"
360
+ }
361
+ ],
362
+ "anonymous": false
363
+ },
364
+ {
365
+ "type": "event",
366
+ "name": "TreasurySet",
367
+ "inputs": [
368
+ {
369
+ "name": "treasury",
370
+ "type": "address",
371
+ "indexed": false,
372
+ "internalType": "address"
373
+ }
374
+ ],
375
+ "anonymous": false
376
+ },
377
+ {
378
+ "type": "error",
379
+ "name": "BadFeeData",
380
+ "inputs": [
381
+ {
382
+ "name": "length",
383
+ "type": "uint256",
384
+ "internalType": "uint256"
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "type": "error",
390
+ "name": "BadTreasury",
391
+ "inputs": [
392
+ {
393
+ "name": "treasury",
394
+ "type": "address",
395
+ "internalType": "address"
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ "type": "error",
401
+ "name": "EscrowOfAnotherRegistry",
402
+ "inputs": [
403
+ {
404
+ "name": "escrowRegistry",
405
+ "type": "address",
406
+ "internalType": "address"
407
+ }
408
+ ]
409
+ },
410
+ {
411
+ "type": "error",
412
+ "name": "NotRegistry",
413
+ "inputs": [
414
+ {
415
+ "name": "caller",
416
+ "type": "address",
417
+ "internalType": "address"
418
+ }
419
+ ]
420
+ },
421
+ {
422
+ "type": "error",
423
+ "name": "OwnableInvalidOwner",
424
+ "inputs": [
425
+ {
426
+ "name": "owner",
427
+ "type": "address",
428
+ "internalType": "address"
429
+ }
430
+ ]
431
+ },
432
+ {
433
+ "type": "error",
434
+ "name": "OwnableUnauthorizedAccount",
435
+ "inputs": [
436
+ {
437
+ "name": "account",
438
+ "type": "address",
439
+ "internalType": "address"
440
+ }
441
+ ]
442
+ },
443
+ {
444
+ "type": "error",
445
+ "name": "RenounceDisabled",
446
+ "inputs": []
447
+ },
448
+ {
449
+ "type": "error",
450
+ "name": "ShareAboveWhole",
451
+ "inputs": [
452
+ {
453
+ "name": "shareBps",
454
+ "type": "uint16",
455
+ "internalType": "uint16"
456
+ }
457
+ ]
458
+ },
459
+ {
460
+ "type": "error",
461
+ "name": "TreasuryRefused",
462
+ "inputs": [
463
+ {
464
+ "name": "treasury",
465
+ "type": "address",
466
+ "internalType": "address"
467
+ },
468
+ {
469
+ "name": "amount",
470
+ "type": "uint256",
471
+ "internalType": "uint256"
472
+ }
473
+ ]
474
+ },
475
+ {
476
+ "type": "error",
477
+ "name": "WrongBindFee",
478
+ "inputs": [
479
+ {
480
+ "name": "required",
481
+ "type": "uint256",
482
+ "internalType": "uint256"
483
+ },
484
+ {
485
+ "name": "provided",
486
+ "type": "uint256",
487
+ "internalType": "uint256"
488
+ }
489
+ ]
490
+ },
491
+ {
492
+ "type": "error",
493
+ "name": "ZeroAddress",
494
+ "inputs": []
495
+ }
496
+ ] as const satisfies Abi
@@ -49,6 +49,18 @@ export function bindPrivately(
49
49
  }
50
50
  }
51
51
 
52
+ export function bindWithFeeCall(
53
+ to: Address,
54
+ value: bigint,
55
+ ...args: IdentityRegistryArgs<'bindWithFeeCall'>
56
+ ): Call {
57
+ return {
58
+ to,
59
+ value,
60
+ data: encodeFunctionData({ abi: identityRegistryAbi, functionName: 'bindWithFeeCall', args }),
61
+ }
62
+ }
63
+
52
64
  export function initialize(to: Address, ...args: IdentityRegistryArgs<'initialize'>): Call {
53
65
  return {
54
66
  to,
@@ -3,6 +3,7 @@
3
3
  export * as identityRegistry from './identityRegistry.js'
4
4
  export * as handleResolver from './handleResolver.js'
5
5
  export * as handleEscrow from './handleEscrow.js'
6
+ export * as referralSplitter from './referralSplitter.js'
6
7
  export * as notaryService from './notaryService.js'
7
8
  export * as ceremonyProofVerifier from './ceremonyProofVerifier.js'
8
9
  export * as googleJwtRoots from './googleJwtRoots.js'
@@ -0,0 +1,73 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/ReferralSplitter.sol/ReferralSplitter.json
3
+
4
+ import {
5
+ type Address,
6
+ type ContractFunctionArgs,
7
+ type ContractFunctionName,
8
+ encodeFunctionData,
9
+ } from 'viem'
10
+
11
+ import type { Call } from '../call.js'
12
+ import { referralSplitterAbi } from '../abis/referralSplitter.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type ReferralSplitterFn = ContractFunctionName<typeof referralSplitterAbi, Mutability>
16
+ type ReferralSplitterArgs<F extends ReferralSplitterFn> = ContractFunctionArgs<
17
+ typeof referralSplitterAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(
23
+ to: Address,
24
+ ...args: ReferralSplitterArgs<'acceptOwnership'>
25
+ ): Call {
26
+ return {
27
+ to,
28
+ data: encodeFunctionData({ abi: referralSplitterAbi, functionName: 'acceptOwnership', args }),
29
+ }
30
+ }
31
+
32
+ export function onBindFee(
33
+ to: Address,
34
+ value: bigint,
35
+ ...args: ReferralSplitterArgs<'onBindFee'>
36
+ ): Call {
37
+ return {
38
+ to,
39
+ value,
40
+ data: encodeFunctionData({ abi: referralSplitterAbi, functionName: 'onBindFee', args }),
41
+ }
42
+ }
43
+
44
+ export function setFee(to: Address, ...args: ReferralSplitterArgs<'setFee'>): Call {
45
+ return {
46
+ to,
47
+ data: encodeFunctionData({ abi: referralSplitterAbi, functionName: 'setFee', args }),
48
+ }
49
+ }
50
+
51
+ export function setShare(to: Address, ...args: ReferralSplitterArgs<'setShare'>): Call {
52
+ return {
53
+ to,
54
+ data: encodeFunctionData({ abi: referralSplitterAbi, functionName: 'setShare', args }),
55
+ }
56
+ }
57
+
58
+ export function setTreasury(to: Address, ...args: ReferralSplitterArgs<'setTreasury'>): Call {
59
+ return {
60
+ to,
61
+ data: encodeFunctionData({ abi: referralSplitterAbi, functionName: 'setTreasury', args }),
62
+ }
63
+ }
64
+
65
+ export function transferOwnership(
66
+ to: Address,
67
+ ...args: ReferralSplitterArgs<'transferOwnership'>
68
+ ): Call {
69
+ return {
70
+ to,
71
+ data: encodeFunctionData({ abi: referralSplitterAbi, functionName: 'transferOwnership', args }),
72
+ }
73
+ }