@cofhe/sdk 0.2.0 → 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.
- package/CHANGELOG.md +8 -0
- package/chains/defineChain.ts +2 -2
- package/chains/types.ts +3 -3
- package/core/client.test.ts +111 -0
- package/core/client.ts +22 -2
- package/core/clientTypes.ts +7 -1
- package/core/config.test.ts +8 -0
- package/core/config.ts +10 -4
- package/core/consts.ts +18 -0
- package/core/decrypt/cofheMocksSealOutput.ts +2 -4
- package/core/encrypt/cofheMocksZkVerifySign.ts +4 -11
- package/core/index.ts +9 -1
- package/core/permits.test.ts +5 -6
- package/core/permits.ts +5 -4
- package/dist/chains.cjs +4 -7
- package/dist/chains.d.cts +12 -12
- package/dist/chains.d.ts +12 -12
- package/dist/chains.js +1 -1
- package/dist/{chunk-WGCRJCBR.js → chunk-I5WFEYXX.js} +33 -19
- package/dist/{chunk-UGBVZNRT.js → chunk-R3B5TMVX.js} +308 -189
- package/dist/{chunk-WEAZ25JO.js → chunk-TBLR7NNE.js} +4 -7
- package/dist/{clientTypes-Es7fyi65.d.ts → clientTypes-RqkgkV2i.d.ts} +34 -93
- package/dist/{clientTypes-5_1nwtUe.d.cts → clientTypes-e4filDzK.d.cts} +34 -93
- package/dist/core.cjs +343 -208
- package/dist/core.d.cts +17 -6
- package/dist/core.d.ts +17 -6
- package/dist/core.js +3 -3
- package/dist/node.cjs +337 -208
- package/dist/node.d.cts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js +3 -3
- package/dist/{permit-fUSe6KKq.d.cts → permit-MZ502UBl.d.cts} +30 -33
- package/dist/{permit-fUSe6KKq.d.ts → permit-MZ502UBl.d.ts} +30 -33
- package/dist/permits.cjs +305 -187
- package/dist/permits.d.cts +111 -812
- package/dist/permits.d.ts +111 -812
- package/dist/permits.js +1 -1
- package/dist/types-YiAC4gig.d.cts +33 -0
- package/dist/types-YiAC4gig.d.ts +33 -0
- package/dist/web.cjs +337 -208
- package/dist/web.d.cts +3 -3
- package/dist/web.d.ts +3 -3
- package/dist/web.js +3 -3
- package/package.json +3 -3
- package/permits/localstorage.test.ts +9 -13
- package/permits/onchain-utils.ts +221 -0
- package/permits/permit.test.ts +51 -5
- package/permits/permit.ts +28 -74
- package/permits/store.test.ts +10 -50
- package/permits/store.ts +4 -14
- package/permits/test-utils.ts +10 -2
- package/permits/types.ts +22 -9
- package/permits/utils.ts +0 -4
- package/permits/validation.test.ts +29 -32
- package/permits/validation.ts +112 -194
- package/dist/types-KImPrEIe.d.cts +0 -48
- package/dist/types-KImPrEIe.d.ts +0 -48
package/dist/permits.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { GenerateSealingKey, ImportPermitOptionsValidator, ImportPermitValidator, PERMIT_STORE_DEFAULTS, PermitUtils, SealingKey, SelfPermitOptionsValidator, SelfPermitValidator, SharingPermitOptionsValidator, SharingPermitValidator, SignatureTypes, SignatureUtils, ValidationUtils, _permitStore, clearStaleStore, getActivePermit, getActivePermitHash, getPermit, getPermits, getSignatureTypesAndMessage, permitStore, removeActivePermitHash, removePermit, resetStore, setActivePermitHash, setPermit, validateImportPermit, validateImportPermitOptions, validateSelfPermit, validateSelfPermitOptions, validateSharingPermit, validateSharingPermitOptions } from './chunk-
|
|
1
|
+
export { GenerateSealingKey, ImportPermitOptionsValidator, ImportPermitValidator, PERMIT_STORE_DEFAULTS, PermitUtils, SealingKey, SelfPermitOptionsValidator, SelfPermitValidator, SharingPermitOptionsValidator, SharingPermitValidator, SignatureTypes, SignatureUtils, ValidationUtils, _permitStore, addressNotZeroSchema, addressSchema, bytesNotEmptySchema, bytesSchema, clearStaleStore, getActivePermit, getActivePermitHash, getPermit, getPermits, getSignatureTypesAndMessage, permitStore, removeActivePermitHash, removePermit, resetStore, setActivePermitHash, setPermit, validateImportPermit, validateImportPermitOptions, validateSelfPermit, validateSelfPermitOptions, validateSharingPermit, validateSharingPermitOptions } from './chunk-R3B5TMVX.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Environment schema for @cofhe/sdk chains
|
|
5
|
+
*/
|
|
6
|
+
declare const EnvironmentSchema: z.ZodEnum<{
|
|
7
|
+
MOCK: "MOCK";
|
|
8
|
+
TESTNET: "TESTNET";
|
|
9
|
+
MAINNET: "MAINNET";
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Zod schema for CofheChain validation
|
|
13
|
+
*/
|
|
14
|
+
declare const CofheChainSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodNumber;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
network: z.ZodString;
|
|
18
|
+
coFheUrl: z.ZodURL;
|
|
19
|
+
verifierUrl: z.ZodURL;
|
|
20
|
+
thresholdNetworkUrl: z.ZodURL;
|
|
21
|
+
environment: z.ZodEnum<{
|
|
22
|
+
MOCK: "MOCK";
|
|
23
|
+
TESTNET: "TESTNET";
|
|
24
|
+
MAINNET: "MAINNET";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/**
|
|
28
|
+
* Type inference from the schema
|
|
29
|
+
*/
|
|
30
|
+
type CofheChain = z.infer<typeof CofheChainSchema>;
|
|
31
|
+
type Environment = z.infer<typeof EnvironmentSchema>;
|
|
32
|
+
|
|
33
|
+
export type { CofheChain as C, Environment as E };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Environment schema for @cofhe/sdk chains
|
|
5
|
+
*/
|
|
6
|
+
declare const EnvironmentSchema: z.ZodEnum<{
|
|
7
|
+
MOCK: "MOCK";
|
|
8
|
+
TESTNET: "TESTNET";
|
|
9
|
+
MAINNET: "MAINNET";
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Zod schema for CofheChain validation
|
|
13
|
+
*/
|
|
14
|
+
declare const CofheChainSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodNumber;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
network: z.ZodString;
|
|
18
|
+
coFheUrl: z.ZodURL;
|
|
19
|
+
verifierUrl: z.ZodURL;
|
|
20
|
+
thresholdNetworkUrl: z.ZodURL;
|
|
21
|
+
environment: z.ZodEnum<{
|
|
22
|
+
MOCK: "MOCK";
|
|
23
|
+
TESTNET: "TESTNET";
|
|
24
|
+
MAINNET: "MAINNET";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
/**
|
|
28
|
+
* Type inference from the schema
|
|
29
|
+
*/
|
|
30
|
+
type CofheChain = z.infer<typeof CofheChainSchema>;
|
|
31
|
+
type Environment = z.infer<typeof EnvironmentSchema>;
|
|
32
|
+
|
|
33
|
+
export type { CofheChain as C, Environment as E };
|