@inco/js 0.8.0-devnet-9 → 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 +997 -102
- package/dist/cjs/generated/abis/lightning.js +642 -3
- 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 +39 -0
- package/dist/cjs/generated/abis/verifier.js +22 -1
- package/dist/cjs/generated/lightning.d.ts +20 -0
- package/dist/cjs/generated/lightning.js +22 -1
- package/dist/cjs/generated/local-node.d.ts +4 -4
- package/dist/cjs/generated/local-node.js +22 -7
- 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 -2
- package/dist/cjs/lite/lightning.js +2 -2
- 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 +997 -102
- package/dist/esm/generated/abis/lightning.js +640 -1
- 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 +39 -0
- package/dist/esm/generated/abis/verifier.js +22 -1
- package/dist/esm/generated/lightning.d.ts +20 -0
- package/dist/esm/generated/lightning.js +22 -1
- package/dist/esm/generated/local-node.d.ts +4 -4
- package/dist/esm/generated/local-node.js +22 -7
- 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 -2
- package/dist/esm/lite/lightning.js +2 -2
- 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 +997 -102
- package/dist/types/generated/abis/test-elist.d.ts +1 -1
- package/dist/types/generated/abis/verifier.d.ts +39 -0
- package/dist/types/generated/lightning.d.ts +20 -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 -2
- 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 -1445
- package/dist/cjs/generated/abis/lightning-preview.js +0 -908
- package/dist/esm/generated/abis/lightning-preview.d.ts +0 -1445
- package/dist/esm/generated/abis/lightning-preview.js +0 -905
- package/dist/types/generated/abis/lightning-preview.d.ts +0 -1445
|
@@ -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 [{
|
|
@@ -1,4 +1,24 @@
|
|
|
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
|
+
}, {
|
|
2
22
|
readonly name: "incoLightningPreview_5_0_0__203964628";
|
|
3
23
|
readonly majorVersion: 5;
|
|
4
24
|
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,11 +387,11 @@ 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;
|
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
|
}
|