@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/core.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as CofhesdkClientConnectionState, a as CofhesdkConfig, d as CofhesdkClientParams, b as CofhesdkClient, F as FheTypes } from './clientTypes-
|
|
2
|
-
export { h as CofhesdkClientPermits, C as CofhesdkInputConfig, f as CofhesdkInternalConfig, X as DecryptHandlesBuilder, W as EncryptInputsBuilder, B as EncryptSetStateFn, M as EncryptStep, D as EncryptStepCallbackContext, J as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, x as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, y as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, H as FheAllUTypes, R as FheKeyDeserializer, A as FheTypeValue, G as FheUintUTypes, I as IStorage, T as KeysStorage, V as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, Z as ZkBuilderAndCrsGenerator, Y as ZkProveWorkerFunction, _ as ZkProveWorkerRequest, $ as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofhesdkConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofhesdkConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a0 as zkProveWithWorker } from './clientTypes-
|
|
1
|
+
import { c as CofhesdkClientConnectionState, a as CofhesdkConfig, d as CofhesdkClientParams, b as CofhesdkClient, F as FheTypes } from './clientTypes-e4filDzK.cjs';
|
|
2
|
+
export { h as CofhesdkClientPermits, C as CofhesdkInputConfig, f as CofhesdkInternalConfig, X as DecryptHandlesBuilder, W as EncryptInputsBuilder, B as EncryptSetStateFn, M as EncryptStep, D as EncryptStepCallbackContext, J as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, x as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, y as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, H as FheAllUTypes, R as FheKeyDeserializer, A as FheTypeValue, G as FheUintUTypes, I as IStorage, T as KeysStorage, V as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, Z as ZkBuilderAndCrsGenerator, Y as ZkProveWorkerFunction, _ as ZkProveWorkerRequest, $ as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofhesdkConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofhesdkConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a0 as zkProveWithWorker } from './clientTypes-e4filDzK.cjs';
|
|
3
3
|
import 'viem';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-YiAC4gig.cjs';
|
|
5
5
|
import 'zod';
|
|
6
|
-
import './permit-
|
|
6
|
+
import './permit-MZ502UBl.cjs';
|
|
7
7
|
import 'zustand/vanilla';
|
|
8
8
|
|
|
9
9
|
declare const InitialConnectStore: CofhesdkClientConnectionState;
|
|
@@ -100,7 +100,18 @@ declare class CofhesdkError extends Error {
|
|
|
100
100
|
}
|
|
101
101
|
declare const isCofhesdkError: (error: unknown) => error is CofhesdkError;
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
/** Main Task Manager contract address */
|
|
104
|
+
declare const TASK_MANAGER_ADDRESS: "0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9";
|
|
105
|
+
/** Mock ZK Verifier contract address (used for testing) */
|
|
106
|
+
declare const MOCKS_ZK_VERIFIER_ADDRESS: "0x0000000000000000000000000000000000005001";
|
|
107
|
+
/** Mock Query Decrypter contract address (used for testing) */
|
|
108
|
+
declare const MOCKS_QUERY_DECRYPTER_ADDRESS: "0x0000000000000000000000000000000000005002";
|
|
109
|
+
/** Test Bed contract address (used for testing) */
|
|
110
|
+
declare const TEST_BED_ADDRESS: "0x0000000000000000000000000000000000005003";
|
|
111
|
+
/** Private key for the Mock ZK Verifier signer account */
|
|
112
|
+
declare const MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY: "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
|
|
113
|
+
/** Address for the Mock ZK Verifier signer account */
|
|
114
|
+
declare const MOCKS_ZK_VERIFIER_SIGNER_ADDRESS: "0x6E12D8C87503D4287c294f2Fdef96ACd9DFf6bd2";
|
|
104
115
|
|
|
105
116
|
/**
|
|
106
117
|
* Converts FheTypes enum to string representation for serialization
|
|
@@ -108,4 +119,4 @@ declare const MOCKS_ZK_VERIFIER_SIGNER_ADDRESS = "0x6E12D8C87503D4287c294f2Fdef9
|
|
|
108
119
|
*/
|
|
109
120
|
declare function fheTypeToString(utype: FheTypes): string;
|
|
110
121
|
|
|
111
|
-
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofhesdkClient, CofhesdkClientConnectionState, CofhesdkClientParams, CofhesdkConfig, CofhesdkError, CofhesdkErrorCode, type CofhesdkErrorParams, FheTypes, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, createCofhesdkClientBase, fheTypeToString, isCofhesdkError };
|
|
122
|
+
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofhesdkClient, CofhesdkClientConnectionState, CofhesdkClientParams, CofhesdkConfig, CofhesdkError, CofhesdkErrorCode, type CofhesdkErrorParams, FheTypes, MOCKS_QUERY_DECRYPTER_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TEST_BED_ADDRESS, createCofhesdkClientBase, fheTypeToString, isCofhesdkError };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as CofhesdkClientConnectionState, a as CofhesdkConfig, d as CofhesdkClientParams, b as CofhesdkClient, F as FheTypes } from './clientTypes-
|
|
2
|
-
export { h as CofhesdkClientPermits, C as CofhesdkInputConfig, f as CofhesdkInternalConfig, X as DecryptHandlesBuilder, W as EncryptInputsBuilder, B as EncryptSetStateFn, M as EncryptStep, D as EncryptStepCallbackContext, J as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, x as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, y as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, H as FheAllUTypes, R as FheKeyDeserializer, A as FheTypeValue, G as FheUintUTypes, I as IStorage, T as KeysStorage, V as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, Z as ZkBuilderAndCrsGenerator, Y as ZkProveWorkerFunction, _ as ZkProveWorkerRequest, $ as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofhesdkConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofhesdkConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a0 as zkProveWithWorker } from './clientTypes-
|
|
1
|
+
import { c as CofhesdkClientConnectionState, a as CofhesdkConfig, d as CofhesdkClientParams, b as CofhesdkClient, F as FheTypes } from './clientTypes-RqkgkV2i.js';
|
|
2
|
+
export { h as CofhesdkClientPermits, C as CofhesdkInputConfig, f as CofhesdkInternalConfig, X as DecryptHandlesBuilder, W as EncryptInputsBuilder, B as EncryptSetStateFn, M as EncryptStep, D as EncryptStepCallbackContext, J as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, x as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, y as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, H as FheAllUTypes, R as FheKeyDeserializer, A as FheTypeValue, G as FheUintUTypes, I as IStorage, T as KeysStorage, V as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, Z as ZkBuilderAndCrsGenerator, Y as ZkProveWorkerFunction, _ as ZkProveWorkerRequest, $ as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofhesdkConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofhesdkConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a0 as zkProveWithWorker } from './clientTypes-RqkgkV2i.js';
|
|
3
3
|
import 'viem';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-YiAC4gig.js';
|
|
5
5
|
import 'zod';
|
|
6
|
-
import './permit-
|
|
6
|
+
import './permit-MZ502UBl.js';
|
|
7
7
|
import 'zustand/vanilla';
|
|
8
8
|
|
|
9
9
|
declare const InitialConnectStore: CofhesdkClientConnectionState;
|
|
@@ -100,7 +100,18 @@ declare class CofhesdkError extends Error {
|
|
|
100
100
|
}
|
|
101
101
|
declare const isCofhesdkError: (error: unknown) => error is CofhesdkError;
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
/** Main Task Manager contract address */
|
|
104
|
+
declare const TASK_MANAGER_ADDRESS: "0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9";
|
|
105
|
+
/** Mock ZK Verifier contract address (used for testing) */
|
|
106
|
+
declare const MOCKS_ZK_VERIFIER_ADDRESS: "0x0000000000000000000000000000000000005001";
|
|
107
|
+
/** Mock Query Decrypter contract address (used for testing) */
|
|
108
|
+
declare const MOCKS_QUERY_DECRYPTER_ADDRESS: "0x0000000000000000000000000000000000005002";
|
|
109
|
+
/** Test Bed contract address (used for testing) */
|
|
110
|
+
declare const TEST_BED_ADDRESS: "0x0000000000000000000000000000000000005003";
|
|
111
|
+
/** Private key for the Mock ZK Verifier signer account */
|
|
112
|
+
declare const MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY: "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
|
|
113
|
+
/** Address for the Mock ZK Verifier signer account */
|
|
114
|
+
declare const MOCKS_ZK_VERIFIER_SIGNER_ADDRESS: "0x6E12D8C87503D4287c294f2Fdef96ACd9DFf6bd2";
|
|
104
115
|
|
|
105
116
|
/**
|
|
106
117
|
* Converts FheTypes enum to string representation for serialization
|
|
@@ -108,4 +119,4 @@ declare const MOCKS_ZK_VERIFIER_SIGNER_ADDRESS = "0x6E12D8C87503D4287c294f2Fdef9
|
|
|
108
119
|
*/
|
|
109
120
|
declare function fheTypeToString(utype: FheTypes): string;
|
|
110
121
|
|
|
111
|
-
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofhesdkClient, CofhesdkClientConnectionState, CofhesdkClientParams, CofhesdkConfig, CofhesdkError, CofhesdkErrorCode, type CofhesdkErrorParams, FheTypes, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, createCofhesdkClientBase, fheTypeToString, isCofhesdkError };
|
|
122
|
+
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofhesdkClient, CofhesdkClientConnectionState, CofhesdkClientParams, CofhesdkConfig, CofhesdkError, CofhesdkErrorCode, type CofhesdkErrorParams, FheTypes, MOCKS_QUERY_DECRYPTER_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TEST_BED_ADDRESS, createCofhesdkClientBase, fheTypeToString, isCofhesdkError };
|
package/dist/core.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofhesdkError, CofhesdkErrorCode, DecryptHandlesBuilder, EncryptInputsBuilder, EncryptStep, Encryptable, FheAllUTypes, FheTypes, FheUintUTypes,
|
|
2
|
-
import './chunk-
|
|
3
|
-
|
|
1
|
+
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofhesdkError, CofhesdkErrorCode, DecryptHandlesBuilder, EncryptInputsBuilder, EncryptStep, Encryptable, FheAllUTypes, FheTypes, FheUintUTypes, assertCorrectEncryptedItemInput, createCofhesdkClientBase, createCofhesdkConfigBase, createKeysStore, fetchKeys, fheTypeToString, getCofhesdkConfigItem, isCofhesdkError, isEncryptableItem, isLastEncryptionStep, zkProveWithWorker } from './chunk-I5WFEYXX.js';
|
|
2
|
+
import './chunk-TBLR7NNE.js';
|
|
3
|
+
export { MOCKS_QUERY_DECRYPTER_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TEST_BED_ADDRESS } from './chunk-R3B5TMVX.js';
|