@libid/contracts 0.6.0 → 0.8.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 (180) 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/ceremony/index.d.ts +2 -0
  63. package/dist/ceremony/index.d.ts.map +1 -0
  64. package/dist/ceremony/index.js +13 -0
  65. package/dist/ceremony/index.js.map +1 -0
  66. package/dist/ceremony/profiles.d.ts +82 -0
  67. package/dist/ceremony/profiles.d.ts.map +1 -0
  68. package/dist/ceremony/profiles.js +86 -0
  69. package/dist/ceremony/profiles.js.map +1 -0
  70. package/dist/identity/handleVectors.d.ts +3 -3
  71. package/dist/identity/handleVectors.d.ts.map +1 -1
  72. package/dist/identity/handleVectors.js +3 -3
  73. package/dist/identity/handleVectors.js.map +1 -1
  74. package/dist/identity/index.d.ts +0 -1
  75. package/dist/identity/index.d.ts.map +1 -1
  76. package/dist/identity/index.js +7 -6
  77. package/dist/identity/index.js.map +1 -1
  78. package/dist/identity/resolve.js +4 -4
  79. package/dist/identity/resolve.js.map +1 -1
  80. package/dist/index.d.ts +3 -0
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +6 -3
  83. package/dist/index.js.map +1 -1
  84. package/package.json +12 -7
  85. package/src/abis/{googleIdentityVerifier.ts → ceremonyProofVerifier.ts} +181 -155
  86. package/src/abis/{identityJwksRoots.ts → googleJwtRoots.ts} +344 -252
  87. package/src/abis/{walletFactory.ts → handleResolver.ts} +218 -169
  88. package/src/abis/identityNames.ts +210 -266
  89. package/src/abis/index.ts +4 -16
  90. package/src/abis/{xZkVerifier.ts → notaryService.ts} +296 -336
  91. package/src/call.ts +15 -0
  92. package/src/calls/ceremonyProofVerifier.ts +90 -0
  93. package/src/calls/googleJwtRoots.ts +74 -0
  94. package/src/calls/handleResolver.ts +51 -0
  95. package/src/calls/identityNames.ts +88 -0
  96. package/src/calls/index.ts +9 -0
  97. package/src/calls/libidFactory.ts +63 -0
  98. package/src/calls/notaryService.ts +85 -0
  99. package/src/calls/wtia9.ts +52 -0
  100. package/src/ceremony/index.ts +13 -0
  101. package/src/ceremony/profiles.ts +151 -0
  102. package/src/identity/handleVectors.ts +3 -3
  103. package/src/identity/index.ts +7 -6
  104. package/src/identity/resolve.ts +4 -4
  105. package/src/index.ts +7 -3
  106. package/dist/abis/adminFacet.d.ts +0 -339
  107. package/dist/abis/adminFacet.d.ts.map +0 -1
  108. package/dist/abis/adminFacet.js +0 -442
  109. package/dist/abis/adminFacet.js.map +0 -1
  110. package/dist/abis/bank.d.ts +0 -916
  111. package/dist/abis/bank.d.ts.map +0 -1
  112. package/dist/abis/bank.js +0 -1184
  113. package/dist/abis/bank.js.map +0 -1
  114. package/dist/abis/diamondLoupeFacet.d.ts +0 -73
  115. package/dist/abis/diamondLoupeFacet.d.ts.map +0 -1
  116. package/dist/abis/diamondLoupeFacet.js +0 -100
  117. package/dist/abis/diamondLoupeFacet.js.map +0 -1
  118. package/dist/abis/gitHubIdentityVerifier.d.ts +0 -409
  119. package/dist/abis/gitHubIdentityVerifier.d.ts.map +0 -1
  120. package/dist/abis/gitHubIdentityVerifier.js +0 -531
  121. package/dist/abis/gitHubIdentityVerifier.js.map +0 -1
  122. package/dist/abis/googleIdentityVerifier.js.map +0 -1
  123. package/dist/abis/googleOidcVerifier.d.ts +0 -838
  124. package/dist/abis/googleOidcVerifier.d.ts.map +0 -1
  125. package/dist/abis/googleOidcVerifier.js +0 -1082
  126. package/dist/abis/googleOidcVerifier.js.map +0 -1
  127. package/dist/abis/identityJwksRoots.d.ts.map +0 -1
  128. package/dist/abis/identityJwksRoots.js.map +0 -1
  129. package/dist/abis/mockErc20.d.ts +0 -262
  130. package/dist/abis/mockErc20.d.ts.map +0 -1
  131. package/dist/abis/mockErc20.js +0 -347
  132. package/dist/abis/mockErc20.js.map +0 -1
  133. package/dist/abis/notary.d.ts +0 -263
  134. package/dist/abis/notary.d.ts.map +0 -1
  135. package/dist/abis/notary.js +0 -343
  136. package/dist/abis/notary.js.map +0 -1
  137. package/dist/abis/registry.d.ts +0 -1170
  138. package/dist/abis/registry.d.ts.map +0 -1
  139. package/dist/abis/registry.js +0 -1511
  140. package/dist/abis/registry.js.map +0 -1
  141. package/dist/abis/transferFacet.d.ts +0 -814
  142. package/dist/abis/transferFacet.d.ts.map +0 -1
  143. package/dist/abis/transferFacet.js +0 -1035
  144. package/dist/abis/transferFacet.js.map +0 -1
  145. package/dist/abis/vaultFacet.d.ts +0 -306
  146. package/dist/abis/vaultFacet.d.ts.map +0 -1
  147. package/dist/abis/vaultFacet.js +0 -398
  148. package/dist/abis/vaultFacet.js.map +0 -1
  149. package/dist/abis/walletFactory.d.ts.map +0 -1
  150. package/dist/abis/walletFactory.js.map +0 -1
  151. package/dist/abis/webWallet.d.ts +0 -523
  152. package/dist/abis/webWallet.js +0 -680
  153. package/dist/abis/webWallet.js.map +0 -1
  154. package/dist/abis/xIdentityVerifier.d.ts +0 -473
  155. package/dist/abis/xIdentityVerifier.d.ts.map +0 -1
  156. package/dist/abis/xIdentityVerifier.js +0 -612
  157. package/dist/abis/xIdentityVerifier.js.map +0 -1
  158. package/dist/abis/xZkVerifier.js.map +0 -1
  159. package/dist/identity/bind.d.ts +0 -59
  160. package/dist/identity/bind.d.ts.map +0 -1
  161. package/dist/identity/bind.fixtures.d.ts +0 -8
  162. package/dist/identity/bind.fixtures.d.ts.map +0 -1
  163. package/dist/identity/bind.fixtures.js +0 -55
  164. package/dist/identity/bind.fixtures.js.map +0 -1
  165. package/dist/identity/bind.js +0 -148
  166. package/dist/identity/bind.js.map +0 -1
  167. package/src/abis/adminFacet.ts +0 -444
  168. package/src/abis/bank.ts +0 -1186
  169. package/src/abis/diamondLoupeFacet.ts +0 -102
  170. package/src/abis/gitHubIdentityVerifier.ts +0 -533
  171. package/src/abis/googleOidcVerifier.ts +0 -1084
  172. package/src/abis/mockErc20.ts +0 -349
  173. package/src/abis/notary.ts +0 -345
  174. package/src/abis/registry.ts +0 -1513
  175. package/src/abis/transferFacet.ts +0 -1037
  176. package/src/abis/vaultFacet.ts +0 -400
  177. package/src/abis/webWallet.ts +0 -682
  178. package/src/abis/xIdentityVerifier.ts +0 -614
  179. package/src/identity/bind.fixtures.ts +0 -63
  180. 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
