@cofhe/sdk 0.3.2 → 0.4.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/CHANGELOG.md +6 -0
- package/core/client.ts +4 -4
- package/core/clientTypes.ts +4 -4
- package/core/decrypt/decryptForTxBuilder.ts +9 -9
- package/core/decrypt/tnDecryptUtils.ts +65 -0
- package/core/decrypt/{tnDecrypt.ts → tnDecryptV1.ts} +7 -70
- package/core/decrypt/tnDecryptV2.ts +343 -0
- package/core/permits.ts +3 -3
- package/core/types.ts +8 -0
- package/dist/{chunk-LWMRB6SD.js → chunk-MXND5SVN.js} +201 -62
- package/dist/{clientTypes-Y43CKbOz.d.cts → clientTypes-ACVWbrXL.d.cts} +15 -7
- package/dist/{clientTypes-PQha8zes.d.ts → clientTypes-kkrRdawm.d.ts} +15 -7
- package/dist/core.cjs +201 -62
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/node.cjs +201 -62
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/web.cjs +201 -62
- package/dist/web.d.cts +1 -1
- package/dist/web.d.ts +1 -1
- package/dist/web.js +1 -1
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -2665,13 +2665,13 @@ var serialize = (permit) => {
|
|
|
2665
2665
|
var deserialize = (serialized) => {
|
|
2666
2666
|
return PermitUtils.deserialize(serialized);
|
|
2667
2667
|
};
|
|
2668
|
-
var getPermit2 =
|
|
2668
|
+
var getPermit2 = (chainId, account, hash) => {
|
|
2669
2669
|
return permitStore.getPermit(chainId, account, hash);
|
|
2670
2670
|
};
|
|
2671
|
-
var getPermits2 =
|
|
2671
|
+
var getPermits2 = (chainId, account) => {
|
|
2672
2672
|
return permitStore.getPermits(chainId, account);
|
|
2673
2673
|
};
|
|
2674
|
-
var getActivePermit2 =
|
|
2674
|
+
var getActivePermit2 = (chainId, account) => {
|
|
2675
2675
|
return permitStore.getActivePermit(chainId, account);
|
|
2676
2676
|
};
|
|
2677
2677
|
var getActivePermitHash2 = (chainId, account) => {
|
|
@@ -3440,7 +3440,7 @@ async function cofheMocksDecryptForTx(ctHash, utype, permit, publicClient) {
|
|
|
3440
3440
|
signature
|
|
3441
3441
|
};
|
|
3442
3442
|
}
|
|
3443
|
-
function
|
|
3443
|
+
function normalizeTnSignature(signature) {
|
|
3444
3444
|
if (typeof signature !== "string") {
|
|
3445
3445
|
throw new CofheError({
|
|
3446
3446
|
code: "DECRYPT_RETURNED_NULL" /* DecryptReturnedNull */,
|
|
@@ -3496,57 +3496,77 @@ function parseDecryptedBytesToBigInt(decrypted) {
|
|
|
3496
3496
|
}
|
|
3497
3497
|
return BigInt(`0x${hex}`);
|
|
3498
3498
|
}
|
|
3499
|
-
|
|
3499
|
+
|
|
3500
|
+
// core/decrypt/tnDecryptV2.ts
|
|
3501
|
+
var POLL_INTERVAL_MS2 = 1e3;
|
|
3502
|
+
var POLL_TIMEOUT_MS2 = 5 * 60 * 1e3;
|
|
3503
|
+
function assertDecryptSubmitResponseV2(value) {
|
|
3500
3504
|
if (value == null || typeof value !== "object") {
|
|
3501
3505
|
throw new CofheError({
|
|
3502
3506
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3503
|
-
message: "decrypt response must be a JSON object",
|
|
3507
|
+
message: "decrypt submit response must be a JSON object",
|
|
3504
3508
|
context: {
|
|
3505
3509
|
value
|
|
3506
3510
|
}
|
|
3507
3511
|
});
|
|
3508
3512
|
}
|
|
3509
3513
|
const v = value;
|
|
3510
|
-
|
|
3511
|
-
const signature = v.signature;
|
|
3512
|
-
const encryptionType = v.encryption_type;
|
|
3513
|
-
const errorMessage = v.error_message;
|
|
3514
|
-
if (!Array.isArray(decrypted)) {
|
|
3514
|
+
if (typeof v.request_id !== "string" || v.request_id.trim().length === 0) {
|
|
3515
3515
|
throw new CofheError({
|
|
3516
|
-
code: "
|
|
3517
|
-
message: "decrypt response missing
|
|
3518
|
-
context: {
|
|
3516
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3517
|
+
message: "decrypt submit response missing request_id",
|
|
3518
|
+
context: {
|
|
3519
|
+
value
|
|
3520
|
+
}
|
|
3519
3521
|
});
|
|
3520
3522
|
}
|
|
3521
|
-
|
|
3523
|
+
return { request_id: v.request_id };
|
|
3524
|
+
}
|
|
3525
|
+
function assertDecryptStatusResponseV2(value) {
|
|
3526
|
+
if (value == null || typeof value !== "object") {
|
|
3522
3527
|
throw new CofheError({
|
|
3523
|
-
code: "
|
|
3524
|
-
message: "decrypt response
|
|
3525
|
-
context: {
|
|
3528
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3529
|
+
message: "decrypt status response must be a JSON object",
|
|
3530
|
+
context: {
|
|
3531
|
+
value
|
|
3532
|
+
}
|
|
3533
|
+
});
|
|
3534
|
+
}
|
|
3535
|
+
const v = value;
|
|
3536
|
+
const requestId = v.request_id;
|
|
3537
|
+
const status = v.status;
|
|
3538
|
+
const submittedAt = v.submitted_at;
|
|
3539
|
+
if (typeof requestId !== "string" || requestId.trim().length === 0) {
|
|
3540
|
+
throw new CofheError({
|
|
3541
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3542
|
+
message: "decrypt status response missing request_id",
|
|
3543
|
+
context: {
|
|
3544
|
+
value
|
|
3545
|
+
}
|
|
3526
3546
|
});
|
|
3527
3547
|
}
|
|
3528
|
-
if (
|
|
3548
|
+
if (status !== "PROCESSING" && status !== "COMPLETED") {
|
|
3529
3549
|
throw new CofheError({
|
|
3530
3550
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3531
|
-
message: "decrypt response
|
|
3532
|
-
context: {
|
|
3551
|
+
message: "decrypt status response has invalid status",
|
|
3552
|
+
context: {
|
|
3553
|
+
value,
|
|
3554
|
+
status
|
|
3555
|
+
}
|
|
3533
3556
|
});
|
|
3534
3557
|
}
|
|
3535
|
-
if (
|
|
3558
|
+
if (typeof submittedAt !== "string" || submittedAt.trim().length === 0) {
|
|
3536
3559
|
throw new CofheError({
|
|
3537
3560
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3538
|
-
message: "decrypt response
|
|
3539
|
-
context: {
|
|
3561
|
+
message: "decrypt status response missing submitted_at",
|
|
3562
|
+
context: {
|
|
3563
|
+
value
|
|
3564
|
+
}
|
|
3540
3565
|
});
|
|
3541
3566
|
}
|
|
3542
|
-
return
|
|
3543
|
-
decrypted,
|
|
3544
|
-
signature,
|
|
3545
|
-
encryption_type: encryptionType,
|
|
3546
|
-
error_message: errorMessage
|
|
3547
|
-
};
|
|
3567
|
+
return value;
|
|
3548
3568
|
}
|
|
3549
|
-
async function
|
|
3569
|
+
async function submitDecryptRequestV2(thresholdNetworkUrl, ctHash, chainId, permission) {
|
|
3550
3570
|
const body = {
|
|
3551
3571
|
ct_tempkey: BigInt(ctHash).toString(16).padStart(64, "0"),
|
|
3552
3572
|
host_chain_id: chainId
|
|
@@ -3556,7 +3576,7 @@ async function tnDecrypt(ctHash, chainId, permission, thresholdNetworkUrl) {
|
|
|
3556
3576
|
}
|
|
3557
3577
|
let response;
|
|
3558
3578
|
try {
|
|
3559
|
-
response = await fetch(`${thresholdNetworkUrl}/decrypt`, {
|
|
3579
|
+
response = await fetch(`${thresholdNetworkUrl}/v2/decrypt`, {
|
|
3560
3580
|
method: "POST",
|
|
3561
3581
|
headers: {
|
|
3562
3582
|
"Content-Type": "application/json"
|
|
@@ -3575,18 +3595,15 @@ async function tnDecrypt(ctHash, chainId, permission, thresholdNetworkUrl) {
|
|
|
3575
3595
|
}
|
|
3576
3596
|
});
|
|
3577
3597
|
}
|
|
3578
|
-
const responseText = await response.text();
|
|
3579
3598
|
if (!response.ok) {
|
|
3580
|
-
let errorMessage =
|
|
3599
|
+
let errorMessage = `HTTP ${response.status}`;
|
|
3581
3600
|
try {
|
|
3582
|
-
const errorBody =
|
|
3601
|
+
const errorBody = await response.json();
|
|
3583
3602
|
const maybeMessage = errorBody.error_message || errorBody.message;
|
|
3584
3603
|
if (typeof maybeMessage === "string" && maybeMessage.length > 0)
|
|
3585
3604
|
errorMessage = maybeMessage;
|
|
3586
3605
|
} catch {
|
|
3587
|
-
|
|
3588
|
-
if (trimmed.length > 0)
|
|
3589
|
-
errorMessage = trimmed;
|
|
3606
|
+
errorMessage = response.statusText || errorMessage;
|
|
3590
3607
|
}
|
|
3591
3608
|
throw new CofheError({
|
|
3592
3609
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
@@ -3596,41 +3613,163 @@ async function tnDecrypt(ctHash, chainId, permission, thresholdNetworkUrl) {
|
|
|
3596
3613
|
thresholdNetworkUrl,
|
|
3597
3614
|
status: response.status,
|
|
3598
3615
|
statusText: response.statusText,
|
|
3599
|
-
body
|
|
3600
|
-
responseText
|
|
3616
|
+
body
|
|
3601
3617
|
}
|
|
3602
3618
|
});
|
|
3603
3619
|
}
|
|
3604
3620
|
let rawJson;
|
|
3605
3621
|
try {
|
|
3606
|
-
rawJson =
|
|
3622
|
+
rawJson = await response.json();
|
|
3607
3623
|
} catch (e) {
|
|
3608
3624
|
throw new CofheError({
|
|
3609
3625
|
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3610
|
-
message: `Failed to parse decrypt response`,
|
|
3626
|
+
message: `Failed to parse decrypt submit response`,
|
|
3611
3627
|
cause: e instanceof Error ? e : void 0,
|
|
3612
3628
|
context: {
|
|
3613
3629
|
thresholdNetworkUrl,
|
|
3614
|
-
body
|
|
3615
|
-
responseText
|
|
3630
|
+
body
|
|
3616
3631
|
}
|
|
3617
3632
|
});
|
|
3618
3633
|
}
|
|
3619
|
-
const
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3634
|
+
const submitResponse = assertDecryptSubmitResponseV2(rawJson);
|
|
3635
|
+
return submitResponse.request_id;
|
|
3636
|
+
}
|
|
3637
|
+
async function pollDecryptStatusV2(thresholdNetworkUrl, requestId) {
|
|
3638
|
+
const startTime = Date.now();
|
|
3639
|
+
let completed = false;
|
|
3640
|
+
while (!completed) {
|
|
3641
|
+
if (Date.now() - startTime > POLL_TIMEOUT_MS2) {
|
|
3642
|
+
throw new CofheError({
|
|
3643
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3644
|
+
message: `decrypt polling timed out after ${POLL_TIMEOUT_MS2}ms`,
|
|
3645
|
+
hint: "The request may still be processing. Try again later.",
|
|
3646
|
+
context: {
|
|
3647
|
+
thresholdNetworkUrl,
|
|
3648
|
+
requestId,
|
|
3649
|
+
timeoutMs: POLL_TIMEOUT_MS2
|
|
3650
|
+
}
|
|
3651
|
+
});
|
|
3652
|
+
}
|
|
3653
|
+
let response;
|
|
3654
|
+
try {
|
|
3655
|
+
response = await fetch(`${thresholdNetworkUrl}/v2/decrypt/${requestId}`, {
|
|
3656
|
+
method: "GET",
|
|
3657
|
+
headers: {
|
|
3658
|
+
"Content-Type": "application/json"
|
|
3659
|
+
}
|
|
3660
|
+
});
|
|
3661
|
+
} catch (e) {
|
|
3662
|
+
throw new CofheError({
|
|
3663
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3664
|
+
message: `decrypt status poll failed`,
|
|
3665
|
+
hint: "Ensure the threshold network URL is valid and reachable.",
|
|
3666
|
+
cause: e instanceof Error ? e : void 0,
|
|
3667
|
+
context: {
|
|
3668
|
+
thresholdNetworkUrl,
|
|
3669
|
+
requestId
|
|
3670
|
+
}
|
|
3671
|
+
});
|
|
3672
|
+
}
|
|
3673
|
+
if (response.status === 404) {
|
|
3674
|
+
throw new CofheError({
|
|
3675
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3676
|
+
message: `decrypt request not found: ${requestId}`,
|
|
3677
|
+
hint: "The request may have expired or been invalid.",
|
|
3678
|
+
context: {
|
|
3679
|
+
thresholdNetworkUrl,
|
|
3680
|
+
requestId
|
|
3681
|
+
}
|
|
3682
|
+
});
|
|
3683
|
+
}
|
|
3684
|
+
if (!response.ok) {
|
|
3685
|
+
let errorMessage = `HTTP ${response.status}`;
|
|
3686
|
+
try {
|
|
3687
|
+
const errorBody = await response.json();
|
|
3688
|
+
const maybeMessage = errorBody.error_message || errorBody.message;
|
|
3689
|
+
if (typeof maybeMessage === "string" && maybeMessage.length > 0)
|
|
3690
|
+
errorMessage = maybeMessage;
|
|
3691
|
+
} catch {
|
|
3692
|
+
errorMessage = response.statusText || errorMessage;
|
|
3628
3693
|
}
|
|
3629
|
-
|
|
3694
|
+
throw new CofheError({
|
|
3695
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3696
|
+
message: `decrypt status poll failed: ${errorMessage}`,
|
|
3697
|
+
context: {
|
|
3698
|
+
thresholdNetworkUrl,
|
|
3699
|
+
requestId,
|
|
3700
|
+
status: response.status,
|
|
3701
|
+
statusText: response.statusText
|
|
3702
|
+
}
|
|
3703
|
+
});
|
|
3704
|
+
}
|
|
3705
|
+
let rawJson;
|
|
3706
|
+
try {
|
|
3707
|
+
rawJson = await response.json();
|
|
3708
|
+
} catch (e) {
|
|
3709
|
+
throw new CofheError({
|
|
3710
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3711
|
+
message: `Failed to parse decrypt status response`,
|
|
3712
|
+
cause: e instanceof Error ? e : void 0,
|
|
3713
|
+
context: {
|
|
3714
|
+
thresholdNetworkUrl,
|
|
3715
|
+
requestId
|
|
3716
|
+
}
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3719
|
+
const statusResponse = assertDecryptStatusResponseV2(rawJson);
|
|
3720
|
+
if (statusResponse.status === "COMPLETED") {
|
|
3721
|
+
if (statusResponse.is_succeed === false) {
|
|
3722
|
+
const errorMessage = statusResponse.error_message || "Unknown error";
|
|
3723
|
+
throw new CofheError({
|
|
3724
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3725
|
+
message: `decrypt request failed: ${errorMessage}`,
|
|
3726
|
+
context: {
|
|
3727
|
+
thresholdNetworkUrl,
|
|
3728
|
+
requestId,
|
|
3729
|
+
statusResponse
|
|
3730
|
+
}
|
|
3731
|
+
});
|
|
3732
|
+
}
|
|
3733
|
+
if (statusResponse.error_message) {
|
|
3734
|
+
throw new CofheError({
|
|
3735
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3736
|
+
message: `decrypt request failed: ${statusResponse.error_message}`,
|
|
3737
|
+
context: {
|
|
3738
|
+
thresholdNetworkUrl,
|
|
3739
|
+
requestId,
|
|
3740
|
+
statusResponse
|
|
3741
|
+
}
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
if (!Array.isArray(statusResponse.decrypted)) {
|
|
3745
|
+
throw new CofheError({
|
|
3746
|
+
code: "DECRYPT_RETURNED_NULL" /* DecryptReturnedNull */,
|
|
3747
|
+
message: "decrypt completed but response missing <decrypted> byte array",
|
|
3748
|
+
context: {
|
|
3749
|
+
thresholdNetworkUrl,
|
|
3750
|
+
requestId,
|
|
3751
|
+
statusResponse
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3754
|
+
}
|
|
3755
|
+
const decryptedValue = parseDecryptedBytesToBigInt(statusResponse.decrypted);
|
|
3756
|
+
const signature = normalizeTnSignature(statusResponse.signature);
|
|
3757
|
+
return { decryptedValue, signature };
|
|
3758
|
+
}
|
|
3759
|
+
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS2));
|
|
3630
3760
|
}
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3761
|
+
throw new CofheError({
|
|
3762
|
+
code: "DECRYPT_FAILED" /* DecryptFailed */,
|
|
3763
|
+
message: "Polling loop exited unexpectedly",
|
|
3764
|
+
context: {
|
|
3765
|
+
thresholdNetworkUrl,
|
|
3766
|
+
requestId
|
|
3767
|
+
}
|
|
3768
|
+
});
|
|
3769
|
+
}
|
|
3770
|
+
async function tnDecryptV2(ctHash, chainId, permission, thresholdNetworkUrl) {
|
|
3771
|
+
const requestId = await submitDecryptRequestV2(thresholdNetworkUrl, ctHash, chainId, permission);
|
|
3772
|
+
return await pollDecryptStatusV2(thresholdNetworkUrl, requestId);
|
|
3634
3773
|
}
|
|
3635
3774
|
|
|
3636
3775
|
// core/decrypt/decryptForTxBuilder.ts
|
|
@@ -3791,7 +3930,7 @@ var DecryptForTxBuilder = class extends BaseBuilder {
|
|
|
3791
3930
|
this.assertPublicClient();
|
|
3792
3931
|
const thresholdNetworkUrl = await this.getThresholdNetworkUrl();
|
|
3793
3932
|
const permission = permit ? PermitUtils.getPermission(permit, true) : null;
|
|
3794
|
-
const { decryptedValue, signature } = await
|
|
3933
|
+
const { decryptedValue, signature } = await tnDecryptV2(this.ctHash, this.chainId, permission, thresholdNetworkUrl);
|
|
3795
3934
|
return {
|
|
3796
3935
|
ctHash: this.ctHash,
|
|
3797
3936
|
decryptedValue,
|
|
@@ -3999,19 +4138,19 @@ function createCofheClientBase(opts) {
|
|
|
3999
4138
|
return permits.getOrCreateSharingPermit(publicClient, walletClient, options, _chainId, _account);
|
|
4000
4139
|
},
|
|
4001
4140
|
// Retrieval methods (auto-fill chainId/account)
|
|
4002
|
-
getPermit:
|
|
4141
|
+
getPermit: (hash, chainId, account) => {
|
|
4003
4142
|
const { chainId: _chainId, account: _account } = _getChainIdAndAccount(chainId, account);
|
|
4004
4143
|
return permits.getPermit(_chainId, _account, hash);
|
|
4005
4144
|
},
|
|
4006
|
-
getPermits:
|
|
4145
|
+
getPermits: (chainId, account) => {
|
|
4007
4146
|
const { chainId: _chainId, account: _account } = _getChainIdAndAccount(chainId, account);
|
|
4008
4147
|
return permits.getPermits(_chainId, _account);
|
|
4009
4148
|
},
|
|
4010
|
-
getActivePermit:
|
|
4149
|
+
getActivePermit: (chainId, account) => {
|
|
4011
4150
|
const { chainId: _chainId, account: _account } = _getChainIdAndAccount(chainId, account);
|
|
4012
4151
|
return permits.getActivePermit(_chainId, _account);
|
|
4013
4152
|
},
|
|
4014
|
-
getActivePermitHash:
|
|
4153
|
+
getActivePermitHash: (chainId, account) => {
|
|
4015
4154
|
const { chainId: _chainId, account: _account } = _getChainIdAndAccount(chainId, account);
|
|
4016
4155
|
return permits.getActivePermitHash(_chainId, _account);
|
|
4017
4156
|
},
|
package/dist/core.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as CofheClientConnectionState, a as CofheConfig, d as CofheClientParams, b as CofheClient, F as FheTypes } from './clientTypes-
|
|
2
|
-
export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, Y as DecryptForTxBuilder, Z as DecryptForTxResult, X as DecryptForViewBuilder, 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, _ as ZkBuilderAndCrsGenerator, $ as ZkProveWorkerFunction, a0 as ZkProveWorkerRequest, a1 as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofheConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofheConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a2 as zkProveWithWorker } from './clientTypes-
|
|
1
|
+
import { c as CofheClientConnectionState, a as CofheConfig, d as CofheClientParams, b as CofheClient, F as FheTypes } from './clientTypes-ACVWbrXL.cjs';
|
|
2
|
+
export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, Y as DecryptForTxBuilder, Z as DecryptForTxResult, X as DecryptForViewBuilder, 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, _ as ZkBuilderAndCrsGenerator, $ as ZkProveWorkerFunction, a0 as ZkProveWorkerRequest, a1 as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofheConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofheConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a2 as zkProveWithWorker } from './clientTypes-ACVWbrXL.cjs';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import './types-YiAC4gig.cjs';
|
|
5
5
|
import 'zod';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as CofheClientConnectionState, a as CofheConfig, d as CofheClientParams, b as CofheClient, F as FheTypes } from './clientTypes-
|
|
2
|
-
export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, Y as DecryptForTxBuilder, Z as DecryptForTxResult, X as DecryptForViewBuilder, 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, _ as ZkBuilderAndCrsGenerator, $ as ZkProveWorkerFunction, a0 as ZkProveWorkerRequest, a1 as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofheConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofheConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a2 as zkProveWithWorker } from './clientTypes-
|
|
1
|
+
import { c as CofheClientConnectionState, a as CofheConfig, d as CofheClientParams, b as CofheClient, F as FheTypes } from './clientTypes-kkrRdawm.js';
|
|
2
|
+
export { h as CofheClientPermits, C as CofheInputConfig, f as CofheInternalConfig, Y as DecryptForTxBuilder, Z as DecryptForTxResult, X as DecryptForViewBuilder, 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, _ as ZkBuilderAndCrsGenerator, $ as ZkProveWorkerFunction, a0 as ZkProveWorkerRequest, a1 as ZkProveWorkerResponse, O as assertCorrectEncryptedItemInput, e as createCofheConfigBase, S as createKeysStore, Q as fetchKeys, g as getCofheConfigItem, K as isEncryptableItem, N as isLastEncryptionStep, a2 as zkProveWithWorker } from './clientTypes-kkrRdawm.js';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import './types-YiAC4gig.js';
|
|
5
5
|
import 'zod';
|
package/dist/core.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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, zkProveWithWorker } from './chunk-
|
|
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, zkProveWithWorker } from './chunk-MXND5SVN.js';
|
|
2
2
|
import './chunk-TBLR7NNE.js';
|
|
3
3
|
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, TEST_BED_ADDRESS } from './chunk-NWDKXBIP.js';
|