@inco/lightning-js 0.0.0-bootstrap.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/LICENSE +201 -0
- package/README.md +587 -0
- package/dist/cjs/advancedacl/index.d.ts +2 -0
- package/dist/cjs/advancedacl/index.js +19 -0
- package/dist/cjs/advancedacl/session-key.d.ts +95 -0
- package/dist/cjs/advancedacl/session-key.js +376 -0
- package/dist/cjs/advancedacl/types.d.ts +16 -0
- package/dist/cjs/advancedacl/types.js +3 -0
- package/dist/cjs/attestedcompute/attested-compute.d.ts +65 -0
- package/dist/cjs/attestedcompute/attested-compute.js +80 -0
- package/dist/cjs/attestedcompute/types.d.ts +35 -0
- package/dist/cjs/attestedcompute/types.js +46 -0
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +61 -0
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +118 -0
- package/dist/cjs/attesteddecrypt/index.d.ts +1 -0
- package/dist/cjs/attesteddecrypt/index.js +18 -0
- package/dist/cjs/attesteddecrypt/types.d.ts +27 -0
- package/dist/cjs/attesteddecrypt/types.js +16 -0
- 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 +104 -0
- package/dist/cjs/binary.js +171 -0
- package/dist/cjs/chain.d.ts +50 -0
- package/dist/cjs/chain.js +62 -0
- 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 +51 -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 +235 -0
- package/dist/cjs/encryption/encryption.js +226 -0
- package/dist/cjs/encryption/index.d.ts +1 -0
- package/dist/cjs/encryption/index.js +19 -0
- package/dist/cjs/generated/abis/add-two.d.ts +117 -0
- package/dist/cjs/generated/abis/add-two.js +80 -0
- package/dist/cjs/generated/abis/lightning.d.ts +3362 -0
- package/dist/cjs/generated/abis/lightning.js +2445 -0
- package/dist/cjs/generated/abis/test-elist.d.ts +276 -0
- package/dist/cjs/generated/abis/test-elist.js +168 -0
- package/dist/cjs/generated/abis/verifier.d.ts +1353 -0
- package/dist/cjs/generated/abis/verifier.js +954 -0
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +1494 -0
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +395 -0
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +247 -0
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +80 -0
- package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.d.ts +77 -0
- package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +28 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +685 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +100 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.d.ts +289 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +136 -0
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +371 -0
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +88 -0
- package/dist/cjs/generated/lightning.d.ts +830 -0
- package/dist/cjs/generated/lightning.js +872 -0
- package/dist/cjs/generated/local-node.d.ts +50 -0
- package/dist/cjs/generated/local-node.js +107 -0
- package/dist/cjs/handle.d.ts +123 -0
- package/dist/cjs/handle.js +221 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +31 -0
- package/dist/cjs/kms/client.d.ts +12 -0
- package/dist/cjs/kms/client.js +47 -0
- package/dist/cjs/kms/quorumClient.d.ts +65 -0
- package/dist/cjs/kms/quorumClient.js +463 -0
- 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 +8 -0
- package/dist/cjs/kms/thresholdPromises.js +62 -0
- package/dist/cjs/lite/attested-compute.d.ts +6 -0
- package/dist/cjs/lite/attested-compute.js +8 -0
- package/dist/cjs/lite/attested-decrypt.d.ts +4 -0
- package/dist/cjs/lite/attested-decrypt.js +6 -0
- package/dist/cjs/lite/deployments.d.ts +24 -0
- package/dist/cjs/lite/deployments.js +21 -0
- package/dist/cjs/lite/hadu.d.ts +4 -0
- package/dist/cjs/lite/hadu.js +28 -0
- package/dist/cjs/lite/index.d.ts +13 -0
- package/dist/cjs/lite/index.js +31 -0
- package/dist/cjs/lite/lightning.d.ts +459 -0
- package/dist/cjs/lite/lightning.js +696 -0
- package/dist/cjs/lite/types.d.ts +47 -0
- package/dist/cjs/lite/types.js +3 -0
- package/dist/cjs/lite/xwing.d.ts +154 -0
- package/dist/cjs/lite/xwing.js +326 -0
- package/dist/cjs/local/index.d.ts +1 -0
- package/dist/cjs/local/index.js +18 -0
- package/dist/cjs/local/local-node.d.ts +37 -0
- package/dist/cjs/local/local-node.js +80 -0
- package/dist/cjs/reencryption/eip712.d.ts +56 -0
- package/dist/cjs/reencryption/eip712.js +90 -0
- package/dist/cjs/reencryption/index.d.ts +2 -0
- package/dist/cjs/reencryption/index.js +19 -0
- package/dist/cjs/reencryption/types.d.ts +48 -0
- package/dist/cjs/reencryption/types.js +3 -0
- package/dist/cjs/retry.d.ts +30 -0
- package/dist/cjs/retry.js +87 -0
- package/dist/cjs/schema.d.ts +4 -0
- package/dist/cjs/schema.js +19 -0
- package/dist/cjs/test/mocks.d.ts +20 -0
- package/dist/cjs/test/mocks.js +72 -0
- package/dist/cjs/viem.d.ts +1141 -0
- package/dist/cjs/viem.js +36 -0
- package/dist/esm/advancedacl/index.d.ts +2 -0
- package/dist/esm/advancedacl/index.js +3 -0
- package/dist/esm/advancedacl/session-key.d.ts +95 -0
- package/dist/esm/advancedacl/session-key.js +367 -0
- package/dist/esm/advancedacl/types.d.ts +16 -0
- package/dist/esm/advancedacl/types.js +2 -0
- package/dist/esm/attestedcompute/attested-compute.d.ts +65 -0
- package/dist/esm/attestedcompute/attested-compute.js +76 -0
- package/dist/esm/attestedcompute/types.d.ts +35 -0
- package/dist/esm/attestedcompute/types.js +42 -0
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +61 -0
- package/dist/esm/attesteddecrypt/attested-decrypt.js +112 -0
- package/dist/esm/attesteddecrypt/index.d.ts +1 -0
- package/dist/esm/attesteddecrypt/index.js +2 -0
- package/dist/esm/attesteddecrypt/types.d.ts +27 -0
- package/dist/esm/attesteddecrypt/types.js +12 -0
- 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 +104 -0
- package/dist/esm/binary.js +155 -0
- package/dist/esm/chain.d.ts +50 -0
- package/dist/esm/chain.js +58 -0
- 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 +51 -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 +235 -0
- package/dist/esm/encryption/encryption.js +214 -0
- package/dist/esm/encryption/index.d.ts +1 -0
- package/dist/esm/encryption/index.js +2 -0
- package/dist/esm/generated/abis/add-two.d.ts +117 -0
- package/dist/esm/generated/abis/add-two.js +77 -0
- package/dist/esm/generated/abis/lightning.d.ts +3362 -0
- package/dist/esm/generated/abis/lightning.js +2442 -0
- package/dist/esm/generated/abis/test-elist.d.ts +276 -0
- package/dist/esm/generated/abis/test-elist.js +165 -0
- package/dist/esm/generated/abis/verifier.d.ts +1353 -0
- package/dist/esm/generated/abis/verifier.js +951 -0
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +1494 -0
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +392 -0
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +247 -0
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +77 -0
- package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.d.ts +77 -0
- package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +25 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +685 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +97 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.d.ts +289 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +133 -0
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +371 -0
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +85 -0
- package/dist/esm/generated/lightning.d.ts +830 -0
- package/dist/esm/generated/lightning.js +869 -0
- package/dist/esm/generated/local-node.d.ts +50 -0
- package/dist/esm/generated/local-node.js +104 -0
- package/dist/esm/handle.d.ts +123 -0
- package/dist/esm/handle.js +212 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/kms/client.d.ts +12 -0
- package/dist/esm/kms/client.js +40 -0
- package/dist/esm/kms/quorumClient.d.ts +65 -0
- package/dist/esm/kms/quorumClient.js +459 -0
- 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 +8 -0
- package/dist/esm/kms/thresholdPromises.js +59 -0
- package/dist/esm/lite/attested-compute.d.ts +6 -0
- package/dist/esm/lite/attested-compute.js +4 -0
- package/dist/esm/lite/attested-decrypt.d.ts +4 -0
- package/dist/esm/lite/attested-decrypt.js +3 -0
- package/dist/esm/lite/deployments.d.ts +24 -0
- package/dist/esm/lite/deployments.js +17 -0
- package/dist/esm/lite/hadu.d.ts +4 -0
- package/dist/esm/lite/hadu.js +24 -0
- package/dist/esm/lite/index.d.ts +13 -0
- package/dist/esm/lite/index.js +10 -0
- package/dist/esm/lite/lightning.d.ts +459 -0
- package/dist/esm/lite/lightning.js +692 -0
- package/dist/esm/lite/types.d.ts +47 -0
- package/dist/esm/lite/types.js +2 -0
- package/dist/esm/lite/xwing.d.ts +154 -0
- package/dist/esm/lite/xwing.js +311 -0
- package/dist/esm/local/index.d.ts +1 -0
- package/dist/esm/local/index.js +2 -0
- package/dist/esm/local/local-node.d.ts +37 -0
- package/dist/esm/local/local-node.js +76 -0
- package/dist/esm/reencryption/eip712.d.ts +56 -0
- package/dist/esm/reencryption/eip712.js +87 -0
- package/dist/esm/reencryption/index.d.ts +2 -0
- package/dist/esm/reencryption/index.js +3 -0
- package/dist/esm/reencryption/types.d.ts +48 -0
- package/dist/esm/reencryption/types.js +2 -0
- package/dist/esm/retry.d.ts +30 -0
- package/dist/esm/retry.js +82 -0
- package/dist/esm/schema.d.ts +4 -0
- package/dist/esm/schema.js +15 -0
- package/dist/esm/test/mocks.d.ts +20 -0
- package/dist/esm/test/mocks.js +64 -0
- package/dist/esm/viem.d.ts +1141 -0
- package/dist/esm/viem.js +32 -0
- package/dist/types/advancedacl/index.d.ts +2 -0
- package/dist/types/advancedacl/session-key.d.ts +95 -0
- package/dist/types/advancedacl/types.d.ts +16 -0
- package/dist/types/attestedcompute/attested-compute.d.ts +65 -0
- package/dist/types/attestedcompute/types.d.ts +35 -0
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +61 -0
- package/dist/types/attesteddecrypt/index.d.ts +1 -0
- package/dist/types/attesteddecrypt/types.d.ts +27 -0
- 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 +104 -0
- package/dist/types/chain.d.ts +50 -0
- 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 +51 -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 +235 -0
- package/dist/types/encryption/index.d.ts +1 -0
- package/dist/types/generated/abis/add-two.d.ts +117 -0
- package/dist/types/generated/abis/lightning.d.ts +3362 -0
- package/dist/types/generated/abis/test-elist.d.ts +276 -0
- package/dist/types/generated/abis/verifier.d.ts +1353 -0
- package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +1494 -0
- package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +247 -0
- package/dist/types/generated/es/inco/helioswrapper/v1/helioswrapper_pb.d.ts +77 -0
- package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +685 -0
- package/dist/types/generated/es/inco/kms/lite/v1/types_pb.d.ts +289 -0
- package/dist/types/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +371 -0
- package/dist/types/generated/lightning.d.ts +830 -0
- package/dist/types/generated/local-node.d.ts +50 -0
- package/dist/types/handle.d.ts +123 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/kms/client.d.ts +12 -0
- package/dist/types/kms/quorumClient.d.ts +65 -0
- 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 +8 -0
- package/dist/types/lite/attested-compute.d.ts +6 -0
- package/dist/types/lite/attested-decrypt.d.ts +4 -0
- package/dist/types/lite/deployments.d.ts +24 -0
- package/dist/types/lite/hadu.d.ts +4 -0
- package/dist/types/lite/index.d.ts +13 -0
- package/dist/types/lite/lightning.d.ts +459 -0
- package/dist/types/lite/types.d.ts +47 -0
- package/dist/types/lite/xwing.d.ts +154 -0
- package/dist/types/local/index.d.ts +1 -0
- package/dist/types/local/local-node.d.ts +37 -0
- package/dist/types/reencryption/eip712.d.ts +56 -0
- package/dist/types/reencryption/index.d.ts +2 -0
- package/dist/types/reencryption/types.d.ts +48 -0
- package/dist/types/retry.d.ts +30 -0
- package/dist/types/schema.d.ts +4 -0
- package/dist/types/test/mocks.d.ts +20 -0
- package/dist/types/viem.d.ts +1141 -0
- package/package.json +129 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { Account, Chain, GetContractReturnType, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
|
+
import type { PrivateKeyAccount } from 'viem/accounts';
|
|
3
|
+
import { AllowanceVoucherWithSig } from '../advancedacl/types.js';
|
|
4
|
+
import { AttestedComputeOP } from '../attestedcompute/types.js';
|
|
5
|
+
import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js';
|
|
6
|
+
import { Address, HexString } from '../binary.js';
|
|
7
|
+
import { EListDecryptionAttestation, EncryptedEListDecryptionAttestation } from '../elistattesteddecrypt/index.js';
|
|
8
|
+
import { EncryptionScheme, SupportedTeeType } from '../encryption/encryption.js';
|
|
9
|
+
import { incoVerifierAbi } from '../generated/abis/verifier.js';
|
|
10
|
+
import { lightningDeployments } from '../generated/lightning.js';
|
|
11
|
+
import { localNodeLightningConfig } from '../generated/local-node.js';
|
|
12
|
+
import { TeeType } from '../handle.js';
|
|
13
|
+
import { LocalNodeEnv } from '../local/index.js';
|
|
14
|
+
import type { AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral } from './types.js';
|
|
15
|
+
type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never;
|
|
16
|
+
type Deployment = TupleToUnion<typeof lightningDeployments>;
|
|
17
|
+
type DistributedPick<T, K> = T extends any ? Pick<T, Extract<keyof T, K>> : never;
|
|
18
|
+
export type DeploymentByName = DistributedPick<Deployment, 'name' | 'chainId'>;
|
|
19
|
+
export type DeploymentByExecutor = DistributedPick<Deployment, 'executorAddress' | 'chainId'>;
|
|
20
|
+
export type DeploymentId = DeploymentByName | DeploymentByExecutor;
|
|
21
|
+
export type Pepper = Deployment['pepper'];
|
|
22
|
+
export type LocalNodePepper = keyof typeof localNodeLightningConfig;
|
|
23
|
+
export type ChainId = Deployment['chainId'];
|
|
24
|
+
export type SupportedNativeType = boolean | bigint | number;
|
|
25
|
+
export type EncryptionContext = {
|
|
26
|
+
accountAddress: string;
|
|
27
|
+
dappAddress: string;
|
|
28
|
+
handleType: TeeType;
|
|
29
|
+
};
|
|
30
|
+
export type DeploymentSlice = {
|
|
31
|
+
executorAddress: string;
|
|
32
|
+
chainId: number;
|
|
33
|
+
};
|
|
34
|
+
export type CustomConfig = {
|
|
35
|
+
executorAddress: string;
|
|
36
|
+
chainId: number;
|
|
37
|
+
covalidatorUrls: string[];
|
|
38
|
+
signers?: Address[];
|
|
39
|
+
hostChainRpcUrls?: readonly string[] | string[];
|
|
40
|
+
senderPrivateKey?: HexString;
|
|
41
|
+
};
|
|
42
|
+
export type CustomDeployment = DeploymentSlice & CustomConfig;
|
|
43
|
+
export type IncoVerifierConfig = {
|
|
44
|
+
threshold: number;
|
|
45
|
+
signers: Address[];
|
|
46
|
+
networkPubkey: HexString;
|
|
47
|
+
};
|
|
48
|
+
type LocalNodeEnvFileSource = {
|
|
49
|
+
filePath: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The Lightning class provides a convenient way to interact with the Inco Lightning contract by binding to a specific
|
|
53
|
+
* deployment.
|
|
54
|
+
*/
|
|
55
|
+
export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
|
56
|
+
private readonly _deployment;
|
|
57
|
+
private readonly covalidatorUrls;
|
|
58
|
+
private readonly signers;
|
|
59
|
+
private readonly threshold;
|
|
60
|
+
private readonly networkPubkey;
|
|
61
|
+
private readonly publicClient;
|
|
62
|
+
readonly executorAddress: Address;
|
|
63
|
+
readonly chainId: bigint;
|
|
64
|
+
private readonly kmsQuorumClient;
|
|
65
|
+
private encryptor;
|
|
66
|
+
private encryptionScheme;
|
|
67
|
+
private constructor();
|
|
68
|
+
private getEncryptor;
|
|
69
|
+
/**
|
|
70
|
+
* Get the encryption scheme version used by this Lightning instance.
|
|
71
|
+
* Returns the X-Wing encryption scheme identifier.
|
|
72
|
+
* This is a convenience method to get the encryption scheme used by this Lightning instance.
|
|
73
|
+
*/
|
|
74
|
+
getEncryptionScheme(): Promise<EncryptionScheme>;
|
|
75
|
+
/**
|
|
76
|
+
* Get a Lightning instance bound to the latest Lightning deployment for Base mainnet.
|
|
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.
|
|
80
|
+
*/
|
|
81
|
+
static baseMainnet(options?: {
|
|
82
|
+
hostChainRpcUrls?: readonly string[];
|
|
83
|
+
}): Promise<Lightning<Deployment>>;
|
|
84
|
+
/**
|
|
85
|
+
* Get a Lightning instance bound to the latest Lightning deployment for the Base Sepolia testnet.
|
|
86
|
+
*
|
|
87
|
+
* @param options.hostChainRpcUrls optional list of RPC URLs for the host chain. When multiple URLs are
|
|
88
|
+
* provided, viem's fallback transport is used and providers are tried in order on failure.
|
|
89
|
+
*/
|
|
90
|
+
static baseSepoliaTestnet(options?: {
|
|
91
|
+
hostChainRpcUrls?: readonly string[];
|
|
92
|
+
}): Promise<Lightning<Deployment>>;
|
|
93
|
+
/**
|
|
94
|
+
* Get a Lightning instance bound to our canonical Anvil-based test node and test Covalidator node
|
|
95
|
+
*
|
|
96
|
+
* These can be run in docker-compose using images pushed to dockerhub as:
|
|
97
|
+
* - inconetwork/local-node-anvil
|
|
98
|
+
* - inconetwork/local-node-covalidator
|
|
99
|
+
*
|
|
100
|
+
* See the sample docker-compose file here: https://github.com/Inco-fhevm/lightning-rod/blob/main/docker-compose.yaml
|
|
101
|
+
*
|
|
102
|
+
* @param env either a Pepper such as 'testnet', 'devnet', 'alphanet' or a LocalNodeEnv object containing the
|
|
103
|
+
* executorAddress, networkPubkey, chainId, covalidatorUrl and senderPrivateKey. If none is provided, it defaults to
|
|
104
|
+
* the 'testnet' Pepper. This produces allows connection to a local node running against a state dump of the
|
|
105
|
+
* corresponding Pepper.
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
108
|
+
static localNode(env?: LocalNodeEnv | LocalNodePepper): Promise<Lightning<CustomDeployment>>;
|
|
109
|
+
/**
|
|
110
|
+
* Get a Lightning instance bound to a local node from a file containing a LocalNodeEnv environment .
|
|
111
|
+
*
|
|
112
|
+
* @param filePath the path to the file containing the environment variables in dotenv format
|
|
113
|
+
*/
|
|
114
|
+
static localNodeFromEnv(source?: string | Buffer | LocalNodeEnvFileSource): Promise<Lightning<CustomDeployment>>;
|
|
115
|
+
/**
|
|
116
|
+
* Get a Lightning deployment by name or executor address on a particular chain.
|
|
117
|
+
*
|
|
118
|
+
* @param id this is an object containing either the pair of name and chainId or the executorAddress and chainId
|
|
119
|
+
* @param options.hostChainRpcUrls optional list of RPC URLs for the host chain. When multiple URLs are
|
|
120
|
+
* provided, viem's fallback transport is used and providers are tried in order on failure.
|
|
121
|
+
*/
|
|
122
|
+
static at(id: DeploymentId, options?: {
|
|
123
|
+
hostChainRpcUrls?: readonly string[];
|
|
124
|
+
}): Promise<Lightning<Deployment>>;
|
|
125
|
+
/**
|
|
126
|
+
* Get a Lightning deployment for a local or custom node
|
|
127
|
+
*
|
|
128
|
+
* @param config this is an object containing the executorAddress, networkPubkey, chainId and covalidatorUrl.
|
|
129
|
+
* additional fields past will be made available as part of the `deployment` property.
|
|
130
|
+
*/
|
|
131
|
+
static custom<T extends CustomConfig>(config: T): Promise<Lightning<DeploymentSlice & T>>;
|
|
132
|
+
/**
|
|
133
|
+
* Get the latest deployment for a given pepper, which usually denotes a family of deployments distinct from their
|
|
134
|
+
* version such as 'devnet', 'testnet', 'mainnet', etc.
|
|
135
|
+
*
|
|
136
|
+
* @param pepper the pepper to use to filter the deployments
|
|
137
|
+
* @param chainId the chainId to use to filter the deployments
|
|
138
|
+
*/
|
|
139
|
+
static latestDeployment<P extends Pepper>(pepper: P, chainId: ChainId): Deployment;
|
|
140
|
+
/**
|
|
141
|
+
* Get the latest Lightning deployment for a given pepper amd chainId unconditionally.
|
|
142
|
+
* Note that if you upgrade the library the latest deployment may change and contracts deployed to a previous version
|
|
143
|
+
* will not be compatible with the new version.
|
|
144
|
+
*
|
|
145
|
+
* @param pepper the pepper to use to filter the deployments
|
|
146
|
+
* @param chainId the chainId to use to filter the deployments
|
|
147
|
+
* @param options.hostChainRpcUrls optional list of RPC URLs for the host chain. When multiple URLs are
|
|
148
|
+
* provided, viem's fallback transport is used and providers are tried in order on failure.
|
|
149
|
+
*/
|
|
150
|
+
static latest<P extends Pepper>(pepper: P, chainId: ChainId, options?: {
|
|
151
|
+
hostChainRpcUrls?: readonly string[];
|
|
152
|
+
}): Promise<Lightning<Deployment>>;
|
|
153
|
+
/** Returns a shallow copy of the deployment configuration this Lightning instance is bound to. */
|
|
154
|
+
get deployment(): T;
|
|
155
|
+
/**
|
|
156
|
+
* Encrypt a value using the network's public key (X-Wing).
|
|
157
|
+
* The encryption scheme is automatically detected based on the public key length.
|
|
158
|
+
*
|
|
159
|
+
* @param value a boolean or numeric value to encrypt
|
|
160
|
+
* @param accountAddress the address of the account interacting with the dapp contract, normally an Externally Owned Account (EOA)
|
|
161
|
+
* @param dappAddress the address of the dapp contract that interacts with the Inco Lightning contract or library
|
|
162
|
+
* @param handleType (optional) the handle type to be used for encrypting the value - this is required in case of non-default handle types
|
|
163
|
+
* default handle types:
|
|
164
|
+
* - boolean -> handleTypes.ebool
|
|
165
|
+
* - number | bigint -> handleTypes.euint256
|
|
166
|
+
* @returns a promise that resolves to the encrypted value as a HexString
|
|
167
|
+
*/
|
|
168
|
+
encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress, handleType }: EncryptionContext): Promise<HexString>;
|
|
169
|
+
/**
|
|
170
|
+
* Grants a session key allowance voucher for secure reencryption operations.
|
|
171
|
+
*
|
|
172
|
+
* This method creates a signed allowance voucher that authorizes a specific requester address
|
|
173
|
+
* to perform reencryption operations using session keys. The voucher includes an expiration time
|
|
174
|
+
* and can optionally specify a custom session verifier contract address.
|
|
175
|
+
*
|
|
176
|
+
* @param walletClient - The wallet client used for signing the allowance voucher
|
|
177
|
+
* @param granteeAddress - The address of the entity requesting the session key allowance
|
|
178
|
+
* @param expiresAt - The timestamp when the allowance voucher expires (as a bigint)
|
|
179
|
+
* @param sessionVerifierAddress - Optional custom session verifier contract address. If not provided, uses the executor address
|
|
180
|
+
* @returns A promise that resolves to an AllowanceVoucherWithSig containing the signed allowance voucher
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* const voucher = await lightning.grantSessionKeyAllowanceVoucher(
|
|
185
|
+
* walletClient,
|
|
186
|
+
* "0x1234...",
|
|
187
|
+
* BigInt(Date.now() + 3600000), // 1 hour from now
|
|
188
|
+
* "0x5678..." // optional custom verifier
|
|
189
|
+
* );
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
grantSessionKeyAllowanceVoucher(walletClient: WalletClient<Transport, Chain, Account>, granteeAddress: string, expiresAt: Date, sessionVerifierAddress: string): Promise<AllowanceVoucherWithSig>;
|
|
193
|
+
/**
|
|
194
|
+
* Grants a session key allowance voucher using a custom session verifier contract.
|
|
195
|
+
*
|
|
196
|
+
* This method creates a signed allowance voucher that authorizes reencryption operations
|
|
197
|
+
* using a custom session verifier. Unlike `grantSessionKeyAllowanceVoucher`, this method
|
|
198
|
+
* allows specifying custom `sharerArgData` for use with custom verifier contracts that
|
|
199
|
+
* require additional authorization parameters.
|
|
200
|
+
*
|
|
201
|
+
* @param walletClient - The wallet client used for signing the allowance voucher
|
|
202
|
+
* @param sessionVerifierAddress - The address of the custom session verifier contract
|
|
203
|
+
* @param sharerArgData - Custom encoded arguments for the session verifier's `canUseSession` function
|
|
204
|
+
* @returns A promise that resolves to an AllowanceVoucherWithSig containing the signed allowance voucher
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const sharerArgData = encodeAbiParameters(
|
|
209
|
+
* [{ type: 'address' }, { type: 'uint256' }],
|
|
210
|
+
* [granteeAddress, expiresAt]
|
|
211
|
+
* );
|
|
212
|
+
* const voucher = await lightning.grantCustomSessionKeyAllowanceVoucher(
|
|
213
|
+
* walletClient,
|
|
214
|
+
* "0x5678...", // custom verifier address
|
|
215
|
+
* sharerArgData
|
|
216
|
+
* );
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
grantCustomSessionKeyAllowanceVoucher(walletClient: WalletClient<Transport, Chain, Account>, sessionVerifierAddress: string, sharerArgData: HexString): Promise<AllowanceVoucherWithSig>;
|
|
220
|
+
/**
|
|
221
|
+
* Updates the active session nonce for the given wallet client.
|
|
222
|
+
*
|
|
223
|
+
* This method updates the active session nonce for the given wallet client.
|
|
224
|
+
* It nullifies all the previous shared addresses accessing the voucher.
|
|
225
|
+
*
|
|
226
|
+
* @param walletClient - The wallet client used for updating the session nonce
|
|
227
|
+
* @returns The transaction hash of the updateActiveVouchersSessionNonce transaction
|
|
228
|
+
*/
|
|
229
|
+
updateActiveVouchersSessionNonce(walletClient: WalletClient<Transport, Chain, Account>): Promise<HexString>;
|
|
230
|
+
/**
|
|
231
|
+
* Requests attested decrypts signed by the covalidator using a wallet client.
|
|
232
|
+
*
|
|
233
|
+
* @param walletClient Wallet used to sign the EIP-712 request.
|
|
234
|
+
* @param handles 32-byte handles to decrypt.
|
|
235
|
+
* @param backoffConfig Optional retry configuration.
|
|
236
|
+
*
|
|
237
|
+
* @example Plaintext results
|
|
238
|
+
* ```ts
|
|
239
|
+
* const attestations = await lightning.attestedDecrypt(walletClient, [handle]);
|
|
240
|
+
* console.log(attestations[0].plaintext.value);
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* @example Reencrypt for a delegate
|
|
244
|
+
* ```ts
|
|
245
|
+
* const encrypted = await lightning.attestedDecrypt(walletClient, [handle], {
|
|
246
|
+
* reencryptPubKey: delegatePubKey,
|
|
247
|
+
* });
|
|
248
|
+
* console.log(encrypted[0].encryptedPlaintext.ciphertext.value);
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* @example Reencrypt and decrypt locally
|
|
252
|
+
* ```ts
|
|
253
|
+
* const decrypted = await lightning.attestedDecrypt(walletClient, [handle], {
|
|
254
|
+
* reencryptPubKey: keypair.encodePublicKey(),
|
|
255
|
+
* reencryptKeypair: keypair,
|
|
256
|
+
* });
|
|
257
|
+
* console.log(decrypted[0].plaintext.value);
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], opts?: AttestedOptsEphemeral): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
261
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], opts: AttestedOptsEncrypted): Promise<Array<EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
262
|
+
attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], opts: AttestedOptsDecrypted): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
263
|
+
/**
|
|
264
|
+
* Requests attested decrypts using a voucher-backed session key.
|
|
265
|
+
*
|
|
266
|
+
* @param ephemeralAccount Session Account matching the voucher grantee.
|
|
267
|
+
* @param allowanceVoucherWithSig Signed allowance voucher.
|
|
268
|
+
* @param handles Handles to decrypt.
|
|
269
|
+
* @param opts Optional reencryption/backoff configuration.
|
|
270
|
+
*
|
|
271
|
+
* @example Plaintext results
|
|
272
|
+
* ```ts
|
|
273
|
+
* const attestations = await lightning.attestedDecryptWithVoucher(
|
|
274
|
+
* ephemeralAccount,
|
|
275
|
+
* voucher,
|
|
276
|
+
* [handle],
|
|
277
|
+
* );
|
|
278
|
+
* ```
|
|
279
|
+
*
|
|
280
|
+
* @example Reencrypt for a delegate
|
|
281
|
+
* ```ts
|
|
282
|
+
* const encrypted = await lightning.attestedDecryptWithVoucher(
|
|
283
|
+
* ephemeralAccount,
|
|
284
|
+
* voucher,
|
|
285
|
+
* [handle],
|
|
286
|
+
* { reencryptPubKey: delegateKeypair.encodePublicKey() },
|
|
287
|
+
* );
|
|
288
|
+
* ```
|
|
289
|
+
*
|
|
290
|
+
* @example Reencrypt and decrypt locally
|
|
291
|
+
* ```ts
|
|
292
|
+
* const decrypted = await lightning.attestedDecryptWithVoucher(
|
|
293
|
+
* ephemeralAccount,
|
|
294
|
+
* voucher,
|
|
295
|
+
* [handle],
|
|
296
|
+
* { reencryptPubKey: keypair.encodePublicKey(), reencryptKeypair: keypair },
|
|
297
|
+
* );
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], opts?: AttestedWithVoucherOptsEphemeral): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
301
|
+
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], opts: AttestedWithVoucherOptsEncrypted): Promise<Array<EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
302
|
+
attestedDecryptWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], opts: AttestedWithVoucherOptsDecrypted): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
303
|
+
eListAttestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handle: HexString, opts?: AttestedOptsEphemeral): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
304
|
+
eListAttestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handle: HexString, opts: AttestedOptsEncrypted): Promise<EncryptedEListDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
305
|
+
eListAttestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handle: HexString, opts: AttestedOptsDecrypted): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
306
|
+
/**
|
|
307
|
+
* Reveal a single elist handle without wallet authentication.
|
|
308
|
+
* Returns plaintext values along with an attestation of the checksum.
|
|
309
|
+
*
|
|
310
|
+
* @param handle - The elist handle to reveal
|
|
311
|
+
* @param opts - Optional backoff configuration
|
|
312
|
+
* @returns The elist decryption attestation with plaintext values
|
|
313
|
+
*/
|
|
314
|
+
eListAttestedReveal(handle: HexString, opts?: AttestedRevealOpts): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
315
|
+
/**
|
|
316
|
+
* Get an attested compute for the given wallet client.
|
|
317
|
+
*
|
|
318
|
+
* @param walletClient - The wallet client used for signing the attested compute request
|
|
319
|
+
* @param lhsHandle - The handle to compute
|
|
320
|
+
* @param op - The operation to perform
|
|
321
|
+
* @param rhsPlaintext - The plaintext to compute with
|
|
322
|
+
* @param opts - Optional configuration (reencryption keys and/or backoff config)
|
|
323
|
+
* @returns The decryption attestation
|
|
324
|
+
*
|
|
325
|
+
* @example Plaintext result
|
|
326
|
+
* ```typescript
|
|
327
|
+
* import { AttestedComputeSupportedOps } from '../lite/attested-compute.js';
|
|
328
|
+
* const lhsHandle = '0x...';
|
|
329
|
+
* const rhsPlaintext = 1337n;
|
|
330
|
+
* const op = AttestedComputeSupportedOps.Eq;
|
|
331
|
+
* const response = await lightning.attestedCompute(walletClient, lhsHandle, op, rhsPlaintext);
|
|
332
|
+
* const { plaintext, covalidatorSignature, handle } = response;
|
|
333
|
+
* ```
|
|
334
|
+
*
|
|
335
|
+
* @example Reencrypt for a delegate
|
|
336
|
+
* ```ts
|
|
337
|
+
* const encrypted = await lightning.attestedCompute(
|
|
338
|
+
* walletClient,
|
|
339
|
+
* lhsHandle,
|
|
340
|
+
* op,
|
|
341
|
+
* rhsPlaintext,
|
|
342
|
+
* { reencryptPubKey: delegatePubKey },
|
|
343
|
+
* );
|
|
344
|
+
* console.log(encrypted.encryptedPlaintext.ciphertext.value);
|
|
345
|
+
* ```
|
|
346
|
+
*
|
|
347
|
+
* @example Reencrypt and decrypt locally
|
|
348
|
+
* ```ts
|
|
349
|
+
* const decrypted = await lightning.attestedCompute(
|
|
350
|
+
* walletClient,
|
|
351
|
+
* lhsHandle,
|
|
352
|
+
* op,
|
|
353
|
+
* rhsPlaintext,
|
|
354
|
+
* { reencryptPubKey: keypair.encodePublicKey(), reencryptKeypair: keypair },
|
|
355
|
+
* );
|
|
356
|
+
* console.log(decrypted.plaintext.value);
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts?: AttestedOptsEphemeral): Promise<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
360
|
+
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedOptsEncrypted): Promise<EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
361
|
+
attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedOptsDecrypted): Promise<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
362
|
+
/**
|
|
363
|
+
* Performs attested compute via a voucher-backed session key.
|
|
364
|
+
*
|
|
365
|
+
* @example Plaintext result
|
|
366
|
+
* ```ts
|
|
367
|
+
* const attestation = await lightning.attestedComputeWithVoucher(
|
|
368
|
+
* ephemeralAccount,
|
|
369
|
+
* voucher,
|
|
370
|
+
* lhsHandle,
|
|
371
|
+
* AttestedComputeSupportedOps.Eq,
|
|
372
|
+
* true,
|
|
373
|
+
* );
|
|
374
|
+
* ```
|
|
375
|
+
*
|
|
376
|
+
* @example Reencrypt for a delegate
|
|
377
|
+
* ```ts
|
|
378
|
+
* const encrypted = await lightning.attestedComputeWithVoucher(
|
|
379
|
+
* ephemeralAccount,
|
|
380
|
+
* voucher,
|
|
381
|
+
* lhsHandle,
|
|
382
|
+
* AttestedComputeSupportedOps.Eq,
|
|
383
|
+
* true,
|
|
384
|
+
* { reencryptPubKey: delegatePubKey },
|
|
385
|
+
* );
|
|
386
|
+
* console.log(encrypted.encryptedPlaintext.ciphertext.value);
|
|
387
|
+
* ```
|
|
388
|
+
*
|
|
389
|
+
* @example Reencrypt and decrypt locally
|
|
390
|
+
* ```ts
|
|
391
|
+
* const decrypted = await lightning.attestedComputeWithVoucher(
|
|
392
|
+
* ephemeralAccount,
|
|
393
|
+
* voucher,
|
|
394
|
+
* lhsHandle,
|
|
395
|
+
* AttestedComputeSupportedOps.Eq,
|
|
396
|
+
* true,
|
|
397
|
+
* { reencryptPubKey: keypair.encodePublicKey(), reencryptKeypair: keypair },
|
|
398
|
+
* );
|
|
399
|
+
* console.log(decrypted.plaintext.value);
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts?: AttestedWithVoucherOptsEphemeral): Promise<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
403
|
+
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedWithVoucherOptsEncrypted): Promise<EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
404
|
+
attestedComputeWithVoucher(ephemeralAccount: PrivateKeyAccount, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, opts: AttestedWithVoucherOptsDecrypted): Promise<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
|
|
405
|
+
/**
|
|
406
|
+
* Get an decryption of publicly revealed handles.
|
|
407
|
+
*
|
|
408
|
+
* @param handles - The handles to decrypt
|
|
409
|
+
* @param backoffConfig - The backoff configuration for the attested decrypt request
|
|
410
|
+
* @returns The decryption attestations
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```typescript
|
|
414
|
+
* const response = await lightning.attestedReveal([handle1, handle2]);
|
|
415
|
+
* const { plaintext, covalidatorSignature } = response[0];
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
attestedReveal(handles: HexString[], opts?: AttestedRevealOpts): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedTeeType>>>;
|
|
419
|
+
/**
|
|
420
|
+
* Get the GRPC endpoint for the covalidator that services this deployment.
|
|
421
|
+
*/
|
|
422
|
+
static getCovalidatorUrls(deployment: DeploymentSlice & {
|
|
423
|
+
pepper: string;
|
|
424
|
+
majorVersion: number;
|
|
425
|
+
}, signers: Address[]): string[];
|
|
426
|
+
private static isIdByName;
|
|
427
|
+
private static plaintextFromValue;
|
|
428
|
+
/**
|
|
429
|
+
* Reads the network public key from the on-chain Inco Verifier contract.
|
|
430
|
+
*
|
|
431
|
+
* Falls back to the legacy `eciesPubkey()` getter for older contract versions.
|
|
432
|
+
*
|
|
433
|
+
* @param client - A viem public client connected to the host chain.
|
|
434
|
+
* @param executorAddress - The address of the Inco Lightning executor contract.
|
|
435
|
+
* @returns The network public key as a hex string.
|
|
436
|
+
*/
|
|
437
|
+
static getNetworkPubkey(client: PublicClient, executorAddress: Address): Promise<HexString>;
|
|
438
|
+
/**
|
|
439
|
+
* Resolves the Inco Verifier contract instance associated with a Lightning executor.
|
|
440
|
+
*
|
|
441
|
+
* Reads the `incoVerifier` address from the executor contract and returns a typed contract handle.
|
|
442
|
+
*
|
|
443
|
+
* @param client - A viem public client connected to the host chain.
|
|
444
|
+
* @param executorAddress - The address of the Inco Lightning executor contract.
|
|
445
|
+
* @returns A viem contract instance bound to the Inco Verifier ABI.
|
|
446
|
+
*/
|
|
447
|
+
static getIncoVerifierContract(client: PublicClient, executorAddress: Address): Promise<GetContractReturnType<typeof incoVerifierAbi, PublicClient, Address>>;
|
|
448
|
+
/**
|
|
449
|
+
* Retrieves the verifier contract details including threshold, signers, and XWING public key from the Inco Verifier contract.
|
|
450
|
+
*
|
|
451
|
+
* @param executorAddress The address of the Inco Lightning executor contract.
|
|
452
|
+
* @param client The public client to interact with the blockchain.
|
|
453
|
+
* @returns An object containing the threshold, signers, and XWING public key.
|
|
454
|
+
*/
|
|
455
|
+
private static getVerifierContractDetails;
|
|
456
|
+
private static getChainConfig;
|
|
457
|
+
private static supportsThresholdRetrieval;
|
|
458
|
+
}
|
|
459
|
+
export {};
|