+ }
@@ -0,0 +1,13 @@
1
+ /// The ceremony profiles, TypeScript half.
2
+ ///
3
+ /// What each platform's notarized sessions request, which host answers them,
4
+ /// and which bytes of the response a Platform Verifier reads. Generated from
5
+ /// `solidity/contracts/ceremony/profiles.json`, the same file `CeremonyProfile
6
+ /// .sol` and the Rust table come from, so the browser and the chain cannot
7
+ /// hold different copies.
8
+ ///
9
+ /// The platform id is `keccak256` of `Profile.platform` and the authority id
10
+ /// is `keccak256` of `Session.authority`. Neither is computed here: a caller
11
+ /// that needs one already has a hasher, and this layer stays dependency-free.
12
+
13
+ export * from './profiles.js'
@@ -0,0 +1,151 @@
1
+ // Generated by scripts/regen-ceremony-profiles.py. Do not edit.
2
+ // The source of truth is solidity/contracts/ceremony/profiles.json.
3
+
4
+ /**
5
+ * The single source of truth for the ceremony profiles. Solidity, Rust and
6
+ * TypeScript constants are generated from this file by
7
+ * scripts/regen-ceremony-profiles.py. The Platform Verifiers are hand
8
+ * written and READ these constants; only the values live here.
9
+ *
10
+ * THESE STRINGS ARE OURS, NOT THE SPECIFICATION'S. ceremony-common fixes no
11
+ * literal of its own: platform-ceremonies REQ-PLAT-01 fixes the profile
12
+ * NAMES, and every byte below is the profile author's choice. So this is a
13
+ * cross-implementation agreement, and it is agreed here rather than four
14
+ * times over.
15
+ *
16
+ * Four components must produce the same bytes: this repository's verifiers,
17
+ * the browser that notarizes three of the four sessions, the deployment that
18
+ * notarizes the fourth, and the notary that signs what they observed. A
19
+ * disagreement is silent -- a Consumer dispatching on one string and a
20
+ * verifier registered under another simply never meet, and a request line a
21
+ * prover composes one byte differently is an attestation rejected with no
22
+ * error that says why.
23
+ *
24
+ * Changing a value here changes what a deployed verifier accepts. That is a
25
+ * new ceremonyVersion, not an edit: --check compares every shipped profile
26
+ * against the last release and refuses a changed profile that kept its
27
+ * version.
28
+ */
29
+
30
+ /** Which shape a platform's immutable identifier takes in its response. */
31
+ export type IdShape = 'jsonString' | 'jsonInteger'
32
+
33
+ export interface Session {
34
+ /** The lowercase TLS server name the notary authenticates. */
35
+ readonly authority: string
36
+ readonly method: string
37
+ readonly path: string
38
+ /** The request-line prefix the verifier compares byte for byte. */
39
+ readonly requestLine: string
40
+ }
41
+
42
+ export interface TokenSession {
43
+ readonly session: Session
44
+ /** The body field committed rather than revealed, or null. */
45
+ readonly secretField: string | null
46
+ }
47
+
48
+ export interface IdentitySession {
49
+ readonly session: Session
50
+ readonly idField: string
51
+ readonly idShape: IdShape
52
+ readonly handleField: string
53
+ }
54
+
55
+ export interface Profile {
56
+ /** The platform name. The platform id is its keccak256. */
57
+ readonly platform: string
58
+ readonly ceremonyVersion: number
59
+ readonly token: TokenSession | null
60
+ readonly identity: IdentitySession | null
61
+ }
62
+
63
+ /**
64
+ * Google's evidence is a signed token checked against Google's published
65
+ * keys, so the profile notarizes nothing: no session, no attestation,
66
+ * and no Notary Fee.
67
+ */
68
+ export const GOOGLE: Profile = {
69
+ platform: 'google',
70
+ ceremonyVersion: 1,
71
+ token: null,
72
+ identity: null,
73
+ }
74
+
75
+ /**
76
+ * A public client with S256 PKCE and two browser-owned sessions, both
77
+ * served by the same host.
78
+ */
79
+ export const X: Profile = {
80
+ platform: 'x',
81
+ ceremonyVersion: 1,
82
+ token: {
83
+ session: {
84
+ authority: 'api.x.com',
85
+ method: 'POST',
86
+ path: '/2/oauth2/token',
87
+ requestLine: 'POST /2/oauth2/token ',
88
+ },
89
+ secretField: null,
90
+ },
91
+ identity: {
92
+ session: {
93
+ authority: 'api.x.com',
94
+ method: 'GET',
95
+ path: '/2/users/me',
96
+ requestLine: 'GET /2/users/me ',
97
+ },
98
+ idField: 'id',
99
+ idShape: 'jsonString',
100
+ handleField: 'username',
101
+ },
102
+ }
103
+
104
+ /**
105
+ * A confidential client. The exchange runs in the deployment because the
106
+ * secret cannot reach the browser, and the two sessions are served by
107
+ * DIFFERENT hosts -- which is why one pinned authority per profile would
108
+ * be wrong.
109
+ */
110
+ export const GITHUB: Profile = {
111
+ platform: 'github',
112
+ ceremonyVersion: 1,
113
+ token: {
114
+ session: {
115
+ authority: 'github.com',
116
+ method: 'POST',
117
+ path: '/login/oauth/access_token',
118
+ requestLine: 'POST /login/oauth/access_token ',
119
+ },
120
+ secretField: 'client_secret',
121
+ },
122
+ identity: {
123
+ session: {
124
+ authority: 'api.github.com',
125
+ method: 'GET',
126
+ path: '/user',
127
+ requestLine: 'GET /user ',
128
+ },
129
+ idField: 'id',
130
+ idShape: 'jsonInteger',
131
+ handleField: 'login',
132
+ },
133
+ }
134
+
135
+ /** The closed launch list. */
136
+ export const LAUNCH: readonly Profile[] = [GOOGLE, X, GITHUB]
137
+
138
+ /** The launch profile for a platform name, or undefined. */
139
+ export function launch(platform: string): Profile | undefined {
140
+ return LAUNCH.find((p) => p.platform === platform)
141
+ }
142
+
143
+ /** How many attestations a submission for this profile carries. */
144
+ export function attestationCount(profile: Profile): number {
145
+ return (profile.token ? 1 : 0) + (profile.identity ? 1 : 0)
146
+ }
147
+
148
+ /** Governance-owned launch parameters, in seconds. */
149
+ export const MAX_FUTURE_ATTESTATION_SKEW_SECONDS = 300
150
+ export const PROOF_LIFETIME_SECONDS_X = 3600
151
+ export const PROOF_LIFETIME_SECONDS_GITHUB = 3600