@cofhe/sdk 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/acps/acp.ts +411 -0
  3. package/acps/index.ts +70 -0
  4. package/{permits → acps}/onchain-utils.ts +49 -24
  5. package/acps/sealing.ts +90 -0
  6. package/acps/signature.ts +89 -0
  7. package/acps/store.ts +172 -0
  8. package/acps/test/acp.test.ts +615 -0
  9. package/acps/test/localstorage.test.ts +105 -0
  10. package/acps/test/sealing.test.ts +77 -0
  11. package/acps/test/store.test.ts +88 -0
  12. package/acps/test/validation.test.ts +361 -0
  13. package/acps/test-utils.ts +32 -0
  14. package/acps/types.ts +252 -0
  15. package/acps/validation.ts +392 -0
  16. package/adapters/test/ethers5.test.ts +4 -1
  17. package/adapters/test/ethers6.test.ts +4 -1
  18. package/adapters/test/wagmi.test.ts +5 -2
  19. package/chains/chains/stagingCofhe.ts +21 -0
  20. package/chains/index.ts +3 -1
  21. package/chains/test/chains.test.ts +2 -1
  22. package/core/acps.ts +625 -0
  23. package/core/client.ts +136 -39
  24. package/core/clientTypes.ts +52 -41
  25. package/core/config.ts +66 -5
  26. package/core/debug.ts +72 -0
  27. package/core/decrypt/MockThresholdNetworkAbi.ts +20 -11
  28. package/core/decrypt/apiError.ts +104 -0
  29. package/core/decrypt/cofheMocksDecryptForTx.ts +11 -11
  30. package/core/decrypt/cofheMocksDecryptForView.ts +7 -7
  31. package/core/decrypt/decryptForTxBuilder.ts +102 -102
  32. package/core/decrypt/decryptForViewBuilder.ts +90 -90
  33. package/core/decrypt/submitRetry.ts +38 -30
  34. package/core/decrypt/tnDecryptV1.ts +5 -5
  35. package/core/decrypt/tnDecryptV2.ts +45 -34
  36. package/core/decrypt/tnSealOutputV1.ts +4 -3
  37. package/core/decrypt/tnSealOutputV2.ts +44 -31
  38. package/core/encrypt/cofheMocksZkVerifySign.ts +59 -74
  39. package/core/encrypt/encryptInputsBuilder.ts +86 -52
  40. package/core/encrypt/zkPackProveVerify.ts +25 -18
  41. package/core/error.ts +34 -6
  42. package/core/index.ts +14 -14
  43. package/core/test/acpDefaults.test.ts +52 -0
  44. package/core/test/acps.test.ts +596 -0
  45. package/core/test/apiError.test.ts +130 -0
  46. package/core/test/client.test.ts +22 -19
  47. package/core/test/config.test.ts +25 -5
  48. package/core/test/decrypt.test.ts +40 -35
  49. package/core/test/decryptBuilders.test.ts +68 -68
  50. package/core/test/decryptErrorCodes.test.ts +217 -0
  51. package/core/test/encryptInputsBuilder.test.ts +72 -41
  52. package/core/test/pollCallbacks.test.ts +89 -18
  53. package/core/test/stagingRedirect.ts +18 -0
  54. package/core/test/submitRetry.test.ts +182 -0
  55. package/core/types.ts +9 -69
  56. package/dist/acp-Wi6isVQI.d.cts +407 -0
  57. package/dist/acp-Wi6isVQI.d.ts +407 -0
  58. package/dist/acps.cjs +1081 -0
  59. package/dist/acps.d.cts +480 -0
  60. package/dist/acps.d.ts +480 -0
  61. package/dist/acps.js +2 -0
  62. package/dist/chains.cjs +14 -1
  63. package/dist/chains.d.cts +30 -1
  64. package/dist/chains.d.ts +30 -1
  65. package/dist/chains.js +1 -1
  66. package/dist/{chunk-PE5V5CCV.js → chunk-43USWPEH.js} +1000 -604
  67. package/dist/{chunk-MTRAXQXC.js → chunk-N6IDQRRU.js} +14 -2
  68. package/dist/chunk-Q7CBWGQX.js +1029 -0
  69. package/dist/{clientTypes-CyUvRRzA.d.ts → clientTypes-BN3nbzYM.d.ts} +342 -165
  70. package/dist/{clientTypes-BDy1qIBu.d.cts → clientTypes-CYZjFznO.d.cts} +342 -165
  71. package/dist/core.cjs +1431 -1026
  72. package/dist/core.d.cts +55 -10
  73. package/dist/core.d.ts +55 -10
  74. package/dist/core.js +3 -3
  75. package/dist/node.cjs +1356 -976
  76. package/dist/node.d.cts +2 -2
  77. package/dist/node.d.ts +2 -2
  78. package/dist/node.js +3 -3
  79. package/dist/web.cjs +1356 -976
  80. package/dist/web.d.cts +2 -2
  81. package/dist/web.d.ts +2 -2
  82. package/dist/web.js +3 -3
  83. package/node/test/inherited.test.ts +75 -65
  84. package/node/test/tfheinit.test.ts +23 -8
  85. package/package.json +6 -6
  86. package/web/test/client.web.test.ts +5 -1
  87. package/web/test/inherited.web.test.ts +75 -65
  88. package/web/test/tfheinit.web.test.ts +14 -5
  89. package/web/test/worker.config.web.test.ts +38 -23
  90. package/web/test/worker.output.web.test.ts +25 -24
  91. package/core/encrypt/encryptUtils.ts +0 -67
  92. package/core/permits.ts +0 -206
  93. package/core/test/permits.test.ts +0 -534
  94. package/dist/chunk-VB62WYPL.js +0 -978
  95. package/dist/permit-DnVMDT5h.d.cts +0 -376
  96. package/dist/permit-DnVMDT5h.d.ts +0 -376
  97. package/dist/permits.cjs +0 -1026
  98. package/dist/permits.d.cts +0 -353
  99. package/dist/permits.d.ts +0 -353
  100. package/dist/permits.js +0 -2
  101. package/permits/index.ts +0 -68
  102. package/permits/permit.ts +0 -385
  103. package/permits/sealing.ts +0 -131
  104. package/permits/signature.ts +0 -79
  105. package/permits/store.ts +0 -157
  106. package/permits/test/localstorage.test.ts +0 -113
  107. package/permits/test/permit.test.ts +0 -557
  108. package/permits/test/sealing.test.ts +0 -84
  109. package/permits/test/store.test.ts +0 -88
  110. package/permits/test/validation.test.ts +0 -361
  111. package/permits/test-utils.ts +0 -28
  112. package/permits/types.ts +0 -204
  113. package/permits/validation.ts +0 -327
  114. /package/{permits → acps}/utils.ts +0 -0
