@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.
- package/README.md +65 -26
- package/dist/abis/{googleIdentityVerifier.d.ts → ceremonyProofVerifier.d.ts} +146 -128
- package/dist/abis/{googleIdentityVerifier.d.ts.map → ceremonyProofVerifier.d.ts.map} +1 -1
- package/dist/abis/{googleIdentityVerifier.js → ceremonyProofVerifier.js} +182 -156
- package/dist/abis/ceremonyProofVerifier.js.map +1 -0
- package/dist/abis/{identityJwksRoots.d.ts → googleJwtRoots.d.ts} +273 -211
- package/dist/abis/{xZkVerifier.d.ts.map → googleJwtRoots.d.ts.map} +1 -1
- package/dist/abis/{identityJwksRoots.js → googleJwtRoots.js} +345 -253
- package/dist/abis/googleJwtRoots.js.map +1 -0
- package/dist/abis/{walletFactory.d.ts → handleResolver.d.ts} +185 -151
- package/dist/abis/handleResolver.d.ts.map +1 -0
- package/dist/abis/{walletFactory.js → handleResolver.js} +219 -170
- package/dist/abis/handleResolver.js.map +1 -0
- package/dist/abis/identityNames.d.ts +173 -219
- package/dist/abis/identityNames.d.ts.map +1 -1
- package/dist/abis/identityNames.js +210 -266
- package/dist/abis/identityNames.js.map +1 -1
- package/dist/abis/index.d.ts +4 -16
- package/dist/abis/index.d.ts.map +1 -1
- package/dist/abis/index.js +4 -16
- package/dist/abis/index.js.map +1 -1
- package/dist/abis/{xZkVerifier.d.ts → notaryService.d.ts} +237 -273
- package/dist/abis/{webWallet.d.ts.map → notaryService.d.ts.map} +1 -1
- package/dist/abis/{xZkVerifier.js → notaryService.js} +297 -337
- package/dist/abis/notaryService.js.map +1 -0
- package/dist/call.d.ts +7 -0
- package/dist/call.d.ts.map +1 -0
- package/dist/call.js +2 -0
- package/dist/call.js.map +1 -0
- package/dist/calls/ceremonyProofVerifier.d.ts +14 -0
- package/dist/calls/ceremonyProofVerifier.d.ts.map +1 -0
- package/dist/calls/ceremonyProofVerifier.js +55 -0
- package/dist/calls/ceremonyProofVerifier.js.map +1 -0
- package/dist/calls/googleJwtRoots.d.ts +14 -0
- package/dist/calls/googleJwtRoots.d.ts.map +1 -0
- package/dist/calls/googleJwtRoots.js +43 -0
- package/dist/calls/googleJwtRoots.js.map +1 -0
- package/dist/calls/handleResolver.d.ts +12 -0
- package/dist/calls/handleResolver.d.ts.map +1 -0
- package/dist/calls/handleResolver.js +29 -0
- package/dist/calls/handleResolver.js.map +1 -0
- package/dist/calls/identityNames.d.ts +16 -0
- package/dist/calls/identityNames.d.ts.map +1 -0
- package/dist/calls/identityNames.js +55 -0
- package/dist/calls/identityNames.js.map +1 -0
- package/dist/calls/index.d.ts +8 -0
- package/dist/calls/index.d.ts.map +1 -0
- package/dist/calls/index.js +10 -0
- package/dist/calls/index.js.map +1 -0
- package/dist/calls/libidFactory.d.ts +13 -0
- package/dist/calls/libidFactory.d.ts.map +1 -0
- package/dist/calls/libidFactory.js +36 -0
- package/dist/calls/libidFactory.js.map +1 -0
- package/dist/calls/notaryService.d.ts +16 -0
- package/dist/calls/notaryService.d.ts.map +1 -0
- package/dist/calls/notaryService.js +55 -0
- package/dist/calls/notaryService.js.map +1 -0
- package/dist/calls/wtia9.d.ts +13 -0
- package/dist/calls/wtia9.d.ts.map +1 -0
- package/dist/calls/wtia9.js +36 -0
- package/dist/calls/wtia9.js.map +1 -0
- package/dist/ceremony/index.d.ts +2 -0
- package/dist/ceremony/index.d.ts.map +1 -0
- package/dist/ceremony/index.js +13 -0
- package/dist/ceremony/index.js.map +1 -0
- package/dist/ceremony/profiles.d.ts +82 -0
- package/dist/ceremony/profiles.d.ts.map +1 -0
- package/dist/ceremony/profiles.js +86 -0
- package/dist/ceremony/profiles.js.map +1 -0
- package/dist/identity/handleVectors.d.ts +3 -3
- package/dist/identity/handleVectors.d.ts.map +1 -1
- package/dist/identity/handleVectors.js +3 -3
- package/dist/identity/handleVectors.js.map +1 -1
- package/dist/identity/index.d.ts +0 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +7 -6
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/resolve.js +4 -4
- package/dist/identity/resolve.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +12 -7
- package/src/abis/{googleIdentityVerifier.ts → ceremonyProofVerifier.ts} +181 -155
- package/src/abis/{identityJwksRoots.ts → googleJwtRoots.ts} +344 -252
- package/src/abis/{walletFactory.ts → handleResolver.ts} +218 -169
- package/src/abis/identityNames.ts +210 -266
- package/src/abis/index.ts +4 -16
- package/src/abis/{xZkVerifier.ts → notaryService.ts} +296 -336
- package/src/call.ts +15 -0
- package/src/calls/ceremonyProofVerifier.ts +90 -0
- package/src/calls/googleJwtRoots.ts +74 -0
- package/src/calls/handleResolver.ts +51 -0
- package/src/calls/identityNames.ts +88 -0
- package/src/calls/index.ts +9 -0
- package/src/calls/libidFactory.ts +63 -0
- package/src/calls/notaryService.ts +85 -0
- package/src/calls/wtia9.ts +52 -0
- package/src/ceremony/index.ts +13 -0
- package/src/ceremony/profiles.ts +151 -0
- package/src/identity/handleVectors.ts +3 -3
- package/src/identity/index.ts +7 -6
- package/src/identity/resolve.ts +4 -4
- package/src/index.ts +7 -3
- package/dist/abis/adminFacet.d.ts +0 -339
- package/dist/abis/adminFacet.d.ts.map +0 -1
- package/dist/abis/adminFacet.js +0 -442
- package/dist/abis/adminFacet.js.map +0 -1
- package/dist/abis/bank.d.ts +0 -916
- package/dist/abis/bank.d.ts.map +0 -1
- package/dist/abis/bank.js +0 -1184
- package/dist/abis/bank.js.map +0 -1
- package/dist/abis/diamondLoupeFacet.d.ts +0 -73
- package/dist/abis/diamondLoupeFacet.d.ts.map +0 -1
- package/dist/abis/diamondLoupeFacet.js +0 -100
- package/dist/abis/diamondLoupeFacet.js.map +0 -1
- package/dist/abis/gitHubIdentityVerifier.d.ts +0 -409
- package/dist/abis/gitHubIdentityVerifier.d.ts.map +0 -1
- package/dist/abis/gitHubIdentityVerifier.js +0 -531
- package/dist/abis/gitHubIdentityVerifier.js.map +0 -1
- package/dist/abis/googleIdentityVerifier.js.map +0 -1
- package/dist/abis/googleOidcVerifier.d.ts +0 -838
- package/dist/abis/googleOidcVerifier.d.ts.map +0 -1
- package/dist/abis/googleOidcVerifier.js +0 -1082
- package/dist/abis/googleOidcVerifier.js.map +0 -1
- package/dist/abis/identityJwksRoots.d.ts.map +0 -1
- package/dist/abis/identityJwksRoots.js.map +0 -1
- package/dist/abis/mockErc20.d.ts +0 -262
- package/dist/abis/mockErc20.d.ts.map +0 -1
- package/dist/abis/mockErc20.js +0 -347
- package/dist/abis/mockErc20.js.map +0 -1
- package/dist/abis/notary.d.ts +0 -263
- package/dist/abis/notary.d.ts.map +0 -1
- package/dist/abis/notary.js +0 -343
- package/dist/abis/notary.js.map +0 -1
- package/dist/abis/registry.d.ts +0 -1170
- package/dist/abis/registry.d.ts.map +0 -1
- package/dist/abis/registry.js +0 -1511
- package/dist/abis/registry.js.map +0 -1
- package/dist/abis/transferFacet.d.ts +0 -814
- package/dist/abis/transferFacet.d.ts.map +0 -1
- package/dist/abis/transferFacet.js +0 -1035
- package/dist/abis/transferFacet.js.map +0 -1
- package/dist/abis/vaultFacet.d.ts +0 -306
- package/dist/abis/vaultFacet.d.ts.map +0 -1
- package/dist/abis/vaultFacet.js +0 -398
- package/dist/abis/vaultFacet.js.map +0 -1
- package/dist/abis/walletFactory.d.ts.map +0 -1
- package/dist/abis/walletFactory.js.map +0 -1
- package/dist/abis/webWallet.d.ts +0 -523
- package/dist/abis/webWallet.js +0 -680
- package/dist/abis/webWallet.js.map +0 -1
- package/dist/abis/xIdentityVerifier.d.ts +0 -473
- package/dist/abis/xIdentityVerifier.d.ts.map +0 -1
- package/dist/abis/xIdentityVerifier.js +0 -612
- package/dist/abis/xIdentityVerifier.js.map +0 -1
- package/dist/abis/xZkVerifier.js.map +0 -1
- package/dist/identity/bind.d.ts +0 -59
- package/dist/identity/bind.d.ts.map +0 -1
- package/dist/identity/bind.fixtures.d.ts +0 -8
- package/dist/identity/bind.fixtures.d.ts.map +0 -1
- package/dist/identity/bind.fixtures.js +0 -55
- package/dist/identity/bind.fixtures.js.map +0 -1
- package/dist/identity/bind.js +0 -148
- package/dist/identity/bind.js.map +0 -1
- package/src/abis/adminFacet.ts +0 -444
- package/src/abis/bank.ts +0 -1186
- package/src/abis/diamondLoupeFacet.ts +0 -102
- package/src/abis/gitHubIdentityVerifier.ts +0 -533
- package/src/abis/googleOidcVerifier.ts +0 -1084
- package/src/abis/mockErc20.ts +0 -349
- package/src/abis/notary.ts +0 -345
- package/src/abis/registry.ts +0 -1513
- package/src/abis/transferFacet.ts +0 -1037
- package/src/abis/vaultFacet.ts +0 -400
- package/src/abis/webWallet.ts +0 -682
- package/src/abis/xIdentityVerifier.ts +0 -614
- package/src/identity/bind.fixtures.ts +0 -63
- 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
|