@cofhe/sdk 0.1.0 → 0.2.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/CHANGELOG.md +62 -0
- package/adapters/ethers5.test.ts +174 -0
- package/adapters/ethers5.ts +36 -0
- package/adapters/ethers6.test.ts +169 -0
- package/adapters/ethers6.ts +36 -0
- package/adapters/hardhat-node.ts +167 -0
- package/adapters/hardhat.hh2.test.ts +159 -0
- package/adapters/hardhat.ts +36 -0
- package/adapters/index.test.ts +20 -0
- package/adapters/index.ts +5 -0
- package/adapters/smartWallet.ts +99 -0
- package/adapters/test-utils.ts +53 -0
- package/adapters/types.ts +6 -0
- package/adapters/wagmi.test.ts +156 -0
- package/adapters/wagmi.ts +17 -0
- package/chains/chains/arbSepolia.ts +14 -0
- package/chains/chains/baseSepolia.ts +14 -0
- package/chains/chains/hardhat.ts +15 -0
- package/chains/chains/localcofhe.ts +14 -0
- package/chains/chains/sepolia.ts +14 -0
- package/chains/chains.test.ts +50 -0
- package/chains/defineChain.ts +18 -0
- package/chains/index.ts +35 -0
- package/chains/types.ts +32 -0
- package/core/baseBuilder.ts +119 -0
- package/core/client.test.ts +315 -0
- package/core/client.ts +292 -0
- package/core/clientTypes.ts +108 -0
- package/core/config.test.ts +235 -0
- package/core/config.ts +220 -0
- package/core/decrypt/MockQueryDecrypterAbi.ts +129 -0
- package/core/decrypt/cofheMocksSealOutput.ts +57 -0
- package/core/decrypt/decryptHandleBuilder.ts +287 -0
- package/core/decrypt/decryptUtils.ts +28 -0
- package/core/decrypt/tnSealOutputV1.ts +59 -0
- package/core/decrypt/tnSealOutputV2.ts +298 -0
- package/core/encrypt/MockZkVerifierAbi.ts +106 -0
- package/core/encrypt/cofheMocksZkVerifySign.ts +284 -0
- package/core/encrypt/encryptInputsBuilder.test.ts +751 -0
- package/core/encrypt/encryptInputsBuilder.ts +560 -0
- package/core/encrypt/encryptUtils.ts +67 -0
- package/core/encrypt/zkPackProveVerify.ts +335 -0
- package/core/error.ts +168 -0
- package/core/fetchKeys.test.ts +195 -0
- package/core/fetchKeys.ts +144 -0
- package/core/index.ts +89 -0
- package/core/keyStore.test.ts +226 -0
- package/core/keyStore.ts +154 -0
- package/core/permits.test.ts +494 -0
- package/core/permits.ts +200 -0
- package/core/types.ts +398 -0
- package/core/utils.ts +130 -0
- package/dist/adapters.cjs +88 -0
- package/dist/adapters.d.cts +14576 -0
- package/dist/adapters.d.ts +14576 -0
- package/dist/adapters.js +83 -0
- package/dist/chains.cjs +114 -0
- package/dist/chains.d.cts +121 -0
- package/dist/chains.d.ts +121 -0
- package/dist/chains.js +1 -0
- package/dist/chunk-UGBVZNRT.js +818 -0
- package/dist/chunk-WEAZ25JO.js +105 -0
- package/dist/chunk-WGCRJCBR.js +2523 -0
- package/dist/clientTypes-5_1nwtUe.d.cts +914 -0
- package/dist/clientTypes-Es7fyi65.d.ts +914 -0
- package/dist/core.cjs +3414 -0
- package/dist/core.d.cts +111 -0
- package/dist/core.d.ts +111 -0
- package/dist/core.js +3 -0
- package/dist/node.cjs +3286 -0
- package/dist/node.d.cts +22 -0
- package/dist/node.d.ts +22 -0
- package/dist/node.js +91 -0
- package/dist/permit-fUSe6KKq.d.cts +349 -0
- package/dist/permit-fUSe6KKq.d.ts +349 -0
- package/dist/permits.cjs +871 -0
- package/dist/permits.d.cts +1045 -0
- package/dist/permits.d.ts +1045 -0
- package/dist/permits.js +1 -0
- package/dist/types-KImPrEIe.d.cts +48 -0
- package/dist/types-KImPrEIe.d.ts +48 -0
- package/dist/web.cjs +3478 -0
- package/dist/web.d.cts +38 -0
- package/dist/web.d.ts +38 -0
- package/dist/web.js +240 -0
- package/dist/zkProve.worker.cjs +93 -0
- package/dist/zkProve.worker.d.cts +2 -0
- package/dist/zkProve.worker.d.ts +2 -0
- package/dist/zkProve.worker.js +91 -0
- package/node/client.test.ts +147 -0
- package/node/config.test.ts +68 -0
- package/node/encryptInputs.test.ts +155 -0
- package/node/index.ts +97 -0
- package/node/storage.ts +51 -0
- package/package.json +27 -15
- package/permits/index.ts +68 -0
- package/permits/localstorage.test.ts +117 -0
- package/permits/permit.test.ts +477 -0
- package/permits/permit.ts +405 -0
- package/permits/sealing.test.ts +84 -0
- package/permits/sealing.ts +131 -0
- package/permits/signature.ts +79 -0
- package/permits/store.test.ts +128 -0
- package/permits/store.ts +166 -0
- package/permits/test-utils.ts +20 -0
- package/permits/types.ts +191 -0
- package/permits/utils.ts +62 -0
- package/permits/validation.test.ts +288 -0
- package/permits/validation.ts +369 -0
- package/web/client.web.test.ts +147 -0
- package/web/config.web.test.ts +69 -0
- package/web/encryptInputs.web.test.ts +172 -0
- package/web/index.ts +161 -0
- package/web/storage.ts +34 -0
- package/web/worker.builder.web.test.ts +148 -0
- package/web/worker.config.web.test.ts +329 -0
- package/web/worker.output.web.test.ts +84 -0
- package/web/workerManager.test.ts +80 -0
- package/web/workerManager.ts +214 -0
- package/web/workerManager.web.test.ts +114 -0
- package/web/zkProve.worker.ts +133 -0
|
@@ -0,0 +1,1045 @@
|
|
|
1
|
+
import { P as Permit, V as ValidationResult, a as PermitSignaturePrimaryType, b as Permission, E as EIP712Types, c as EIP712Message, S as SerializedPermit } from './permit-fUSe6KKq.cjs';
|
|
2
|
+
export { C as CreateSelfPermitOptions, d as CreateSharingPermitOptions, f as EIP712Domain, j as EIP712Type, i as EthEncryptedData, o as Expand, G as GenerateSealingKey, I as ImportPermitOptions, I as ImportSharedPermitOptions, e as PermitMetadata, l as PermitOf, k as PermitType, g as PermitUtils, R as RecipientPermit, h as SealingKey, m as SelfPermit, C as SelfPermitOptions, n as SharingPermit, d as SharingPermitOptions } from './permit-fUSe6KKq.cjs';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import * as zustand_middleware from 'zustand/middleware';
|
|
5
|
+
import * as zustand_vanilla from 'zustand/vanilla';
|
|
6
|
+
import 'viem';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Validator for self permit creation options
|
|
10
|
+
*/
|
|
11
|
+
declare const SelfPermitOptionsValidator: z.ZodEffects<z.ZodObject<{
|
|
12
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"self">>>;
|
|
13
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, `0x${string}`, string>;
|
|
14
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
16
|
+
recipient: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>, `0x${string}`, string | undefined>, "0x0000000000000000000000000000000000000000", string | undefined>;
|
|
17
|
+
validatorId: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
18
|
+
validatorContract: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
19
|
+
issuerSignature: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
20
|
+
recipientSignature: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
recipient: "0x0000000000000000000000000000000000000000";
|
|
23
|
+
type: "self";
|
|
24
|
+
name: string;
|
|
25
|
+
issuer: `0x${string}`;
|
|
26
|
+
expiration: number;
|
|
27
|
+
validatorId: number;
|
|
28
|
+
validatorContract: `0x${string}`;
|
|
29
|
+
issuerSignature: `0x${string}`;
|
|
30
|
+
recipientSignature: `0x${string}`;
|
|
31
|
+
}, {
|
|
32
|
+
issuer: string;
|
|
33
|
+
recipient?: string | undefined;
|
|
34
|
+
type?: "self" | undefined;
|
|
35
|
+
name?: string | undefined;
|
|
36
|
+
expiration?: number | undefined;
|
|
37
|
+
validatorId?: number | undefined;
|
|
38
|
+
validatorContract?: string | undefined;
|
|
39
|
+
issuerSignature?: string | undefined;
|
|
40
|
+
recipientSignature?: string | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
recipient: "0x0000000000000000000000000000000000000000";
|
|
43
|
+
type: "self";
|
|
44
|
+
name: string;
|
|
45
|
+
issuer: `0x${string}`;
|
|
46
|
+
expiration: number;
|
|
47
|
+
validatorId: number;
|
|
48
|
+
validatorContract: `0x${string}`;
|
|
49
|
+
issuerSignature: `0x${string}`;
|
|
50
|
+
recipientSignature: `0x${string}`;
|
|
51
|
+
}, {
|
|
52
|
+
issuer: string;
|
|
53
|
+
recipient?: string | undefined;
|
|
54
|
+
type?: "self" | undefined;
|
|
55
|
+
name?: string | undefined;
|
|
56
|
+
expiration?: number | undefined;
|
|
57
|
+
validatorId?: number | undefined;
|
|
58
|
+
validatorContract?: string | undefined;
|
|
59
|
+
issuerSignature?: string | undefined;
|
|
60
|
+
recipientSignature?: string | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Validator for fully formed self permits
|
|
64
|
+
*/
|
|
65
|
+
declare const SelfPermitValidator: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
66
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
67
|
+
type: z.ZodEnum<["self", "sharing", "recipient"]>;
|
|
68
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
69
|
+
expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
70
|
+
recipient: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
71
|
+
validatorId: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
72
|
+
validatorContract: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
73
|
+
issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
74
|
+
recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
75
|
+
} & {
|
|
76
|
+
sealingPair: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
privateKey: z.ZodString;
|
|
78
|
+
publicKey: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
privateKey: string;
|
|
81
|
+
publicKey: string;
|
|
82
|
+
}, {
|
|
83
|
+
privateKey: string;
|
|
84
|
+
publicKey: string;
|
|
85
|
+
}>>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
recipient: `0x${string}`;
|
|
88
|
+
type: "self" | "sharing" | "recipient";
|
|
89
|
+
name: string;
|
|
90
|
+
issuer: `0x${string}`;
|
|
91
|
+
expiration: number;
|
|
92
|
+
validatorId: number;
|
|
93
|
+
validatorContract: `0x${string}`;
|
|
94
|
+
issuerSignature: string;
|
|
95
|
+
recipientSignature: string;
|
|
96
|
+
sealingPair?: {
|
|
97
|
+
privateKey: string;
|
|
98
|
+
publicKey: string;
|
|
99
|
+
} | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
type: "self" | "sharing" | "recipient";
|
|
102
|
+
issuer: string;
|
|
103
|
+
recipient?: string | undefined;
|
|
104
|
+
name?: string | undefined;
|
|
105
|
+
expiration?: number | undefined;
|
|
106
|
+
validatorId?: number | undefined;
|
|
107
|
+
validatorContract?: string | undefined;
|
|
108
|
+
sealingPair?: {
|
|
109
|
+
privateKey: string;
|
|
110
|
+
publicKey: string;
|
|
111
|
+
} | undefined;
|
|
112
|
+
issuerSignature?: string | undefined;
|
|
113
|
+
recipientSignature?: string | undefined;
|
|
114
|
+
}>, {
|
|
115
|
+
recipient: `0x${string}`;
|
|
116
|
+
type: "self" | "sharing" | "recipient";
|
|
117
|
+
name: string;
|
|
118
|
+
issuer: `0x${string}`;
|
|
119
|
+
expiration: number;
|
|
120
|
+
validatorId: number;
|
|
121
|
+
validatorContract: `0x${string}`;
|
|
122
|
+
issuerSignature: string;
|
|
123
|
+
recipientSignature: string;
|
|
124
|
+
sealingPair?: {
|
|
125
|
+
privateKey: string;
|
|
126
|
+
publicKey: string;
|
|
127
|
+
} | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
type: "self" | "sharing" | "recipient";
|
|
130
|
+
issuer: string;
|
|
131
|
+
recipient?: string | undefined;
|
|
132
|
+
name?: string | undefined;
|
|
133
|
+
expiration?: number | undefined;
|
|
134
|
+
validatorId?: number | undefined;
|
|
135
|
+
validatorContract?: string | undefined;
|
|
136
|
+
sealingPair?: {
|
|
137
|
+
privateKey: string;
|
|
138
|
+
publicKey: string;
|
|
139
|
+
} | undefined;
|
|
140
|
+
issuerSignature?: string | undefined;
|
|
141
|
+
recipientSignature?: string | undefined;
|
|
142
|
+
}>, {
|
|
143
|
+
recipient: `0x${string}`;
|
|
144
|
+
type: "self" | "sharing" | "recipient";
|
|
145
|
+
name: string;
|
|
146
|
+
issuer: `0x${string}`;
|
|
147
|
+
expiration: number;
|
|
148
|
+
validatorId: number;
|
|
149
|
+
validatorContract: `0x${string}`;
|
|
150
|
+
issuerSignature: string;
|
|
151
|
+
recipientSignature: string;
|
|
152
|
+
sealingPair?: {
|
|
153
|
+
privateKey: string;
|
|
154
|
+
publicKey: string;
|
|
155
|
+
} | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
type: "self" | "sharing" | "recipient";
|
|
158
|
+
issuer: string;
|
|
159
|
+
recipient?: string | undefined;
|
|
160
|
+
name?: string | undefined;
|
|
161
|
+
expiration?: number | undefined;
|
|
162
|
+
validatorId?: number | undefined;
|
|
163
|
+
validatorContract?: string | undefined;
|
|
164
|
+
sealingPair?: {
|
|
165
|
+
privateKey: string;
|
|
166
|
+
publicKey: string;
|
|
167
|
+
} | undefined;
|
|
168
|
+
issuerSignature?: string | undefined;
|
|
169
|
+
recipientSignature?: string | undefined;
|
|
170
|
+
}>, {
|
|
171
|
+
recipient: `0x${string}`;
|
|
172
|
+
type: "self" | "sharing" | "recipient";
|
|
173
|
+
name: string;
|
|
174
|
+
issuer: `0x${string}`;
|
|
175
|
+
expiration: number;
|
|
176
|
+
validatorId: number;
|
|
177
|
+
validatorContract: `0x${string}`;
|
|
178
|
+
issuerSignature: string;
|
|
179
|
+
recipientSignature: string;
|
|
180
|
+
sealingPair?: {
|
|
181
|
+
privateKey: string;
|
|
182
|
+
publicKey: string;
|
|
183
|
+
} | undefined;
|
|
184
|
+
}, {
|
|
185
|
+
type: "self" | "sharing" | "recipient";
|
|
186
|
+
issuer: string;
|
|
187
|
+
recipient?: string | undefined;
|
|
188
|
+
name?: string | undefined;
|
|
189
|
+
expiration?: number | undefined;
|
|
190
|
+
validatorId?: number | undefined;
|
|
191
|
+
validatorContract?: string | undefined;
|
|
192
|
+
sealingPair?: {
|
|
193
|
+
privateKey: string;
|
|
194
|
+
publicKey: string;
|
|
195
|
+
} | undefined;
|
|
196
|
+
issuerSignature?: string | undefined;
|
|
197
|
+
recipientSignature?: string | undefined;
|
|
198
|
+
}>, {
|
|
199
|
+
recipient: `0x${string}`;
|
|
200
|
+
type: "self" | "sharing" | "recipient";
|
|
201
|
+
name: string;
|
|
202
|
+
issuer: `0x${string}`;
|
|
203
|
+
expiration: number;
|
|
204
|
+
validatorId: number;
|
|
205
|
+
validatorContract: `0x${string}`;
|
|
206
|
+
issuerSignature: string;
|
|
207
|
+
recipientSignature: string;
|
|
208
|
+
sealingPair?: {
|
|
209
|
+
privateKey: string;
|
|
210
|
+
publicKey: string;
|
|
211
|
+
} | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
type: "self" | "sharing" | "recipient";
|
|
214
|
+
issuer: string;
|
|
215
|
+
recipient?: string | undefined;
|
|
216
|
+
name?: string | undefined;
|
|
217
|
+
expiration?: number | undefined;
|
|
218
|
+
validatorId?: number | undefined;
|
|
219
|
+
validatorContract?: string | undefined;
|
|
220
|
+
sealingPair?: {
|
|
221
|
+
privateKey: string;
|
|
222
|
+
publicKey: string;
|
|
223
|
+
} | undefined;
|
|
224
|
+
issuerSignature?: string | undefined;
|
|
225
|
+
recipientSignature?: string | undefined;
|
|
226
|
+
}>, {
|
|
227
|
+
recipient: `0x${string}`;
|
|
228
|
+
type: "self" | "sharing" | "recipient";
|
|
229
|
+
name: string;
|
|
230
|
+
issuer: `0x${string}`;
|
|
231
|
+
expiration: number;
|
|
232
|
+
validatorId: number;
|
|
233
|
+
validatorContract: `0x${string}`;
|
|
234
|
+
issuerSignature: string;
|
|
235
|
+
recipientSignature: string;
|
|
236
|
+
sealingPair?: {
|
|
237
|
+
privateKey: string;
|
|
238
|
+
publicKey: string;
|
|
239
|
+
} | undefined;
|
|
240
|
+
}, {
|
|
241
|
+
type: "self" | "sharing" | "recipient";
|
|
242
|
+
issuer: string;
|
|
243
|
+
recipient?: string | undefined;
|
|
244
|
+
name?: string | undefined;
|
|
245
|
+
expiration?: number | undefined;
|
|
246
|
+
validatorId?: number | undefined;
|
|
247
|
+
validatorContract?: string | undefined;
|
|
248
|
+
sealingPair?: {
|
|
249
|
+
privateKey: string;
|
|
250
|
+
publicKey: string;
|
|
251
|
+
} | undefined;
|
|
252
|
+
issuerSignature?: string | undefined;
|
|
253
|
+
recipientSignature?: string | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
/**
|
|
256
|
+
* Validator for sharing permit creation options
|
|
257
|
+
*/
|
|
258
|
+
declare const SharingPermitOptionsValidator: z.ZodEffects<z.ZodObject<{
|
|
259
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"sharing">>>;
|
|
260
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, `0x${string}`, string>;
|
|
261
|
+
recipient: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, `0x${string}`, string>;
|
|
262
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
263
|
+
expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
264
|
+
validatorId: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
265
|
+
validatorContract: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
266
|
+
issuerSignature: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
267
|
+
recipientSignature: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
recipient: `0x${string}`;
|
|
270
|
+
type: "sharing";
|
|
271
|
+
name: string;
|
|
272
|
+
issuer: `0x${string}`;
|
|
273
|
+
expiration: number;
|
|
274
|
+
validatorId: number;
|
|
275
|
+
validatorContract: `0x${string}`;
|
|
276
|
+
issuerSignature: `0x${string}`;
|
|
277
|
+
recipientSignature: `0x${string}`;
|
|
278
|
+
}, {
|
|
279
|
+
recipient: string;
|
|
280
|
+
issuer: string;
|
|
281
|
+
type?: "sharing" | undefined;
|
|
282
|
+
name?: string | undefined;
|
|
283
|
+
expiration?: number | undefined;
|
|
284
|
+
validatorId?: number | undefined;
|
|
285
|
+
validatorContract?: string | undefined;
|
|
286
|
+
issuerSignature?: string | undefined;
|
|
287
|
+
recipientSignature?: string | undefined;
|
|
288
|
+
}>, {
|
|
289
|
+
recipient: `0x${string}`;
|
|
290
|
+
type: "sharing";
|
|
291
|
+
name: string;
|
|
292
|
+
issuer: `0x${string}`;
|
|
293
|
+
expiration: number;
|
|
294
|
+
validatorId: number;
|
|
295
|
+
validatorContract: `0x${string}`;
|
|
296
|
+
issuerSignature: `0x${string}`;
|
|
297
|
+
recipientSignature: `0x${string}`;
|
|
298
|
+
}, {
|
|
299
|
+
recipient: string;
|
|
300
|
+
issuer: string;
|
|
301
|
+
type?: "sharing" | undefined;
|
|
302
|
+
name?: string | undefined;
|
|
303
|
+
expiration?: number | undefined;
|
|
304
|
+
validatorId?: number | undefined;
|
|
305
|
+
validatorContract?: string | undefined;
|
|
306
|
+
issuerSignature?: string | undefined;
|
|
307
|
+
recipientSignature?: string | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
/**
|
|
310
|
+
* Validator for fully formed sharing permits
|
|
311
|
+
*/
|
|
312
|
+
declare const SharingPermitValidator: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
313
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
314
|
+
type: z.ZodEnum<["self", "sharing", "recipient"]>;
|
|
315
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
316
|
+
expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
317
|
+
recipient: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
318
|
+
validatorId: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
319
|
+
validatorContract: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
320
|
+
issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
321
|
+
recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
322
|
+
} & {
|
|
323
|
+
sealingPair: z.ZodOptional<z.ZodObject<{
|
|
324
|
+
privateKey: z.ZodString;
|
|
325
|
+
publicKey: z.ZodString;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
privateKey: string;
|
|
328
|
+
publicKey: string;
|
|
329
|
+
}, {
|
|
330
|
+
privateKey: string;
|
|
331
|
+
publicKey: string;
|
|
332
|
+
}>>;
|
|
333
|
+
}, "strip", z.ZodTypeAny, {
|
|
334
|
+
recipient: `0x${string}`;
|
|
335
|
+
type: "self" | "sharing" | "recipient";
|
|
336
|
+
name: string;
|
|
337
|
+
issuer: `0x${string}`;
|
|
338
|
+
expiration: number;
|
|
339
|
+
validatorId: number;
|
|
340
|
+
validatorContract: `0x${string}`;
|
|
341
|
+
issuerSignature: string;
|
|
342
|
+
recipientSignature: string;
|
|
343
|
+
sealingPair?: {
|
|
344
|
+
privateKey: string;
|
|
345
|
+
publicKey: string;
|
|
346
|
+
} | undefined;
|
|
347
|
+
}, {
|
|
348
|
+
type: "self" | "sharing" | "recipient";
|
|
349
|
+
issuer: string;
|
|
350
|
+
recipient?: string | undefined;
|
|
351
|
+
name?: string | undefined;
|
|
352
|
+
expiration?: number | undefined;
|
|
353
|
+
validatorId?: number | undefined;
|
|
354
|
+
validatorContract?: string | undefined;
|
|
355
|
+
sealingPair?: {
|
|
356
|
+
privateKey: string;
|
|
357
|
+
publicKey: string;
|
|
358
|
+
} | undefined;
|
|
359
|
+
issuerSignature?: string | undefined;
|
|
360
|
+
recipientSignature?: string | undefined;
|
|
361
|
+
}>, {
|
|
362
|
+
recipient: `0x${string}`;
|
|
363
|
+
type: "self" | "sharing" | "recipient";
|
|
364
|
+
name: string;
|
|
365
|
+
issuer: `0x${string}`;
|
|
366
|
+
expiration: number;
|
|
367
|
+
validatorId: number;
|
|
368
|
+
validatorContract: `0x${string}`;
|
|
369
|
+
issuerSignature: string;
|
|
370
|
+
recipientSignature: string;
|
|
371
|
+
sealingPair?: {
|
|
372
|
+
privateKey: string;
|
|
373
|
+
publicKey: string;
|
|
374
|
+
} | undefined;
|
|
375
|
+
}, {
|
|
376
|
+
type: "self" | "sharing" | "recipient";
|
|
377
|
+
issuer: string;
|
|
378
|
+
recipient?: string | undefined;
|
|
379
|
+
name?: string | undefined;
|
|
380
|
+
expiration?: number | undefined;
|
|
381
|
+
validatorId?: number | undefined;
|
|
382
|
+
validatorContract?: string | undefined;
|
|
383
|
+
sealingPair?: {
|
|
384
|
+
privateKey: string;
|
|
385
|
+
publicKey: string;
|
|
386
|
+
} | undefined;
|
|
387
|
+
issuerSignature?: string | undefined;
|
|
388
|
+
recipientSignature?: string | undefined;
|
|
389
|
+
}>, {
|
|
390
|
+
recipient: `0x${string}`;
|
|
391
|
+
type: "self" | "sharing" | "recipient";
|
|
392
|
+
name: string;
|
|
393
|
+
issuer: `0x${string}`;
|
|
394
|
+
expiration: number;
|
|
395
|
+
validatorId: number;
|
|
396
|
+
validatorContract: `0x${string}`;
|
|
397
|
+
issuerSignature: string;
|
|
398
|
+
recipientSignature: string;
|
|
399
|
+
sealingPair?: {
|
|
400
|
+
privateKey: string;
|
|
401
|
+
publicKey: string;
|
|
402
|
+
} | undefined;
|
|
403
|
+
}, {
|
|
404
|
+
type: "self" | "sharing" | "recipient";
|
|
405
|
+
issuer: string;
|
|
406
|
+
recipient?: string | undefined;
|
|
407
|
+
name?: string | undefined;
|
|
408
|
+
expiration?: number | undefined;
|
|
409
|
+
validatorId?: number | undefined;
|
|
410
|
+
validatorContract?: string | undefined;
|
|
411
|
+
sealingPair?: {
|
|
412
|
+
privateKey: string;
|
|
413
|
+
publicKey: string;
|
|
414
|
+
} | undefined;
|
|
415
|
+
issuerSignature?: string | undefined;
|
|
416
|
+
recipientSignature?: string | undefined;
|
|
417
|
+
}>, {
|
|
418
|
+
recipient: `0x${string}`;
|
|
419
|
+
type: "self" | "sharing" | "recipient";
|
|
420
|
+
name: string;
|
|
421
|
+
issuer: `0x${string}`;
|
|
422
|
+
expiration: number;
|
|
423
|
+
validatorId: number;
|
|
424
|
+
validatorContract: `0x${string}`;
|
|
425
|
+
issuerSignature: string;
|
|
426
|
+
recipientSignature: string;
|
|
427
|
+
sealingPair?: {
|
|
428
|
+
privateKey: string;
|
|
429
|
+
publicKey: string;
|
|
430
|
+
} | undefined;
|
|
431
|
+
}, {
|
|
432
|
+
type: "self" | "sharing" | "recipient";
|
|
433
|
+
issuer: string;
|
|
434
|
+
recipient?: string | undefined;
|
|
435
|
+
name?: string | undefined;
|
|
436
|
+
expiration?: number | undefined;
|
|
437
|
+
validatorId?: number | undefined;
|
|
438
|
+
validatorContract?: string | undefined;
|
|
439
|
+
sealingPair?: {
|
|
440
|
+
privateKey: string;
|
|
441
|
+
publicKey: string;
|
|
442
|
+
} | undefined;
|
|
443
|
+
issuerSignature?: string | undefined;
|
|
444
|
+
recipientSignature?: string | undefined;
|
|
445
|
+
}>, {
|
|
446
|
+
recipient: `0x${string}`;
|
|
447
|
+
type: "self" | "sharing" | "recipient";
|
|
448
|
+
name: string;
|
|
449
|
+
issuer: `0x${string}`;
|
|
450
|
+
expiration: number;
|
|
451
|
+
validatorId: number;
|
|
452
|
+
validatorContract: `0x${string}`;
|
|
453
|
+
issuerSignature: string;
|
|
454
|
+
recipientSignature: string;
|
|
455
|
+
sealingPair?: {
|
|
456
|
+
privateKey: string;
|
|
457
|
+
publicKey: string;
|
|
458
|
+
} | undefined;
|
|
459
|
+
}, {
|
|
460
|
+
type: "self" | "sharing" | "recipient";
|
|
461
|
+
issuer: string;
|
|
462
|
+
recipient?: string | undefined;
|
|
463
|
+
name?: string | undefined;
|
|
464
|
+
expiration?: number | undefined;
|
|
465
|
+
validatorId?: number | undefined;
|
|
466
|
+
validatorContract?: string | undefined;
|
|
467
|
+
sealingPair?: {
|
|
468
|
+
privateKey: string;
|
|
469
|
+
publicKey: string;
|
|
470
|
+
} | undefined;
|
|
471
|
+
issuerSignature?: string | undefined;
|
|
472
|
+
recipientSignature?: string | undefined;
|
|
473
|
+
}>, {
|
|
474
|
+
recipient: `0x${string}`;
|
|
475
|
+
type: "self" | "sharing" | "recipient";
|
|
476
|
+
name: string;
|
|
477
|
+
issuer: `0x${string}`;
|
|
478
|
+
expiration: number;
|
|
479
|
+
validatorId: number;
|
|
480
|
+
validatorContract: `0x${string}`;
|
|
481
|
+
issuerSignature: string;
|
|
482
|
+
recipientSignature: string;
|
|
483
|
+
sealingPair?: {
|
|
484
|
+
privateKey: string;
|
|
485
|
+
publicKey: string;
|
|
486
|
+
} | undefined;
|
|
487
|
+
}, {
|
|
488
|
+
type: "self" | "sharing" | "recipient";
|
|
489
|
+
issuer: string;
|
|
490
|
+
recipient?: string | undefined;
|
|
491
|
+
name?: string | undefined;
|
|
492
|
+
expiration?: number | undefined;
|
|
493
|
+
validatorId?: number | undefined;
|
|
494
|
+
validatorContract?: string | undefined;
|
|
495
|
+
sealingPair?: {
|
|
496
|
+
privateKey: string;
|
|
497
|
+
publicKey: string;
|
|
498
|
+
} | undefined;
|
|
499
|
+
issuerSignature?: string | undefined;
|
|
500
|
+
recipientSignature?: string | undefined;
|
|
501
|
+
}>;
|
|
502
|
+
/**
|
|
503
|
+
* Validator for import permit creation options (recipient receiving shared permit)
|
|
504
|
+
*/
|
|
505
|
+
declare const ImportPermitOptionsValidator: z.ZodEffects<z.ZodObject<{
|
|
506
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"recipient">>>;
|
|
507
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, `0x${string}`, string>;
|
|
508
|
+
recipient: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, `0x${string}`, string>;
|
|
509
|
+
issuerSignature: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
510
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
511
|
+
expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
512
|
+
validatorId: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
513
|
+
validatorContract: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
514
|
+
recipientSignature: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
515
|
+
}, "strip", z.ZodTypeAny, {
|
|
516
|
+
recipient: `0x${string}`;
|
|
517
|
+
type: "recipient";
|
|
518
|
+
name: string;
|
|
519
|
+
issuer: `0x${string}`;
|
|
520
|
+
expiration: number;
|
|
521
|
+
validatorId: number;
|
|
522
|
+
validatorContract: `0x${string}`;
|
|
523
|
+
issuerSignature: `0x${string}`;
|
|
524
|
+
recipientSignature: `0x${string}`;
|
|
525
|
+
}, {
|
|
526
|
+
recipient: string;
|
|
527
|
+
issuer: string;
|
|
528
|
+
issuerSignature: string;
|
|
529
|
+
type?: "recipient" | undefined;
|
|
530
|
+
name?: string | undefined;
|
|
531
|
+
expiration?: number | undefined;
|
|
532
|
+
validatorId?: number | undefined;
|
|
533
|
+
validatorContract?: string | undefined;
|
|
534
|
+
recipientSignature?: string | undefined;
|
|
535
|
+
}>, {
|
|
536
|
+
recipient: `0x${string}`;
|
|
537
|
+
type: "recipient";
|
|
538
|
+
name: string;
|
|
539
|
+
issuer: `0x${string}`;
|
|
540
|
+
expiration: number;
|
|
541
|
+
validatorId: number;
|
|
542
|
+
validatorContract: `0x${string}`;
|
|
543
|
+
issuerSignature: `0x${string}`;
|
|
544
|
+
recipientSignature: `0x${string}`;
|
|
545
|
+
}, {
|
|
546
|
+
recipient: string;
|
|
547
|
+
issuer: string;
|
|
548
|
+
issuerSignature: string;
|
|
549
|
+
type?: "recipient" | undefined;
|
|
550
|
+
name?: string | undefined;
|
|
551
|
+
expiration?: number | undefined;
|
|
552
|
+
validatorId?: number | undefined;
|
|
553
|
+
validatorContract?: string | undefined;
|
|
554
|
+
recipientSignature?: string | undefined;
|
|
555
|
+
}>;
|
|
556
|
+
/**
|
|
557
|
+
* Validator for fully formed import/recipient permits
|
|
558
|
+
*/
|
|
559
|
+
declare const ImportPermitValidator: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
560
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
561
|
+
type: z.ZodEnum<["self", "sharing", "recipient"]>;
|
|
562
|
+
issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
|
|
563
|
+
expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
564
|
+
recipient: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
565
|
+
validatorId: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
566
|
+
validatorContract: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `0x${string}`, string | undefined>;
|
|
567
|
+
issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
568
|
+
recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
569
|
+
} & {
|
|
570
|
+
sealingPair: z.ZodOptional<z.ZodObject<{
|
|
571
|
+
privateKey: z.ZodString;
|
|
572
|
+
publicKey: z.ZodString;
|
|
573
|
+
}, "strip", z.ZodTypeAny, {
|
|
574
|
+
privateKey: string;
|
|
575
|
+
publicKey: string;
|
|
576
|
+
}, {
|
|
577
|
+
privateKey: string;
|
|
578
|
+
publicKey: string;
|
|
579
|
+
}>>;
|
|
580
|
+
}, "strip", z.ZodTypeAny, {
|
|
581
|
+
recipient: `0x${string}`;
|
|
582
|
+
type: "self" | "sharing" | "recipient";
|
|
583
|
+
name: string;
|
|
584
|
+
issuer: `0x${string}`;
|
|
585
|
+
expiration: number;
|
|
586
|
+
validatorId: number;
|
|
587
|
+
validatorContract: `0x${string}`;
|
|
588
|
+
issuerSignature: string;
|
|
589
|
+
recipientSignature: string;
|
|
590
|
+
sealingPair?: {
|
|
591
|
+
privateKey: string;
|
|
592
|
+
publicKey: string;
|
|
593
|
+
} | undefined;
|
|
594
|
+
}, {
|
|
595
|
+
type: "self" | "sharing" | "recipient";
|
|
596
|
+
issuer: string;
|
|
597
|
+
recipient?: string | undefined;
|
|
598
|
+
name?: string | undefined;
|
|
599
|
+
expiration?: number | undefined;
|
|
600
|
+
validatorId?: number | undefined;
|
|
601
|
+
validatorContract?: string | undefined;
|
|
602
|
+
sealingPair?: {
|
|
603
|
+
privateKey: string;
|
|
604
|
+
publicKey: string;
|
|
605
|
+
} | undefined;
|
|
606
|
+
issuerSignature?: string | undefined;
|
|
607
|
+
recipientSignature?: string | undefined;
|
|
608
|
+
}>, {
|
|
609
|
+
recipient: `0x${string}`;
|
|
610
|
+
type: "self" | "sharing" | "recipient";
|
|
611
|
+
name: string;
|
|
612
|
+
issuer: `0x${string}`;
|
|
613
|
+
expiration: number;
|
|
614
|
+
validatorId: number;
|
|
615
|
+
validatorContract: `0x${string}`;
|
|
616
|
+
issuerSignature: string;
|
|
617
|
+
recipientSignature: string;
|
|
618
|
+
sealingPair?: {
|
|
619
|
+
privateKey: string;
|
|
620
|
+
publicKey: string;
|
|
621
|
+
} | undefined;
|
|
622
|
+
}, {
|
|
623
|
+
type: "self" | "sharing" | "recipient";
|
|
624
|
+
issuer: string;
|
|
625
|
+
recipient?: string | undefined;
|
|
626
|
+
name?: string | undefined;
|
|
627
|
+
expiration?: number | undefined;
|
|
628
|
+
validatorId?: number | undefined;
|
|
629
|
+
validatorContract?: string | undefined;
|
|
630
|
+
sealingPair?: {
|
|
631
|
+
privateKey: string;
|
|
632
|
+
publicKey: string;
|
|
633
|
+
} | undefined;
|
|
634
|
+
issuerSignature?: string | undefined;
|
|
635
|
+
recipientSignature?: string | undefined;
|
|
636
|
+
}>, {
|
|
637
|
+
recipient: `0x${string}`;
|
|
638
|
+
type: "self" | "sharing" | "recipient";
|
|
639
|
+
name: string;
|
|
640
|
+
issuer: `0x${string}`;
|
|
641
|
+
expiration: number;
|
|
642
|
+
validatorId: number;
|
|
643
|
+
validatorContract: `0x${string}`;
|
|
644
|
+
issuerSignature: string;
|
|
645
|
+
recipientSignature: string;
|
|
646
|
+
sealingPair?: {
|
|
647
|
+
privateKey: string;
|
|
648
|
+
publicKey: string;
|
|
649
|
+
} | undefined;
|
|
650
|
+
}, {
|
|
651
|
+
type: "self" | "sharing" | "recipient";
|
|
652
|
+
issuer: string;
|
|
653
|
+
recipient?: string | undefined;
|
|
654
|
+
name?: string | undefined;
|
|
655
|
+
expiration?: number | undefined;
|
|
656
|
+
validatorId?: number | undefined;
|
|
657
|
+
validatorContract?: string | undefined;
|
|
658
|
+
sealingPair?: {
|
|
659
|
+
privateKey: string;
|
|
660
|
+
publicKey: string;
|
|
661
|
+
} | undefined;
|
|
662
|
+
issuerSignature?: string | undefined;
|
|
663
|
+
recipientSignature?: string | undefined;
|
|
664
|
+
}>, {
|
|
665
|
+
recipient: `0x${string}`;
|
|
666
|
+
type: "self" | "sharing" | "recipient";
|
|
667
|
+
name: string;
|
|
668
|
+
issuer: `0x${string}`;
|
|
669
|
+
expiration: number;
|
|
670
|
+
validatorId: number;
|
|
671
|
+
validatorContract: `0x${string}`;
|
|
672
|
+
issuerSignature: string;
|
|
673
|
+
recipientSignature: string;
|
|
674
|
+
sealingPair?: {
|
|
675
|
+
privateKey: string;
|
|
676
|
+
publicKey: string;
|
|
677
|
+
} | undefined;
|
|
678
|
+
}, {
|
|
679
|
+
type: "self" | "sharing" | "recipient";
|
|
680
|
+
issuer: string;
|
|
681
|
+
recipient?: string | undefined;
|
|
682
|
+
name?: string | undefined;
|
|
683
|
+
expiration?: number | undefined;
|
|
684
|
+
validatorId?: number | undefined;
|
|
685
|
+
validatorContract?: string | undefined;
|
|
686
|
+
sealingPair?: {
|
|
687
|
+
privateKey: string;
|
|
688
|
+
publicKey: string;
|
|
689
|
+
} | undefined;
|
|
690
|
+
issuerSignature?: string | undefined;
|
|
691
|
+
recipientSignature?: string | undefined;
|
|
692
|
+
}>, {
|
|
693
|
+
recipient: `0x${string}`;
|
|
694
|
+
type: "self" | "sharing" | "recipient";
|
|
695
|
+
name: string;
|
|
696
|
+
issuer: `0x${string}`;
|
|
697
|
+
expiration: number;
|
|
698
|
+
validatorId: number;
|
|
699
|
+
validatorContract: `0x${string}`;
|
|
700
|
+
issuerSignature: string;
|
|
701
|
+
recipientSignature: string;
|
|
702
|
+
sealingPair?: {
|
|
703
|
+
privateKey: string;
|
|
704
|
+
publicKey: string;
|
|
705
|
+
} | undefined;
|
|
706
|
+
}, {
|
|
707
|
+
type: "self" | "sharing" | "recipient";
|
|
708
|
+
issuer: string;
|
|
709
|
+
recipient?: string | undefined;
|
|
710
|
+
name?: string | undefined;
|
|
711
|
+
expiration?: number | undefined;
|
|
712
|
+
validatorId?: number | undefined;
|
|
713
|
+
validatorContract?: string | undefined;
|
|
714
|
+
sealingPair?: {
|
|
715
|
+
privateKey: string;
|
|
716
|
+
publicKey: string;
|
|
717
|
+
} | undefined;
|
|
718
|
+
issuerSignature?: string | undefined;
|
|
719
|
+
recipientSignature?: string | undefined;
|
|
720
|
+
}>, {
|
|
721
|
+
recipient: `0x${string}`;
|
|
722
|
+
type: "self" | "sharing" | "recipient";
|
|
723
|
+
name: string;
|
|
724
|
+
issuer: `0x${string}`;
|
|
725
|
+
expiration: number;
|
|
726
|
+
validatorId: number;
|
|
727
|
+
validatorContract: `0x${string}`;
|
|
728
|
+
issuerSignature: string;
|
|
729
|
+
recipientSignature: string;
|
|
730
|
+
sealingPair?: {
|
|
731
|
+
privateKey: string;
|
|
732
|
+
publicKey: string;
|
|
733
|
+
} | undefined;
|
|
734
|
+
}, {
|
|
735
|
+
type: "self" | "sharing" | "recipient";
|
|
736
|
+
issuer: string;
|
|
737
|
+
recipient?: string | undefined;
|
|
738
|
+
name?: string | undefined;
|
|
739
|
+
expiration?: number | undefined;
|
|
740
|
+
validatorId?: number | undefined;
|
|
741
|
+
validatorContract?: string | undefined;
|
|
742
|
+
sealingPair?: {
|
|
743
|
+
privateKey: string;
|
|
744
|
+
publicKey: string;
|
|
745
|
+
} | undefined;
|
|
746
|
+
issuerSignature?: string | undefined;
|
|
747
|
+
recipientSignature?: string | undefined;
|
|
748
|
+
}>;
|
|
749
|
+
/**
|
|
750
|
+
* Validates self permit creation options
|
|
751
|
+
*/
|
|
752
|
+
declare const validateSelfPermitOptions: (options: any) => z.SafeParseReturnType<{
|
|
753
|
+
issuer: string;
|
|
754
|
+
recipient?: string | undefined;
|
|
755
|
+
type?: "self" | undefined;
|
|
756
|
+
name?: string | undefined;
|
|
757
|
+
expiration?: number | undefined;
|
|
758
|
+
validatorId?: number | undefined;
|
|
759
|
+
validatorContract?: string | undefined;
|
|
760
|
+
issuerSignature?: string | undefined;
|
|
761
|
+
recipientSignature?: string | undefined;
|
|
762
|
+
}, {
|
|
763
|
+
recipient: "0x0000000000000000000000000000000000000000";
|
|
764
|
+
type: "self";
|
|
765
|
+
name: string;
|
|
766
|
+
issuer: `0x${string}`;
|
|
767
|
+
expiration: number;
|
|
768
|
+
validatorId: number;
|
|
769
|
+
validatorContract: `0x${string}`;
|
|
770
|
+
issuerSignature: `0x${string}`;
|
|
771
|
+
recipientSignature: `0x${string}`;
|
|
772
|
+
}>;
|
|
773
|
+
/**
|
|
774
|
+
* Validates sharing permit creation options
|
|
775
|
+
*/
|
|
776
|
+
declare const validateSharingPermitOptions: (options: any) => z.SafeParseReturnType<{
|
|
777
|
+
recipient: string;
|
|
778
|
+
issuer: string;
|
|
779
|
+
type?: "sharing" | undefined;
|
|
780
|
+
name?: string | undefined;
|
|
781
|
+
expiration?: number | undefined;
|
|
782
|
+
validatorId?: number | undefined;
|
|
783
|
+
validatorContract?: string | undefined;
|
|
784
|
+
issuerSignature?: string | undefined;
|
|
785
|
+
recipientSignature?: string | undefined;
|
|
786
|
+
}, {
|
|
787
|
+
recipient: `0x${string}`;
|
|
788
|
+
type: "sharing";
|
|
789
|
+
name: string;
|
|
790
|
+
issuer: `0x${string}`;
|
|
791
|
+
expiration: number;
|
|
792
|
+
validatorId: number;
|
|
793
|
+
validatorContract: `0x${string}`;
|
|
794
|
+
issuerSignature: `0x${string}`;
|
|
795
|
+
recipientSignature: `0x${string}`;
|
|
796
|
+
}>;
|
|
797
|
+
/**
|
|
798
|
+
* Validates import permit creation options
|
|
799
|
+
*/
|
|
800
|
+
declare const validateImportPermitOptions: (options: any) => z.SafeParseReturnType<{
|
|
801
|
+
recipient: string;
|
|
802
|
+
issuer: string;
|
|
803
|
+
issuerSignature: string;
|
|
804
|
+
type?: "recipient" | undefined;
|
|
805
|
+
name?: string | undefined;
|
|
806
|
+
expiration?: number | undefined;
|
|
807
|
+
validatorId?: number | undefined;
|
|
808
|
+
validatorContract?: string | undefined;
|
|
809
|
+
recipientSignature?: string | undefined;
|
|
810
|
+
}, {
|
|
811
|
+
recipient: `0x${string}`;
|
|
812
|
+
type: "recipient";
|
|
813
|
+
name: string;
|
|
814
|
+
issuer: `0x${string}`;
|
|
815
|
+
expiration: number;
|
|
816
|
+
validatorId: number;
|
|
817
|
+
validatorContract: `0x${string}`;
|
|
818
|
+
issuerSignature: `0x${string}`;
|
|
819
|
+
recipientSignature: `0x${string}`;
|
|
820
|
+
}>;
|
|
821
|
+
/**
|
|
822
|
+
* Validates a fully formed self permit
|
|
823
|
+
*/
|
|
824
|
+
declare const validateSelfPermit: (permit: any) => z.SafeParseReturnType<{
|
|
825
|
+
type: "self" | "sharing" | "recipient";
|
|
826
|
+
issuer: string;
|
|
827
|
+
recipient?: string | undefined;
|
|
828
|
+
name?: string | undefined;
|
|
829
|
+
expiration?: number | undefined;
|
|
830
|
+
validatorId?: number | undefined;
|
|
831
|
+
validatorContract?: string | undefined;
|
|
832
|
+
sealingPair?: {
|
|
833
|
+
privateKey: string;
|
|
834
|
+
publicKey: string;
|
|
835
|
+
} | undefined;
|
|
836
|
+
issuerSignature?: string | undefined;
|
|
837
|
+
recipientSignature?: string | undefined;
|
|
838
|
+
}, {
|
|
839
|
+
recipient: `0x${string}`;
|
|
840
|
+
type: "self" | "sharing" | "recipient";
|
|
841
|
+
name: string;
|
|
842
|
+
issuer: `0x${string}`;
|
|
843
|
+
expiration: number;
|
|
844
|
+
validatorId: number;
|
|
845
|
+
validatorContract: `0x${string}`;
|
|
846
|
+
issuerSignature: string;
|
|
847
|
+
recipientSignature: string;
|
|
848
|
+
sealingPair?: {
|
|
849
|
+
privateKey: string;
|
|
850
|
+
publicKey: string;
|
|
851
|
+
} | undefined;
|
|
852
|
+
}>;
|
|
853
|
+
/**
|
|
854
|
+
* Validates a fully formed sharing permit
|
|
855
|
+
*/
|
|
856
|
+
declare const validateSharingPermit: (permit: any) => z.SafeParseReturnType<{
|
|
857
|
+
type: "self" | "sharing" | "recipient";
|
|
858
|
+
issuer: string;
|
|
859
|
+
recipient?: string | undefined;
|
|
860
|
+
name?: string | undefined;
|
|
861
|
+
expiration?: number | undefined;
|
|
862
|
+
validatorId?: number | undefined;
|
|
863
|
+
validatorContract?: string | undefined;
|
|
864
|
+
sealingPair?: {
|
|
865
|
+
privateKey: string;
|
|
866
|
+
publicKey: string;
|
|
867
|
+
} | undefined;
|
|
868
|
+
issuerSignature?: string | undefined;
|
|
869
|
+
recipientSignature?: string | undefined;
|
|
870
|
+
}, {
|
|
871
|
+
recipient: `0x${string}`;
|
|
872
|
+
type: "self" | "sharing" | "recipient";
|
|
873
|
+
name: string;
|
|
874
|
+
issuer: `0x${string}`;
|
|
875
|
+
expiration: number;
|
|
876
|
+
validatorId: number;
|
|
877
|
+
validatorContract: `0x${string}`;
|
|
878
|
+
issuerSignature: string;
|
|
879
|
+
recipientSignature: string;
|
|
880
|
+
sealingPair?: {
|
|
881
|
+
privateKey: string;
|
|
882
|
+
publicKey: string;
|
|
883
|
+
} | undefined;
|
|
884
|
+
}>;
|
|
885
|
+
/**
|
|
886
|
+
* Validates a fully formed import/recipient permit
|
|
887
|
+
*/
|
|
888
|
+
declare const validateImportPermit: (permit: any) => z.SafeParseReturnType<{
|
|
889
|
+
type: "self" | "sharing" | "recipient";
|
|
890
|
+
issuer: string;
|
|
891
|
+
recipient?: string | undefined;
|
|
892
|
+
name?: string | undefined;
|
|
893
|
+
expiration?: number | undefined;
|
|
894
|
+
validatorId?: number | undefined;
|
|
895
|
+
validatorContract?: string | undefined;
|
|
896
|
+
sealingPair?: {
|
|
897
|
+
privateKey: string;
|
|
898
|
+
publicKey: string;
|
|
899
|
+
} | undefined;
|
|
900
|
+
issuerSignature?: string | undefined;
|
|
901
|
+
recipientSignature?: string | undefined;
|
|
902
|
+
}, {
|
|
903
|
+
recipient: `0x${string}`;
|
|
904
|
+
type: "self" | "sharing" | "recipient";
|
|
905
|
+
name: string;
|
|
906
|
+
issuer: `0x${string}`;
|
|
907
|
+
expiration: number;
|
|
908
|
+
validatorId: number;
|
|
909
|
+
validatorContract: `0x${string}`;
|
|
910
|
+
issuerSignature: string;
|
|
911
|
+
recipientSignature: string;
|
|
912
|
+
sealingPair?: {
|
|
913
|
+
privateKey: string;
|
|
914
|
+
publicKey: string;
|
|
915
|
+
} | undefined;
|
|
916
|
+
}>;
|
|
917
|
+
/**
|
|
918
|
+
* Simple validation functions for common checks
|
|
919
|
+
*/
|
|
920
|
+
declare const ValidationUtils: {
|
|
921
|
+
/**
|
|
922
|
+
* Check if permit is expired
|
|
923
|
+
*/
|
|
924
|
+
isExpired: (permit: Permit) => boolean;
|
|
925
|
+
/**
|
|
926
|
+
* Check if permit is signed by the active party
|
|
927
|
+
*/
|
|
928
|
+
isSigned: (permit: Permit) => boolean;
|
|
929
|
+
/**
|
|
930
|
+
* Overall validity checker of a permit
|
|
931
|
+
*/
|
|
932
|
+
isValid: (permit: Permit) => ValidationResult;
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
declare const PermitSignatureAllFields: readonly [{
|
|
936
|
+
readonly name: "issuer";
|
|
937
|
+
readonly type: "address";
|
|
938
|
+
}, {
|
|
939
|
+
readonly name: "expiration";
|
|
940
|
+
readonly type: "uint64";
|
|
941
|
+
}, {
|
|
942
|
+
readonly name: "recipient";
|
|
943
|
+
readonly type: "address";
|
|
944
|
+
}, {
|
|
945
|
+
readonly name: "validatorId";
|
|
946
|
+
readonly type: "uint256";
|
|
947
|
+
}, {
|
|
948
|
+
readonly name: "validatorContract";
|
|
949
|
+
readonly type: "address";
|
|
950
|
+
}, {
|
|
951
|
+
readonly name: "sealingKey";
|
|
952
|
+
readonly type: "bytes32";
|
|
953
|
+
}, {
|
|
954
|
+
readonly name: "issuerSignature";
|
|
955
|
+
readonly type: "bytes";
|
|
956
|
+
}];
|
|
957
|
+
type PermitSignatureFieldOption = (typeof PermitSignatureAllFields)[number]['name'];
|
|
958
|
+
declare const SignatureTypes: {
|
|
959
|
+
readonly PermissionedV2IssuerSelf: ("recipient" | "issuer" | "expiration" | "validatorId" | "validatorContract" | "sealingKey")[];
|
|
960
|
+
readonly PermissionedV2IssuerShared: ("recipient" | "issuer" | "expiration" | "validatorId" | "validatorContract")[];
|
|
961
|
+
readonly PermissionedV2Recipient: ("issuerSignature" | "sealingKey")[];
|
|
962
|
+
};
|
|
963
|
+
/**
|
|
964
|
+
* Get signature types and message for EIP712 signing
|
|
965
|
+
*/
|
|
966
|
+
declare const getSignatureTypesAndMessage: <T extends PermitSignatureFieldOption>(primaryType: PermitSignaturePrimaryType, fields: T[] | readonly T[], values: Pick<Permission, T> & Partial<Permission>) => {
|
|
967
|
+
types: EIP712Types;
|
|
968
|
+
primaryType: string;
|
|
969
|
+
message: EIP712Message;
|
|
970
|
+
};
|
|
971
|
+
/**
|
|
972
|
+
* Signature utilities for permit operations
|
|
973
|
+
*/
|
|
974
|
+
declare const SignatureUtils: {
|
|
975
|
+
/**
|
|
976
|
+
* Get signature parameters for a permit
|
|
977
|
+
*/
|
|
978
|
+
getSignatureParams: (permit: Permission, primaryType: PermitSignaturePrimaryType) => {
|
|
979
|
+
types: EIP712Types;
|
|
980
|
+
primaryType: string;
|
|
981
|
+
message: EIP712Message;
|
|
982
|
+
};
|
|
983
|
+
/**
|
|
984
|
+
* Determine the required signature type based on permit type
|
|
985
|
+
*/
|
|
986
|
+
getPrimaryType: (permitType: "self" | "sharing" | "recipient") => PermitSignaturePrimaryType;
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
type ChainRecord<T> = Record<number, T>;
|
|
990
|
+
type AccountRecord<T> = Record<string, T>;
|
|
991
|
+
type HashRecord<T> = Record<string, T>;
|
|
992
|
+
type PermitsStore = {
|
|
993
|
+
permits: ChainRecord<AccountRecord<HashRecord<SerializedPermit | undefined>>>;
|
|
994
|
+
activePermitHash: ChainRecord<AccountRecord<string | undefined>>;
|
|
995
|
+
};
|
|
996
|
+
declare const PERMIT_STORE_DEFAULTS: PermitsStore;
|
|
997
|
+
declare const _permitStore: Omit<zustand_vanilla.StoreApi<PermitsStore>, "setState" | "persist"> & {
|
|
998
|
+
setState(partial: PermitsStore | Partial<PermitsStore> | ((state: PermitsStore) => PermitsStore | Partial<PermitsStore>), replace?: false | undefined): unknown;
|
|
999
|
+
setState(state: PermitsStore | ((state: PermitsStore) => PermitsStore), replace: true): unknown;
|
|
1000
|
+
persist: {
|
|
1001
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>) => void;
|
|
1002
|
+
clearStorage: () => void;
|
|
1003
|
+
rehydrate: () => Promise<void> | void;
|
|
1004
|
+
hasHydrated: () => boolean;
|
|
1005
|
+
onHydrate: (fn: (state: PermitsStore) => void) => () => void;
|
|
1006
|
+
onFinishHydration: (fn: (state: PermitsStore) => void) => () => void;
|
|
1007
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>;
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
declare const clearStaleStore: () => void;
|
|
1011
|
+
declare const getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined;
|
|
1012
|
+
declare const getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined;
|
|
1013
|
+
declare const getPermits: (chainId: number | undefined, account: string | undefined) => Record<string, Permit>;
|
|
1014
|
+
declare const setPermit: (chainId: number, account: string, permit: Permit) => void;
|
|
1015
|
+
declare const removePermit: (chainId: number, account: string, hash: string, force?: boolean) => void;
|
|
1016
|
+
declare const getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined;
|
|
1017
|
+
declare const setActivePermitHash: (chainId: number, account: string, hash: string) => void;
|
|
1018
|
+
declare const removeActivePermitHash: (chainId: number, account: string) => void;
|
|
1019
|
+
declare const resetStore: () => void;
|
|
1020
|
+
declare const permitStore: {
|
|
1021
|
+
store: Omit<zustand_vanilla.StoreApi<PermitsStore>, "setState" | "persist"> & {
|
|
1022
|
+
setState(partial: PermitsStore | Partial<PermitsStore> | ((state: PermitsStore) => PermitsStore | Partial<PermitsStore>), replace?: false | undefined): unknown;
|
|
1023
|
+
setState(state: PermitsStore | ((state: PermitsStore) => PermitsStore), replace: true): unknown;
|
|
1024
|
+
persist: {
|
|
1025
|
+
setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>) => void;
|
|
1026
|
+
clearStorage: () => void;
|
|
1027
|
+
rehydrate: () => Promise<void> | void;
|
|
1028
|
+
hasHydrated: () => boolean;
|
|
1029
|
+
onHydrate: (fn: (state: PermitsStore) => void) => () => void;
|
|
1030
|
+
onFinishHydration: (fn: (state: PermitsStore) => void) => () => void;
|
|
1031
|
+
getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>;
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined;
|
|
1035
|
+
getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined;
|
|
1036
|
+
getPermits: (chainId: number | undefined, account: string | undefined) => Record<string, Permit>;
|
|
1037
|
+
setPermit: (chainId: number, account: string, permit: Permit) => void;
|
|
1038
|
+
removePermit: (chainId: number, account: string, hash: string, force?: boolean) => void;
|
|
1039
|
+
getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined;
|
|
1040
|
+
setActivePermitHash: (chainId: number, account: string, hash: string) => void;
|
|
1041
|
+
removeActivePermitHash: (chainId: number, account: string) => void;
|
|
1042
|
+
resetStore: () => void;
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
export { EIP712Message, EIP712Types, ImportPermitOptionsValidator, ImportPermitValidator, PERMIT_STORE_DEFAULTS, Permission, Permit, PermitSignaturePrimaryType, SelfPermitOptionsValidator, SelfPermitValidator, SerializedPermit, SharingPermitOptionsValidator, SharingPermitValidator, SignatureTypes, SignatureUtils, ValidationResult, ValidationUtils, _permitStore, clearStaleStore, getActivePermit, getActivePermitHash, getPermit, getPermits, getSignatureTypesAndMessage, permitStore, removeActivePermitHash, removePermit, resetStore, setActivePermitHash, setPermit, validateImportPermit, validateImportPermitOptions, validateSelfPermit, validateSelfPermitOptions, validateSharingPermit, validateSharingPermitOptions };
|