@cofhe/sdk 0.5.2 → 0.6.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 +30 -0
- package/chains/chains/hardhat.ts +3 -3
- package/core/consts.ts +0 -3
- package/core/debug.ts +72 -0
- package/core/decrypt/tnDecryptV2.ts +20 -13
- package/core/decrypt/tnSealOutputV2.ts +20 -13
- package/core/encrypt/cofheMocksZkVerifySign.ts +2 -2
- package/core/encrypt/encryptInputsBuilder.ts +46 -11
- package/core/encrypt/zkPackProveVerify.ts +3 -3
- package/core/index.ts +23 -1
- package/core/permits.ts +17 -7
- package/core/test/encryptInputsBuilder.test.ts +35 -0
- package/core/test/permits.test.ts +62 -0
- package/core/types.ts +65 -5
- package/dist/chains.cjs +3 -3
- package/dist/chains.js +1 -1
- package/dist/{chunk-4FP4V35O.js → chunk-ESMZCFJY.js} +1 -2
- package/dist/{chunk-TBLR7NNE.js → chunk-MTRAXQXC.js} +3 -3
- package/dist/{chunk-YDOK4BDL.js → chunk-NOC3PYB7.js} +108 -33
- package/dist/{chunk-MRCKUMOS.js → chunk-VB62WYPL.js} +1 -1
- package/dist/{clientTypes-BJbFeeno.d.cts → clientTypes-BDy1qIBu.d.cts} +73 -11
- package/dist/{clientTypes-CEno_BEf.d.ts → clientTypes-CyUvRRzA.d.ts} +73 -11
- package/dist/core.cjs +110 -34
- package/dist/core.d.cts +26 -5
- package/dist/core.d.ts +26 -5
- package/dist/core.js +4 -4
- package/dist/node.cjs +100 -32
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +4 -4
- package/dist/permits.d.cts +10 -6
- package/dist/permits.d.ts +10 -6
- package/dist/permits.js +2 -2
- package/dist/web.cjs +100 -32
- package/dist/web.d.cts +1 -1
- package/dist/web.d.ts +1 -1
- package/dist/web.js +4 -4
- package/dist/zkProve.worker.js +1 -1
- package/package.json +2 -2
- package/permits/store.ts +1 -0
- package/web/test/ssr.test.ts +23 -0
- package/web/test/tfheinit.web.test.ts +81 -5
|
@@ -59,13 +59,13 @@ type EncryptedNumber = {
|
|
|
59
59
|
data: Uint8Array;
|
|
60
60
|
securityZone: number;
|
|
61
61
|
};
|
|
62
|
-
type EncryptedItemInput
|
|
62
|
+
type EncryptedItemInput = {
|
|
63
63
|
ctHash: bigint;
|
|
64
64
|
securityZone: number;
|
|
65
65
|
utype: FheTypes;
|
|
66
|
-
signature:
|
|
66
|
+
signature: `0x${string}`;
|
|
67
67
|
};
|
|
68
|
-
declare function assertCorrectEncryptedItemInput(input: EncryptedItemInput): asserts input is EncryptedItemInput
|
|
68
|
+
declare function assertCorrectEncryptedItemInput(input: EncryptedItemInput): asserts input is EncryptedItemInput;
|
|
69
69
|
type EncryptedBoolInput = EncryptedItemInput & {
|
|
70
70
|
utype: FheTypes.Bool;
|
|
71
71
|
};
|
|
@@ -165,6 +165,55 @@ type EncryptStepCallbackContext = Record<string, any> & {
|
|
|
165
165
|
duration: number;
|
|
166
166
|
};
|
|
167
167
|
type EncryptStepCallbackFunction = (state: EncryptStep, context?: EncryptStepCallbackContext) => void;
|
|
168
|
+
/**
|
|
169
|
+
* Branded bytes32 types for external encrypted inputs (Solidity: externalEbool, externalEuint*, externalEaddress).
|
|
170
|
+
* The readonly `utype` field brands each hash so it can't be accidentally passed to the wrong asE* function.
|
|
171
|
+
*/
|
|
172
|
+
type ExternalBoolHash = `0x${string}` & {
|
|
173
|
+
readonly utype: FheTypes.Bool;
|
|
174
|
+
};
|
|
175
|
+
type ExternalUint8Hash = `0x${string}` & {
|
|
176
|
+
readonly utype: FheTypes.Uint8;
|
|
177
|
+
};
|
|
178
|
+
type ExternalUint16Hash = `0x${string}` & {
|
|
179
|
+
readonly utype: FheTypes.Uint16;
|
|
180
|
+
};
|
|
181
|
+
type ExternalUint32Hash = `0x${string}` & {
|
|
182
|
+
readonly utype: FheTypes.Uint32;
|
|
183
|
+
};
|
|
184
|
+
type ExternalUint64Hash = `0x${string}` & {
|
|
185
|
+
readonly utype: FheTypes.Uint64;
|
|
186
|
+
};
|
|
187
|
+
type ExternalUint128Hash = `0x${string}` & {
|
|
188
|
+
readonly utype: FheTypes.Uint128;
|
|
189
|
+
};
|
|
190
|
+
type ExternalAddressHash = `0x${string}` & {
|
|
191
|
+
readonly utype: FheTypes.Uint160;
|
|
192
|
+
};
|
|
193
|
+
/** Branded bytes proof blob (Solidity: bytes memory proof). */
|
|
194
|
+
type ExternalHashProof = `0x${string}` & {
|
|
195
|
+
readonly _kind: 'ExternalHashProof';
|
|
196
|
+
};
|
|
197
|
+
/** Union of all External*Hash types — useful for utilities that operate on any hash without caring about the specific FHE type. */
|
|
198
|
+
type AnyExternalHash = ExternalBoolHash | ExternalUint8Hash | ExternalUint16Hash | ExternalUint32Hash | ExternalUint64Hash | ExternalUint128Hash | ExternalAddressHash;
|
|
199
|
+
/**
|
|
200
|
+
* Maps a single EncryptableItem to its corresponding External*Hash type.
|
|
201
|
+
* Mirrors EncryptableToEncryptedItemInputMap.
|
|
202
|
+
*/
|
|
203
|
+
type EncryptableToExternalHashMap<E extends EncryptableItem> = E extends EncryptableBool ? ExternalBoolHash : E extends EncryptableUint8 ? ExternalUint8Hash : E extends EncryptableUint16 ? ExternalUint16Hash : E extends EncryptableUint32 ? ExternalUint32Hash : E extends EncryptableUint64 ? ExternalUint64Hash : E extends EncryptableUint128 ? ExternalUint128Hash : E extends EncryptableAddress ? ExternalAddressHash : never;
|
|
204
|
+
/**
|
|
205
|
+
* Maps an EncryptableItem[] tuple to a tuple of corresponding External*Hash types,
|
|
206
|
+
* preserving index positions. e.g. [EncryptableBool, EncryptableUint32] → [ExternalBoolHash, ExternalUint32Hash]
|
|
207
|
+
*/
|
|
208
|
+
type ExternalItemHashes<T extends EncryptableItem[]> = {
|
|
209
|
+
[K in keyof T]: T[K] extends EncryptableItem ? EncryptableToExternalHashMap<T[K]> : never;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Return type of EncryptInputsBuilder.execute() when asHashPlusProof() is set.
|
|
213
|
+
* Tuple of per-input hashes in input order, followed by a single proof blob.
|
|
214
|
+
* e.g. [Encryptable.bool(true), Encryptable.uint32(5)] → [ExternalBoolHash, ExternalUint32Hash, ExternalHashProof]
|
|
215
|
+
*/
|
|
216
|
+
type HashPlusProofResult<T extends EncryptableItem[]> = [...ExternalItemHashes<T>, ExternalHashProof];
|
|
168
217
|
type DecryptEndpoint = 'decrypt' | 'sealoutput';
|
|
169
218
|
type DecryptPollCallbackContext = {
|
|
170
219
|
operation: DecryptEndpoint;
|
|
@@ -702,10 +751,11 @@ type EncryptInputsBuilderParams<T extends EncryptableItem[]> = BaseBuilderParams
|
|
|
702
751
|
* account, securityZone, and chainId can be overridden in the builder.
|
|
703
752
|
* config, tfhePublicKeyDeserializer, compactPkeCrsDeserializer, and zkBuilderAndCrsGenerator are required to be set in the builder.
|
|
704
753
|
*/
|
|
705
|
-
declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuilder {
|
|
754
|
+
declare class EncryptInputsBuilder<T extends EncryptableItem[], HPP extends boolean = false> extends BaseBuilder {
|
|
706
755
|
private securityZone;
|
|
707
756
|
private stepCallback?;
|
|
708
757
|
private inputItems;
|
|
758
|
+
private hpp;
|
|
709
759
|
private zkvWalletClient;
|
|
710
760
|
private tfhePublicKeyDeserializer;
|
|
711
761
|
private compactPkeCrsDeserializer;
|
|
@@ -730,7 +780,7 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
730
780
|
*
|
|
731
781
|
* @returns The chainable EncryptInputsBuilder instance.
|
|
732
782
|
*/
|
|
733
|
-
setAccount(account: string): EncryptInputsBuilder<T>;
|
|
783
|
+
setAccount(account: string): EncryptInputsBuilder<T, HPP>;
|
|
734
784
|
getAccount(): string | undefined;
|
|
735
785
|
/**
|
|
736
786
|
* @param chainId - Chain that will consume the encrypted inputs.
|
|
@@ -746,7 +796,7 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
746
796
|
*
|
|
747
797
|
* @returns The chainable EncryptInputsBuilder instance.
|
|
748
798
|
*/
|
|
749
|
-
setChainId(chainId: number): EncryptInputsBuilder<T>;
|
|
799
|
+
setChainId(chainId: number): EncryptInputsBuilder<T, HPP>;
|
|
750
800
|
getChainId(): number | undefined;
|
|
751
801
|
/**
|
|
752
802
|
* @param securityZone - Security zone to encrypt the inputs for.
|
|
@@ -762,8 +812,19 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
762
812
|
*
|
|
763
813
|
* @returns The chainable EncryptInputsBuilder instance.
|
|
764
814
|
*/
|
|
765
|
-
setSecurityZone(securityZone: number): EncryptInputsBuilder<T>;
|
|
815
|
+
setSecurityZone(securityZone: number): EncryptInputsBuilder<T, HPP>;
|
|
766
816
|
getSecurityZone(): number;
|
|
817
|
+
/**
|
|
818
|
+
* Example:
|
|
819
|
+
* ```typescript
|
|
820
|
+
* const encrypted = await encryptInputs([Encryptable.uint128(10n)])
|
|
821
|
+
* .asHashPlusProof()
|
|
822
|
+
* .execute();
|
|
823
|
+
* ```
|
|
824
|
+
*
|
|
825
|
+
* @returns Chainable EncryptInputsBuilder instance that will return a HashPlusProofResult instead of an array of EncryptedItemInputs.
|
|
826
|
+
*/
|
|
827
|
+
asHashPlusProof(): EncryptInputsBuilder<T, true>;
|
|
767
828
|
/**
|
|
768
829
|
* @param useWorker - Whether to use Web Workers for ZK proof generation.
|
|
769
830
|
*
|
|
@@ -778,7 +839,7 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
778
839
|
*
|
|
779
840
|
* @returns The chainable EncryptInputsBuilder instance.
|
|
780
841
|
*/
|
|
781
|
-
setUseWorker(useWorker: boolean): EncryptInputsBuilder<T>;
|
|
842
|
+
setUseWorker(useWorker: boolean): EncryptInputsBuilder<T, HPP>;
|
|
782
843
|
/**
|
|
783
844
|
* Gets the current worker configuration.
|
|
784
845
|
*
|
|
@@ -808,7 +869,7 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
808
869
|
*
|
|
809
870
|
* @returns The EncryptInputsBuilder instance.
|
|
810
871
|
*/
|
|
811
|
-
onStep(callback: EncryptStepCallbackFunction): EncryptInputsBuilder<T>;
|
|
872
|
+
onStep(callback: EncryptStepCallbackFunction): EncryptInputsBuilder<T, HPP>;
|
|
812
873
|
getStepCallback(): EncryptStepCallbackFunction | undefined;
|
|
813
874
|
/**
|
|
814
875
|
* Fires the step callback if set
|
|
@@ -849,6 +910,7 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
849
910
|
* In the production context, perform a true encryption with the CoFHE coprocessor.
|
|
850
911
|
*/
|
|
851
912
|
private productionExecute;
|
|
913
|
+
private structsToHashPlusProof;
|
|
852
914
|
/**
|
|
853
915
|
* Final step of the encryption process. MUST BE CALLED LAST IN THE CHAIN.
|
|
854
916
|
*
|
|
@@ -868,7 +930,7 @@ declare class EncryptInputsBuilder<T extends EncryptableItem[]> extends BaseBuil
|
|
|
868
930
|
*
|
|
869
931
|
* @returns The encrypted inputs.
|
|
870
932
|
*/
|
|
871
|
-
execute(): Promise<[...EncryptedItemInputs<T>]>;
|
|
933
|
+
execute(): Promise<HPP extends true ? HashPlusProofResult<T> : [...EncryptedItemInputs<T>]>;
|
|
872
934
|
}
|
|
873
935
|
|
|
874
936
|
declare const permits: {
|
|
@@ -1001,4 +1063,4 @@ type CofheClientParams<TConfig extends CofheConfig> = {
|
|
|
1001
1063
|
zkProveWorkerFn?: ZkProveWorkerFunction;
|
|
1002
1064
|
};
|
|
1003
1065
|
|
|
1004
|
-
export {
|
|
1066
|
+
export { Encryptable as $, type FheTypeValue as A, type ExternalBoolHash as B, type CofheInputConfig as C, type ExternalUint8Hash as D, type EncryptableItem as E, FheTypes as F, type ExternalUint16Hash as G, type ExternalUint32Hash as H, type IStorage as I, type ExternalUint64Hash as J, type ExternalUint128Hash as K, type LiteralToPrimitive as L, type ExternalAddressHash as M, type ExternalHashProof as N, type AnyExternalHash as O, type Primitive as P, type EncryptableToExternalHashMap as Q, type ExternalItemHashes as R, type HashPlusProofResult as S, type DecryptPollCallbackFunction as T, type UnsealedItem as U, type DecryptPollCallbackContext as V, type DecryptEndpoint as W, type EncryptStepCallbackFunction as X, type EncryptStepCallbackContext as Y, FheUintUTypes as Z, FheAllUTypes as _, type CofheConfig as a, isEncryptableItem as a0, EncryptStep as a1, isLastEncryptionStep as a2, assertCorrectEncryptedItemInput as a3, fetchKeys as a4, type FheKeyDeserializer as a5, createKeysStore as a6, type KeysStorage as a7, type KeysStore as a8, EncryptInputsBuilder as a9, DecryptForViewBuilder as aa, DecryptForTxBuilder as ab, type DecryptForTxResult as ac, type ZkBuilderAndCrsGenerator as ad, type ZkProveWorkerFunction as ae, type ZkProveWorkerRequest as af, type ZkProveWorkerResponse as ag, zkProveWithWorker as ah, type CofheClient as b, type CofheClientParams as c, type CofheClientConnectionState as d, createCofheConfigBase as e, type CofheInternalConfig as f, getCofheConfigItem as g, type CofheClientPermits as h, type EncryptableBool as i, type EncryptableUint8 as j, type EncryptableUint16 as k, type EncryptableUint32 as l, type EncryptableUint64 as m, type EncryptableUint128 as n, type EncryptableAddress as o, type EncryptedNumber as p, type EncryptedItemInput as q, type EncryptedBoolInput as r, type EncryptedUint8Input as s, type EncryptedUint16Input as t, type EncryptedUint32Input as u, type EncryptedUint64Input as v, type EncryptedUint128Input as w, type EncryptedAddressInput as x, type EncryptedItemInputs as y, type EncryptableToEncryptedItemInputMap as z };
|
package/dist/core.cjs
CHANGED
|
@@ -154,7 +154,6 @@ var isCofheError = (error) => error instanceof CofheError;
|
|
|
154
154
|
var TASK_MANAGER_ADDRESS = "0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9";
|
|
155
155
|
var MOCKS_ZK_VERIFIER_ADDRESS = "0x0000000000000000000000000000000000005001";
|
|
156
156
|
var MOCKS_THRESHOLD_NETWORK_ADDRESS = "0x0000000000000000000000000000000000005002";
|
|
157
|
-
var TEST_BED_ADDRESS = "0x0000000000000000000000000000000000005003";
|
|
158
157
|
var MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY = "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
|
|
159
158
|
var MOCKS_ZK_VERIFIER_SIGNER_ADDRESS = "0x6E12D8C87503D4287c294f2Fdef96ACd9DFf6bd2";
|
|
160
159
|
var MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d";
|
|
@@ -546,7 +545,7 @@ var zkVerify = async (verifierUrl, serializedBytes, address, securityZone, chain
|
|
|
546
545
|
}
|
|
547
546
|
};
|
|
548
547
|
var concatSigRecid = (signature, recid) => {
|
|
549
|
-
return signature
|
|
548
|
+
return `${signature}${(recid + 27).toString(16).padStart(2, "0")}`;
|
|
550
549
|
};
|
|
551
550
|
|
|
552
551
|
// core/encrypt/MockZkVerifierAbi.ts
|
|
@@ -878,9 +877,9 @@ var hardhat2 = defineChain({
|
|
|
878
877
|
name: "Hardhat",
|
|
879
878
|
network: "localhost",
|
|
880
879
|
// These are unused in the mock environment
|
|
881
|
-
coFheUrl: "http://
|
|
882
|
-
verifierUrl: "http://
|
|
883
|
-
thresholdNetworkUrl: "http://
|
|
880
|
+
coFheUrl: "http://ignored-in-mock-environment",
|
|
881
|
+
verifierUrl: "http://ignored-in-mock-environment",
|
|
882
|
+
thresholdNetworkUrl: "http://ignored-in-mock-environment",
|
|
884
883
|
environment: "MOCK"
|
|
885
884
|
});
|
|
886
885
|
var CofheConfigSchema = zod.z.object({
|
|
@@ -1269,6 +1268,7 @@ var EncryptInputsBuilder = class extends BaseBuilder {
|
|
|
1269
1268
|
securityZone;
|
|
1270
1269
|
stepCallback;
|
|
1271
1270
|
inputItems;
|
|
1271
|
+
hpp = false;
|
|
1272
1272
|
zkvWalletClient;
|
|
1273
1273
|
tfhePublicKeyDeserializer;
|
|
1274
1274
|
compactPkeCrsDeserializer;
|
|
@@ -1398,6 +1398,20 @@ var EncryptInputsBuilder = class extends BaseBuilder {
|
|
|
1398
1398
|
getSecurityZone() {
|
|
1399
1399
|
return this.securityZone;
|
|
1400
1400
|
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Example:
|
|
1403
|
+
* ```typescript
|
|
1404
|
+
* const encrypted = await encryptInputs([Encryptable.uint128(10n)])
|
|
1405
|
+
* .asHashPlusProof()
|
|
1406
|
+
* .execute();
|
|
1407
|
+
* ```
|
|
1408
|
+
*
|
|
1409
|
+
* @returns Chainable EncryptInputsBuilder instance that will return a HashPlusProofResult instead of an array of EncryptedItemInputs.
|
|
1410
|
+
*/
|
|
1411
|
+
asHashPlusProof() {
|
|
1412
|
+
this.hpp = true;
|
|
1413
|
+
return this;
|
|
1414
|
+
}
|
|
1401
1415
|
/**
|
|
1402
1416
|
* @param useWorker - Whether to use Web Workers for ZK proof generation.
|
|
1403
1417
|
*
|
|
@@ -1679,6 +1693,15 @@ var EncryptInputsBuilder = class extends BaseBuilder {
|
|
|
1679
1693
|
this.fireStepEnd("verify" /* Verify */);
|
|
1680
1694
|
return encryptedInputs;
|
|
1681
1695
|
}
|
|
1696
|
+
structsToHashPlusProof(inItems) {
|
|
1697
|
+
let hashes = [];
|
|
1698
|
+
let proof = "";
|
|
1699
|
+
for (const item of inItems) {
|
|
1700
|
+
hashes.push("0x" + item.ctHash.toString(16).padStart(64, "0"));
|
|
1701
|
+
proof += item.signature;
|
|
1702
|
+
}
|
|
1703
|
+
return [...hashes, proof];
|
|
1704
|
+
}
|
|
1682
1705
|
/**
|
|
1683
1706
|
* Final step of the encryption process. MUST BE CALLED LAST IN THE CHAIN.
|
|
1684
1707
|
*
|
|
@@ -1699,9 +1722,14 @@ var EncryptInputsBuilder = class extends BaseBuilder {
|
|
|
1699
1722
|
* @returns The encrypted inputs.
|
|
1700
1723
|
*/
|
|
1701
1724
|
async execute() {
|
|
1725
|
+
let items;
|
|
1702
1726
|
if (this.chainId === chains.hardhat.id)
|
|
1703
|
-
|
|
1704
|
-
|
|
1727
|
+
items = await this.mocksExecute();
|
|
1728
|
+
else
|
|
1729
|
+
items = await this.productionExecute();
|
|
1730
|
+
if (this.hpp)
|
|
1731
|
+
return this.structsToHashPlusProof(items);
|
|
1732
|
+
return items;
|
|
1705
1733
|
}
|
|
1706
1734
|
};
|
|
1707
1735
|
|
|
@@ -2724,7 +2752,7 @@ var getOrCreateSelfPermit = async (publicClient, walletClient, chainId, account,
|
|
|
2724
2752
|
const _chainId = chainId ?? await publicClient.getChainId();
|
|
2725
2753
|
const _account = account ?? walletClient.account.address;
|
|
2726
2754
|
const activePermit = await getActivePermit2(_chainId, _account);
|
|
2727
|
-
if (activePermit && activePermit.type === "self") {
|
|
2755
|
+
if (activePermit && activePermit.type === "self" && PermitUtils.isValid(activePermit).valid) {
|
|
2728
2756
|
return activePermit;
|
|
2729
2757
|
}
|
|
2730
2758
|
return createSelf(options ?? { issuer: _account, name: "Autogenerated Self Permit" }, publicClient, walletClient);
|
|
@@ -2733,7 +2761,7 @@ var getOrCreateSharingPermit = async (publicClient, walletClient, options, chain
|
|
|
2733
2761
|
const _chainId = chainId ?? await publicClient.getChainId();
|
|
2734
2762
|
const _account = account ?? walletClient.account.address;
|
|
2735
2763
|
const activePermit = await getActivePermit2(_chainId, _account);
|
|
2736
|
-
if (activePermit && activePermit.type === "sharing") {
|
|
2764
|
+
if (activePermit && activePermit.type === "sharing" && PermitUtils.isValid(activePermit).valid) {
|
|
2737
2765
|
return activePermit;
|
|
2738
2766
|
}
|
|
2739
2767
|
return createSharing(options, publicClient, walletClient);
|
|
@@ -2992,6 +3020,36 @@ async function cofheMocksDecryptForView(ctHash, utype, permit, publicClient) {
|
|
|
2992
3020
|
return unsealed;
|
|
2993
3021
|
}
|
|
2994
3022
|
|
|
3023
|
+
// core/debug.ts
|
|
3024
|
+
var interceptors = {};
|
|
3025
|
+
function setCofheDebugInterceptors(next) {
|
|
3026
|
+
interceptors.onRequest = next?.onRequest;
|
|
3027
|
+
interceptors.onResponse = next?.onResponse;
|
|
3028
|
+
}
|
|
3029
|
+
function getCofheDebugInterceptors() {
|
|
3030
|
+
return interceptors;
|
|
3031
|
+
}
|
|
3032
|
+
async function cofheFetch(url, init, ctx = { op: "request" }) {
|
|
3033
|
+
let finalUrl = url;
|
|
3034
|
+
let finalInit = init;
|
|
3035
|
+
if (interceptors.onRequest) {
|
|
3036
|
+
const override = await interceptors.onRequest(finalUrl, finalInit, ctx);
|
|
3037
|
+
if (override) {
|
|
3038
|
+
if (override.url !== void 0)
|
|
3039
|
+
finalUrl = override.url;
|
|
3040
|
+
if (override.init !== void 0)
|
|
3041
|
+
finalInit = override.init;
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
let response = await fetch(finalUrl, finalInit);
|
|
3045
|
+
if (interceptors.onResponse) {
|
|
3046
|
+
const replaced = await interceptors.onResponse(response, ctx);
|
|
3047
|
+
if (replaced)
|
|
3048
|
+
response = replaced;
|
|
3049
|
+
}
|
|
3050
|
+
return response;
|
|
3051
|
+
}
|
|
3052
|
+
|
|
2995
3053
|
// core/decrypt/polling.ts
|
|
2996
3054
|
function computeMinuteRampPollIntervalMs(elapsedMs, params) {
|
|
2997
3055
|
const elapsedSeconds = Math.floor(elapsedMs / 1e3);
|
|
@@ -3161,13 +3219,17 @@ async function submitSealOutputRequest(thresholdNetworkUrl, ctHash, chainId, per
|
|
|
3161
3219
|
for (; ; ) {
|
|
3162
3220
|
let response;
|
|
3163
3221
|
try {
|
|
3164
|
-
response = await
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3222
|
+
response = await cofheFetch(
|
|
3223
|
+
`${thresholdNetworkUrl}/v2/sealoutput`,
|
|
3224
|
+
/*op:sealoutput*/
|
|
3225
|
+
{
|
|
3226
|
+
method: "POST",
|
|
3227
|
+
headers: {
|
|
3228
|
+
"Content-Type": "application/json"
|
|
3229
|
+
},
|
|
3230
|
+
body: JSON.stringify(body)
|
|
3231
|
+
}
|
|
3232
|
+
);
|
|
3171
3233
|
} catch (e) {
|
|
3172
3234
|
throw new CofheError({
|
|
3173
3235
|
code: "SEAL_OUTPUT_FAILED" /* SealOutputFailed */,
|
|
@@ -3290,12 +3352,16 @@ async function pollSealOutputStatus(thresholdNetworkUrl, requestId, overallStart
|
|
|
3290
3352
|
}
|
|
3291
3353
|
let response;
|
|
3292
3354
|
try {
|
|
3293
|
-
response = await
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3355
|
+
response = await cofheFetch(
|
|
3356
|
+
`${thresholdNetworkUrl}/v2/sealoutput/${requestId}`,
|
|
3357
|
+
/*op:sealoutput-poll*/
|
|
3358
|
+
{
|
|
3359
|
+
method: "GET",
|
|
3360
|
+
headers: {
|
|
3361
|
+
"Content-Type": "application/json"
|
|
3362
|
+
}
|
|
3297
3363
|
}
|
|
3298
|
-
|
|
3364
|
+
);
|
|
3299
3365
|
} catch (e) {
|
|
3300
3366
|
throw new CofheError({
|
|
3301
3367
|
code: "SEAL_OUTPUT_FAILED" /* SealOutputFailed */,
|
|
@@ -3892,13 +3958,17 @@ async function submitDecryptRequestV2(thresholdNetworkUrl, ctHash, chainId, perm
|
|
|
3892
3958
|
for (; ; ) {
|
|
3893
3959
|
let response;
|
|
3894
3960
|
try {
|
|
3895
|
-
response = await
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3961
|
+
response = await cofheFetch(
|
|
3962
|
+
`${thresholdNetworkUrl}/v2/decrypt`,
|
|
3963
|
+
/*op:decrypt*/
|
|
3964
|
+
{
|
|
3965
|
+
method: "POST",
|
|
3966
|
+
headers: {
|
|
3967
|
+
"Content-Type": "application/json"
|
|
3968
|
+
},
|
|
3969
|
+
body: JSON.stringify(body)
|
|
3970
|
+
}
|
|
3971
|
+
);
|
|
3902
3972
|
} catch (e) {
|
|
3903
3973
|
throw new CofheError({
|
|
3904
3974
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
@@ -4023,12 +4093,16 @@ async function pollDecryptStatusV2(thresholdNetworkUrl, requestId, overallStartT
|
|
|
4023
4093
|
}
|
|
4024
4094
|
let response;
|
|
4025
4095
|
try {
|
|
4026
|
-
response = await
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4096
|
+
response = await cofheFetch(
|
|
4097
|
+
`${thresholdNetworkUrl}/v2/decrypt/${requestId}`,
|
|
4098
|
+
/*op:decrypt-poll*/
|
|
4099
|
+
{
|
|
4100
|
+
method: "GET",
|
|
4101
|
+
headers: {
|
|
4102
|
+
"Content-Type": "application/json"
|
|
4103
|
+
}
|
|
4030
4104
|
}
|
|
4031
|
-
|
|
4105
|
+
);
|
|
4032
4106
|
} catch (e) {
|
|
4033
4107
|
throw new CofheError({
|
|
4034
4108
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
@@ -4644,18 +4718,20 @@ exports.MOCKS_ZK_VERIFIER_ADDRESS = MOCKS_ZK_VERIFIER_ADDRESS;
|
|
|
4644
4718
|
exports.MOCKS_ZK_VERIFIER_SIGNER_ADDRESS = MOCKS_ZK_VERIFIER_SIGNER_ADDRESS;
|
|
4645
4719
|
exports.MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY = MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY;
|
|
4646
4720
|
exports.TASK_MANAGER_ADDRESS = TASK_MANAGER_ADDRESS;
|
|
4647
|
-
exports.TEST_BED_ADDRESS = TEST_BED_ADDRESS;
|
|
4648
4721
|
exports.TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT = TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT;
|
|
4649
4722
|
exports.TFHE_RS_ZK_MAX_BITS = TFHE_RS_ZK_MAX_BITS;
|
|
4650
4723
|
exports.assertCorrectEncryptedItemInput = assertCorrectEncryptedItemInput;
|
|
4724
|
+
exports.cofheFetch = cofheFetch;
|
|
4651
4725
|
exports.createCofheClientBase = createCofheClientBase;
|
|
4652
4726
|
exports.createCofheConfigBase = createCofheConfigBase;
|
|
4653
4727
|
exports.createKeysStore = createKeysStore;
|
|
4654
4728
|
exports.fetchKeys = fetchKeys;
|
|
4655
4729
|
exports.fheTypeToString = fheTypeToString;
|
|
4656
4730
|
exports.getCofheConfigItem = getCofheConfigItem;
|
|
4731
|
+
exports.getCofheDebugInterceptors = getCofheDebugInterceptors;
|
|
4657
4732
|
exports.isCofheError = isCofheError;
|
|
4658
4733
|
exports.isEncryptableItem = isEncryptableItem;
|
|
4659
4734
|
exports.isLastEncryptionStep = isLastEncryptionStep;
|
|
4735
|
+
exports.setCofheDebugInterceptors = setCofheDebugInterceptors;
|
|
4660
4736
|
exports.verifyDecryptResult = verifyDecryptResult;
|
|
4661
4737
|
exports.zkProveWithWorker = zkProveWithWorker;
|
package/dist/core.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as CofheConfig, c as CofheClientParams, b as CofheClient, d as CofheClientConnectionState, F as FheTypes } from './clientTypes-
|
|
2
|
-
export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig,
|
|
1
|
+
import { a as CofheConfig, c as CofheClientParams, b as CofheClient, d as CofheClientConnectionState, F as FheTypes } from './clientTypes-BDy1qIBu.cjs';
|
|
2
|
+
export { O as AnyExternalHash, h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, W as DecryptEndpoint, ab as DecryptForTxBuilder, ac as DecryptForTxResult, aa as DecryptForViewBuilder, V as DecryptPollCallbackContext, T as DecryptPollCallbackFunction, a9 as EncryptInputsBuilder, X as EncryptSetStateFn, a1 as EncryptStep, Y as EncryptStepCallbackContext, $ as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, Q as EncryptableToExternalHashMap, 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, M as ExternalAddressHash, B as ExternalBoolHash, N as ExternalHashProof, R as ExternalItemHashes, K as ExternalUint128Hash, G as ExternalUint16Hash, H as ExternalUint32Hash, J as ExternalUint64Hash, D as ExternalUint8Hash, _ as FheAllUTypes, a5 as FheKeyDeserializer, A as FheTypeValue, Z as FheUintUTypes, S as HashPlusProofResult, I as IStorage, a7 as KeysStorage, a8 as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, ad as ZkBuilderAndCrsGenerator, ae as ZkProveWorkerFunction, af as ZkProveWorkerRequest, ag as ZkProveWorkerResponse, a3 as assertCorrectEncryptedItemInput, e as createCofheConfigBase, a6 as createKeysStore, a4 as fetchKeys, g as getCofheConfigItem, a0 as isEncryptableItem, a2 as isLastEncryptionStep, ah as zkProveWithWorker } from './clientTypes-BDy1qIBu.cjs';
|
|
3
3
|
import { Hex, PublicClient } from 'viem';
|
|
4
4
|
import './types-C07FK-cL.cjs';
|
|
5
5
|
import 'zod';
|
|
@@ -14,6 +14,29 @@ declare const InitialConnectStore: CofheClientConnectionState;
|
|
|
14
14
|
*/
|
|
15
15
|
declare function createCofheClientBase<TConfig extends CofheConfig>(opts: CofheClientParams<TConfig>): CofheClient<TConfig>;
|
|
16
16
|
|
|
17
|
+
interface CofheRequestContext {
|
|
18
|
+
/** Coarse label for the call site, e.g. 'decrypt' | 'sealoutput' | 'fetchKeys'. */
|
|
19
|
+
op: string;
|
|
20
|
+
}
|
|
21
|
+
interface CofheRequestOverride {
|
|
22
|
+
url?: string;
|
|
23
|
+
init?: RequestInit;
|
|
24
|
+
}
|
|
25
|
+
type CofheOnRequest = (url: string, init: RequestInit | undefined, ctx: CofheRequestContext) => CofheRequestOverride | void | Promise<CofheRequestOverride | void>;
|
|
26
|
+
type CofheOnResponse = (response: Response, ctx: CofheRequestContext) => Response | void | Promise<Response | void>;
|
|
27
|
+
interface CofheDebugInterceptors {
|
|
28
|
+
onRequest?: CofheOnRequest;
|
|
29
|
+
onResponse?: CofheOnResponse;
|
|
30
|
+
}
|
|
31
|
+
/** Register (or clear, with null) the debug interceptors. */
|
|
32
|
+
declare function setCofheDebugInterceptors(next: CofheDebugInterceptors | null): void;
|
|
33
|
+
declare function getCofheDebugInterceptors(): CofheDebugInterceptors;
|
|
34
|
+
/**
|
|
35
|
+
* fetch() wrapper used by all low-level SDK network ops. Applies the registered
|
|
36
|
+
* debug interceptors when present; otherwise behaves exactly like fetch().
|
|
37
|
+
*/
|
|
38
|
+
declare function cofheFetch(url: string, init?: RequestInit, ctx?: CofheRequestContext): Promise<Response>;
|
|
39
|
+
|
|
17
40
|
declare enum CofheErrorCode {
|
|
18
41
|
InternalError = "INTERNAL_ERROR",
|
|
19
42
|
UnknownEnvironment = "UNKNOWN_ENVIRONMENT",
|
|
@@ -106,8 +129,6 @@ declare const TASK_MANAGER_ADDRESS: "0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9"
|
|
|
106
129
|
declare const MOCKS_ZK_VERIFIER_ADDRESS: "0x0000000000000000000000000000000000005001";
|
|
107
130
|
/** Mock Threshold Network contract address (used for testing) */
|
|
108
131
|
declare const MOCKS_THRESHOLD_NETWORK_ADDRESS: "0x0000000000000000000000000000000000005002";
|
|
109
|
-
/** Test Bed contract address (used for testing) */
|
|
110
|
-
declare const TEST_BED_ADDRESS: "0x0000000000000000000000000000000000005003";
|
|
111
132
|
/** Private key for the Mock ZK Verifier signer account */
|
|
112
133
|
declare const MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY: "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
|
|
113
134
|
/** Address for the Mock ZK Verifier signer account */
|
|
@@ -139,4 +160,4 @@ declare function verifyDecryptResult(handle: bigint | string, cleartext: bigint,
|
|
|
139
160
|
*/
|
|
140
161
|
declare function fheTypeToString(utype: FheTypes): string;
|
|
141
162
|
|
|
142
|
-
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheClient, CofheClientConnectionState, CofheClientParams, CofheConfig, CofheError, CofheErrorCode, type CofheErrorParams, FheTypes, MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS,
|
|
163
|
+
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheClient, CofheClientConnectionState, CofheClientParams, CofheConfig, type CofheDebugInterceptors, CofheError, CofheErrorCode, type CofheErrorParams, type CofheOnRequest, type CofheOnResponse, type CofheRequestContext, type CofheRequestOverride, FheTypes, MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT, TFHE_RS_ZK_MAX_BITS, cofheFetch, createCofheClientBase, fheTypeToString, getCofheDebugInterceptors, isCofheError, setCofheDebugInterceptors, verifyDecryptResult };
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as CofheConfig, c as CofheClientParams, b as CofheClient, d as CofheClientConnectionState, F as FheTypes } from './clientTypes-
|
|
2
|
-
export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig,
|
|
1
|
+
import { a as CofheConfig, c as CofheClientParams, b as CofheClient, d as CofheClientConnectionState, F as FheTypes } from './clientTypes-CyUvRRzA.js';
|
|
2
|
+
export { O as AnyExternalHash, h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, W as DecryptEndpoint, ab as DecryptForTxBuilder, ac as DecryptForTxResult, aa as DecryptForViewBuilder, V as DecryptPollCallbackContext, T as DecryptPollCallbackFunction, a9 as EncryptInputsBuilder, X as EncryptSetStateFn, a1 as EncryptStep, Y as EncryptStepCallbackContext, $ as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, z as EncryptableToEncryptedItemInputMap, Q as EncryptableToExternalHashMap, 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, M as ExternalAddressHash, B as ExternalBoolHash, N as ExternalHashProof, R as ExternalItemHashes, K as ExternalUint128Hash, G as ExternalUint16Hash, H as ExternalUint32Hash, J as ExternalUint64Hash, D as ExternalUint8Hash, _ as FheAllUTypes, a5 as FheKeyDeserializer, A as FheTypeValue, Z as FheUintUTypes, S as HashPlusProofResult, I as IStorage, a7 as KeysStorage, a8 as KeysStore, L as LiteralToPrimitive, P as Primitive, U as UnsealedItem, ad as ZkBuilderAndCrsGenerator, ae as ZkProveWorkerFunction, af as ZkProveWorkerRequest, ag as ZkProveWorkerResponse, a3 as assertCorrectEncryptedItemInput, e as createCofheConfigBase, a6 as createKeysStore, a4 as fetchKeys, g as getCofheConfigItem, a0 as isEncryptableItem, a2 as isLastEncryptionStep, ah as zkProveWithWorker } from './clientTypes-CyUvRRzA.js';
|
|
3
3
|
import { Hex, PublicClient } from 'viem';
|
|
4
4
|
import './types-C07FK-cL.js';
|
|
5
5
|
import 'zod';
|
|
@@ -14,6 +14,29 @@ declare const InitialConnectStore: CofheClientConnectionState;
|
|
|
14
14
|
*/
|
|
15
15
|
declare function createCofheClientBase<TConfig extends CofheConfig>(opts: CofheClientParams<TConfig>): CofheClient<TConfig>;
|
|
16
16
|
|
|
17
|
+
interface CofheRequestContext {
|
|
18
|
+
/** Coarse label for the call site, e.g. 'decrypt' | 'sealoutput' | 'fetchKeys'. */
|
|
19
|
+
op: string;
|
|
20
|
+
}
|
|
21
|
+
interface CofheRequestOverride {
|
|
22
|
+
url?: string;
|
|
23
|
+
init?: RequestInit;
|
|
24
|
+
}
|
|
25
|
+
type CofheOnRequest = (url: string, init: RequestInit | undefined, ctx: CofheRequestContext) => CofheRequestOverride | void | Promise<CofheRequestOverride | void>;
|
|
26
|
+
type CofheOnResponse = (response: Response, ctx: CofheRequestContext) => Response | void | Promise<Response | void>;
|
|
27
|
+
interface CofheDebugInterceptors {
|
|
28
|
+
onRequest?: CofheOnRequest;
|
|
29
|
+
onResponse?: CofheOnResponse;
|
|
30
|
+
}
|
|
31
|
+
/** Register (or clear, with null) the debug interceptors. */
|
|
32
|
+
declare function setCofheDebugInterceptors(next: CofheDebugInterceptors | null): void;
|
|
33
|
+
declare function getCofheDebugInterceptors(): CofheDebugInterceptors;
|
|
34
|
+
/**
|
|
35
|
+
* fetch() wrapper used by all low-level SDK network ops. Applies the registered
|
|
36
|
+
* debug interceptors when present; otherwise behaves exactly like fetch().
|
|
37
|
+
*/
|
|
38
|
+
declare function cofheFetch(url: string, init?: RequestInit, ctx?: CofheRequestContext): Promise<Response>;
|
|
39
|
+
|
|
17
40
|
declare enum CofheErrorCode {
|
|
18
41
|
InternalError = "INTERNAL_ERROR",
|
|
19
42
|
UnknownEnvironment = "UNKNOWN_ENVIRONMENT",
|
|
@@ -106,8 +129,6 @@ declare const TASK_MANAGER_ADDRESS: "0xeA30c4B8b44078Bbf8a6ef5b9f1eC1626C7848D9"
|
|
|
106
129
|
declare const MOCKS_ZK_VERIFIER_ADDRESS: "0x0000000000000000000000000000000000005001";
|
|
107
130
|
/** Mock Threshold Network contract address (used for testing) */
|
|
108
131
|
declare const MOCKS_THRESHOLD_NETWORK_ADDRESS: "0x0000000000000000000000000000000000005002";
|
|
109
|
-
/** Test Bed contract address (used for testing) */
|
|
110
|
-
declare const TEST_BED_ADDRESS: "0x0000000000000000000000000000000000005003";
|
|
111
132
|
/** Private key for the Mock ZK Verifier signer account */
|
|
112
133
|
declare const MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY: "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
|
|
113
134
|
/** Address for the Mock ZK Verifier signer account */
|
|
@@ -139,4 +160,4 @@ declare function verifyDecryptResult(handle: bigint | string, cleartext: bigint,
|
|
|
139
160
|
*/
|
|
140
161
|
declare function fheTypeToString(utype: FheTypes): string;
|
|
141
162
|
|
|
142
|
-
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheClient, CofheClientConnectionState, CofheClientParams, CofheConfig, CofheError, CofheErrorCode, type CofheErrorParams, FheTypes, MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS,
|
|
163
|
+
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheClient, CofheClientConnectionState, CofheClientParams, CofheConfig, type CofheDebugInterceptors, CofheError, CofheErrorCode, type CofheErrorParams, type CofheOnRequest, type CofheOnResponse, type CofheRequestContext, type CofheRequestOverride, FheTypes, MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT, TFHE_RS_ZK_MAX_BITS, cofheFetch, createCofheClientBase, fheTypeToString, getCofheDebugInterceptors, isCofheError, setCofheDebugInterceptors, verifyDecryptResult };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheError, CofheErrorCode, DecryptForTxBuilder, DecryptForViewBuilder, EncryptInputsBuilder, EncryptStep, Encryptable, FheAllUTypes, FheTypes, FheUintUTypes, assertCorrectEncryptedItemInput, createCofheClientBase, createCofheConfigBase, createKeysStore, fetchKeys, fheTypeToString, getCofheConfigItem, isCofheError, isEncryptableItem, isLastEncryptionStep, verifyDecryptResult, zkProveWithWorker } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
export { MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS,
|
|
1
|
+
export { InitialConnectStore as CONNECT_STORE_DEFAULTS, CofheError, CofheErrorCode, DecryptForTxBuilder, DecryptForViewBuilder, EncryptInputsBuilder, EncryptStep, Encryptable, FheAllUTypes, FheTypes, FheUintUTypes, assertCorrectEncryptedItemInput, cofheFetch, createCofheClientBase, createCofheConfigBase, createKeysStore, fetchKeys, fheTypeToString, getCofheConfigItem, getCofheDebugInterceptors, isCofheError, isEncryptableItem, isLastEncryptionStep, setCofheDebugInterceptors, verifyDecryptResult, zkProveWithWorker } from './chunk-NOC3PYB7.js';
|
|
2
|
+
import './chunk-MTRAXQXC.js';
|
|
3
|
+
import './chunk-VB62WYPL.js';
|
|
4
|
+
export { MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ADDRESS, TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT, TFHE_RS_ZK_MAX_BITS } from './chunk-ESMZCFJY.js';
|