@cofhe/sdk 0.1.1 → 0.2.1

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 (107) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/adapters/ethers6.ts +28 -28
  3. package/adapters/hardhat.ts +0 -1
  4. package/adapters/index.test.ts +14 -19
  5. package/adapters/smartWallet.ts +81 -73
  6. package/adapters/test-utils.ts +45 -45
  7. package/adapters/types.ts +3 -3
  8. package/chains/chains/localcofhe.ts +14 -0
  9. package/chains/chains.test.ts +2 -1
  10. package/chains/defineChain.ts +2 -2
  11. package/chains/index.ts +3 -1
  12. package/chains/types.ts +3 -3
  13. package/core/baseBuilder.ts +30 -49
  14. package/core/client.test.ts +200 -72
  15. package/core/client.ts +152 -148
  16. package/core/clientTypes.ts +114 -0
  17. package/core/config.test.ts +30 -11
  18. package/core/config.ts +26 -13
  19. package/core/consts.ts +18 -0
  20. package/core/decrypt/cofheMocksSealOutput.ts +2 -4
  21. package/core/decrypt/decryptHandleBuilder.ts +51 -45
  22. package/core/decrypt/{tnSealOutput.ts → tnSealOutputV1.ts} +1 -1
  23. package/core/decrypt/tnSealOutputV2.ts +298 -0
  24. package/core/encrypt/cofheMocksZkVerifySign.ts +15 -16
  25. package/core/encrypt/encryptInputsBuilder.test.ts +132 -116
  26. package/core/encrypt/encryptInputsBuilder.ts +159 -111
  27. package/core/encrypt/encryptUtils.ts +6 -3
  28. package/core/encrypt/zkPackProveVerify.ts +70 -8
  29. package/core/error.ts +0 -2
  30. package/core/fetchKeys.test.ts +1 -18
  31. package/core/fetchKeys.ts +0 -26
  32. package/core/index.ts +37 -17
  33. package/core/keyStore.ts +65 -38
  34. package/core/permits.test.ts +255 -4
  35. package/core/permits.ts +83 -18
  36. package/core/types.ts +198 -152
  37. package/core/utils.ts +43 -1
  38. package/dist/adapters.d.cts +38 -20
  39. package/dist/adapters.d.ts +38 -20
  40. package/dist/chains.cjs +18 -8
  41. package/dist/chains.d.cts +31 -9
  42. package/dist/chains.d.ts +31 -9
  43. package/dist/chains.js +1 -1
  44. package/dist/{chunk-KFGPTJ6X.js → chunk-I5WFEYXX.js} +1768 -1526
  45. package/dist/{chunk-LU7BMUUT.js → chunk-R3B5TMVX.js} +330 -197
  46. package/dist/{chunk-GZCQQYVI.js → chunk-TBLR7NNE.js} +18 -9
  47. package/dist/{types-PhwGgQvs.d.ts → clientTypes-RqkgkV2i.d.ts} +331 -429
  48. package/dist/{types-bB7wLj0q.d.cts → clientTypes-e4filDzK.d.cts} +331 -429
  49. package/dist/core.cjs +3000 -2625
  50. package/dist/core.d.cts +113 -7
  51. package/dist/core.d.ts +113 -7
  52. package/dist/core.js +3 -3
  53. package/dist/node.cjs +2851 -2526
  54. package/dist/node.d.cts +4 -4
  55. package/dist/node.d.ts +4 -4
  56. package/dist/node.js +4 -3
  57. package/dist/{permit-S9CnI6MF.d.cts → permit-MZ502UBl.d.cts} +54 -41
  58. package/dist/{permit-S9CnI6MF.d.ts → permit-MZ502UBl.d.ts} +54 -41
  59. package/dist/permits.cjs +328 -195
  60. package/dist/permits.d.cts +113 -825
  61. package/dist/permits.d.ts +113 -825
  62. package/dist/permits.js +1 -1
  63. package/dist/types-YiAC4gig.d.cts +33 -0
  64. package/dist/types-YiAC4gig.d.ts +33 -0
  65. package/dist/web.cjs +3067 -2527
  66. package/dist/web.d.cts +22 -6
  67. package/dist/web.d.ts +22 -6
  68. package/dist/web.js +185 -9
  69. package/dist/zkProve.worker.cjs +93 -0
  70. package/dist/zkProve.worker.d.cts +2 -0
  71. package/dist/zkProve.worker.d.ts +2 -0
  72. package/dist/zkProve.worker.js +91 -0
  73. package/node/client.test.ts +20 -25
  74. package/node/encryptInputs.test.ts +18 -38
  75. package/node/index.ts +1 -0
  76. package/package.json +15 -15
  77. package/permits/index.ts +1 -0
  78. package/permits/localstorage.test.ts +9 -14
  79. package/permits/onchain-utils.ts +221 -0
  80. package/permits/permit.test.ts +76 -27
  81. package/permits/permit.ts +58 -95
  82. package/permits/sealing.test.ts +3 -3
  83. package/permits/sealing.ts +2 -2
  84. package/permits/store.test.ts +10 -50
  85. package/permits/store.ts +9 -21
  86. package/permits/test-utils.ts +11 -3
  87. package/permits/types.ts +39 -9
  88. package/permits/utils.ts +0 -5
  89. package/permits/validation.test.ts +29 -32
  90. package/permits/validation.ts +114 -176
  91. package/web/client.web.test.ts +20 -25
  92. package/web/config.web.test.ts +0 -2
  93. package/web/encryptInputs.web.test.ts +31 -54
  94. package/web/index.ts +65 -1
  95. package/web/storage.ts +19 -5
  96. package/web/worker.builder.web.test.ts +148 -0
  97. package/web/worker.config.web.test.ts +329 -0
  98. package/web/worker.output.web.test.ts +84 -0
  99. package/web/workerManager.test.ts +80 -0
  100. package/web/workerManager.ts +214 -0
  101. package/web/workerManager.web.test.ts +114 -0
  102. package/web/zkProve.worker.ts +133 -0
  103. package/core/result.test.ts +0 -180
  104. package/core/result.ts +0 -67
  105. package/core/test-utils.ts +0 -45
  106. package/dist/types-KImPrEIe.d.cts +0 -48
  107. package/dist/types-KImPrEIe.d.ts +0 -48
