@libid/contracts 0.6.0 → 0.7.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 (170) hide show
  1. package/README.md +65 -26
  2. package/dist/abis/{googleIdentityVerifier.d.ts → ceremonyProofVerifier.d.ts} +146 -128
  3. package/dist/abis/{googleIdentityVerifier.d.ts.map → ceremonyProofVerifier.d.ts.map} +1 -1
  4. package/dist/abis/{googleIdentityVerifier.js → ceremonyProofVerifier.js} +182 -156
  5. package/dist/abis/ceremonyProofVerifier.js.map +1 -0
  6. package/dist/abis/{identityJwksRoots.d.ts → googleJwtRoots.d.ts} +273 -211
  7. package/dist/abis/{xZkVerifier.d.ts.map → googleJwtRoots.d.ts.map} +1 -1
  8. package/dist/abis/{identityJwksRoots.js → googleJwtRoots.js} +345 -253
  9. package/dist/abis/googleJwtRoots.js.map +1 -0
  10. package/dist/abis/{walletFactory.d.ts → handleResolver.d.ts} +185 -151
  11. package/dist/abis/handleResolver.d.ts.map +1 -0
  12. package/dist/abis/{walletFactory.js → handleResolver.js} +219 -170
  13. package/dist/abis/handleResolver.js.map +1 -0
  14. package/dist/abis/identityNames.d.ts +173 -219
  15. package/dist/abis/identityNames.d.ts.map +1 -1
  16. package/dist/abis/identityNames.js +210 -266
  17. package/dist/abis/identityNames.js.map +1 -1
  18. package/dist/abis/index.d.ts +4 -16
  19. package/dist/abis/index.d.ts.map +1 -1
  20. package/dist/abis/index.js +4 -16
  21. package/dist/abis/index.js.map +1 -1
  22. package/dist/abis/{xZkVerifier.d.ts → notaryService.d.ts} +237 -273
  23. package/dist/abis/{webWallet.d.ts.map → notaryService.d.ts.map} +1 -1
  24. package/dist/abis/{xZkVerifier.js → notaryService.js} +297 -337
  25. package/dist/abis/notaryService.js.map +1 -0
  26. package/dist/call.d.ts +7 -0
  27. package/dist/call.d.ts.map +1 -0
  28. package/dist/call.js +2 -0
  29. package/dist/call.js.map +1 -0
  30. package/dist/calls/ceremonyProofVerifier.d.ts +14 -0
  31. package/dist/calls/ceremonyProofVerifier.d.ts.map +1 -0
  32. package/dist/calls/ceremonyProofVerifier.js +55 -0
  33. package/dist/calls/ceremonyProofVerifier.js.map +1 -0
  34. package/dist/calls/googleJwtRoots.d.ts +14 -0
  35. package/dist/calls/googleJwtRoots.d.ts.map +1 -0
  36. package/dist/calls/googleJwtRoots.js +43 -0
  37. package/dist/calls/googleJwtRoots.js.map +1 -0
  38. package/dist/calls/handleResolver.d.ts +12 -0
  39. package/dist/calls/handleResolver.d.ts.map +1 -0
  40. package/dist/calls/handleResolver.js +29 -0
  41. package/dist/calls/handleResolver.js.map +1 -0
  42. package/dist/calls/identityNames.d.ts +16 -0
  43. package/dist/calls/identityNames.d.ts.map +1 -0
  44. package/dist/calls/identityNames.js +55 -0
  45. package/dist/calls/identityNames.js.map +1 -0
  46. package/dist/calls/index.d.ts +8 -0
  47. package/dist/calls/index.d.ts.map +1 -0
  48. package/dist/calls/index.js +10 -0
  49. package/dist/calls/index.js.map +1 -0
  50. package/dist/calls/libidFactory.d.ts +13 -0
  51. package/dist/calls/libidFactory.d.ts.map +1 -0
  52. package/dist/calls/libidFactory.js +36 -0
  53. package/dist/calls/libidFactory.js.map +1 -0
  54. package/dist/calls/notaryService.d.ts +16 -0
  55. package/dist/calls/notaryService.d.ts.map +1 -0
  56. package/dist/calls/notaryService.js +55 -0
  57. package/dist/calls/notaryService.js.map +1 -0
  58. package/dist/calls/wtia9.d.ts +13 -0
  59. package/dist/calls/wtia9.d.ts.map +1 -0
  60. package/dist/calls/wtia9.js +36 -0
  61. package/dist/calls/wtia9.js.map +1 -0
  62. package/dist/identity/handleVectors.d.ts +3 -3
  63. package/dist/identity/handleVectors.d.ts.map +1 -1
  64. package/dist/identity/handleVectors.js +3 -3
  65. package/dist/identity/handleVectors.js.map +1 -1
  66. package/dist/identity/index.d.ts +0 -1
  67. package/dist/identity/index.d.ts.map +1 -1
  68. package/dist/identity/index.js +7 -6
  69. package/dist/identity/index.js.map +1 -1
  70. package/dist/identity/resolve.js +4 -4
  71. package/dist/identity/resolve.js.map +1 -1
  72. package/dist/index.d.ts +2 -0
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +5 -3
  75. package/dist/index.js.map +1 -1
  76. package/package.json +8 -7
  77. package/src/abis/{googleIdentityVerifier.ts → ceremonyProofVerifier.ts} +181 -155
  78. package/src/abis/{identityJwksRoots.ts → googleJwtRoots.ts} +344 -252
  79. package/src/abis/{walletFactory.ts → handleResolver.ts} +218 -169
  80. package/src/abis/identityNames.ts +210 -266
  81. package/src/abis/index.ts +4 -16
  82. package/src/abis/{xZkVerifier.ts → notaryService.ts} +296 -336
  83. package/src/call.ts +15 -0
  84. package/src/calls/ceremonyProofVerifier.ts +90 -0
  85. package/src/calls/googleJwtRoots.ts +74 -0
  86. package/src/calls/handleResolver.ts +51 -0
  87. package/src/calls/identityNames.ts +88 -0
  88. package/src/calls/index.ts +9 -0
  89. package/src/calls/libidFactory.ts +63 -0
  90. package/src/calls/notaryService.ts +85 -0
  91. package/src/calls/wtia9.ts +52 -0
  92. package/src/identity/handleVectors.ts +3 -3
  93. package/src/identity/index.ts +7 -6
  94. package/src/identity/resolve.ts +4 -4
  95. package/src/index.ts +6 -3
  96. package/dist/abis/adminFacet.d.ts +0 -339
  97. package/dist/abis/adminFacet.d.ts.map +0 -1
  98. package/dist/abis/adminFacet.js +0 -442
  99. package/dist/abis/adminFacet.js.map +0 -1
  100. package/dist/abis/bank.d.ts +0 -916
  101. package/dist/abis/bank.d.ts.map +0 -1
  102. package/dist/abis/bank.js +0 -1184
  103. package/dist/abis/bank.js.map +0 -1
  104. package/dist/abis/diamondLoupeFacet.d.ts +0 -73
  105. package/dist/abis/diamondLoupeFacet.d.ts.map +0 -1
  106. package/dist/abis/diamondLoupeFacet.js +0 -100
  107. package/dist/abis/diamondLoupeFacet.js.map +0 -1
  108. package/dist/abis/gitHubIdentityVerifier.d.ts +0 -409
  109. package/dist/abis/gitHubIdentityVerifier.d.ts.map +0 -1
  110. package/dist/abis/gitHubIdentityVerifier.js +0 -531
  111. package/dist/abis/gitHubIdentityVerifier.js.map +0 -1
  112. package/dist/abis/googleIdentityVerifier.js.map +0 -1
  113. package/dist/abis/googleOidcVerifier.d.ts +0 -838
  114. package/dist/abis/googleOidcVerifier.d.ts.map +0 -1
  115. package/dist/abis/googleOidcVerifier.js +0 -1082
  116. package/dist/abis/googleOidcVerifier.js.map +0 -1
  117. package/dist/abis/identityJwksRoots.d.ts.map +0 -1
  118. package/dist/abis/identityJwksRoots.js.map +0 -1
  119. package/dist/abis/mockErc20.d.ts +0 -262
  120. package/dist/abis/mockErc20.d.ts.map +0 -1
  121. package/dist/abis/mockErc20.js +0 -347
  122. package/dist/abis/mockErc20.js.map +0 -1
  123. package/dist/abis/notary.d.ts +0 -263
  124. package/dist/abis/notary.d.ts.map +0 -1
  125. package/dist/abis/notary.js +0 -343
  126. package/dist/abis/notary.js.map +0 -1
  127. package/dist/abis/registry.d.ts +0 -1170
  128. package/dist/abis/registry.d.ts.map +0 -1
  129. package/dist/abis/registry.js +0 -1511
  130. package/dist/abis/registry.js.map +0 -1
  131. package/dist/abis/transferFacet.d.ts +0 -814
  132. package/dist/abis/transferFacet.d.ts.map +0 -1
  133. package/dist/abis/transferFacet.js +0 -1035
  134. package/dist/abis/transferFacet.js.map +0 -1
  135. package/dist/abis/vaultFacet.d.ts +0 -306
  136. package/dist/abis/vaultFacet.d.ts.map +0 -1
  137. package/dist/abis/vaultFacet.js +0 -398
  138. package/dist/abis/vaultFacet.js.map +0 -1
  139. package/dist/abis/walletFactory.d.ts.map +0 -1
  140. package/dist/abis/walletFactory.js.map +0 -1
  141. package/dist/abis/webWallet.d.ts +0 -523
  142. package/dist/abis/webWallet.js +0 -680
  143. package/dist/abis/webWallet.js.map +0 -1
  144. package/dist/abis/xIdentityVerifier.d.ts +0 -473
  145. package/dist/abis/xIdentityVerifier.d.ts.map +0 -1
  146. package/dist/abis/xIdentityVerifier.js +0 -612
  147. package/dist/abis/xIdentityVerifier.js.map +0 -1
  148. package/dist/abis/xZkVerifier.js.map +0 -1
  149. package/dist/identity/bind.d.ts +0 -59
  150. package/dist/identity/bind.d.ts.map +0 -1
  151. package/dist/identity/bind.fixtures.d.ts +0 -8
  152. package/dist/identity/bind.fixtures.d.ts.map +0 -1
  153. package/dist/identity/bind.fixtures.js +0 -55
  154. package/dist/identity/bind.fixtures.js.map +0 -1
  155. package/dist/identity/bind.js +0 -148
  156. package/dist/identity/bind.js.map +0 -1
  157. package/src/abis/adminFacet.ts +0 -444
  158. package/src/abis/bank.ts +0 -1186
  159. package/src/abis/diamondLoupeFacet.ts +0 -102
  160. package/src/abis/gitHubIdentityVerifier.ts +0 -533
  161. package/src/abis/googleOidcVerifier.ts +0 -1084
  162. package/src/abis/mockErc20.ts +0 -349
  163. package/src/abis/notary.ts +0 -345
  164. package/src/abis/registry.ts +0 -1513
  165. package/src/abis/transferFacet.ts +0 -1037
  166. package/src/abis/vaultFacet.ts +0 -400
  167. package/src/abis/webWallet.ts +0 -682
  168. package/src/abis/xIdentityVerifier.ts +0 -614
  169. package/src/identity/bind.fixtures.ts +0 -63
  170. package/src/identity/bind.ts +0 -243
