@inco/js 0.8.0-devnet-20 → 0.8.0-devnet-23
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/attestedcompute/attested-compute.js +5 -2
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +5 -1
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +14 -4
- package/dist/cjs/generated/abis/verifier.d.ts +70 -0
- package/dist/cjs/generated/abis/verifier.js +46 -1
- package/dist/cjs/kms/quorumClient.d.ts +4 -3
- package/dist/cjs/kms/quorumClient.js +57 -26
- package/dist/cjs/kms/signatureVerification.d.ts +35 -0
- package/dist/cjs/kms/signatureVerification.js +88 -0
- package/dist/cjs/lite/lightning.js +5 -1
- package/dist/esm/attestedcompute/attested-compute.js +6 -3
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +5 -1
- package/dist/esm/attesteddecrypt/attested-decrypt.js +15 -5
- package/dist/esm/generated/abis/verifier.d.ts +70 -0
- package/dist/esm/generated/abis/verifier.js +46 -1
- package/dist/esm/kms/quorumClient.d.ts +4 -3
- package/dist/esm/kms/quorumClient.js +57 -26
- package/dist/esm/kms/signatureVerification.d.ts +35 -0
- package/dist/esm/kms/signatureVerification.js +84 -0
- package/dist/esm/lite/lightning.js +5 -1
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +5 -1
- package/dist/types/generated/abis/verifier.d.ts +70 -0
- package/dist/types/kms/quorumClient.d.ts +4 -3
- package/dist/types/kms/signatureVerification.d.ts +35 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import type { AttestedComputeRequest, AttestedDecryptRequest, AttestedRevealRequ
|
|
|
5
5
|
import type { XwingKeypair } from '../lite/xwing.js';
|
|
6
6
|
import type { BackoffConfig } from '../retry.js';
|
|
7
7
|
import { type KmsClient } from './client.js';
|
|
8
|
+
import type { ViemClient } from './signatureVerification.js';
|
|
8
9
|
export declare class KmsQuorumClient {
|
|
9
10
|
private readonly kmss;
|
|
10
11
|
private readonly threshold;
|
|
@@ -29,9 +30,9 @@ export declare class KmsQuorumClient {
|
|
|
29
30
|
* @throws {Error} If KMS clients array is empty or threshold is invalid
|
|
30
31
|
*/
|
|
31
32
|
static fromKmsClients(kmsClients: KmsClient[], threshold: number): KmsQuorumClient;
|
|
32
|
-
attestedDecrypt(request: AttestedDecryptRequest, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair): Promise<(DecryptionAttestation<EncryptionScheme, SupportedFheType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>)[]>;
|
|
33
|
-
attestedCompute(request: AttestedComputeRequest, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair): Promise<DecryptionAttestation<EncryptionScheme, SupportedFheType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
34
|
-
attestedReveal(request: AttestedRevealRequest, backoffConfig?: Partial<BackoffConfig
|
|
33
|
+
attestedDecrypt(request: AttestedDecryptRequest, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair, executorAddress?: Address, client?: ViemClient): Promise<(DecryptionAttestation<EncryptionScheme, SupportedFheType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>)[]>;
|
|
34
|
+
attestedCompute(request: AttestedComputeRequest, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair, executorAddress?: Address, client?: ViemClient): Promise<DecryptionAttestation<EncryptionScheme, SupportedFheType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
35
|
+
attestedReveal(request: AttestedRevealRequest, backoffConfig?: Partial<BackoffConfig>, executorAddress?: Address, client?: ViemClient): Promise<(DecryptionAttestation<EncryptionScheme, SupportedFheType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>)[]>;
|
|
35
36
|
/**
|
|
36
37
|
* Generic method to execute a KMS operation across all clients with retry and threshold logic.
|
|
37
38
|
* Returns results with both the response and signer address.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Account, Address, Chain, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
|
+
export type ViemClient = WalletClient<Transport, Chain, Account> | PublicClient<Transport, Chain>;
|
|
3
|
+
/**
|
|
4
|
+
* Verifies covalidator signatures for a plaintext DecryptionAttestation
|
|
5
|
+
* by calling `isValidDecryptionAttestation` on the IncoVerifier contract.
|
|
6
|
+
*
|
|
7
|
+
* This delegates all verification logic (EIP-712 digest computation,
|
|
8
|
+
* ECDSA recovery, signer authorization, threshold check) to the contract,
|
|
9
|
+
* ensuring exact parity with on-chain verification.
|
|
10
|
+
*
|
|
11
|
+
* @param handle - The handle hex string (bytes32)
|
|
12
|
+
* @param rawValueBytes - The raw plaintext value bytes (will be left-padded to 32 bytes)
|
|
13
|
+
* @param signatures - The covalidator ECDSA signatures to verify
|
|
14
|
+
* @param executorAddress - The Lightning contract address (executor)
|
|
15
|
+
* @param client - A viem client capable of reading contract state
|
|
16
|
+
* @throws If the contract returns false (insufficient valid signatures)
|
|
17
|
+
*/
|
|
18
|
+
export declare function verifyPlaintextAttestationSignatures(handle: string, rawValueBytes: Uint8Array, signatures: Uint8Array[], executorAddress: Address, client: ViemClient): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Verifies covalidator envelope signatures for reencryption attestations
|
|
21
|
+
* by calling `isValidReencryptionAttestation` on the IncoVerifier contract.
|
|
22
|
+
*
|
|
23
|
+
* Each covalidator signs over its own unique (userCiphertext, handle, encryptedSignature)
|
|
24
|
+
* tuple, so all three per-covalidator arrays must be aligned by index and sorted
|
|
25
|
+
* by signer address in ascending order.
|
|
26
|
+
*
|
|
27
|
+
* @param handle - The handle hex string (bytes32)
|
|
28
|
+
* @param userCiphertexts - Per-covalidator ciphertexts (sorted by signer address)
|
|
29
|
+
* @param encryptedSignatures - Per-covalidator encrypted inner signatures (sorted by signer address)
|
|
30
|
+
* @param envelopeSignatures - Per-covalidator envelope signatures (sorted by signer address)
|
|
31
|
+
* @param executorAddress - The Lightning contract address (executor)
|
|
32
|
+
* @param client - A viem client capable of reading contract state
|
|
33
|
+
* @throws If the contract returns false (insufficient valid signatures)
|
|
34
|
+
*/
|
|
35
|
+
export declare function verifyReencryptionAttestationSignatures(handle: string, userCiphertexts: Uint8Array[], encryptedSignatures: Uint8Array[], envelopeSignatures: Uint8Array[], executorAddress: Address, client: ViemClient): Promise<void>;
|