package/dist/permits.d.ts CHANGED
@@ -1,919 +1,218 @@
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-S9CnI6MF.js';
2
- export { C as CreateSelfPermitOptions, d as CreateSharingPermitOptions, f as EIP712Domain, j as EIP712Type, i as EthEncryptedData, k as Expand, G as GenerateSealingKey, I as ImportPermitOptions, I as ImportSharedPermitOptions, e as PermitMetadata, g as PermitUtils, h as SealingKey, C as SelfPermitOptions, d as SharingPermitOptions } from './permit-S9CnI6MF.js';
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-MZ502UBl.js';
2
+ export { C as CreateSelfPermitOptions, d as CreateSharingPermitOptions, f as EIP712Domain, j as EIP712Type, i as EthEncryptedData, p as Expand, G as GenerateSealingKey, I as ImportPermitOptions, I as ImportSharedPermitOptions, o as PermitHashFields, 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-MZ502UBl.js';
3
3
  import { z } from 'zod';
4
4
  import * as zustand_middleware from 'zustand/middleware';
5
5
  import * as zustand_vanilla from 'zustand/vanilla';
6
6
  import 'viem';
7
7
 
8
+ declare const addressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
9
+ declare const addressNotZeroSchema: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
10
+ declare const bytesSchema: z.ZodCustom<`0x${string}`, `0x${string}`>;
11
+ declare const bytesNotEmptySchema: z.ZodCustom<`0x${string}`, `0x${string}`>;
8
12
  /**
9
13
  * Validator for self permit creation options
10
14
  */
11
- declare const SelfPermitOptionsValidator: z.ZodEffects<z.ZodObject<{
15
+ declare const SelfPermitOptionsValidator: z.ZodObject<{
12
16
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"self">>>;
13
- issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
17
+ issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
14
18
  name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
15
- expiration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
16
- recipient: z.ZodEffects<z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, `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
- name: string;
24
- type: "self";
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
- name?: string | undefined;
35
- type?: "self" | 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
- name: string;
44
- type: "self";
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
- name?: string | undefined;
55
- type?: "self" | undefined;
56
- expiration?: number | undefined;
57
- validatorId?: number | undefined;
58
- validatorContract?: string | undefined;
59
- issuerSignature?: string | undefined;
60
- recipientSignature?: string | undefined;
61
- }>;
19
+ expiration: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
20
+ recipient: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
21
+ validatorId: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
22
+ validatorContract: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
23
+ issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
24
+ recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
25
+ }, z.core.$strip>;
62
26
  /**
63
27
  * Validator for fully formed self permits
64
28
  */
65
- declare const SelfPermitValidator: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
29
+ declare const SelfPermitValidator: z.ZodObject<{
66
30
  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
- } & {
31
+ type: z.ZodEnum<{
32
+ self: "self";
33
+ sharing: "sharing";
34
+ recipient: "recipient";
35
+ }>;
36
+ issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
37
+ expiration: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
38
+ recipient: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
39
+ validatorId: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
40
+ validatorContract: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
41
+ issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
42
+ recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
76
43
  sealingPair: z.ZodOptional<z.ZodObject<{
77
44
  privateKey: z.ZodString;
78
45
  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
- name: string;
89
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
105
- privateKey: string;
106
- publicKey: string;
107
- } | undefined;
108
- name?: string | undefined;
109
- expiration?: number | undefined;
110
- validatorId?: number | undefined;
111
- validatorContract?: string | undefined;
112
- issuerSignature?: string | undefined;
113
- recipientSignature?: string | undefined;
114
- }>, {
115
- recipient: `0x${string}`;
116
- name: string;
117
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
133
- privateKey: string;
134
- publicKey: string;
135
- } | undefined;
136
- name?: string | undefined;
137
- expiration?: number | undefined;
138
- validatorId?: number | undefined;
139
- validatorContract?: string | undefined;
140
- issuerSignature?: string | undefined;
141
- recipientSignature?: string | undefined;
142
- }>, {
143
- recipient: `0x${string}`;
144
- name: string;
145
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
161
- privateKey: string;
162
- publicKey: string;
163
- } | undefined;
164
- name?: string | undefined;
165
- expiration?: number | undefined;
166
- validatorId?: number | undefined;
167
- validatorContract?: string | undefined;
168
- issuerSignature?: string | undefined;
169
- recipientSignature?: string | undefined;
170
- }>, {
171
- recipient: `0x${string}`;
172
- name: string;
173
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
189
- privateKey: string;
190
- publicKey: string;
191
- } | undefined;
192
- name?: string | undefined;
193
- expiration?: number | undefined;
194
- validatorId?: number | undefined;
195
- validatorContract?: string | undefined;
196
- issuerSignature?: string | undefined;
197
- recipientSignature?: string | undefined;
198
- }>, {
199
- recipient: `0x${string}`;
200
- name: string;
201
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
217
- privateKey: string;
218
- publicKey: string;
219
- } | undefined;
220
- name?: string | undefined;
221
- expiration?: number | undefined;
222
- validatorId?: number | undefined;
223
- validatorContract?: string | undefined;
224
- issuerSignature?: string | undefined;
225
- recipientSignature?: string | undefined;
226
- }>, {
227
- recipient: `0x${string}`;
228
- name: string;
229
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
245
- privateKey: string;
246
- publicKey: string;
247
- } | undefined;
248
- name?: string | undefined;
249
- expiration?: number | undefined;
250
- validatorId?: number | undefined;
251
- validatorContract?: string | undefined;
252
- issuerSignature?: string | undefined;
253
- recipientSignature?: string | undefined;
254
- }>;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>;
255
48
  /**
256
49
  * Validator for sharing permit creation options
257
50
  */
258
- declare const SharingPermitOptionsValidator: z.ZodEffects<z.ZodObject<{
51
+ declare const SharingPermitOptionsValidator: z.ZodObject<{
259
52
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"sharing">>>;
260
- issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
261
- recipient: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
53
+ issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
54
+ recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
262
55
  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
- name: string;
271
- type: "sharing";
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
- name?: string | undefined;
282
- type?: "sharing" | 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
- name: string;
291
- type: "sharing";
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
- name?: string | undefined;
302
- type?: "sharing" | undefined;
303
- expiration?: number | undefined;
304
- validatorId?: number | undefined;
305
- validatorContract?: string | undefined;
306
- issuerSignature?: string | undefined;
307
- recipientSignature?: string | undefined;
308
- }>;
56
+ expiration: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
57
+ validatorId: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
58
+ validatorContract: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
59
+ issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
60
+ recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
61
+ }, z.core.$strip>;
309
62
  /**
310
63
  * Validator for fully formed sharing permits
311
64
  */
312
- declare const SharingPermitValidator: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
65
+ declare const SharingPermitValidator: z.ZodObject<{
313
66
  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
- } & {
67
+ type: z.ZodEnum<{
68
+ self: "self";
69
+ sharing: "sharing";
70
+ recipient: "recipient";
71
+ }>;
72
+ issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
73
+ expiration: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
74
+ recipient: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
75
+ validatorId: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
76
+ validatorContract: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
77
+ issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
78
+ recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
323
79
  sealingPair: z.ZodOptional<z.ZodObject<{
324
80
  privateKey: z.ZodString;
325
81
  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
- name: string;
336
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
352
- privateKey: string;
353
- publicKey: string;
354
- } | undefined;
355
- name?: string | undefined;
356
- expiration?: number | undefined;
357
- validatorId?: number | undefined;
358
- validatorContract?: string | undefined;
359
- issuerSignature?: string | undefined;
360
- recipientSignature?: string | undefined;
361
- }>, {
362
- recipient: `0x${string}`;
363
- name: string;
364
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
380
- privateKey: string;
381
- publicKey: string;
382
- } | undefined;
383
- name?: string | undefined;
384
- expiration?: number | undefined;
385
- validatorId?: number | undefined;
386
- validatorContract?: string | undefined;
387
- issuerSignature?: string | undefined;
388
- recipientSignature?: string | undefined;
389
- }>, {
390
- recipient: `0x${string}`;
391
- name: string;
392
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
408
- privateKey: string;
409
- publicKey: string;
410
- } | undefined;
411
- name?: string | undefined;
412
- expiration?: number | undefined;
413
- validatorId?: number | undefined;
414
- validatorContract?: string | undefined;
415
- issuerSignature?: string | undefined;
416
- recipientSignature?: string | undefined;
417
- }>, {
418
- recipient: `0x${string}`;
419
- name: string;
420
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
436
- privateKey: string;
437
- publicKey: string;
438
- } | undefined;
439
- name?: string | undefined;
440
- expiration?: number | undefined;
441
- validatorId?: number | undefined;
442
- validatorContract?: string | undefined;
443
- issuerSignature?: string | undefined;
444
- recipientSignature?: string | undefined;
445
- }>, {
446
- recipient: `0x${string}`;
447
- name: string;
448
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
464
- privateKey: string;
465
- publicKey: string;
466
- } | undefined;
467
- name?: string | undefined;
468
- expiration?: number | undefined;
469
- validatorId?: number | undefined;
470
- validatorContract?: string | undefined;
471
- issuerSignature?: string | undefined;
472
- recipientSignature?: string | undefined;
473
- }>, {
474
- recipient: `0x${string}`;
475
- name: string;
476
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
492
- privateKey: string;
493
- publicKey: string;
494
- } | undefined;
495
- name?: string | undefined;
496
- expiration?: number | undefined;
497
- validatorId?: number | undefined;
498
- validatorContract?: string | undefined;
499
- issuerSignature?: string | undefined;
500
- recipientSignature?: string | undefined;
501
- }>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
502
84
  /**
503
85
  * Validator for import permit creation options (recipient receiving shared permit)
504
86
  */
505
- declare const ImportPermitOptionsValidator: z.ZodEffects<z.ZodObject<{
87
+ declare const ImportPermitOptionsValidator: z.ZodObject<{
506
88
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"recipient">>>;
507
- issuer: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
508
- recipient: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
509
- issuerSignature: z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>;
89
+ issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
90
+ recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
510
91
  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
- name: string;
518
- type: "recipient";
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
- name?: string | undefined;
530
- type?: "recipient" | undefined;
531
- expiration?: number | undefined;
532
- validatorId?: number | undefined;
533
- validatorContract?: string | undefined;
534
- recipientSignature?: string | undefined;
535
- }>, {
536
- recipient: `0x${string}`;
537
- name: string;
538
- type: "recipient";
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
- name?: string | undefined;
550
- type?: "recipient" | undefined;
551
- expiration?: number | undefined;
552
- validatorId?: number | undefined;
553
- validatorContract?: string | undefined;
554
- recipientSignature?: string | undefined;
555
- }>;
92
+ expiration: z.ZodInt;
93
+ validatorId: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
94
+ validatorContract: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
95
+ issuerSignature: z.ZodCustom<`0x${string}`, `0x${string}`>;
96
+ recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
97
+ }, z.core.$strip>;
556
98
  /**
557
99
  * Validator for fully formed import/recipient permits
558
100
  */
559
- declare const ImportPermitValidator: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
101
+ declare const ImportPermitValidator: z.ZodObject<{
560
102
  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
- } & {
103
+ type: z.ZodEnum<{
104
+ self: "self";
105
+ sharing: "sharing";
106
+ recipient: "recipient";
107
+ }>;
108
+ issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
109
+ expiration: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
110
+ recipient: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
111
+ validatorId: z.ZodDefault<z.ZodOptional<z.ZodInt>>;
112
+ validatorContract: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
113
+ issuerSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
114
+ recipientSignature: z.ZodDefault<z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
570
115
  sealingPair: z.ZodOptional<z.ZodObject<{
571
116
  privateKey: z.ZodString;
572
117
  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
- name: string;
583
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
599
- privateKey: string;
600
- publicKey: string;
601
- } | undefined;
602
- name?: string | undefined;
603
- expiration?: number | undefined;
604
- validatorId?: number | undefined;
605
- validatorContract?: string | undefined;
606
- issuerSignature?: string | undefined;
607
- recipientSignature?: string | undefined;
608
- }>, {
609
- recipient: `0x${string}`;
610
- name: string;
611
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
627
- privateKey: string;
628
- publicKey: string;
629
- } | undefined;
630
- name?: string | undefined;
631
- expiration?: number | undefined;
632
- validatorId?: number | undefined;
633
- validatorContract?: string | undefined;
634
- issuerSignature?: string | undefined;
635
- recipientSignature?: string | undefined;
636
- }>, {
637
- recipient: `0x${string}`;
638
- name: string;
639
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
655
- privateKey: string;
656
- publicKey: string;
657
- } | undefined;
658
- name?: string | undefined;
659
- expiration?: number | undefined;
660
- validatorId?: number | undefined;
661
- validatorContract?: string | undefined;
662
- issuerSignature?: string | undefined;
663
- recipientSignature?: string | undefined;
664
- }>, {
665
- recipient: `0x${string}`;
666
- name: string;
667
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
683
- privateKey: string;
684
- publicKey: string;
685
- } | undefined;
686
- name?: string | undefined;
687
- expiration?: number | undefined;
688
- validatorId?: number | undefined;
689
- validatorContract?: string | undefined;
690
- issuerSignature?: string | undefined;
691
- recipientSignature?: string | undefined;
692
- }>, {
693
- recipient: `0x${string}`;
694
- name: string;
695
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
711
- privateKey: string;
712
- publicKey: string;
713
- } | undefined;
714
- name?: string | undefined;
715
- expiration?: number | undefined;
716
- validatorId?: number | undefined;
717
- validatorContract?: string | undefined;
718
- issuerSignature?: string | undefined;
719
- recipientSignature?: string | undefined;
720
- }>, {
721
- recipient: `0x${string}`;
722
- name: string;
723
- type: "self" | "sharing" | "recipient";
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
- sealingPair?: {
739
- privateKey: string;
740
- publicKey: string;
741
- } | undefined;
742
- name?: string | undefined;
743
- expiration?: number | undefined;
744
- validatorId?: number | undefined;
745
- validatorContract?: string | undefined;
746
- issuerSignature?: string | undefined;
747
- recipientSignature?: string | undefined;
748
- }>;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip>;
749
120
  /**
750
121
  * Validates self permit creation options
751
122
  */
752
- declare const validateSelfPermitOptions: (options: any) => z.SafeParseReturnType<{
753
- issuer: string;
754
- recipient?: string | undefined;
755
- name?: string | undefined;
756
- type?: "self" | 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
- name: string;
123
+ declare const validateSelfPermitOptions: (options: any) => {
765
124
  type: "self";
766
125
  issuer: `0x${string}`;
126
+ name: string;
767
127
  expiration: number;
128
+ recipient: `0x${string}`;
768
129
  validatorId: number;
769
130
  validatorContract: `0x${string}`;
770
131
  issuerSignature: `0x${string}`;
771
132
  recipientSignature: `0x${string}`;
772
- }>;
133
+ };
773
134
  /**
774
135
  * Validates sharing permit creation options
775
136
  */
776
- declare const validateSharingPermitOptions: (options: any) => z.SafeParseReturnType<{
777
- recipient: string;
778
- issuer: string;
779
- name?: string | undefined;
780
- type?: "sharing" | 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
- name: string;
137
+ declare const validateSharingPermitOptions: (options: any) => {
789
138
  type: "sharing";
790
139
  issuer: `0x${string}`;
140
+ recipient: `0x${string}`;
141
+ name: string;
791
142
  expiration: number;
792
143
  validatorId: number;
793
144
  validatorContract: `0x${string}`;
794
145
  issuerSignature: `0x${string}`;
795
146
  recipientSignature: `0x${string}`;
796
- }>;
147
+ };
797
148
  /**
798
149
  * Validates import permit creation options
799
150
  */
800
- declare const validateImportPermitOptions: (options: any) => z.SafeParseReturnType<{
801
- recipient: string;
802
- issuer: string;
803
- issuerSignature: string;
804
- name?: string | undefined;
805
- type?: "recipient" | undefined;
806
- expiration?: number | undefined;
807
- validatorId?: number | undefined;
808
- validatorContract?: string | undefined;
809
- recipientSignature?: string | undefined;
810
- }, {
811
- recipient: `0x${string}`;
812
- name: string;
151
+ declare const validateImportPermitOptions: (options: any) => {
813
152
  type: "recipient";
814
153
  issuer: `0x${string}`;
154
+ recipient: `0x${string}`;
155
+ name: string;
815
156
  expiration: number;
816
157
  validatorId: number;
817
158
  validatorContract: `0x${string}`;
818
159
  issuerSignature: `0x${string}`;
819
160
  recipientSignature: `0x${string}`;
820
- }>;
161
+ };
821
162
  /**
822
163
  * Validates a fully formed self permit
823
164
  */
824
- declare const validateSelfPermit: (permit: any) => z.SafeParseReturnType<{
825
- type: "self" | "sharing" | "recipient";
826
- issuer: string;
827
- recipient?: string | undefined;
828
- sealingPair?: {
829
- privateKey: string;
830
- publicKey: string;
831
- } | undefined;
832
- name?: string | undefined;
833
- expiration?: number | undefined;
834
- validatorId?: number | undefined;
835
- validatorContract?: string | undefined;
836
- issuerSignature?: string | undefined;
837
- recipientSignature?: string | undefined;
838
- }, {
839
- recipient: `0x${string}`;
165
+ declare const validateSelfPermit: (permit: any) => {
840
166
  name: string;
841
167
  type: "self" | "sharing" | "recipient";
842
168
  issuer: `0x${string}`;
843
169
  expiration: number;
170
+ recipient: `0x${string}`;
844
171
  validatorId: number;
845
172
  validatorContract: `0x${string}`;
846
- issuerSignature: string;
847
- recipientSignature: string;
173
+ issuerSignature: `0x${string}`;
174
+ recipientSignature: `0x${string}`;
848
175
  sealingPair?: {
849
176
  privateKey: string;
850
177
  publicKey: string;
851
178
  } | undefined;
852
- }>;
179
+ };
853
180
  /**
854
181
  * Validates a fully formed sharing permit
855
182
  */
856
- declare const validateSharingPermit: (permit: any) => z.SafeParseReturnType<{
857
- type: "self" | "sharing" | "recipient";
858
- issuer: string;
859
- recipient?: string | undefined;
860
- sealingPair?: {
861
- privateKey: string;
862
- publicKey: string;
863
- } | undefined;
864
- name?: string | undefined;
865
- expiration?: number | undefined;
866
- validatorId?: number | undefined;
867
- validatorContract?: string | undefined;
868
- issuerSignature?: string | undefined;
869
- recipientSignature?: string | undefined;
870
- }, {
871
- recipient: `0x${string}`;
183
+ declare const validateSharingPermit: (permit: any) => {
872
184
  name: string;
873
185
  type: "self" | "sharing" | "recipient";
874
186
  issuer: `0x${string}`;
875
187
  expiration: number;
188
+ recipient: `0x${string}`;
876
189
  validatorId: number;
877
190
  validatorContract: `0x${string}`;
878
- issuerSignature: string;
879
- recipientSignature: string;
191
+ issuerSignature: `0x${string}`;
192
+ recipientSignature: `0x${string}`;
880
193
  sealingPair?: {
881
194
  privateKey: string;
882
195
  publicKey: string;
883
196
  } | undefined;
884
- }>;
197
+ };
885
198
  /**
886
199
  * Validates a fully formed import/recipient permit
887
200
  */
888
- declare const validateImportPermit: (permit: any) => z.SafeParseReturnType<{
889
- type: "self" | "sharing" | "recipient";
890
- issuer: string;
891
- recipient?: string | undefined;
892
- sealingPair?: {
893
- privateKey: string;
894
- publicKey: string;
895
- } | undefined;
896
- name?: string | undefined;
897
- expiration?: number | undefined;
898
- validatorId?: number | undefined;
899
- validatorContract?: string | undefined;
900
- issuerSignature?: string | undefined;
901
- recipientSignature?: string | undefined;
902
- }, {
903
- recipient: `0x${string}`;
201
+ declare const validateImportPermit: (permit: any) => {
904
202
  name: string;
905
203
  type: "self" | "sharing" | "recipient";
906
204
  issuer: `0x${string}`;
907
205
  expiration: number;
206
+ recipient: `0x${string}`;
908
207
  validatorId: number;
909
208
  validatorContract: `0x${string}`;
910
- issuerSignature: string;
911
- recipientSignature: string;
209
+ issuerSignature: `0x${string}`;
210
+ recipientSignature: `0x${string}`;
912
211
  sealingPair?: {
913
212
  privateKey: string;
914
213
  publicKey: string;
915
214
  } | undefined;
916
- }>;
215
+ };
917
216
  /**
918
217
  * Simple validation functions for common checks
919
218
  */
@@ -993,23 +292,18 @@ type PermitsStore = {
993
292
  permits: ChainRecord<AccountRecord<HashRecord<SerializedPermit | undefined>>>;
994
293
  activePermitHash: ChainRecord<AccountRecord<string | undefined>>;
995
294
  };
295
+ declare const PERMIT_STORE_DEFAULTS: PermitsStore;
996
296
  declare const _permitStore: Omit<zustand_vanilla.StoreApi<PermitsStore>, "setState" | "persist"> & {
997
297
  setState(partial: PermitsStore | Partial<PermitsStore> | ((state: PermitsStore) => PermitsStore | Partial<PermitsStore>), replace?: false | undefined): unknown;
998
298
  setState(state: PermitsStore | ((state: PermitsStore) => PermitsStore), replace: true): unknown;
999
299
  persist: {
1000
- setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, {
1001
- permits: {};
1002
- activePermitHash: {};
1003
- }, unknown>>) => void;
300
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>) => void;
1004
301
  clearStorage: () => void;
1005
302
  rehydrate: () => Promise<void> | void;
1006
303
  hasHydrated: () => boolean;
1007
304
  onHydrate: (fn: (state: PermitsStore) => void) => () => void;
1008
305
  onFinishHydration: (fn: (state: PermitsStore) => void) => () => void;
1009
- getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, {
1010
- permits: {};
1011
- activePermitHash: {};
1012
- }, unknown>>;
306
+ getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>;
1013
307
  };
1014
308
  };
1015
309
  declare const clearStaleStore: () => void;
@@ -1017,7 +311,7 @@ declare const getPermit: (chainId: number | undefined, account: string | undefin
1017
311
  declare const getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined;
1018
312
  declare const getPermits: (chainId: number | undefined, account: string | undefined) => Record<string, Permit>;
1019
313
  declare const setPermit: (chainId: number, account: string, permit: Permit) => void;
1020
- declare const removePermit: (chainId: number, account: string, hash: string, force?: boolean) => void;
314
+ declare const removePermit: (chainId: number, account: string, hash: string) => void;
1021
315
  declare const getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined;
1022
316
  declare const setActivePermitHash: (chainId: number, account: string, hash: string) => void;
1023
317
  declare const removeActivePermitHash: (chainId: number, account: string) => void;
@@ -1027,30 +321,24 @@ declare const permitStore: {
1027
321
  setState(partial: PermitsStore | Partial<PermitsStore> | ((state: PermitsStore) => PermitsStore | Partial<PermitsStore>), replace?: false | undefined): unknown;
1028
322
  setState(state: PermitsStore | ((state: PermitsStore) => PermitsStore), replace: true): unknown;
1029
323
  persist: {
1030
- setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, {
1031
- permits: {};
1032
- activePermitHash: {};
1033
- }, unknown>>) => void;
324
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>) => void;
1034
325
  clearStorage: () => void;
1035
326
  rehydrate: () => Promise<void> | void;
1036
327
  hasHydrated: () => boolean;
1037
328
  onHydrate: (fn: (state: PermitsStore) => void) => () => void;
1038
329
  onFinishHydration: (fn: (state: PermitsStore) => void) => () => void;
1039
- getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, {
1040
- permits: {};
1041
- activePermitHash: {};
1042
- }, unknown>>;
330
+ getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>;
1043
331
  };
1044
332
  };
1045
333
  getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined;
1046
334
  getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined;
1047
335
  getPermits: (chainId: number | undefined, account: string | undefined) => Record<string, Permit>;
1048
336
  setPermit: (chainId: number, account: string, permit: Permit) => void;
1049
- removePermit: (chainId: number, account: string, hash: string, force?: boolean) => void;
337
+ removePermit: (chainId: number, account: string, hash: string) => void;
1050
338
  getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined;
1051
339
  setActivePermitHash: (chainId: number, account: string, hash: string) => void;
1052
340
  removeActivePermitHash: (chainId: number, account: string) => void;
1053
341
  resetStore: () => void;
1054
342
  };
1055
343
 
1056
- export { EIP712Message, EIP712Types, ImportPermitOptionsValidator, ImportPermitValidator, 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 };
344
+ export { EIP712Message, EIP712Types, ImportPermitOptionsValidator, ImportPermitValidator, PERMIT_STORE_DEFAULTS, Permission, Permit, PermitSignaturePrimaryType, SelfPermitOptionsValidator, SelfPermitValidator, SerializedPermit, SharingPermitOptionsValidator, SharingPermitValidator, SignatureTypes, SignatureUtils, ValidationResult, ValidationUtils, _permitStore, addressNotZeroSchema, addressSchema, bytesNotEmptySchema, bytesSchema, clearStaleStore, getActivePermit, getActivePermitHash, getPermit, getPermits, getSignatureTypesAndMessage, permitStore, removeActivePermitHash, removePermit, resetStore, setActivePermitHash, setPermit, validateImportPermit, validateImportPermitOptions, validateSelfPermit, validateSelfPermitOptions, validateSharingPermit, validateSharingPermitOptions };