package/src/call.ts ADDED
@@ -0,0 +1,15 @@
1
+ // SPDX-License-Identifier: MIT
2
+ /// One contract call, as data rather than as an action.
3
+ ///
4
+ /// The builders in `./calls` return this instead of sending anything: they
5
+ /// take no provider and no signer, so the caller decides how it is submitted —
6
+ /// directly, batched, or through a smart account's `execute`.
7
+ import type { Address, Hex } from 'viem'
8
+
9
+ export interface Call {
10
+ to: Address
11
+ /// ABI-encoded selector and arguments.
12
+ data: Hex
13
+ /// Set only by builders for payable functions.
14
+ value?: bigint
15
+ }
@@ -0,0 +1,90 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/CeremonyProofVerifier.sol/CeremonyProofVerifier.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 { ceremonyProofVerifierAbi } from '../abis/ceremonyProofVerifier.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type CeremonyProofVerifierFn = ContractFunctionName<typeof ceremonyProofVerifierAbi, Mutability>
16
+ type CeremonyProofVerifierArgs<F extends CeremonyProofVerifierFn> = ContractFunctionArgs<
17
+ typeof ceremonyProofVerifierAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(
23
+ to: Address,
24
+ ...args: CeremonyProofVerifierArgs<'acceptOwnership'>
25
+ ): Call {
26
+ return {
27
+ to,
28
+ data: encodeFunctionData({
29
+ abi: ceremonyProofVerifierAbi,
30
+ functionName: 'acceptOwnership',
31
+ args,
32
+ }),
33
+ }
34
+ }
35
+
36
+ export function initialize(to: Address, ...args: CeremonyProofVerifierArgs<'initialize'>): Call {
37
+ return {
38
+ to,
39
+ data: encodeFunctionData({ abi: ceremonyProofVerifierAbi, functionName: 'initialize', args }),
40
+ }
41
+ }
42
+
43
+ export function setVerifier(to: Address, ...args: CeremonyProofVerifierArgs<'setVerifier'>): Call {
44
+ return {
45
+ to,
46
+ data: encodeFunctionData({ abi: ceremonyProofVerifierAbi, functionName: 'setVerifier', args }),
47
+ }
48
+ }
49
+
50
+ export function transferOwnership(
51
+ to: Address,
52
+ ...args: CeremonyProofVerifierArgs<'transferOwnership'>
53
+ ): Call {
54
+ return {
55
+ to,
56
+ data: encodeFunctionData({
57
+ abi: ceremonyProofVerifierAbi,
58
+ functionName: 'transferOwnership',
59
+ args,
60
+ }),
61
+ }
62
+ }
63
+
64
+ export function upgradeToAndCall(
65
+ to: Address,
66
+ value: bigint,
67
+ ...args: CeremonyProofVerifierArgs<'upgradeToAndCall'>
68
+ ): Call {
69
+ return {
70
+ to,
71
+ value,
72
+ data: encodeFunctionData({
73
+ abi: ceremonyProofVerifierAbi,
74
+ functionName: 'upgradeToAndCall',
75
+ args,
76
+ }),
77
+ }
78
+ }
79
+
80
+ export function verify(
81
+ to: Address,
82
+ value: bigint,
83
+ ...args: CeremonyProofVerifierArgs<'verify'>
84
+ ): Call {
85
+ return {
86
+ to,
87
+ value,
88
+ data: encodeFunctionData({ abi: ceremonyProofVerifierAbi, functionName: 'verify', args }),
89
+ }
90
+ }
@@ -0,0 +1,74 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/GoogleJwtRoots.sol/GoogleJwtRoots.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 { googleJwtRootsAbi } from '../abis/googleJwtRoots.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type GoogleJwtRootsFn = ContractFunctionName<typeof googleJwtRootsAbi, Mutability>
16
+ type GoogleJwtRootsArgs<F extends GoogleJwtRootsFn> = ContractFunctionArgs<
17
+ typeof googleJwtRootsAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(to: Address, ...args: GoogleJwtRootsArgs<'acceptOwnership'>): Call {
23
+ return {
24
+ to,
25
+ data: encodeFunctionData({ abi: googleJwtRootsAbi, functionName: 'acceptOwnership', args }),
26
+ }
27
+ }
28
+
29
+ export function initialize(to: Address, ...args: GoogleJwtRootsArgs<'initialize'>): Call {
30
+ return {
31
+ to,
32
+ data: encodeFunctionData({ abi: googleJwtRootsAbi, functionName: 'initialize', args }),
33
+ }
34
+ }
35
+
36
+ export function rotate(to: Address, value: bigint, ...args: GoogleJwtRootsArgs<'rotate'>): Call {
37
+ return {
38
+ to,
39
+ value,
40
+ data: encodeFunctionData({ abi: googleJwtRootsAbi, functionName: 'rotate', args }),
41
+ }
42
+ }
43
+
44
+ export function setNotaryService(
45
+ to: Address,
46
+ ...args: GoogleJwtRootsArgs<'setNotaryService'>
47
+ ): Call {
48
+ return {
49
+ to,
50
+ data: encodeFunctionData({ abi: googleJwtRootsAbi, functionName: 'setNotaryService', args }),
51
+ }
52
+ }
53
+
54
+ export function transferOwnership(
55
+ to: Address,
56
+ ...args: GoogleJwtRootsArgs<'transferOwnership'>
57
+ ): Call {
58
+ return {
59
+ to,
60
+ data: encodeFunctionData({ abi: googleJwtRootsAbi, functionName: 'transferOwnership', args }),
61
+ }
62
+ }
63
+
64
+ export function upgradeToAndCall(
65
+ to: Address,
66
+ value: bigint,
67
+ ...args: GoogleJwtRootsArgs<'upgradeToAndCall'>
68
+ ): Call {
69
+ return {
70
+ to,
71
+ value,
72
+ data: encodeFunctionData({ abi: googleJwtRootsAbi, functionName: 'upgradeToAndCall', args }),
73
+ }
74
+ }
@@ -0,0 +1,51 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/HandleResolver.sol/HandleResolver.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 { handleResolverAbi } from '../abis/handleResolver.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type HandleResolverFn = ContractFunctionName<typeof handleResolverAbi, Mutability>
16
+ type HandleResolverArgs<F extends HandleResolverFn> = ContractFunctionArgs<
17
+ typeof handleResolverAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(to: Address, ...args: HandleResolverArgs<'acceptOwnership'>): Call {
23
+ return {
24
+ to,
25
+ data: encodeFunctionData({ abi: handleResolverAbi, functionName: 'acceptOwnership', args }),
26
+ }
27
+ }
28
+
29
+ export function setSigner(to: Address, ...args: HandleResolverArgs<'setSigner'>): Call {
30
+ return {
31
+ to,
32
+ data: encodeFunctionData({ abi: handleResolverAbi, functionName: 'setSigner', args }),
33
+ }
34
+ }
35
+
36
+ export function setUrls(to: Address, ...args: HandleResolverArgs<'setUrls'>): Call {
37
+ return {
38
+ to,
39
+ data: encodeFunctionData({ abi: handleResolverAbi, functionName: 'setUrls', args }),
40
+ }
41
+ }
42
+
43
+ export function transferOwnership(
44
+ to: Address,
45
+ ...args: HandleResolverArgs<'transferOwnership'>
46
+ ): Call {
47
+ return {
48
+ to,
49
+ data: encodeFunctionData({ abi: handleResolverAbi, functionName: 'transferOwnership', args }),
50
+ }
51
+ }
@@ -0,0 +1,88 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/IdentityNames.sol/IdentityNames.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 { identityNamesAbi } from '../abis/identityNames.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type IdentityNamesFn = ContractFunctionName<typeof identityNamesAbi, Mutability>
16
+ type IdentityNamesArgs<F extends IdentityNamesFn> = ContractFunctionArgs<
17
+ typeof identityNamesAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(to: Address, ...args: IdentityNamesArgs<'acceptOwnership'>): Call {
23
+ return {
24
+ to,
25
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'acceptOwnership', args }),
26
+ }
27
+ }
28
+
29
+ export function claim(to: Address, value: bigint, ...args: IdentityNamesArgs<'claim'>): Call {
30
+ return {
31
+ to,
32
+ value,
33
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'claim', args }),
34
+ }
35
+ }
36
+
37
+ export function initialize(to: Address, ...args: IdentityNamesArgs<'initialize'>): Call {
38
+ return {
39
+ to,
40
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'initialize', args }),
41
+ }
42
+ }
43
+
44
+ export function setPlatform(to: Address, ...args: IdentityNamesArgs<'setPlatform'>): Call {
45
+ return {
46
+ to,
47
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'setPlatform', args }),
48
+ }
49
+ }
50
+
51
+ export function setProofVerifier(
52
+ to: Address,
53
+ ...args: IdentityNamesArgs<'setProofVerifier'>
54
+ ): Call {
55
+ return {
56
+ to,
57
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'setProofVerifier', args }),
58
+ }
59
+ }
60
+
61
+ export function transferOwnership(
62
+ to: Address,
63
+ ...args: IdentityNamesArgs<'transferOwnership'>
64
+ ): Call {
65
+ return {
66
+ to,
67
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'transferOwnership', args }),
68
+ }
69
+ }
70
+
71
+ export function unpublish(to: Address, ...args: IdentityNamesArgs<'unpublish'>): Call {
72
+ return {
73
+ to,
74
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'unpublish', args }),
75
+ }
76
+ }
77
+
78
+ export function upgradeToAndCall(
79
+ to: Address,
80
+ value: bigint,
81
+ ...args: IdentityNamesArgs<'upgradeToAndCall'>
82
+ ): Call {
83
+ return {
84
+ to,
85
+ value,
86
+ data: encodeFunctionData({ abi: identityNamesAbi, functionName: 'upgradeToAndCall', args }),
87
+ }
88
+ }
@@ -0,0 +1,9 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/*
3
+ export * as identityNames from './identityNames.js'
4
+ export * as handleResolver from './handleResolver.js'
5
+ export * as notaryService from './notaryService.js'
6
+ export * as ceremonyProofVerifier from './ceremonyProofVerifier.js'
7
+ export * as googleJwtRoots from './googleJwtRoots.js'
8
+ export * as libidFactory from './libidFactory.js'
9
+ export * as wtia9 from './wtia9.js'
@@ -0,0 +1,63 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/LibidFactory.sol/LibidFactory.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 { libidFactoryAbi } from '../abis/libidFactory.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type LibidFactoryFn = ContractFunctionName<typeof libidFactoryAbi, Mutability>
16
+ type LibidFactoryArgs<F extends LibidFactoryFn> = ContractFunctionArgs<
17
+ typeof libidFactoryAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(to: Address, ...args: LibidFactoryArgs<'acceptOwnership'>): Call {
23
+ return {
24
+ to,
25
+ data: encodeFunctionData({ abi: libidFactoryAbi, functionName: 'acceptOwnership', args }),
26
+ }
27
+ }
28
+
29
+ export function deploy(to: Address, ...args: LibidFactoryArgs<'deploy'>): Call {
30
+ return {
31
+ to,
32
+ data: encodeFunctionData({ abi: libidFactoryAbi, functionName: 'deploy', args }),
33
+ }
34
+ }
35
+
36
+ export function initialize(to: Address, ...args: LibidFactoryArgs<'initialize'>): Call {
37
+ return {
38
+ to,
39
+ data: encodeFunctionData({ abi: libidFactoryAbi, functionName: 'initialize', args }),
40
+ }
41
+ }
42
+
43
+ export function transferOwnership(
44
+ to: Address,
45
+ ...args: LibidFactoryArgs<'transferOwnership'>
46
+ ): Call {
47
+ return {
48
+ to,
49
+ data: encodeFunctionData({ abi: libidFactoryAbi, functionName: 'transferOwnership', args }),
50
+ }
51
+ }
52
+
53
+ export function upgradeToAndCall(
54
+ to: Address,
55
+ value: bigint,
56
+ ...args: LibidFactoryArgs<'upgradeToAndCall'>
57
+ ): Call {
58
+ return {
59
+ to,
60
+ value,
61
+ data: encodeFunctionData({ abi: libidFactoryAbi, functionName: 'upgradeToAndCall', args }),
62
+ }
63
+ }
@@ -0,0 +1,85 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/NotaryService.sol/NotaryService.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 { notaryServiceAbi } from '../abis/notaryService.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type NotaryServiceFn = ContractFunctionName<typeof notaryServiceAbi, Mutability>
16
+ type NotaryServiceArgs<F extends NotaryServiceFn> = ContractFunctionArgs<
17
+ typeof notaryServiceAbi,
18
+ Mutability,
19
+ F
20
+ >
21
+
22
+ export function acceptOwnership(to: Address, ...args: NotaryServiceArgs<'acceptOwnership'>): Call {
23
+ return {
24
+ to,
25
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'acceptOwnership', args }),
26
+ }
27
+ }
28
+
29
+ export function initialize(to: Address, ...args: NotaryServiceArgs<'initialize'>): Call {
30
+ return {
31
+ to,
32
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'initialize', args }),
33
+ }
34
+ }
35
+
36
+ export function setFee(to: Address, ...args: NotaryServiceArgs<'setFee'>): Call {
37
+ return {
38
+ to,
39
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'setFee', args }),
40
+ }
41
+ }
42
+
43
+ export function setNotary(to: Address, ...args: NotaryServiceArgs<'setNotary'>): Call {
44
+ return {
45
+ to,
46
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'setNotary', args }),
47
+ }
48
+ }
49
+
50
+ export function transferOwnership(
51
+ to: Address,
52
+ ...args: NotaryServiceArgs<'transferOwnership'>
53
+ ): Call {
54
+ return {
55
+ to,
56
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'transferOwnership', args }),
57
+ }
58
+ }
59
+
60
+ export function upgradeToAndCall(
61
+ to: Address,
62
+ value: bigint,
63
+ ...args: NotaryServiceArgs<'upgradeToAndCall'>
64
+ ): Call {
65
+ return {
66
+ to,
67
+ value,
68
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'upgradeToAndCall', args }),
69
+ }
70
+ }
71
+
72
+ export function verify(to: Address, value: bigint, ...args: NotaryServiceArgs<'verify'>): Call {
73
+ return {
74
+ to,
75
+ value,
76
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'verify', args }),
77
+ }
78
+ }
79
+
80
+ export function withdraw(to: Address, ...args: NotaryServiceArgs<'withdraw'>): Call {
81
+ return {
82
+ to,
83
+ data: encodeFunctionData({ abi: notaryServiceAbi, functionName: 'withdraw', args }),
84
+ }
85
+ }
@@ -0,0 +1,52 @@
1
+ // Generated by ts/packages/contracts/scripts/codegen.mjs. Do not edit.
2
+ // Source artifact: solidity/out/WTIA9.sol/WTIA9.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 { wtia9Abi } from '../abis/wtia9.js'
13
+
14
+ type Mutability = 'nonpayable' | 'payable'
15
+ type Wtia9Fn = ContractFunctionName<typeof wtia9Abi, Mutability>
16
+ type Wtia9Args<F extends Wtia9Fn> = ContractFunctionArgs<typeof wtia9Abi, Mutability, F>
17
+
18
+ export function approve(to: Address, ...args: Wtia9Args<'approve'>): Call {
19
+ return {
20
+ to,
21
+ data: encodeFunctionData({ abi: wtia9Abi, functionName: 'approve', args }),
22
+ }
23
+ }
24
+
25
+ export function deposit(to: Address, value: bigint, ...args: Wtia9Args<'deposit'>): Call {
26
+ return {
27
+ to,
28
+ value,
29
+ data: encodeFunctionData({ abi: wtia9Abi, functionName: 'deposit', args }),
30
+ }
31
+ }
32
+
33
+ export function transfer(to: Address, ...args: Wtia9Args<'transfer'>): Call {
34
+ return {
35
+ to,
36
+ data: encodeFunctionData({ abi: wtia9Abi, functionName: 'transfer', args }),
37
+ }
38
+ }
39
+
40
+ export function transferFrom(to: Address, ...args: Wtia9Args<'transferFrom'>): Call {
41
+ return {
42
+ to,
43
+ data: encodeFunctionData({ abi: wtia9Abi, functionName: 'transferFrom', args }),
44
+ }
45
+ }
46
+
47
+ export function withdraw(to: Address, ...args: Wtia9Args<'withdraw'>): Call {
48
+ return {
49
+ to,
50
+ data: encodeFunctionData({ abi: wtia9Abi, functionName: 'withdraw', args }),
51
+ }
52
+ }
@@ -13,11 +13,11 @@ export interface HandleVector {
13
13
  }
14
14
 
15
15
  /** keccak256 of this string is the platform id. */
