@cofhe/sdk 1.0.0-alpha.0 → 1.1.0-alpha.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.
package/dist/web.cjs CHANGED
@@ -43,6 +43,100 @@ function toBigInt(value) {
43
43
  }
44
44
  }
45
45
 
46
+ // core/error.ts
47
+ var CofheError = class _CofheError extends Error {
48
+ code;
49
+ cause;
50
+ hint;
51
+ context;
52
+ apiErrorCode;
53
+ constructor({ code, message, cause, hint, context, apiErrorCode }) {
54
+ const fullMessage = cause ? `${message} | Caused by: ${cause.message}` : message;
55
+ super(fullMessage);
56
+ this.name = "CofheError";
57
+ this.code = code;
58
+ this.cause = cause;
59
+ this.hint = hint;
60
+ this.context = context;
61
+ this.apiErrorCode = apiErrorCode;
62
+ if (Error.captureStackTrace) {
63
+ Error.captureStackTrace(this, _CofheError);
64
+ }
65
+ }
66
+ /**
67
+ * Creates a CofheError from an unknown error
68
+ * If the error is a CofheError, it is returned unchanged, else a new CofheError is created
69
+ * If a wrapperError is provided, it is used to create the new CofheError, else a default is used
70
+ */
71
+ static fromError(error, wrapperError) {
72
+ if (isCofheError(error))
73
+ return error;
74
+ const cause = error instanceof Error ? error : new Error(`${error}`);
75
+ return new _CofheError({
76
+ code: wrapperError?.code ?? "INTERNAL_ERROR" /* InternalError */,
77
+ message: wrapperError?.message ?? "An internal error occurred",
78
+ hint: wrapperError?.hint,
79
+ context: wrapperError?.context,
80
+ apiErrorCode: wrapperError?.apiErrorCode,
81
+ cause
82
+ });
83
+ }
84
+ /**
85
+ * Serializes the error to JSON string with proper handling of Error objects
86
+ */
87
+ serialize() {
88
+ return bigintSafeJsonStringify({
89
+ name: this.name,
90
+ code: this.code,
91
+ message: this.message,
92
+ hint: this.hint,
93
+ context: this.context,
94
+ apiErrorCode: this.apiErrorCode,
95
+ cause: this.cause ? {
96
+ name: this.cause.name,
97
+ message: this.cause.message,
98
+ stack: this.cause.stack
99
+ } : void 0,
100
+ stack: this.stack
101
+ });
102
+ }
103
+ /**
104
+ * Returns a human-readable string representation of the error
105
+ */
106
+ toString() {
107
+ const codeSuffix = this.apiErrorCode ? ` (api: ${this.apiErrorCode})` : "";
108
+ const parts = [`${this.name} [${this.code}]${codeSuffix}: ${this.message}`];
109
+ if (this.hint) {
110
+ parts.push(`Hint: ${this.hint}`);
111
+ }
112
+ if (this.context && Object.keys(this.context).length > 0) {
113
+ parts.push(`Context: ${bigintSafeJsonStringify(this.context)}`);
114
+ }
115
+ if (this.stack) {
116
+ parts.push(`
117
+ Stack trace:`);
118
+ parts.push(this.stack);
119
+ }
120
+ if (this.cause) {
121
+ parts.push(`
122
+ Caused by: ${this.cause.name}: ${this.cause.message}`);
123
+ if (this.cause.stack) {
124
+ parts.push(this.cause.stack);
125
+ }
126
+ }
127
+ return parts.join("\n");
128
+ }
129
+ };
130
+ var bigintSafeJsonStringify = (value) => {
131
+ return JSON.stringify(value, (key, value2) => {
132
+ if (typeof value2 === "bigint") {
133
+ return `${value2}n`;
134
+ }
135
+ return value2;
136
+ });
137
+ };
138
+ var isCofheError = (error) => error instanceof CofheError;
139
+
46
140
  // acps/sealing.ts
47
141
  var KEY_HEX_LENGTH = 64;