@@ -1,353 +0,0 @@
1
- import { P as Permit, V as ValidationResult, a as Permission, b as PermitSignaturePrimaryType, E as EIP712Types, c as EIP712Message, S as SerializedPermit } from './permit-DnVMDT5h.cjs';
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-DnVMDT5h.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
- 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}`>;
12
- /**
13
- * Validator for self permit creation options
14
- */
15
- declare const SelfPermitOptionsValidator: z.ZodObject<{
16
- type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"self">>>;
17
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
18
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
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>;
26
- /**
27
- * Validator for fully formed self permits
28
- */
29
- declare const SelfPermitValidator: z.ZodObject<{
30
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
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}`>>>;
43
- sealingPair: z.ZodOptional<z.ZodObject<{
44
- privateKey: z.ZodString;
45
- publicKey: z.ZodString;
46
- }, z.core.$strip>>;
47
- }, z.core.$strip>;
48
- /**
49
- * Validator for sharing permit creation options
50
- */
51
- declare const SharingPermitOptionsValidator: z.ZodObject<{
52
- type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"sharing">>>;
53
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
54
- recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
55
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
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>;
62
- /**
63
- * Validator for fully formed sharing permits
64
- */
65
- declare const SharingPermitValidator: z.ZodObject<{
66
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
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}`>>>;
79
- sealingPair: z.ZodOptional<z.ZodObject<{
80
- privateKey: z.ZodString;
81
- publicKey: z.ZodString;
82
- }, z.core.$strip>>;
83
- }, z.core.$strip>;
84
- /**
85
- * Validator for import permit creation options (recipient receiving shared permit)
86
- */
87
- declare const ImportPermitOptionsValidator: z.ZodObject<{
88
- type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"recipient">>>;
89
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
90
- recipient: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
91
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
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>;
98
- /**
99
- * Validator for fully formed import/recipient permits
100
- */
101
- declare const ImportPermitValidator: z.ZodObject<{
102
- name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
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}`>>>;
115
- sealingPair: z.ZodOptional<z.ZodObject<{
116
- privateKey: z.ZodString;
117
- publicKey: z.ZodString;
118
- }, z.core.$strip>>;
119
- }, z.core.$strip>;
120
- /**
121
- * Validates self permit creation options
122
- */
123
- declare const validateSelfPermitOptions: (options: any) => {
124
- type: "self";
125
- issuer: `0x${string}`;
126
- name: string;
127
- expiration: number;
128
- recipient: `0x${string}`;
129
- validatorId: number;
130
- validatorContract: `0x${string}`;
131
- issuerSignature: `0x${string}`;
132
- recipientSignature: `0x${string}`;
133
- };
134
- /**
135
- * Validates sharing permit creation options
136
- */
137
- declare const validateSharingPermitOptions: (options: any) => {
138
- type: "sharing";
139
- issuer: `0x${string}`;
140
- recipient: `0x${string}`;
141
- name: string;
142
- expiration: number;
143
- validatorId: number;
144
- validatorContract: `0x${string}`;
145
- issuerSignature: `0x${string}`;
146
- recipientSignature: `0x${string}`;
147
- };
148
- /**
149
- * Validates import permit creation options
150
- */
151
- declare const validateImportPermitOptions: (options: any) => {
152
- type: "recipient";
153
- issuer: `0x${string}`;
154
- recipient: `0x${string}`;
155
- name: string;
156
- expiration: number;
157
- validatorId: number;
158
- validatorContract: `0x${string}`;
159
- issuerSignature: `0x${string}`;
160
- recipientSignature: `0x${string}`;
161
- };
162
- /**
163
- * Validates a fully formed self permit
164
- */
165
- declare const validateSelfPermit: (permit: any) => {
166
- name: string;
167
- type: "self" | "sharing" | "recipient";
168
- issuer: `0x${string}`;
169
- expiration: number;
170
- recipient: `0x${string}`;
171
- validatorId: number;
172
- validatorContract: `0x${string}`;
173
- issuerSignature: `0x${string}`;
174
- recipientSignature: `0x${string}`;
175
- sealingPair?: {
176
- privateKey: string;
177
- publicKey: string;
178
- } | undefined;
179
- };
180
- /**
181
- * Validates a fully formed sharing permit
182
- */
183
- declare const validateSharingPermit: (permit: any) => {
184
- name: string;
185
- type: "self" | "sharing" | "recipient";
186
- issuer: `0x${string}`;
187
- expiration: number;
188
- recipient: `0x${string}`;
189
- validatorId: number;
190
- validatorContract: `0x${string}`;
191
- issuerSignature: `0x${string}`;
192
- recipientSignature: `0x${string}`;
193
- sealingPair?: {
194
- privateKey: string;
195
- publicKey: string;
196
- } | undefined;
197
- };
198
- /**
199
- * Validates a fully formed import/recipient permit
200
- */
201
- declare const validateImportPermit: (permit: any) => {
202
- name: string;
203
- type: "self" | "sharing" | "recipient";
204
- issuer: `0x${string}`;
205
- expiration: number;
206
- recipient: `0x${string}`;
207
- validatorId: number;
208
- validatorContract: `0x${string}`;
209
- issuerSignature: `0x${string}`;
210
- recipientSignature: `0x${string}`;
211
- sealingPair?: {
212
- privateKey: string;
213
- publicKey: string;
214
- } | undefined;
215
- };
216
- /**
217
- * Simple validation functions for common checks
218
- */
219
- declare const ValidationUtils: {
220
- /**
221
- * Check if permit is expired
222
- */
223
- isExpired: (permit: Permit) => boolean;
224
- /**
225
- * Check if permit is signed by the active party
226
- */
227
- isSigned: (permit: Permit) => boolean;
228
- /**
229
- * Checks that a permit is signed and not expired.
230
- */
231
- isSignedAndNotExpired: (permit: Permit) => ValidationResult;
232
- /**
233
- * Asserts that a permit is signed and not expired.
234
- *
235
- * Throws `Error` with message:
236
- * - `Permit is expired`
237
- * - `Permit is not signed`
238
- */
239
- assertSignedAndNotExpired: (permit: Permit) => void;
240
- isValid: (permit: Permit) => ValidationResult;
241
- };
242
-
243
- declare const PermitSignatureAllFields: readonly [{
244
- readonly name: "issuer";
245
- readonly type: "address";
246
- }, {
247
- readonly name: "expiration";
248
- readonly type: "uint64";
249
- }, {
250
- readonly name: "recipient";
251
- readonly type: "address";
252
- }, {
253
- readonly name: "validatorId";
254
- readonly type: "uint256";
255
- }, {
256
- readonly name: "validatorContract";
257
- readonly type: "address";
258
- }, {
259
- readonly name: "sealingKey";
260
- readonly type: "bytes32";
261
- }, {
262
- readonly name: "issuerSignature";
263
- readonly type: "bytes";
264
- }];
265
- type PermitSignatureFieldOption = (typeof PermitSignatureAllFields)[number]['name'];
266
- declare const SignatureTypes: {
267
- readonly PermissionedV2IssuerSelf: ("recipient" | "issuer" | "expiration" | "validatorId" | "validatorContract" | "sealingKey")[];
268
- readonly PermissionedV2IssuerShared: ("recipient" | "issuer" | "expiration" | "validatorId" | "validatorContract")[];
269
- readonly PermissionedV2Recipient: ("issuerSignature" | "sealingKey")[];
270
- };
271
- /**
272
- * Get signature types and message for EIP712 signing
273
- */
274
- declare const getSignatureTypesAndMessage: <T extends PermitSignatureFieldOption>(primaryType: PermitSignaturePrimaryType, fields: T[] | readonly T[], values: Pick<Permission, T> & Partial<Permission>) => {
275
- types: EIP712Types;
276
- primaryType: string;
277
- message: EIP712Message;
278
- };
279
- /**
280
- * Signature utilities for permit operations
281
- */
282
- declare const SignatureUtils: {
283
- /**
284
- * Get signature parameters for a permit
285
- */
286
- getSignatureParams: (permit: Permission, primaryType: PermitSignaturePrimaryType) => {
287
- types: EIP712Types;
288
- primaryType: string;
289
- message: EIP712Message;
290
- };
291
- /**
292
- * Determine the required signature type based on permit type
293
- */
294
- getPrimaryType: (permitType: "self" | "sharing" | "recipient") => PermitSignaturePrimaryType;
295
- };
296
-
297
- type ChainRecord<T> = Record<number, T>;
298
- type AccountRecord<T> = Record<string, T>;
299
- type HashRecord<T> = Record<string, T>;
300
- type PermitsStore = {
301
- permits: ChainRecord<AccountRecord<HashRecord<SerializedPermit | undefined>>>;
302
- activePermitHash: ChainRecord<AccountRecord<string | undefined>>;
303
- };
304
- declare const PERMIT_STORE_DEFAULTS: PermitsStore;
305
- declare const _permitStore: Omit<zustand_vanilla.StoreApi<PermitsStore>, "setState" | "persist"> & {
306
- setState(partial: PermitsStore | Partial<PermitsStore> | ((state: PermitsStore) => PermitsStore | Partial<PermitsStore>), replace?: false | undefined): unknown;
307
- setState(state: PermitsStore | ((state: PermitsStore) => PermitsStore), replace: true): unknown;
308
- persist: {
309
- setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>) => void;
310
- clearStorage: () => void;
311
- rehydrate: () => Promise<void> | void;
312
- hasHydrated: () => boolean;
313
- onHydrate: (fn: (state: PermitsStore) => void) => () => void;
314
- onFinishHydration: (fn: (state: PermitsStore) => void) => () => void;
315
- getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>;
316
- };
317
- };
318
- declare const clearStaleStore: () => void;
319
- declare const getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined;
320
- declare const getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined;
321
- declare const getPermits: (chainId: number | undefined, account: string | undefined) => Record<string, Permit>;
322
- declare const setPermit: (chainId: number, account: string, permit: Permit) => void;
323
- declare const removePermit: (chainId: number, account: string, hash: string) => void;
324
- declare const getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined;
325
- declare const setActivePermitHash: (chainId: number, account: string, hash: string) => void;
326
- declare const removeActivePermitHash: (chainId: number, account: string) => void;
327
- declare const resetStore: () => void;
328
- declare const permitStore: {
329
- store: Omit<zustand_vanilla.StoreApi<PermitsStore>, "setState" | "persist"> & {
330
- setState(partial: PermitsStore | Partial<PermitsStore> | ((state: PermitsStore) => PermitsStore | Partial<PermitsStore>), replace?: false | undefined): unknown;
331
- setState(state: PermitsStore | ((state: PermitsStore) => PermitsStore), replace: true): unknown;
332
- persist: {
333
- setOptions: (options: Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>) => void;
334
- clearStorage: () => void;
335
- rehydrate: () => Promise<void> | void;
336
- hasHydrated: () => boolean;
337
- onHydrate: (fn: (state: PermitsStore) => void) => () => void;
338
- onFinishHydration: (fn: (state: PermitsStore) => void) => () => void;
339
- getOptions: () => Partial<zustand_middleware.PersistOptions<PermitsStore, PermitsStore, unknown>>;
340
- };
341
- };
342
- getPermit: (chainId: number | undefined, account: string | undefined, hash: string | undefined) => Permit | undefined;
343
- getActivePermit: (chainId: number | undefined, account: string | undefined) => Permit | undefined;
344
- getPermits: (chainId: number | undefined, account: string | undefined) => Record<string, Permit>;
345
- setPermit: (chainId: number, account: string, permit: Permit) => void;
346
- removePermit: (chainId: number, account: string, hash: string) => void;
347
- getActivePermitHash: (chainId: number | undefined, account: string | undefined) => string | undefined;
348
- setActivePermitHash: (chainId: number, account: string, hash: string) => void;
349
- removeActivePermitHash: (chainId: number, account: string) => void;
350
- resetStore: () => void;
351
- };
352
-
353
- 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 };