16
- export const PLATFORM_X_DOMAIN = 'dyaka.identity.platform.x'
16
+ export const PLATFORM_X_DOMAIN = 'x'
17
17
  /** keccak256 of this string is the platform id. */
18
- export const PLATFORM_GITHUB_DOMAIN = 'dyaka.identity.platform.github'
18
+ export const PLATFORM_GITHUB_DOMAIN = 'github'
19
19
  /** keccak256 of this string is the platform id. */
20
- export const PLATFORM_GOOGLE_DOMAIN = 'dyaka.identity.platform.google'
20
+ export const PLATFORM_GOOGLE_DOMAIN = 'google'
21
21
 
22
22
  /** Bytes a x handle may have after normalization. */
23
23
  export const MAX_LENGTH_X = 15
@@ -1,12 +1,13 @@
1
1
  /// The wallet-agnostic identity system, TypeScript half.
2
2
  ///
3
- /// Handle normalization mirrors the on-chain normalizer byte for byte, the
4
- /// bind encoders produce exactly what the verifiers decode, and the resolvers
5
- /// wrap the `IdentityNames` view calls. Everything on-chain-shaped comes from
6
- /// the generated ABIs in `../abis`, so this layer and the contracts cannot
7
- /// drift apart silently.
3
+ /// Handle normalization mirrors the on-chain normalizer byte for byte, and the
4
+ /// resolvers wrap the `IdentityNames` view calls. Everything on-chain-shaped
5
+ /// comes from the generated ABIs in `../abis`, so this layer and the contracts
6
+ /// cannot drift apart silently.
7
+ ///
8
+ /// Calldata for the writes is generated too, in `../calls` — `unpublish` had a
9
+ /// hand-written builder here until every write function got one.
8
10
 
