@inco/js 0.8.0-devnet-8 → 0.8.0-devnet-10
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/cjs/advancedacl/session-key.js +15 -6
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +2 -6
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +15 -22
- package/dist/cjs/generated/abis/lightning.d.ts +990 -95
- package/dist/cjs/generated/abis/lightning.js +645 -6
- package/dist/cjs/generated/abis/test-elist.d.ts +1 -1
- package/dist/cjs/generated/abis/test-elist.js +2 -2
- package/dist/cjs/generated/abis/verifier.d.ts +43 -0
- package/dist/cjs/generated/abis/verifier.js +23 -1
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +2 -2
- package/dist/cjs/generated/lightning.d.ts +40 -0
- package/dist/cjs/generated/lightning.js +43 -1
- package/dist/cjs/generated/local-node.d.ts +4 -4
- package/dist/cjs/generated/local-node.js +22 -5
- package/dist/cjs/handle.d.ts +12 -0
- package/dist/cjs/handle.js +29 -2
- package/dist/cjs/kms/client.d.ts +1 -1
- package/dist/cjs/kms/client.js +4 -3
- package/dist/cjs/kms/quorumClient.d.ts +1 -0
- package/dist/cjs/kms/quorumClient.js +21 -4
- package/dist/cjs/lite/index.d.ts +1 -1
- package/dist/cjs/lite/index.js +2 -3
- package/dist/cjs/lite/lightning.d.ts +2 -3
- package/dist/cjs/lite/lightning.js +4 -14
- package/dist/cjs/lite/xwing.d.ts +25 -0
- package/dist/cjs/lite/xwing.js +49 -5
- package/dist/cjs/retry.d.ts +14 -0
- package/dist/cjs/retry.js +58 -2
- package/dist/cjs/test/mocks.d.ts +1 -0
- package/dist/cjs/test/mocks.js +3 -2
- package/dist/esm/advancedacl/session-key.js +13 -4
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +2 -6
- package/dist/esm/attesteddecrypt/attested-decrypt.js +14 -20
- package/dist/esm/generated/abis/lightning.d.ts +990 -95
- package/dist/esm/generated/abis/lightning.js +643 -4
- package/dist/esm/generated/abis/test-elist.d.ts +1 -1
- package/dist/esm/generated/abis/test-elist.js +2 -2
- package/dist/esm/generated/abis/verifier.d.ts +43 -0
- package/dist/esm/generated/abis/verifier.js +23 -1
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +2 -2
- package/dist/esm/generated/lightning.d.ts +40 -0
- package/dist/esm/generated/lightning.js +43 -1
- package/dist/esm/generated/local-node.d.ts +4 -4
- package/dist/esm/generated/local-node.js +22 -5
- package/dist/esm/handle.d.ts +12 -0
- package/dist/esm/handle.js +27 -1
- package/dist/esm/kms/client.d.ts +1 -1
- package/dist/esm/kms/client.js +3 -2
- package/dist/esm/kms/quorumClient.d.ts +1 -0
- package/dist/esm/kms/quorumClient.js +21 -4
- package/dist/esm/lite/index.d.ts +1 -1
- package/dist/esm/lite/index.js +2 -2
- package/dist/esm/lite/lightning.d.ts +2 -3
- package/dist/esm/lite/lightning.js +6 -16
- package/dist/esm/lite/xwing.d.ts +25 -0
- package/dist/esm/lite/xwing.js +47 -5
- package/dist/esm/retry.d.ts +14 -0
- package/dist/esm/retry.js +56 -2
- package/dist/esm/test/mocks.d.ts +1 -0
- package/dist/esm/test/mocks.js +4 -3
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +2 -6
- package/dist/types/generated/abis/lightning.d.ts +990 -95
- package/dist/types/generated/abis/test-elist.d.ts +1 -1
- package/dist/types/generated/abis/verifier.d.ts +43 -0
- package/dist/types/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/types/generated/lightning.d.ts +40 -0
- package/dist/types/generated/local-node.d.ts +4 -4
- package/dist/types/handle.d.ts +12 -0
- package/dist/types/kms/client.d.ts +1 -1
- package/dist/types/kms/quorumClient.d.ts +1 -0
- package/dist/types/lite/index.d.ts +1 -1
- package/dist/types/lite/lightning.d.ts +2 -3
- package/dist/types/lite/xwing.d.ts +25 -0
- package/dist/types/retry.d.ts +14 -0
- package/dist/types/test/mocks.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/generated/abis/lightning-preview.d.ts +0 -1441
- package/dist/cjs/generated/abis/lightning-preview.js +0 -907
- package/dist/esm/generated/abis/lightning-preview.d.ts +0 -1441
- package/dist/esm/generated/abis/lightning-preview.js +0 -904
- package/dist/types/generated/abis/lightning-preview.d.ts +0 -1441
|
@@ -2,7 +2,7 @@ export declare const elistTesterAbi: readonly [{
|
|
|
2
2
|
readonly type: "constructor";
|
|
3
3
|
readonly inputs: readonly [{
|
|
4
4
|
readonly name: "_inco";
|
|
5
|
-
readonly internalType: "contract
|
|
5
|
+
readonly internalType: "contract IIncoLightning";
|
|
6
6
|
readonly type: "address";
|
|
7
7
|
}];
|
|
8
8
|
readonly stateMutability: "nonpayable";
|
|
@@ -429,6 +429,45 @@ export declare const incoVerifierAbi: readonly [{
|
|
|
429
429
|
readonly type: "bool";
|
|
430
430
|
}];
|
|
431
431
|
readonly stateMutability: "view";
|
|
432
|
+
}, {
|
|
433
|
+
readonly type: "function";
|
|
434
|
+
readonly inputs: readonly [{
|
|
435
|
+
readonly name: "elistHandle";
|
|
436
|
+
readonly internalType: "bytes32";
|
|
437
|
+
readonly type: "bytes32";
|
|
438
|
+
}, {
|
|
439
|
+
readonly name: "proofElements";
|
|
440
|
+
readonly internalType: "struct ElementDecryptionProof[]";
|
|
441
|
+
readonly type: "tuple[]";
|
|
442
|
+
readonly components: readonly [{
|
|
443
|
+
readonly name: "pairHash";
|
|
444
|
+
readonly internalType: "bytes32";
|
|
445
|
+
readonly type: "bytes32";
|
|
446
|
+
}, {
|
|
447
|
+
readonly name: "commitment";
|
|
448
|
+
readonly internalType: "bytes32";
|
|
449
|
+
readonly type: "bytes32";
|
|
450
|
+
}, {
|
|
451
|
+
readonly name: "value";
|
|
452
|
+
readonly internalType: "uint256";
|
|
453
|
+
readonly type: "uint256";
|
|
454
|
+
}];
|
|
455
|
+
}, {
|
|
456
|
+
readonly name: "proof";
|
|
457
|
+
readonly internalType: "bytes32";
|
|
458
|
+
readonly type: "bytes32";
|
|
459
|
+
}, {
|
|
460
|
+
readonly name: "signatures";
|
|
461
|
+
readonly internalType: "bytes[]";
|
|
462
|
+
readonly type: "bytes[]";
|
|
463
|
+
}];
|
|
464
|
+
readonly name: "isValidEListDecryptionAttestation";
|
|
465
|
+
readonly outputs: readonly [{
|
|
466
|
+
readonly name: "";
|
|
467
|
+
readonly internalType: "bool";
|
|
468
|
+
readonly type: "bool";
|
|
469
|
+
}];
|
|
470
|
+
readonly stateMutability: "view";
|
|
432
471
|
}, {
|
|
433
472
|
readonly type: "function";
|
|
434
473
|
readonly inputs: readonly [{
|
|
@@ -1079,6 +1118,10 @@ export declare const incoVerifierAbi: readonly [{
|
|
|
1079
1118
|
readonly type: "uint256";
|
|
1080
1119
|
}];
|
|
1081
1120
|
readonly name: "InvalidThreshold";
|
|
1121
|
+
}, {
|
|
1122
|
+
readonly type: "error";
|
|
1123
|
+
readonly inputs: readonly [];
|
|
1124
|
+
readonly name: "InvalidVerifyingContract";
|
|
1082
1125
|
}, {
|
|
1083
1126
|
readonly type: "error";
|
|
1084
1127
|
readonly inputs: readonly [{
|
|
@@ -122,6 +122,13 @@ export type TeeKeys = Message<"inco.sealingfetcher.v1.TeeKeys"> & {
|
|
|
122
122
|
* @generated from field: bytes storage_privkey = 3;
|
|
123
123
|
*/
|
|
124
124
|
storagePrivkey: Uint8Array;
|
|
125
|
+
/**
|
|
126
|
+
* The 32-byte seed used for Lightning's RNG. Generated at bootstrap and
|
|
127
|
+
* distinct from the network private key.
|
|
128
|
+
*
|
|
129
|
+
* @generated from field: bytes rand_seed = 4;
|
|
130
|
+
*/
|
|
131
|
+
randSeed: Uint8Array;
|
|
125
132
|
};
|
|
126
133
|
/**
|
|
127
134
|
* Describes the message inco.sealingfetcher.v1.TeeKeys.
|
|
@@ -1,4 +1,44 @@
|
|
|
1
1
|
export declare const lightningDeployments: readonly [{
|
|
2
|
+
readonly name: "incoLightning_6_0_0__281949651";
|
|
3
|
+
readonly majorVersion: 6;
|
|
4
|
+
readonly deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC";
|
|
5
|
+
readonly pepper: "devnet";
|
|
6
|
+
readonly executorAddress: "0xDF3830489208461f72Df6E45D0e6cbF9DBB74fe1";
|
|
7
|
+
readonly salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc009531587de02194b1b7a9d3";
|
|
8
|
+
readonly chainId: 84532;
|
|
9
|
+
readonly chainName: "Base Sepolia";
|
|
10
|
+
readonly version: {
|
|
11
|
+
readonly major: 6;
|
|
12
|
+
readonly minor: 0;
|
|
13
|
+
readonly patch: 0;
|
|
14
|
+
readonly shortSalt: "281949651";
|
|
15
|
+
};
|
|
16
|
+
readonly blockNumber: 37516200;
|
|
17
|
+
readonly deployDate: "2026-02-11T09:04:51.931Z";
|
|
18
|
+
readonly commit: "v0.8.0-devnet-9-13-ge2ba2377";
|
|
19
|
+
readonly active: true;
|
|
20
|
+
readonly includesPreviewFeatures: false;
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "incoLightningPreview_5_0_0__203964628";
|
|
23
|
+
readonly majorVersion: 5;
|
|
24
|
+
readonly deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC";
|
|
25
|
+
readonly pepper: "devnet";
|
|
26
|
+
readonly executorAddress: "0x8D5D75CC00E2Fc84ec4dE085aE1708223591c6b6";
|
|
27
|
+
readonly salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00c573fb2bf617e75b6210d4";
|
|
28
|
+
readonly chainId: 84532;
|
|
29
|
+
readonly chainName: "Base Sepolia";
|
|
30
|
+
readonly version: {
|
|
31
|
+
readonly major: 5;
|
|
32
|
+
readonly minor: 0;
|
|
33
|
+
readonly patch: 0;
|
|
34
|
+
readonly shortSalt: "203964628";
|
|
35
|
+
};
|
|
36
|
+
readonly blockNumber: 37431152;
|
|
37
|
+
readonly deployDate: "2026-02-09T09:49:55.326Z";
|
|
38
|
+
readonly commit: "v0.8.0-devnet-8-8-ge2e37e00";
|
|
39
|
+
readonly active: true;
|
|
40
|
+
readonly includesPreviewFeatures: true;
|
|
41
|
+
}, {
|
|
2
42
|
readonly name: "incoLightningPreview_4_0_0__409204766";
|
|
3
43
|
readonly majorVersion: 4;
|
|
4
44
|
readonly deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC";
|
|
@@ -16,12 +16,12 @@ export declare const localNodeLightningConfig: {
|
|
|
16
16
|
readonly senderPrivateKey: "0x3ff395b755c4dc09837d0672dd421915e9b9835a4733edf63d8fd12b3fe4475c";
|
|
17
17
|
};
|
|
18
18
|
readonly devnet: {
|
|
19
|
-
readonly executorAddress: "
|
|
19
|
+
readonly executorAddress: "0xDF3830489208461f72Df6E45D0e6cbF9DBB74fe1";
|
|
20
20
|
readonly chainId: 31337;
|
|
21
21
|
readonly covalidatorUrls: readonly ["http://localhost:50055"];
|
|
22
|
-
readonly signers: readonly ["
|
|
22
|
+
readonly signers: readonly ["0x686190B567C1EF3adD333B73ad9B4B092D8723c1"];
|
|
23
23
|
readonly hostChainRpcUrl: "http://localhost:8545";
|
|
24
|
-
readonly senderPrivateKey: "
|
|
24
|
+
readonly senderPrivateKey: "0xcffaf5c90b8131b526b028c6c328b3e9f5079932e29a2ec3a1b7f29b383fd0e6";
|
|
25
25
|
};
|
|
26
26
|
readonly alphanet: {
|
|
27
27
|
readonly executorAddress: "0xc0d693DeEF0A91CE39208676b6da09B822abd199";
|
|
@@ -32,7 +32,7 @@ export declare const localNodeLightningConfig: {
|
|
|
32
32
|
readonly senderPrivateKey: "0x279c172cf3638a79642daa5f7666c600befde318550d7579cf96280920e318b6";
|
|
33
33
|
};
|
|
34
34
|
readonly scratch: {
|
|
35
|
-
readonly executorAddress: "
|
|
35
|
+
readonly executorAddress: "0xF253724506f9aF666C301c0aD94f92f92Ff390E4";
|
|
36
36
|
readonly chainId: 31337;
|
|
37
37
|
readonly covalidatorUrls: readonly ["http://localhost:50055"];
|
|
38
38
|
readonly signers: readonly ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"];
|
package/dist/types/handle.d.ts
CHANGED
|
@@ -29,6 +29,18 @@ export declare const InputContext: Schema.Struct<{
|
|
|
29
29
|
}>;
|
|
30
30
|
export type InputContext = typeof InputContext.Type;
|
|
31
31
|
export type Handle = HexString;
|
|
32
|
+
/**
|
|
33
|
+
* Expected length of a handle in bytes.
|
|
34
|
+
* Handle format: 29 bytes hash + 1 byte index + 1 byte type + 1 byte version = 32 bytes
|
|
35
|
+
*/
|
|
36
|
+
export declare const HANDLE_LENGTH_BYTES = 32;
|
|
37
|
+
/**
|
|
38
|
+
* Validates handle integrity by checking format, length, and version.
|
|
39
|
+
* Matches the validation in Go's HandleFromBytes (pkg/fhe/handle.go).
|
|
40
|
+
* @param handle - The handle to validate
|
|
41
|
+
* @throws Error if handle is malformed (wrong format, length, or unsupported version)
|
|
42
|
+
*/
|
|
43
|
+
export declare function validateHandle(handle: HexString): void;
|
|
32
44
|
export declare function getHandleType(handle: HexString): FheType;
|
|
33
45
|
/**
|
|
34
46
|
* Computes the prehandle hash for an input based on the ciphertext
|
|
@@ -2,7 +2,7 @@ import { type Client } from '@connectrpc/connect';
|
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
3
|
import type { SupportedChain } from '../chain.js';
|
|
4
4
|
import { KmsService } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const TEST_DEFAULT_COVALIDATOR_SIGNER: Address;
|
|
6
6
|
export type KmsClient = Client<typeof KmsService> & {
|
|
7
7
|
signerAddress: Address;
|
|
8
8
|
};
|
|
@@ -52,6 +52,7 @@ export declare class KmsQuorumClient {
|
|
|
52
52
|
private verifyComputeResponseConsistency;
|
|
53
53
|
/**
|
|
54
54
|
* Verifies that two plaintext byte arrays are identical.
|
|
55
|
+
* Uses constant-time comparison to prevent timing side-channel attacks.
|
|
55
56
|
*/
|
|
56
57
|
private verifyPlaintextBytesConsistency;
|
|
57
58
|
private verifyPlaintextConsistency;
|
|
@@ -6,4 +6,4 @@ export * from './attested-decrypt.js';
|
|
|
6
6
|
export * from './deployments.js';
|
|
7
7
|
export * from './hadu.js';
|
|
8
8
|
export * from './lightning.js';
|
|
9
|
-
export { TEST_NETWORK_SEED_KEY,
|
|
9
|
+
export { TEST_NETWORK_SEED_KEY, XWING_PUBLIC_KEY_SIZE, decodeXwingPrivateKey, decodeXwingPublicKey, decrypt, deriveXwingKeypairFromSeed, encodeXwingPublicKey, encrypt, generateXwingKeypair, getXwingDecryptor, getXwingEncryptor, type XwingDecryptorArgs, type XwingEncryptorArgs, type XwingKeypair, } from './xwing.js';
|
|
@@ -387,15 +387,14 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
387
387
|
static getNetworkPubkey(client: PublicClient, executorAddress: Address): Promise<HexString>;
|
|
388
388
|
static getIncoVerifierContract(client: PublicClient, executorAddress: Address): Promise<GetContractReturnType<typeof incoVerifierAbi, PublicClient, Address>>;
|
|
389
389
|
/**
|
|
390
|
-
* Retrieves the verifier contract details including threshold, signers, and
|
|
390
|
+
* Retrieves the verifier contract details including threshold, signers, and XWING public key from the Inco Verifier contract.
|
|
391
391
|
*
|
|
392
392
|
* @param executorAddress The address of the Inco Lightning executor contract.
|
|
393
393
|
* @param client The public client to interact with the blockchain.
|
|
394
|
-
* @returns An object containing the threshold, signers, and
|
|
394
|
+
* @returns An object containing the threshold, signers, and XWING public key.
|
|
395
395
|
*/
|
|
396
396
|
private static getVerifierContractDetails;
|
|
397
397
|
private static getChainConfig;
|
|
398
398
|
private static supportsThresholdRetrieval;
|
|
399
|
-
private static getDefaultThresholdAndSigners;
|
|
400
399
|
}
|
|
401
400
|
export {};
|
|
@@ -5,8 +5,33 @@ import { PubKeyEncodable } from '../reencryption/index.js';
|
|
|
5
5
|
* Combining ML-KEM-768 (1184 bytes) and X25519 (32 bytes).
|
|
6
6
|
*/
|
|
7
7
|
export declare const XWING_PUBLIC_KEY_SIZE: number;
|
|
8
|
+
/**
|
|
9
|
+
* WARNING: TEST KEY - DO NOT USE IN PRODUCTION
|
|
10
|
+
* This is a well-known test seed (all zeros) that provides NO security.
|
|
11
|
+
* Anyone can derive the private key from this seed and decrypt all data.
|
|
12
|
+
* Only use for local development and testing.
|
|
13
|
+
*/
|
|
8
14
|
export declare const TEST_NETWORK_SEED_KEY = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
15
|
+
/**
|
|
16
|
+
* WARNING: TEST KEY - DO NOT USE IN PRODUCTION
|
|
17
|
+
* This is the public key derived from TEST_NETWORK_SEED_KEY (all zeros).
|
|
18
|
+
* Data encrypted with this key can be decrypted by anyone who knows the seed.
|
|
19
|
+
* Only use for local development and testing.
|
|
20
|
+
*
|
|
21
|
+
* Generated from Go with seed of all zeros using HPKE layer: hpke.KEM_XWING.Scheme().DeriveKeyPair(seed)
|
|
22
|
+
* This matches the key used in covalidator's GetXwingPrivateKeyForTesting() via DeriveXwingPrivateKey
|
|
23
|
+
*/
|
|
9
24
|
export declare const TEST_NETWORK_XWING_PUBKEY = "0xca882388911c7c762aafc20debd63e845b3bed28c9d5262cdea7771fb31bd660a1ae7b395a9a7df3d12c7b118e8eda5057572c1ba05cd9b635edf33dabca4cac7291e0848f19c20e5beb850c3818f3543d49b3a5c729cb86a28fda539775d04feda112fe0c81d138aaf623aea7d507a4e826e890105db6065a44aba76a10d771c00d1b33f4ac51869806aae18eada68f19047024542d64a7aa1c91a5e1aa49d93613b5224b415bcc7aa166e4b55033438d20c641f9664fdb1689b53208181463e3d1325d46b30f07c5945b7e3fa1418bf833d975258461b294664eaf60795964924a280729c10a37fc6e967440bdd55d4ca53596286383481291152365303d44517cef369c00933b0b30368a230353e729c031075e8388673678a56b3ba84a165b28096ee9bd684483e1844258b451c365c41fa534152a3b64120041450128e960c7d6437d717ee266bdde7aaeec225ed93b958d188e97407349f1382976ca47d761ecc59a6f394487eb015c083abb490584677240eb47f838c838568a496119378b8bb81484610a50792b5d9c9939db188e7d0249d3cb918c436f111a2898849b286b0743a22c57464c709c5eaceac1ba493adca3328c0b14b5e38d3aea74e328b622b17e7181c35ad11c2103bdb7f2b209d93dcbc4ab61a06bc37139e6d2b7a06c5b7e9267bef3a8918a706f793271a5acc2574532da79e5a10cf074b998147a3c43586a411a513bba0d11cc19a36c83b19277f28022c88b120abfdba7076a8263e05336e3245aef7033eb3c762b5bbfa5791ac960398b649d5cbb652ddc6b2398143a0861ab3b410b696328879c099098adf819fbf7ac170030e86675e7f45c22ac9e1cf52c3102487bb0b91ab592afdc69c6e3a9b71876b86260b6c736b8291098f1130d3b763525cbad540ce2d042eacb6ed43b7bcba898f712c412f26066e09945f44ec7026c8ef959831abc10719d2017a12a41728b41c02371a5f5756ebc79406be708ea41bbd21563c874a0b791a3b4e4224a609967004f065c5ab4f3b4c61cb35df70573269da53179c3701fc5205f61974426f9b794c1b5826494b70842b6920c17752029369264dc8590b898b85c9d89a258e1f46c1b0490efd17c485cb51687cea272041e90b8e629521d3c5e3fa7518161bad7a159295b63cc6c0077897b53d47db8bc0ecb820f550705b65715a1a1094d04854f56acd26aa0baa10cb8447fad6211f53105796a42882328e6852e8de821c283b51eaab9bc95c4dc53615626049d63b1f9a457193805276b1905b0ab39353b5cf91fdd6023d4d816aef9cce4a3cfb3d12190172df221ae61d427563a098cc60e3dc9997ef54959180be5dc64a911157db6be3a01be2ee343caab33b8729abf0c50c674758c511291941fceac646232920907c2e88b9ec10211161729c797643a553a6ae5c4b7483c04e3263bd291e311c609071348b7c3310aa97d6b8318e0a4afe8399fa22f951049a9bb8860f7c69a333d3cc1aaf0129ab560713bf29eb3a01f9a276c78e54e3a3648b2447c80242b271b11406866389426d8b59796540d6b5702092ab21ee217c075cfc0c17ef826ce9ea29b9e61617457a5b1aaa23a58615dc53c59183beb36ea19498c21820b70ab47adeb678f1c52bf8768b3597b608ea1a8a15cd62e8a29bec4a1ac248ef9f02de0144bca06025f95a42bd6c8eaaaaaa2366328561d";
|
|
25
|
+
/**
|
|
26
|
+
* Check if a byte array matches the test seed key.
|
|
27
|
+
* Logs a warning if it does.
|
|
28
|
+
*/
|
|
29
|
+
export declare function warnIfTestSeed(seed: Uint8Array): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a byte array matches the test public key.
|
|
32
|
+
* Logs a warning if it does.
|
|
33
|
+
*/
|
|
34
|
+
export declare function warnIfTestPubKey(pubKeyBytes: Uint8Array): boolean;
|
|
10
35
|
/**
|
|
11
36
|
* X-Wing keypair interface.
|
|
12
37
|
* X-Wing is a post-quantum hybrid KEM combining ML-KEM-768 and X25519.
|
package/dist/types/retry.d.ts
CHANGED
|
@@ -7,6 +7,20 @@ export type BackoffConfig = {
|
|
|
7
7
|
backoffFactor: number;
|
|
8
8
|
errHandler?: (error: Error, attempt: number) => 'stop' | 'continue';
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Checks if an error is safe to retry.
|
|
12
|
+
* Only transient errors matching the allowlist should return true.
|
|
13
|
+
* All other errors fail fast to avoid masking security-critical failures.
|
|
14
|
+
*
|
|
15
|
+
* @param error - The error to check
|
|
16
|
+
* @returns true if the error is transient and safe to retry, false otherwise
|
|
17
|
+
*/
|
|
18
|
+
export declare function isRetryableError(error: Error): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Default error handler that only retries known transient errors.
|
|
21
|
+
* Security-critical errors will fail fast.
|
|
22
|
+
*/
|
|
23
|
+
export declare function defaultRetryErrorHandler(error: Error): 'stop' | 'continue';
|
|
10
24
|
/**
|
|
11
25
|
* Helper function to implement exponential backoff retry logic.
|
|
12
26
|
* @param fn - The function to retry
|
|
@@ -5,6 +5,7 @@ import { KmsQuorumClient } from '../kms/quorumClient.js';
|
|
|
5
5
|
interface MinimalKmsClient {
|
|
6
6
|
attestedCompute: ReturnType<typeof vi.fn>;
|
|
7
7
|
attestedDecrypt: ReturnType<typeof vi.fn>;
|
|
8
|
+
attestedReveal: ReturnType<typeof vi.fn>;
|
|
8
9
|
key: ReturnType<typeof vi.fn>;
|
|
9
10
|
reencrypt: ReturnType<typeof vi.fn>;
|
|
10
11
|
}
|