@inco/js 0.9.0-devnet-test-10 → 0.10.0-devnet-2
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/README.md +503 -47
- package/dist/cjs/advancedacl/session-key.d.ts +5 -5
- package/dist/cjs/advancedacl/session-key.js +33 -9
- package/dist/cjs/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/cjs/attestedcompute/attested-compute.js +15 -7
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +33 -96
- package/dist/cjs/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/cjs/attestedreveal/attested-reveal.js +31 -0
- package/dist/cjs/attestedreveal/index.d.ts +2 -0
- package/dist/cjs/attestedreveal/index.js +21 -0
- package/dist/cjs/attestedreveal/types.d.ts +4 -0
- package/dist/cjs/attestedreveal/types.js +13 -0
- package/dist/cjs/binary.d.ts +82 -0
- package/dist/cjs/binary.js +87 -5
- package/dist/cjs/chain.d.ts +29 -4
- package/dist/cjs/chain.js +34 -6
- package/dist/cjs/eip712/eip712.d.ts +18 -0
- package/dist/cjs/eip712/eip712.js +51 -0
- package/dist/cjs/eip712/index.d.ts +1 -0
- package/dist/cjs/eip712/index.js +8 -0
- package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.js +94 -0
- package/dist/cjs/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/cjs/elistattesteddecrypt/index.js +22 -0
- package/dist/cjs/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/cjs/elistattesteddecrypt/types.js +16 -0
- package/dist/cjs/encryption/encryption.d.ts +115 -0
- package/dist/cjs/encryption/encryption.js +98 -7
- package/dist/cjs/encryption/index.d.ts +1 -1
- package/dist/cjs/encryption/index.js +17 -16
- package/dist/cjs/generated/abis/lightning.d.ts +1119 -107
- package/dist/cjs/generated/abis/lightning.js +762 -52
- package/dist/cjs/generated/abis/test-elist.d.ts +20 -2
- package/dist/cjs/generated/abis/test-elist.js +16 -3
- package/dist/cjs/generated/abis/verifier.d.ts +118 -15
- package/dist/cjs/generated/abis/verifier.js +71 -19
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +36 -41
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -3
- package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +1 -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 +3 -3
- package/dist/cjs/generated/lightning.d.ts +150 -0
- package/dist/cjs/generated/lightning.js +157 -1
- package/dist/cjs/generated/local-node.d.ts +9 -9
- package/dist/cjs/generated/local-node.js +37 -10
- package/dist/cjs/handle.d.ts +72 -0
- package/dist/cjs/handle.js +113 -9
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +11 -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 +18 -12
- package/dist/cjs/kms/quorumClient.js +212 -231
- package/dist/cjs/kms/quorumConsistency.d.ts +82 -0
- package/dist/cjs/kms/quorumConsistency.js +269 -0
- package/dist/cjs/kms/signatureVerification.d.ts +35 -0
- package/dist/cjs/kms/signatureVerification.js +88 -0
- package/dist/cjs/kms/thresholdPromises.d.ts +4 -3
- package/dist/cjs/kms/thresholdPromises.js +25 -15
- package/dist/cjs/lite/attested-compute.d.ts +2 -2
- package/dist/cjs/lite/attested-compute.js +2 -3
- package/dist/cjs/lite/attested-decrypt.d.ts +2 -2
- package/dist/cjs/lite/attested-decrypt.js +2 -3
- package/dist/cjs/lite/hadu.d.ts +1 -1
- package/dist/cjs/lite/hadu.js +3 -3
- package/dist/cjs/lite/index.d.ts +6 -2
- package/dist/cjs/lite/index.js +8 -14
- package/dist/cjs/lite/lightning.d.ts +96 -47
- package/dist/cjs/lite/lightning.js +221 -267
- package/dist/cjs/lite/types.d.ts +47 -0
- package/dist/cjs/lite/types.js +3 -0
- package/dist/cjs/lite/xwing.d.ts +33 -2
- package/dist/cjs/lite/xwing.js +62 -7
- package/dist/cjs/local/local-node.d.ts +18 -0
- package/dist/cjs/local/local-node.js +18 -3
- package/dist/cjs/reencryption/eip712.d.ts +27 -0
- package/dist/cjs/reencryption/eip712.js +20 -7
- package/dist/cjs/reencryption/types.d.ts +24 -0
- package/dist/cjs/retry.d.ts +14 -0
- package/dist/cjs/retry.js +58 -2
- package/dist/cjs/test/mocks.d.ts +6 -1
- package/dist/cjs/test/mocks.js +31 -6
- package/dist/cjs/viem.d.ts +361 -1
- package/dist/cjs/viem.js +14 -1
- package/dist/esm/advancedacl/session-key.d.ts +5 -5
- package/dist/esm/advancedacl/session-key.js +33 -9
- package/dist/esm/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/esm/attestedcompute/attested-compute.js +13 -5
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/esm/attesteddecrypt/attested-decrypt.js +34 -96
- package/dist/esm/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/esm/attestedreveal/attested-reveal.js +28 -0
- package/dist/esm/attestedreveal/index.d.ts +2 -0
- package/dist/esm/attestedreveal/index.js +3 -0
- package/dist/esm/attestedreveal/types.d.ts +4 -0
- package/dist/esm/attestedreveal/types.js +9 -0
- package/dist/esm/binary.d.ts +82 -0
- package/dist/esm/binary.js +87 -5
- package/dist/esm/chain.d.ts +29 -4
- package/dist/esm/chain.js +33 -5
- package/dist/esm/eip712/eip712.d.ts +18 -0
- package/dist/esm/eip712/eip712.js +46 -0
- package/dist/esm/eip712/index.d.ts +1 -0
- package/dist/esm/eip712/index.js +2 -0
- package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.js +89 -0
- package/dist/esm/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/esm/elistattesteddecrypt/index.js +3 -0
- package/dist/esm/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/esm/elistattesteddecrypt/types.js +12 -0
- package/dist/esm/encryption/encryption.d.ts +115 -0
- package/dist/esm/encryption/encryption.js +98 -7
- package/dist/esm/encryption/index.d.ts +1 -1
- package/dist/esm/encryption/index.js +2 -2
- package/dist/esm/generated/abis/lightning.d.ts +1119 -107
- package/dist/esm/generated/abis/lightning.js +761 -51
- package/dist/esm/generated/abis/test-elist.d.ts +20 -2
- package/dist/esm/generated/abis/test-elist.js +16 -3
- package/dist/esm/generated/abis/verifier.d.ts +118 -15
- package/dist/esm/generated/abis/verifier.js +71 -19
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +35 -40
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -3
- package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +1 -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 +3 -3
- package/dist/esm/generated/lightning.d.ts +150 -0
- package/dist/esm/generated/lightning.js +157 -1
- package/dist/esm/generated/local-node.d.ts +9 -9
- package/dist/esm/generated/local-node.js +37 -10
- package/dist/esm/handle.d.ts +72 -0
- package/dist/esm/handle.js +110 -8
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/kms/client.d.ts +1 -1
- package/dist/esm/kms/client.js +3 -2
- package/dist/esm/kms/quorumClient.d.ts +18 -12
- package/dist/esm/kms/quorumClient.js +213 -232
- package/dist/esm/kms/quorumConsistency.d.ts +82 -0
- package/dist/esm/kms/quorumConsistency.js +260 -0
- package/dist/esm/kms/signatureVerification.d.ts +35 -0
- package/dist/esm/kms/signatureVerification.js +84 -0
- package/dist/esm/kms/thresholdPromises.d.ts +4 -3
- package/dist/esm/kms/thresholdPromises.js +25 -15
- package/dist/esm/lite/attested-compute.d.ts +2 -2
- package/dist/esm/lite/attested-compute.js +3 -3
- package/dist/esm/lite/attested-decrypt.d.ts +2 -2
- package/dist/esm/lite/attested-decrypt.js +3 -3
- package/dist/esm/lite/hadu.d.ts +1 -1
- package/dist/esm/lite/hadu.js +2 -2
- package/dist/esm/lite/index.d.ts +6 -2
- package/dist/esm/lite/index.js +5 -3
- package/dist/esm/lite/lightning.d.ts +96 -47
- package/dist/esm/lite/lightning.js +217 -263
- package/dist/esm/lite/types.d.ts +47 -0
- package/dist/esm/lite/types.js +2 -0
- package/dist/esm/lite/xwing.d.ts +33 -2
- package/dist/esm/lite/xwing.js +59 -7
- package/dist/esm/local/local-node.d.ts +18 -0
- package/dist/esm/local/local-node.js +18 -3
- package/dist/esm/reencryption/eip712.d.ts +27 -0
- package/dist/esm/reencryption/eip712.js +20 -7
- package/dist/esm/reencryption/types.d.ts +24 -0
- package/dist/esm/retry.d.ts +14 -0
- package/dist/esm/retry.js +56 -2
- package/dist/esm/test/mocks.d.ts +6 -1
- package/dist/esm/test/mocks.js +31 -8
- package/dist/esm/viem.d.ts +361 -1
- package/dist/esm/viem.js +15 -2
- package/dist/types/advancedacl/session-key.d.ts +5 -5
- package/dist/types/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/types/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/types/attestedreveal/index.d.ts +2 -0
- package/dist/types/attestedreveal/types.d.ts +4 -0
- package/dist/types/binary.d.ts +82 -0
- package/dist/types/chain.d.ts +29 -4
- package/dist/types/eip712/eip712.d.ts +18 -0
- package/dist/types/eip712/index.d.ts +1 -0
- package/dist/types/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/types/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/types/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/types/encryption/encryption.d.ts +115 -0
- package/dist/types/encryption/index.d.ts +1 -1
- package/dist/types/generated/abis/lightning.d.ts +1119 -107
- package/dist/types/generated/abis/test-elist.d.ts +20 -2
- package/dist/types/generated/abis/verifier.d.ts +118 -15
- package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/types/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/types/generated/lightning.d.ts +150 -0
- package/dist/types/generated/local-node.d.ts +9 -9
- package/dist/types/handle.d.ts +72 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/kms/client.d.ts +1 -1
- package/dist/types/kms/quorumClient.d.ts +18 -12
- package/dist/types/kms/quorumConsistency.d.ts +82 -0
- package/dist/types/kms/signatureVerification.d.ts +35 -0
- package/dist/types/kms/thresholdPromises.d.ts +4 -3
- package/dist/types/lite/attested-compute.d.ts +2 -2
- package/dist/types/lite/attested-decrypt.d.ts +2 -2
- package/dist/types/lite/hadu.d.ts +1 -1
- package/dist/types/lite/index.d.ts +6 -2
- package/dist/types/lite/lightning.d.ts +96 -47
- package/dist/types/lite/types.d.ts +47 -0
- package/dist/types/lite/xwing.d.ts +33 -2
- package/dist/types/local/local-node.d.ts +18 -0
- package/dist/types/reencryption/eip712.d.ts +27 -0
- package/dist/types/reencryption/types.d.ts +24 -0
- package/dist/types/retry.d.ts +14 -0
- package/dist/types/test/mocks.d.ts +6 -1
- package/dist/types/viem.d.ts +361 -1
- package/package.json +19 -21
- package/dist/cjs/generated/abis/lightning-preview.d.ts +0 -1385
- package/dist/cjs/generated/abis/lightning-preview.js +0 -857
- package/dist/esm/generated/abis/lightning-preview.d.ts +0 -1385
- package/dist/esm/generated/abis/lightning-preview.js +0 -854
- package/dist/types/generated/abis/lightning-preview.d.ts +0 -1385
package/dist/esm/lite/index.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
export { AttestedComputeError } from '../attestedcompute/types.js';
|
|
2
|
+
export { AttestedDecryptError } from '../attesteddecrypt/types.js';
|
|
3
|
+
export { AttestedRevealError } from '../attestedreveal/types.js';
|
|
1
4
|
export * from '../generated/abis/lightning.js';
|
|
2
5
|
export type { AttestedComputeRequest, AttestedDecryptRequest, KmsService, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
|
|
3
6
|
export type { HandleWithProof } from '../generated/es/inco/kms/lite/v1/types_pb.js';
|
|
4
7
|
export * from './attested-compute.js';
|
|
5
8
|
export * from './attested-decrypt.js';
|
|
6
9
|
export * from './deployments.js';
|
|
7
|
-
export * from './hadu.js';
|
|
8
10
|
export * from './lightning.js';
|
|
9
|
-
export {
|
|
11
|
+
export type { AttestedOpts, AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral, } from './types.js';
|
|
12
|
+
export { generateXwingKeypair } from './xwing.js';
|
|
13
|
+
export type { XwingKeypair } from './xwing.js';
|
package/dist/esm/lite/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export { AttestedComputeError } from '../attestedcompute/types.js';
|
|
2
|
+
export { AttestedDecryptError } from '../attesteddecrypt/types.js';
|
|
3
|
+
export { AttestedRevealError } from '../attestedreveal/types.js';
|
|
1
4
|
export * from '../generated/abis/lightning.js';
|
|
2
5
|
export * from './attested-compute.js';
|
|
3
6
|
export * from './attested-decrypt.js';
|
|
4
7
|
export * from './deployments.js';
|
|
5
|
-
export * from './hadu.js';
|
|
6
8
|
export * from './lightning.js';
|
|
7
|
-
export {
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
export { generateXwingKeypair } from './xwing.js';
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGl0ZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNqRSxjQUFjLGdDQUFnQyxDQUFDO0FBTy9DLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLGNBQWMsZ0JBQWdCLENBQUM7QUFZL0IsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sWUFBWSxDQUFDIn0=
|
|
@@ -4,14 +4,14 @@ import { AllowanceVoucherWithSig } from '../advancedacl/types.js';
|
|
|
4
4
|
import { AttestedComputeOP } from '../attestedcompute/types.js';
|
|
5
5
|
import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js';
|
|
6
6
|
import { Address, HexString } from '../binary.js';
|
|
7
|
-
import {
|
|
7
|
+
import { EListDecryptionAttestation, EncryptedEListDecryptionAttestation } from '../elistattesteddecrypt/index.js';
|
|
8
|
+
import { EncryptionScheme, SupportedFheType } from '../encryption/encryption.js';
|
|
8
9
|
import { incoVerifierAbi } from '../generated/abis/verifier.js';
|
|
9
10
|
import { lightningDeployments } from '../generated/lightning.js';
|
|
10
11
|
import { localNodeLightningConfig } from '../generated/local-node.js';
|
|
11
12
|
import { FheType } from '../handle.js';
|
|
12
13
|
import { LocalNodeEnv } from '../local/index.js';
|
|
13
|
-
import {
|
|
14
|
-
import { XwingKeypair } from './xwing.js';
|
|
14
|
+
import type { AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral } from './types.js';
|
|
15
15
|
type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never;
|
|
16
16
|
type Deployment = TupleToUnion<typeof lightningDeployments>;
|
|
17
17
|
type DistributedPick<T, K> = T extends any ? Pick<T, Extract<keyof T, K>> : never;
|
|
@@ -36,7 +36,7 @@ export type CustomConfig = {
|
|
|
36
36
|
chainId: number;
|
|
37
37
|
covalidatorUrls: string[];
|
|
38
38
|
signers?: Address[];
|
|
39
|
-
|
|
39
|
+
hostChainRpcUrls?: readonly string[] | string[];
|
|
40
40
|
senderPrivateKey?: HexString;
|
|
41
41
|
};
|
|
42
42
|
export type CustomDeployment = DeploymentSlice & CustomConfig;
|
|
@@ -58,6 +58,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
58
58
|
private readonly signers;
|
|
59
59
|
private readonly threshold;
|
|
60
60
|
private readonly networkPubkey;
|
|
61
|
+
private readonly publicClient;
|
|
61
62
|
readonly executorAddress: Address;
|
|
62
63
|
readonly chainId: bigint;
|
|
63
64
|
private readonly kmsQuorumClient;
|
|
@@ -67,14 +68,19 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
67
68
|
private getEncryptor;
|
|
68
69
|
/**
|
|
69
70
|
* Get the encryption scheme version used by this Lightning instance.
|
|
70
|
-
* Returns
|
|
71
|
+
* Returns the X-Wing encryption scheme identifier.
|
|
71
72
|
* This is a convenience method to get the encryption scheme used by this Lightning instance.
|
|
72
73
|
*/
|
|
73
74
|
getEncryptionScheme(): Promise<EncryptionScheme>;
|
|
74
75
|
/**
|
|
75
76
|
* Get a Lightning instance bound to the latest Lightning deployment for the Base Sepolia testnet.
|
|
77
|
+
*
|
|
78
|
+
* @param options.hostChainRpcUrls optional list of RPC URLs for the host chain. When multiple URLs are
|
|
79
|
+
* provided, viem's fallback transport is used and providers are tried in order on failure.
|
|
76
80
|
*/
|
|
77
|
-
static baseSepoliaTestnet(
|
|
81
|
+
static baseSepoliaTestnet(options?: {
|
|
82
|
+
hostChainRpcUrls?: readonly string[];
|
|
83
|
+
}): Promise<Lightning<Deployment>>;
|
|
78
84
|
/**
|
|
79
85
|
* Get a Lightning instance bound to our canonical Anvil-based test node and test Covalidator node
|
|
80
86
|
*
|
|
@@ -101,8 +107,12 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
101
107
|
* Get a Lightning deployment by name or executor address on a particular chain.
|
|
102
108
|
*
|
|
103
109
|
* @param id this is an object containing either the pair of name and chainId or the executorAddress and chainId
|
|
110
|
+
* @param options.hostChainRpcUrls optional list of RPC URLs for the host chain. When multiple URLs are
|
|
111
|
+
* provided, viem's fallback transport is used and providers are tried in order on failure.
|
|
104
112
|
*/
|
|
105
|
-
static at(id: DeploymentId
|
|
113
|
+
static at(id: DeploymentId, options?: {
|
|
114
|
+
hostChainRpcUrls?: readonly string[];
|
|
115
|
+
}): Promise<Lightning<Deployment>>;
|
|
106
116
|
/**
|
|
107
117
|
* Get a Lightning deployment for a local or custom node
|
|
108
118
|
*
|
|
@@ -124,12 +134,17 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
124
134
|
* will not be compatible with the new version.
|
|
125
135
|
*
|
|
126
136
|
* @param pepper the pepper to use to filter the deployments
|
|
127
|
-
* @param
|
|
137
|
+
* @param chainId the chainId to use to filter the deployments
|
|
138
|
+
* @param options.hostChainRpcUrls optional list of RPC URLs for the host chain. When multiple URLs are
|
|
139
|
+
* provided, viem's fallback transport is used and providers are tried in order on failure.
|
|
128
140
|
*/
|
|
129
|
-
static latest<P extends Pepper>(pepper: P, chainId: ChainId
|
|
141
|
+
static latest<P extends Pepper>(pepper: P, chainId: ChainId, options?: {
|
|
142
|
+
hostChainRpcUrls?: readonly string[];
|
|
143
|
+
}): Promise<Lightning<Deployment>>;
|
|
144
|
+
/** Returns a shallow copy of the deployment configuration this Lightning instance is bound to. */
|
|
130
145
|
get deployment(): T;
|
|
131
146
|
/**
|
|
132
|
-
* Encrypt a value using the network's public key (
|
|
147
|
+
* Encrypt a value using the network's public key (X-Wing).
|
|
133
148
|
* The encryption scheme is automatically detected based on the public key length.
|
|
134
149
|
*
|
|
135
150
|
* @param value a boolean or numeric value to encrypt
|
|
@@ -218,39 +233,37 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
218
233
|
*
|
|
219
234
|
* @example Reencrypt for a delegate
|
|
220
235
|
* ```ts
|
|
221
|
-
* const encrypted = await lightning.attestedDecrypt(walletClient, [handle],
|
|
236
|
+
* const encrypted = await lightning.attestedDecrypt(walletClient, [handle], {
|
|
237
|
+
* reencryptPubKey: delegatePubKey,
|
|
238
|
+
* });
|
|
222
239
|
* console.log(encrypted[0].encryptedPlaintext.ciphertext.value);
|
|
223
240
|
* ```
|
|
224
241
|
*
|
|
225
242
|
* @example Reencrypt and decrypt locally
|
|
226
243
|
* ```ts
|
|
227
|
-
* const decrypted = await lightning.attestedDecrypt(
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
* keypair,
|
|
232
|
-
* );
|
|
244
|
+
* const decrypted = await lightning.attestedDecrypt(walletClient, [handle], {
|
|
245
|
+
* reencryptPubKey: keypair.encodePublicKey(),
|
|
246
|
+
* reencryptKeypair: keypair,
|
|
247
|
+
* });
|
|
233
248
|
* console.log(decrypted[0].plaintext.value);
|
|
234
249
|
* ```
|
|
235
250
|
*/
|
|
236
|
-
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[],
|
|
237
|
-
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[],
|
|
238
|
-
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[],
|
|
251
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], opts?: AttestedOptsEphemeral): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
252
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], opts: AttestedOptsEncrypted): Promise<Array<EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
253
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], opts: AttestedOptsDecrypted): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
239
254
|
/**
|
|
240
255
|
* Requests attested decrypts using a voucher-backed session key.
|
|
241
256
|
*
|
|
242
257
|
* @param ephemeralAccount Session Account matching the voucher grantee.
|
|
243
258
|
* @param allowanceVoucherWithSig Signed allowance voucher.
|
|
244
|
-
* @param ethClient - A public eth client or eth wallet client used for signing the attested decrypt request
|
|
245
259
|
* @param handles Handles to decrypt.
|
|
246
|
-
* @param
|
|
260
|
+
* @param opts Optional reencryption/backoff configuration.
|
|
247
261
|
*
|
|
248
262
|
* @example Plaintext results
|
|
249
263
|
* ```ts
|
|
250
264
|
* const attestations = await lightning.attestedDecryptWithVoucher(
|
|
251
265
|
* ephemeralAccount,
|
|
252
266
|
* voucher,
|
|
253
|
-
* ethClient,
|
|
254
267
|
* [handle],
|
|
255
268
|
* );
|
|
256
269
|
* ```
|
|
@@ -260,15 +273,36 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
260
273
|
* const encrypted = await lightning.attestedDecryptWithVoucher(
|
|
261
274
|
* ephemeralAccount,
|
|
262
275
|
* voucher,
|
|
263
|
-
* ethClient,
|
|
264
276
|
* [handle],
|
|
265
277
|
* { reencryptPubKey: delegateKeypair.encodePublicKey() },
|
|
266
278
|
* );
|
|
267
279
|
* ```
|
|
280
|
+
*
|
|
281
|
+
* @example Reencrypt and decrypt locally
|
|
282
|
+
* ```ts
|
|
283
|
+
* const decrypted = await lightning.attestedDecryptWithVoucher(
|
|
284
|
+
* ephemeralAccount,
|
|
285
|
+
* voucher,
|
|
286
|
+
* [handle],
|
|
287
|
+
* { reencryptPubKey: keypair.encodePublicKey(), reencryptKeypair: keypair },
|
|
288
|
+
* );
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
291
|
+
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], opts?: AttestedWithVoucherOptsEphemeral): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
292
|
+
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], opts: AttestedWithVoucherOptsEncrypted): Promise<Array<EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
293
|
+
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], opts: AttestedWithVoucherOptsDecrypted): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
294
|
+
eListAttestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handle: HexString, opts?: AttestedOptsEphemeral): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
295
|
+
eListAttestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handle: HexString, opts: AttestedOptsEncrypted): Promise<EncryptedEListDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
296
|
+
eListAttestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handle: HexString, opts: AttestedOptsDecrypted): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
297
|
+
/**
|
|
298
|
+
* Reveal a single elist handle without wallet authentication.
|
|
299
|
+
* Returns plaintext values along with an attestation of the checksum.
|
|
300
|
+
*
|
|
301
|
+
* @param handle - The elist handle to reveal
|
|
302
|
+
* @param opts - Optional backoff configuration
|
|
303
|
+
* @returns The elist decryption attestation with plaintext values
|
|
268
304
|
*/
|
|
269
|
-
|
|
270
|
-
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, ethClient: PublicClient<Transport, Chain> | WalletClient<Transport, Chain, Account>, handles: HexString[], reencryptPubKey: Uint8Array, requesterArgData?: HexString, backoffConfig?: Partial<BackoffConfig>): Promise<Array<EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
271
|
-
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, ethClient: PublicClient<Transport, Chain> | WalletClient<Transport, Chain, Account>, handles: HexString[], reencryptPubKey: Uint8Array, reencryptKeypair: XwingKeypair, requesterArgData?: HexString, backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
305
|
+
eListAttestedReveal(handle: HexString, opts?: AttestedRevealOpts): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
272
306
|
/**
|
|
273
307
|
* Get an attested compute for the given wallet client.
|
|
274
308
|
*
|
|
@@ -276,7 +310,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
276
310
|
* @param lhsHandle - The handle to compute
|
|
277
311
|
* @param op - The operation to perform
|
|
278
312
|
* @param rhsPlaintext - The plaintext to compute with
|
|
279
|
-
* @param
|
|
313
|
+
* @param opts - Optional configuration (reencryption keys and/or backoff config)
|
|
280
314
|
* @returns The decryption attestation
|
|
281
315
|
*
|
|
282
316
|
* @example Plaintext result
|
|
@@ -296,7 +330,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
296
330
|
* lhsHandle,
|
|
297
331
|
* op,
|
|
298
332
|
* rhsPlaintext,
|
|
299
|
-
* delegatePubKey,
|
|
333
|
+
* { reencryptPubKey: delegatePubKey },
|
|
300
334
|
* );
|
|
301
335
|
* console.log(encrypted.encryptedPlaintext.ciphertext.value);
|
|
302
336
|
* ```
|
|
@@ -308,15 +342,14 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
308
342
|
* lhsHandle,
|
|
309
343
|
* op,
|
|
310
344
|
* rhsPlaintext,
|
|
311
|
-
* keypair.encodePublicKey(),
|
|
312
|
-
* keypair,
|
|
345
|
+
* { reencryptPubKey: keypair.encodePublicKey(), reencryptKeypair: keypair },
|
|
313
346
|
* );
|
|
314
347
|
* console.log(decrypted.plaintext.value);
|
|
315
348
|
* ```
|
|
316
349
|
*/
|
|
317
|
-
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean,
|
|
318
|
-
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean,
|
|
319
|
-
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean,
|
|
350
|
+
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts?: AttestedOptsEphemeral): Promise<DecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
351
|
+
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedOptsEncrypted): Promise<EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
352
|
+
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedOptsDecrypted): Promise<DecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
320
353
|
/**
|
|
321
354
|
* Performs attested compute via a voucher-backed session key.
|
|
322
355
|
*
|
|
@@ -325,7 +358,6 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
325
358
|
* const attestation = await lightning.attestedComputeWithVoucher(
|
|
326
359
|
* ephemeralAccount,
|
|
327
360
|
* voucher,
|
|
328
|
-
* ethClient,
|
|
329
361
|
* lhsHandle,
|
|
330
362
|
* AttestedComputeSupportedOps.Eq,
|
|
331
363
|
* true,
|
|
@@ -340,7 +372,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
340
372
|
* lhsHandle,
|
|
341
373
|
* AttestedComputeSupportedOps.Eq,
|
|
342
374
|
* true,
|
|
343
|
-
* delegatePubKey,
|
|
375
|
+
* { reencryptPubKey: delegatePubKey },
|
|
344
376
|
* );
|
|
345
377
|
* console.log(encrypted.encryptedPlaintext.ciphertext.value);
|
|
346
378
|
* ```
|
|
@@ -353,15 +385,14 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
353
385
|
* lhsHandle,
|
|
354
386
|
* AttestedComputeSupportedOps.Eq,
|
|
355
387
|
* true,
|
|
356
|
-
* keypair.encodePublicKey(),
|
|
357
|
-
* keypair,
|
|
388
|
+
* { reencryptPubKey: keypair.encodePublicKey(), reencryptKeypair: keypair },
|
|
358
389
|
* );
|
|
359
390
|
* console.log(decrypted.plaintext.value);
|
|
360
391
|
* ```
|
|
361
392
|
*/
|
|
362
|
-
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig,
|
|
363
|
-
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig,
|
|
364
|
-
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig,
|
|
393
|
+
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts?: AttestedWithVoucherOptsEphemeral): Promise<DecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
394
|
+
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedWithVoucherOptsEncrypted): Promise<EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
395
|
+
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedWithVoucherOptsDecrypted): Promise<DecryptionAttestation<EncryptionScheme, SupportedFheType>>;
|
|
365
396
|
/**
|
|
366
397
|
* Get an decryption of publicly revealed handles.
|
|
367
398
|
*
|
|
@@ -371,31 +402,49 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
|
371
402
|
*
|
|
372
403
|
* @example
|
|
373
404
|
* ```typescript
|
|
374
|
-
* const response = await lightning.attestedReveal([handle1, handle2]
|
|
405
|
+
* const response = await lightning.attestedReveal([handle1, handle2]);
|
|
375
406
|
* const { plaintext, covalidatorSignature } = response[0];
|
|
376
407
|
* ```
|
|
377
408
|
*/
|
|
378
|
-
attestedReveal(handles: HexString[],
|
|
409
|
+
attestedReveal(handles: HexString[], opts?: AttestedRevealOpts): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
379
410
|
/**
|
|
380
411
|
* Get the GRPC endpoint for the covalidator that services this deployment.
|
|
381
412
|
*/
|
|
382
413
|
static getCovalidatorUrls(deployment: DeploymentSlice & {
|
|
383
414
|
pepper: string;
|
|
384
|
-
|
|
415
|
+
majorVersion: number;
|
|
416
|
+
}, signers: Address[]): string[];
|
|
385
417
|
private static isIdByName;
|
|
386
418
|
private static plaintextFromValue;
|
|
419
|
+
/**
|
|
420
|
+
* Reads the network public key from the on-chain Inco Verifier contract.
|
|
421
|
+
*
|
|
422
|
+
* Falls back to the legacy `eciesPubkey()` getter for older contract versions.
|
|
423
|
+
*
|
|
424
|
+
* @param client - A viem public client connected to the host chain.
|
|
425
|
+
* @param executorAddress - The address of the Inco Lightning executor contract.
|
|
426
|
+
* @returns The network public key as a hex string.
|
|
427
|
+
*/
|
|
387
428
|
static getNetworkPubkey(client: PublicClient, executorAddress: Address): Promise<HexString>;
|
|
429
|
+
/**
|
|
430
|
+
* Resolves the Inco Verifier contract instance associated with a Lightning executor.
|
|
431
|
+
*
|
|
432
|
+
* Reads the `incoVerifier` address from the executor contract and returns a typed contract handle.
|
|
433
|
+
*
|
|
434
|
+
* @param client - A viem public client connected to the host chain.
|
|
435
|
+
* @param executorAddress - The address of the Inco Lightning executor contract.
|
|
436
|
+
* @returns A viem contract instance bound to the Inco Verifier ABI.
|
|
437
|
+
*/
|
|
388
438
|
static getIncoVerifierContract(client: PublicClient, executorAddress: Address): Promise<GetContractReturnType<typeof incoVerifierAbi, PublicClient, Address>>;
|
|
389
439
|
/**
|
|
390
|
-
* Retrieves the verifier contract details including threshold, signers, and
|
|
440
|
+
* Retrieves the verifier contract details including threshold, signers, and XWING public key from the Inco Verifier contract.
|
|
391
441
|
*
|
|
392
442
|
* @param executorAddress The address of the Inco Lightning executor contract.
|
|
393
443
|
* @param client The public client to interact with the blockchain.
|
|
394
|
-
* @returns An object containing the threshold, signers, and
|
|
444
|
+
* @returns An object containing the threshold, signers, and XWING public key.
|
|
395
445
|
*/
|
|
396
446
|
private static getVerifierContractDetails;
|
|
397
447
|
private static getChainConfig;
|
|
398
448
|
private static supportsThresholdRetrieval;
|
|
399
|
-
private static getDefaultThresholdAndSigners;
|
|
400
449
|
}
|
|
401
450
|
export {};
|