9
- export * from './bind.js'
10
11
  export * from './handle.js'
11
12
  export * from './handleVectors.js'
12
13
  export * from './resolve.js'
@@ -1,8 +1,8 @@
1
1
  /// Reading names from the chain.
2
2
  ///
3
- /// Everything here is a view call. Binding a name needs a proof and a wallet;
4
- /// reading one needs neither, which is the point — any product can resolve a
5
- /// name without touching the login that created it.
3
+ /// Everything here is a view call. Claiming a name needs a ceremony payload and a
4
+ /// wallet; reading one needs neither, which is the point — any product can
5
+ /// resolve a name without touching the ceremony that created it.
6
6
  ///
7
7
  /// The client and the contract address are arguments rather than imports. This
8
8
  /// package ships separately from the repository it currently lives in, so it
@@ -26,7 +26,7 @@ export interface NamesReader {
26
26
 
27
27
  /// One view call.
28
28
  ///
29
- /// Routed through a narrow cast for the same reason the wallet package does it:
29
+ /// Routed through a narrow cast for one reason:
30
30
  /// viem's `PublicClient`, without its chain type parameters, types
31
31
  /// `authorizationList` as required even for a read. The alternative is to
32
32
  /// spread that noise across every call site here.
package/src/index.ts CHANGED
@@ -1,6 +1,9 @@
1
- /// @libid/contracts — typed viem-ready ABIs for every contract, plus the
2
- /// identity helper layer. Subpath imports work too: `@libid/contracts/abis`
3
- /// and `@libid/contracts/identity`.
1
+ /// @libid/contracts — typed viem-ready ABIs for every contract, a call builder
2
+ /// for every state-changing function, and the identity helper layer. Subpath
3
+ /// imports work too: `@libid/contracts/abis`, `@libid/contracts/calls` and
4
+ /// `@libid/contracts/identity`.
4
5
 
5
6
  export * from './abis/index.js'
7
+ export type { Call } from './call.js'
8
+ export * as calls from './calls/index.js'
6
9
  export * from './identity/index.js'