48
142
  var GenerateSealingKey = () => {
@@ -57,9 +151,25 @@ var unsealWithPrivateKey = (privateKey, parsedData) => {
57
151
  const nonce = parsedData.nonce instanceof Uint8Array ? parsedData.nonce : new Uint8Array(parsedData.nonce);
58
152
  const ephemPublicKey = parsedData.public_key instanceof Uint8Array ? parsedData.public_key : new Uint8Array(parsedData.public_key);
59
153
  const dataToDecrypt = parsedData.data instanceof Uint8Array ? parsedData.data : new Uint8Array(parsedData.data);
60
- const decryptedMessage = nacl__default.default.box.open(dataToDecrypt, nonce, ephemPublicKey, fromHexString(privateKey));
154
+ let decryptedMessage;
155
+ let cause;
156
+ try {
157
+ decryptedMessage = nacl__default.default.box.open(dataToDecrypt, nonce, ephemPublicKey, fromHexString(privateKey));
158
+ } catch (e) {
159
+ decryptedMessage = null;
160
+ cause = e instanceof Error ? e : void 0;
161
+ }
61
162
  if (!decryptedMessage) {
62
- throw new Error("Failed to decrypt message");
163
+ throw new CofheError({
164
+ code: "SEAL_OUTPUT_FAILED" /* SealOutputFailed */,
165
+ message: "Failed to unseal decrypt response",
166
+ cause,
167
+ context: {
168
+ dataLength: dataToDecrypt.length,
169
+ nonceLength: nonce.length,
170
+ publicKeyLength: ephemPublicKey.length
171
+ }
172
+ });
63
173
  }
64
174
  return toBigInt(decryptedMessage);
65
175
  };
@@ -377,100 +487,6 @@ var TFHE_RS_ZK_MAX_BITS = 2048;
377
487
  var TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT = BigInt(1 << 30);
378
488
  var TFHE_RS_KEY_VERSION = 2;
379
489
 
380
- // core/error.ts
381
- var CofheError = class _CofheError extends Error {
382
- code;
383
- cause;
384
- hint;
385
- context;
386
- apiErrorCode;
387
- constructor({ code, message, cause, hint, context, apiErrorCode }) {
388
- const fullMessage = cause ? `${message} | Caused by: ${cause.message}` : message;
389
- super(fullMessage);
390
- this.name = "CofheError";
391
- this.code = code;
392
- this.cause = cause;
393
- this.hint = hint;
394
- this.context = context;
395
- this.apiErrorCode = apiErrorCode;
396
- if (Error.captureStackTrace) {
397
- Error.captureStackTrace(this, _CofheError);
398
- }
399
- }
400
- /**
401
- * Creates a CofheError from an unknown error
402
- * If the error is a CofheError, it is returned unchanged, else a new CofheError is created
403
- * If a wrapperError is provided, it is used to create the new CofheError, else a default is used
404
- */
405
- static fromError(error, wrapperError) {
406
- if (isCofheError(error))
407
- return error;
408
- const cause = error instanceof Error ? error : new Error(`${error}`);
409
- return new _CofheError({
410
- code: wrapperError?.code ?? "INTERNAL_ERROR" /* InternalError */,
411
- message: wrapperError?.message ?? "An internal error occurred",
412
- hint: wrapperError?.hint,
413
- context: wrapperError?.context,
414
- apiErrorCode: wrapperError?.apiErrorCode,
415
- cause
416
- });
417
- }
418
- /**
419
- * Serializes the error to JSON string with proper handling of Error objects
420
- */
421
- serialize() {
422
- return bigintSafeJsonStringify({
423
- name: this.name,
424
- code: this.code,
425
- message: this.message,
426
- hint: this.hint,
427
- context: this.context,
428
- apiErrorCode: this.apiErrorCode,
429
- cause: this.cause ? {
430
- name: this.cause.name,
431
- message: this.cause.message,
432
- stack: this.cause.stack
433
- } : void 0,
434
- stack: this.stack
435
- });
436
- }
437
- /**
438
- * Returns a human-readable string representation of the error
439
- */
440
- toString() {
441
- const codeSuffix = this.apiErrorCode ? ` (api: ${this.apiErrorCode})` : "";
442
- const parts = [`${this.name} [${this.code}]${codeSuffix}: ${this.message}`];
443
- if (this.hint) {
444
- parts.push(`Hint: ${this.hint}`);
445
- }
446
- if (this.context && Object.keys(this.context).length > 0) {
447
- parts.push(`Context: ${bigintSafeJsonStringify(this.context)}`);
448
- }
449
- if (this.stack) {
450
- parts.push(`
451
- Stack trace:`);
452
- parts.push(this.stack);
453
- }
454
- if (this.cause) {
455
- parts.push(`
456
- Caused by: ${this.cause.name}: ${this.cause.message}`);
457
- if (this.cause.stack) {
458
- parts.push(this.cause.stack);
459
- }
460
- }
461
- return parts.join("\n");
462
- }
463
- };
464
- var bigintSafeJsonStringify = (value) => {
465
- return JSON.stringify(value, (key, value2) => {
466
- if (typeof value2 === "bigint") {
467
- return `${value2}n`;
468
- }
469
- return value2;
470
- });
471
- };
472
- var isCofheError = (error) => error instanceof CofheError;
473
-
474
490
  // core/taskManager.ts
475
491
  var ADDRESS_BOOK_ABI = viem.parseAbi([
476
492
  "function getTm(uint256 id) view returns (address)",
@@ -778,15 +794,22 @@ var getAclServedAddresses = async (publicClient, chainId) => {
778
794
  } catch {
779
795
  return {};
780
796
  }
797
+ let transient = false;
798
+ const readServedAddress = (functionName) => publicClient.readContract({ address: aclAddress, abi: ACL_SERVED_ADDRESSES_ABI, functionName }).catch((err) => {
799
+ if (revertErrorName(err, ACL_SERVED_ADDRESSES_ABI) === void 0)
800
+ transient = true;
801
+ return void 0;
802
+ });
781
803
  const [defaultRevoker, shareRegistry] = await Promise.all([
782
- publicClient.readContract({ address: aclAddress, abi: ACL_SERVED_ADDRESSES_ABI, functionName: "defaultRevokerContract" }).catch(() => void 0),
783
- publicClient.readContract({ address: aclAddress, abi: ACL_SERVED_ADDRESSES_ABI, functionName: "shareRegistry" }).catch(() => void 0)
804
+ readServedAddress("defaultRevokerContract"),
805
+ readServedAddress("shareRegistry")
784
806
  ]);
785
807
  const resolved = {
786
808
  defaultRevoker: defaultRevoker != null && defaultRevoker !== viem.zeroAddress ? defaultRevoker : void 0,
787
809
  shareRegistry: shareRegistry != null && shareRegistry !== viem.zeroAddress ? shareRegistry : void 0
788
810
  };
789
- aclServedAddressesCache.set(chainId, resolved);
811
+ if (!transient)
812
+ aclServedAddressesCache.set(chainId, resolved);
790
813
  return resolved;
791
814
  };
792
815
 
@@ -3269,23 +3292,25 @@ var getBlockRevokerData = async (publicClient) => {
3269
3292
  }
3270
3293
  return revokerData;
3271
3294
  };
3272
- var revokeACP = async (acp, walletClient) => {
3295
+ var prepareRevokeACP = (acp) => {
3273
3296
  if (acp.revokerContract === viem.zeroAddress || acp.revokerData === 0) {
3274
3297
  throw new Error("ACP is not revocable: it has no revoker (revokerContract/revokerData unset)");
3275
3298
  }
3299
+ return {
3300
+ address: acp.revokerContract,
3301
+ abi: ACP_REVOKER_ABI,
3302
+ functionName: "revokeSingle",
3303
+ args: [BigInt(acp.revokerData)]
3304
+ };
3305
+ };
3306
+ var revokeACP = async (acp, walletClient) => {
3307
+ const write = prepareRevokeACP(acp);
3276
3308
  if (walletClient.account == null)
3277
3309
  throw new Error("Missing walletClient account");
3278
3310
  if (walletClient.account.address.toLowerCase() !== acp.issuer.toLowerCase()) {
3279
3311
  throw new Error("Only the acp issuer can revoke it");
3280
3312
  }
3281
- return walletClient.writeContract({
3282
- address: acp.revokerContract,
3283
- abi: ACP_REVOKER_ABI,
3284
- functionName: "revokeSingle",
3285
- args: [BigInt(acp.revokerData)],
3286
- account: walletClient.account,
3287
- chain: walletClient.chain
3288
- });
3313
+ return walletClient.writeContract({ ...write, account: walletClient.account, chain: walletClient.chain });
3289
3314
  };
3290
3315
  var revokeAllACPs = async (walletClient, publicClient, revokerContract) => {
3291
3316
  if (walletClient.account == null)
@@ -3336,28 +3361,36 @@ var metadataOf = (acp, { labels, metadata, appKey }) => {
3336
3361
  }
3337
3362
  return encodeShareMetadata(labels, { issuer: acp.issuer, appKey });
3338
3363
  };
3339
- var shareOnChain = async (acp, walletClient, registry, options = {}) => {
3364
+ var prepareShareOnChain = (acp, registry, options = {}) => {
3340
3365
  if (acp.type !== "sharing") {
3341
3366
  throw new Error(`Cannot share a '${acp.type}' ACP on-chain \u2014 only 'sharing' ACPs are shareable.`);
3342
3367
  }
3343
3368
  if (acp.issuerSignature === "0x") {
3344
3369
  throw new Error("Cannot share an unsigned sharing ACP \u2014 sign it first.");
3345
3370
  }
3371
+ return {
3372
+ write: {
3373
+ address: registry,
3374
+ abi: ACP_SHARE_REGISTRY_ABI,
3375
+ functionName: "share",
3376
+ args: [toChainShare(acp), metadataOf(acp, options)]
3377
+ },
3378
+ shareId: computeShareId(acp)
3379
+ };
3380
+ };
3381
+ var shareOnChain = async (acp, walletClient, registry, options = {}) => {
3382
+ const { write, shareId } = prepareShareOnChain(acp, registry, options);
3346
3383
  if (walletClient.account == null)
3347
3384
  throw new Error("Missing walletClient account");
3348
3385
  if (walletClient.account.address.toLowerCase() !== acp.issuer.toLowerCase()) {
3349
3386
  throw new Error("Only the ACP issuer can share it on-chain");
3350
3387
  }
3351
- const metadata = metadataOf(acp, options);
3352
3388
  const txHash = await walletClient.writeContract({
3353
- address: registry,
3354
- abi: ACP_SHARE_REGISTRY_ABI,
3355
- functionName: "share",
3356
- args: [toChainShare(acp), metadata],
3389
+ ...write,
3357
3390
  account: walletClient.account,
3358
3391
  chain: walletClient.chain ?? null
3359
3392
  });
3360
- return { txHash, shareId: computeShareId(acp) };
3393
+ return { txHash, shareId };
3361
3394
  };
3362
3395
  var toIncomingShare = ({ shareId, share: s, metadata }) => ({
3363
3396
  shareId,
@@ -3392,14 +3425,17 @@ var importFromChain = async (share, publicClient, walletClient, importOptions =
3392
3425
  const { shareId: _shareId, appKey: _appKey, ...options } = share;
3393
3426
  return importShared({ ...options, type: "sharing" }, publicClient, walletClient, importOptions);
3394
3427
  };
3428
+ var prepareRemoveShare = (shareId, registry) => ({
3429
+ address: registry,
3430
+ abi: ACP_SHARE_REGISTRY_ABI,
3431
+ functionName: "removeShare",
3432
+ args: [shareId]
3433
+ });
3395
3434
  var removeShareOnChain = async (shareId, walletClient, registry) => {
3396
3435
  if (walletClient.account == null)
3397
3436
  throw new Error("Missing walletClient account");
3398
3437
  return walletClient.writeContract({
3399
- address: registry,
3400
- abi: ACP_SHARE_REGISTRY_ABI,
3401
- functionName: "removeShare",
3402
- args: [shareId],
3438
+ ...prepareRemoveShare(shareId, registry),
3403
3439
  account: walletClient.account,
3404
3440
  chain: walletClient.chain ?? null
3405
3441
  });
@@ -3426,14 +3462,17 @@ var acps = {
3426
3462
  selectActiveACP,
3427
3463
  removeActiveACP,
3428
3464
  revokeACP,
3465
+ prepareRevokeACP,
3429
3466
  revokeAllACPs,
3430
3467
  isACPRevoked,
3431
3468
  checkAccess,
3432
3469
  shareOnChain,
3470
+ prepareShareOnChain,
3433
3471
  getIncomingShares,
3434
3472
  getShareFromChain,
3435
3473
  importFromChain,
3436
3474
  removeShareOnChain,
3475
+ prepareRemoveShare,
3437
3476
  computeShareId,
3438
3477
  applyACPDefaultsFromChain,
3439
3478
  getAclServedAddresses,
@@ -5209,6 +5248,12 @@ function createCofheClientBase(opts) {
5209
5248
  });
5210
5249
  }
5211
5250
  };
5251
+ const _requireIssuer = (acp, what) => {
5252
+ const sender = connectStore.getState().walletClient?.account?.address;
5253
+ if (sender == null || sender.toLowerCase() !== acp.issuer.toLowerCase()) {
5254
+ throw new Error(`Only the acp issuer can ${what}`);
5255
+ }
5256
+ };
5212
5257
  async function connect(publicClient, walletClient) {
5213
5258
  const state = connectStore.getState();
5214
5259
  if (state.connected && state.publicClient === publicClient && state.walletClient === walletClient)
@@ -5376,6 +5421,11 @@ function createCofheClientBase(opts) {
5376
5421
  const { walletClient } = connectStore.getState();
5377
5422
  return acps.revokeACP(acp, walletClient);
5378
5423
  },
5424
+ prepareRevokeACP: (acp) => {
5425
+ _requireConnected();
5426
+ _requireIssuer(acp, "revoke it");
5427
+ return acps.prepareRevokeACP(acp);
5428
+ },
5379
5429
  revokeAllACPs: async (revokerContract) => {
5380
5430
  _requireConnected();
5381
5431
  const { publicClient, walletClient } = connectStore.getState();
@@ -5399,6 +5449,21 @@ function createCofheClientBase(opts) {
5399
5449
  const sharingRegistry = await _resolveSharingRegistry(publicClient, chainId);
5400
5450
  return acps.shareOnChain(acp, walletClient, sharingRegistry, { ...withAppKey(), ...options });
5401
5451
  },
5452
+ prepareShareOnChain: async (acp, options) => {
5453
+ _requireConnected();
5454
+ _requireIssuer(acp, "share it on-chain");
5455
+ const { publicClient } = connectStore.getState();
5456
+ const chainId = await publicClient.getChainId();
5457
+ const sharingRegistry = await _resolveSharingRegistry(publicClient, chainId);
5458
+ return acps.prepareShareOnChain(acp, sharingRegistry, { ...withAppKey(), ...options });
5459
+ },
5460
+ prepareRemoveShare: async (shareId) => {
5461
+ _requireConnected();
5462
+ const { publicClient } = connectStore.getState();
5463
+ const chainId = await publicClient.getChainId();
5464
+ const sharingRegistry = await _resolveSharingRegistry(publicClient, chainId);
5465
+ return acps.prepareRemoveShare(shareId, sharingRegistry);
5466
+ },
5402
5467
  getIncomingShares: async () => {
5403
5468
  _requireConnected();
5404
5469
  const { publicClient, walletClient } = connectStore.getState();
package/dist/web.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { I as IStorage, C as CofheInputConfig, a as CofheConfig, b as CofheClient, E as EncryptableItem } from './clientTypes-C0A9ji5O.cjs';
1
+ import { I as IStorage, C as CofheInputConfig, a as CofheConfig, b as CofheClient, E as EncryptableItem } from './clientTypes-RXwLVWou.cjs';
2
2
  import 'viem';
3
3
  import './types-C07FK-cL.cjs';
4
4
  import 'zod';
5
- import './onchain-utils-D9Z33IP7.cjs';
5
+ import './onchain-utils-Ns56cBm0.cjs';
6
6
  import 'zustand/vanilla';
7
7
 
8
8
  declare function createSsrStorage(): IStorage;
package/dist/web.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { I as IStorage, C as CofheInputConfig, a as CofheConfig, b as CofheClient, E as EncryptableItem } from './clientTypes-CcU5WvdV.js';
1
+ import { I as IStorage, C as CofheInputConfig, a as CofheConfig, b as CofheClient, E as EncryptableItem } from './clientTypes-CnslFzxB.js';
2
2
  import 'viem';
3
3
  import './types-C07FK-cL.js';
4
4
  import 'zod';
5
- import './onchain-utils-D9Z33IP7.js';
5
+ import './onchain-utils-Ns56cBm0.js';
6
6
  import 'zustand/vanilla';
7
7
 
8
8
  declare function createSsrStorage(): IStorage;
package/dist/web.js CHANGED
@@ -1,9 +1,9 @@
1
- import { createCofheConfigBase, createCofheClientBase } from './chunk-OL3DZN7A.js';
1
+ import { createCofheConfigBase, createCofheClientBase } from './chunk-2EO4JSR7.js';
2
2
  import './chunk-UKQAJK4N.js';
3
- import './chunk-BQWHPIYU.js';
3
+ import './chunk-3L2IVPMI.js';
4
4
  import { initTfheThreadPool } from './chunk-KSOV5B4B.js';
5
- import { fheTypeToString, fromHexString } from './chunk-6ZW76ZKB.js';
6
- import { TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT } from './chunk-XQ32JG3T.js';
5
+ import { fheTypeToString, fromHexString } from './chunk-WJGTPW7K.js';
6
+ import { TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT } from './chunk-J23FYAI2.js';
7
7
  import { constructClient } from 'iframe-shared-storage';
8
8
 
9
9
  // web/const.ts
@@ -1,6 +1,6 @@
1
1
  import { initTfheThreadPool } from './chunk-KSOV5B4B.js';
2
- import { fromHexString } from './chunk-6ZW76ZKB.js';
3
- import { TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT } from './chunk-XQ32JG3T.js';
2
+ import { fromHexString } from './chunk-WJGTPW7K.js';
3
+ import { TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT } from './chunk-J23FYAI2.js';
4
4
 
5
5
  // web/zkProve.worker.ts
6
6
  var tfheModule = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofhe/sdk",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.1.0-alpha.0",
4
4
  "type": "module",
5
5
  "description": "SDK for Fhenix COFHE coprocessor interaction",
6
6
  "main": "./dist/core.cjs",
@@ -1,16 +1,3 @@
1
- // core/consts.ts
2
- var COFHE_ADDRESS_BOOK_ADDRESS = "0xC0F4e00E531a2B086492Ae3DCC1515038307196b";
3
- var TASK_MANAGER_ID = 1n;
4
- var MOCKS_TASK_MANAGER_ADDRESS = "0x0000000000000000000000000000000000005000";
5
- var MOCKS_ZK_VERIFIER_ADDRESS = "0x0000000000000000000000000000000000005001";
6
- var MOCKS_THRESHOLD_NETWORK_ADDRESS = "0x0000000000000000000000000000000000005002";
7
- var MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY = "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
8
- var MOCKS_ZK_VERIFIER_SIGNER_ADDRESS = "0x6E12D8C87503D4287c294f2Fdef96ACd9DFf6bd2";
9
- var MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d";
10
- var TFHE_RS_ZK_MAX_BITS = 2048;
11
- var TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT = BigInt(1 << 30);
12
- var TFHE_RS_KEY_VERSION = 2;
13
-
14
1
  // core/error.ts
15
2
  var CofheErrorCode = /* @__PURE__ */ ((CofheErrorCode2) => {
16
3
  CofheErrorCode2["InternalError"] = "INTERNAL_ERROR";
@@ -171,4 +158,17 @@ var bigintSafeJsonStringify = (value) => {
171
158
  };
172
159
  var isCofheError = (error) => error instanceof CofheError;
173
160
 
161
+ // core/consts.ts
162
+ var COFHE_ADDRESS_BOOK_ADDRESS = "0xC0F4e00E531a2B086492Ae3DCC1515038307196b";
163
+ var TASK_MANAGER_ID = 1n;
164
+ var MOCKS_TASK_MANAGER_ADDRESS = "0x0000000000000000000000000000000000005000";
165
+ var MOCKS_ZK_VERIFIER_ADDRESS = "0x0000000000000000000000000000000000005001";
166
+ var MOCKS_THRESHOLD_NETWORK_ADDRESS = "0x0000000000000000000000000000000000005002";
167
+ var MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY = "0x6C8D7F768A6BB4AAFE85E8A2F5A9680355239C7E14646ED62B044E39DE154512";
168
+ var MOCKS_ZK_VERIFIER_SIGNER_ADDRESS = "0x6E12D8C87503D4287c294f2Fdef96ACd9DFf6bd2";
169
+ var MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d";
170
+ var TFHE_RS_ZK_MAX_BITS = 2048;
171
+ var TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT = BigInt(1 << 30);
172
+ var TFHE_RS_KEY_VERSION = 2;
173
+
174
174
  export { COFHE_ADDRESS_BOOK_ADDRESS, CofheError, CofheErrorCode, MOCKS_DECRYPT_RESULT_SIGNER_PRIVATE_KEY, MOCKS_TASK_MANAGER_ADDRESS, MOCKS_THRESHOLD_NETWORK_ADDRESS, MOCKS_ZK_VERIFIER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_ADDRESS, MOCKS_ZK_VERIFIER_SIGNER_PRIVATE_KEY, TASK_MANAGER_ID, TFHE_RS_KEY_VERSION, TFHE_RS_SAFE_SERIALIZATION_SIZE_LIMIT, TFHE_RS_ZK_MAX_BITS, isCofheError };