@inco/js 0.6.8 → 0.7.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.
Files changed (140) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/advancedacl/session-key.d.ts +39 -19
  3. package/dist/cjs/advancedacl/session-key.js +59 -108
  4. package/dist/cjs/attestedcompute/attested-compute.d.ts +6 -6
  5. package/dist/cjs/attestedcompute/attested-compute.js +5 -28
  6. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +68 -16
  7. package/dist/cjs/attesteddecrypt/attested-decrypt.js +108 -66
  8. package/dist/cjs/attesteddecrypt/types.d.ts +8 -3
  9. package/dist/cjs/attesteddecrypt/types.js +1 -1
  10. package/dist/cjs/encryption/encryption.d.ts +8 -10
  11. package/dist/cjs/encryption/encryption.js +6 -6
  12. package/dist/cjs/generated/abis/add-two.d.ts +1 -1
  13. package/dist/cjs/generated/abis/add-two.js +1 -1
  14. package/dist/cjs/generated/abis/lightning-preview.d.ts +40 -0
  15. package/dist/cjs/generated/abis/lightning-preview.js +29 -1
  16. package/dist/cjs/generated/abis/lightning.d.ts +1 -1
  17. package/dist/cjs/generated/abis/lightning.js +1 -1
  18. package/dist/cjs/generated/abis/verifier.d.ts +126 -67
  19. package/dist/cjs/generated/abis/verifier.js +108 -54
  20. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  21. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  22. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +87 -132
  23. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +21 -27
  24. package/dist/cjs/generated/lightning.d.ts +40 -32
  25. package/dist/cjs/generated/lightning.js +43 -33
  26. package/dist/cjs/generated/local-node.d.ts +11 -11
  27. package/dist/cjs/generated/local-node.js +28 -12
  28. package/dist/cjs/kms/client.d.ts +8 -4
  29. package/dist/cjs/kms/client.js +9 -4
  30. package/dist/cjs/kms/quorumClient.d.ts +58 -0
  31. package/dist/cjs/kms/quorumClient.js +378 -0
  32. package/dist/cjs/kms/thresholdPromises.d.ts +7 -0
  33. package/dist/cjs/kms/thresholdPromises.js +52 -0
  34. package/dist/cjs/lite/deployments.d.ts +20 -2
  35. package/dist/cjs/lite/deployments.js +1 -1
  36. package/dist/cjs/lite/index.d.ts +1 -2
  37. package/dist/cjs/lite/index.js +1 -2
  38. package/dist/cjs/lite/lightning.d.ts +109 -77
  39. package/dist/cjs/lite/lightning.js +279 -112
  40. package/dist/cjs/local/local-node.d.ts +1 -2
  41. package/dist/cjs/local/local-node.js +2 -3
  42. package/dist/cjs/test/mocks.d.ts +15 -0
  43. package/dist/cjs/test/mocks.js +45 -0
  44. package/dist/cjs/viem.d.ts +1 -1
  45. package/dist/esm/advancedacl/session-key.d.ts +39 -19
  46. package/dist/esm/advancedacl/session-key.js +52 -100
  47. package/dist/esm/attestedcompute/attested-compute.d.ts +6 -6
  48. package/dist/esm/attestedcompute/attested-compute.js +6 -29
  49. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +68 -16
  50. package/dist/esm/attesteddecrypt/attested-decrypt.js +109 -68
  51. package/dist/esm/attesteddecrypt/types.d.ts +8 -3
  52. package/dist/esm/attesteddecrypt/types.js +1 -1
  53. package/dist/esm/encryption/encryption.d.ts +8 -10
  54. package/dist/esm/encryption/encryption.js +6 -6
  55. package/dist/esm/generated/abis/add-two.d.ts +1 -1
  56. package/dist/esm/generated/abis/add-two.js +1 -1
  57. package/dist/esm/generated/abis/lightning-preview.d.ts +40 -0
  58. package/dist/esm/generated/abis/lightning-preview.js +29 -1
  59. package/dist/esm/generated/abis/lightning.d.ts +1 -1
  60. package/dist/esm/generated/abis/lightning.js +1 -1
  61. package/dist/esm/generated/abis/verifier.d.ts +126 -67
  62. package/dist/esm/generated/abis/verifier.js +108 -54
  63. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  64. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  65. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +87 -132
  66. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +19 -25
  67. package/dist/esm/generated/lightning.d.ts +40 -32
  68. package/dist/esm/generated/lightning.js +43 -33
  69. package/dist/esm/generated/local-node.d.ts +11 -11
  70. package/dist/esm/generated/local-node.js +28 -12
  71. package/dist/esm/kms/client.d.ts +8 -4
  72. package/dist/esm/kms/client.js +8 -4
  73. package/dist/esm/kms/quorumClient.d.ts +58 -0
  74. package/dist/esm/kms/quorumClient.js +374 -0
  75. package/dist/esm/kms/thresholdPromises.d.ts +7 -0
  76. package/dist/esm/kms/thresholdPromises.js +49 -0
  77. package/dist/esm/lite/deployments.d.ts +20 -2
  78. package/dist/esm/lite/deployments.js +1 -1
  79. package/dist/esm/lite/index.d.ts +1 -2
  80. package/dist/esm/lite/index.js +1 -2
  81. package/dist/esm/lite/lightning.d.ts +109 -77
  82. package/dist/esm/lite/lightning.js +278 -111
  83. package/dist/esm/local/local-node.d.ts +1 -2
  84. package/dist/esm/local/local-node.js +2 -3
  85. package/dist/esm/test/mocks.d.ts +15 -0
  86. package/dist/esm/test/mocks.js +39 -0
  87. package/dist/esm/viem.d.ts +1 -1
  88. package/dist/types/advancedacl/session-key.d.ts +39 -19
  89. package/dist/types/attestedcompute/attested-compute.d.ts +6 -6
  90. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +68 -16
  91. package/dist/types/attesteddecrypt/types.d.ts +8 -3
  92. package/dist/types/encryption/encryption.d.ts +8 -10
  93. package/dist/types/generated/abis/add-two.d.ts +1 -1
  94. package/dist/types/generated/abis/lightning-preview.d.ts +40 -0
  95. package/dist/types/generated/abis/lightning.d.ts +1 -1
  96. package/dist/types/generated/abis/verifier.d.ts +126 -67
  97. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  98. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +87 -132
  99. package/dist/types/generated/lightning.d.ts +40 -32
  100. package/dist/types/generated/local-node.d.ts +11 -11
  101. package/dist/types/kms/client.d.ts +8 -4
  102. package/dist/types/kms/quorumClient.d.ts +58 -0
  103. package/dist/types/kms/thresholdPromises.d.ts +7 -0
  104. package/dist/types/lite/deployments.d.ts +20 -2
  105. package/dist/types/lite/index.d.ts +1 -2
  106. package/dist/types/lite/lightning.d.ts +109 -77
  107. package/dist/types/local/local-node.d.ts +1 -2
  108. package/dist/types/test/mocks.d.ts +15 -0
  109. package/dist/types/viem.d.ts +1 -1
  110. package/package.json +3 -3
  111. package/dist/cjs/attestedreveal/attested-reveal.d.ts +0 -21
  112. package/dist/cjs/attestedreveal/attested-reveal.js +0 -67
  113. package/dist/cjs/attestedreveal/index.d.ts +0 -1
  114. package/dist/cjs/attestedreveal/index.js +0 -18
  115. package/dist/cjs/attestedreveal/types.d.ts +0 -7
  116. package/dist/cjs/attestedreveal/types.js +0 -16
  117. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  118. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +0 -118
  119. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  120. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +0 -136
  121. package/dist/cjs/lite/reencrypt.d.ts +0 -23
  122. package/dist/cjs/lite/reencrypt.js +0 -131
  123. package/dist/esm/attestedreveal/attested-reveal.d.ts +0 -21
  124. package/dist/esm/attestedreveal/attested-reveal.js +0 -64
  125. package/dist/esm/attestedreveal/index.d.ts +0 -1
  126. package/dist/esm/attestedreveal/index.js +0 -2
  127. package/dist/esm/attestedreveal/types.d.ts +0 -7
  128. package/dist/esm/attestedreveal/types.js +0 -12
  129. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  130. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +0 -115
  131. package/dist/esm/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  132. package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +0 -133
  133. package/dist/esm/lite/reencrypt.d.ts +0 -23
  134. package/dist/esm/lite/reencrypt.js +0 -122
  135. package/dist/types/attestedreveal/attested-reveal.d.ts +0 -21
  136. package/dist/types/attestedreveal/index.d.ts +0 -1
  137. package/dist/types/attestedreveal/types.d.ts +0 -7
  138. package/dist/types/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  139. package/dist/types/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  140. package/dist/types/lite/reencrypt.d.ts +0 -23
@@ -1,13 +1,12 @@
1
- import { Account, Chain, Transport, WalletClient } from 'viem';
1
+ import { Account, Chain, PublicClient, Transport, WalletClient } from 'viem';
2
2
  import { AllowanceVoucherWithSig } from '../advancedacl/types.js';
3
3
  import { AttestedComputeOP } from '../attestedcompute/types.js';
4
- import { DecryptionAttestation } from '../attesteddecrypt/index.js';
4
+ import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js';
5
5
  import { Address, HexString } from '../binary.js';
6
- import { EciesScheme, PlaintextOf, SupportedFheType } from '../encryption/index.js';
6
+ import { EciesScheme, Encryptor, SupportedFheType } from '../encryption/index.js';
7
7
  import { lightningDeployments } from '../generated/lightning.js';
8
8
  import { localNodeLightningConfig } from '../generated/local-node.js';
9
9
  import { LocalNodeEnv } from '../local/index.js';
10
- import type { Reencryptor } from '../reencryption/index.js';
11
10
  import { BackoffConfig } from '../retry.js';
12
11
  import { Secp256k1Keypair } from './ecies.js';
13
12
  type TupleToUnion<T> = T extends readonly unknown[] ? T[number] : never;
@@ -26,36 +25,38 @@ export type EncryptionContext = {
26
25
  };
27
26
  export type DeploymentSlice = {
28
27
  executorAddress: string;
29
- eciesPublicKey: string;
30
28
  chainId: number;
31
29
  };
32
30
  export type CustomConfig = {
33
31
  executorAddress: string;
34
- eciesPublicKey: string;
35
32
  chainId: number;
36
- covalidatorUrl: string;
33
+ covalidatorUrls: string[];
34
+ signers?: Address[];
37
35
  hostChainRpcUrl?: string;
38
36
  senderPrivateKey?: HexString;
39
37
  };
40
38
  export type CustomDeployment = DeploymentSlice & CustomConfig;
39
+ type LocalNodeEnvFileSource = {
40
+ filePath: string;
41
+ };
41
42
  /**
42
43
  * The Lightning class provides a convenient way to interact with the Inco Lightning contract by binding to a specific
43
44
  * deployment.
44
45
  */
45
46
  export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
46
47
  private readonly _deployment;
47
- readonly covalidatorUrl: string;
48
+ readonly covalidatorUrls: string[];
49
+ readonly signers: Address[];
50
+ readonly threshold: number;
48
51
  readonly executorAddress: Address;
49
- readonly eciesPublicKey: HexString;
50
52
  readonly chainId: bigint;
51
- private readonly encryptor;
52
53
  private readonly ephemeralKeypair;
53
- private readonly kmsClient;
54
+ private readonly kmsQuorumClient;
54
55
  private constructor();
55
56
  /**
56
57
  * Get a Lightning instance bound to the latest Lightning deployment for the Base Sepolia testnet.
57
58
  */
58
- static baseSepoliaTestnet(): Lightning<Deployment>;
59
+ static baseSepoliaTestnet(): Promise<Lightning<Deployment>>;
59
60
  /**
60
61
  * Get a Lightning instance bound to our canonical Anvil-based test node and test Covalidator node
61
62
  *
@@ -71,26 +72,27 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
71
72
  * corresponding Pepper.
72
73
  *
73
74
  */
74
- static localNode(env?: LocalNodeEnv | LocalNodePepper): Lightning<CustomDeployment>;
75
+ static localNode(env?: LocalNodeEnv | LocalNodePepper): Promise<Lightning<CustomDeployment>>;
75
76
  /**
76
77
  * Get a Lightning instance bound to a local node from a file containing a LocalNodeEnv environment .
77
78
  *
78
79
  * @param filePath the path to the file containing the environment variables in dotenv format
79
80
  */
80
- static localNodeFromEnv(filePath?: string): Promise<Lightning<CustomDeployment>>;
81
+ static localNodeFromEnv(source?: string | Buffer | LocalNodeEnvFileSource): Promise<Lightning<CustomDeployment>>;
81
82
  /**
82
83
  * Get a Lightning deployment by name or executor address on a particular chain.
83
84
  *
84
85
  * @param id this is an object containing either the pair of name and chainId or the executorAddress and chainId
85
86
  */
86
- static at(id: DeploymentId): Lightning<Deployment>;
87
+ static at(id: DeploymentId): Promise<Lightning<Deployment>>;
87
88
  /**
88
89
  * Get a Lightning deployment for a local or custom node
89
90
  *
90
91
  * @param config this is an object containing the executorAddress, eciesPublicKey, chainId and covalidatorUrl.
91
92
  * additional fields past will be made available as part of the `deployment` property.
92
93
  */
93
- static custom<T extends CustomConfig>(config: T): Lightning<DeploymentSlice & T>;
94
+ static custom<T extends CustomConfig>(config: T): Promise<Lightning<DeploymentSlice & T>>;
95
+ static getEciesPublicKey(client: PublicClient, executorAddress: Address): Promise<HexString>;
94
96
  /**
95
97
  * Get the latest deployment for a given pepper, which usually denotes a family of deployments distinct from their
96
98
  * version such as 'devnet', 'testnet', 'mainnet', etc.
@@ -105,9 +107,9 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
105
107
  * will not be compatible with the new version.
106
108
  *
107
109
  * @param pepper the pepper to use to filter the deployments
108
- * @param chainId the chainId to use to filter the deployments
110
+ * @param chain the chain to use to filter the deployments
109
111
  */
110
- static latest<P extends Pepper>(pepper: P, chainId: ChainId): Lightning<Deployment>;
112
+ static latest<P extends Pepper>(pepper: P, chainId: ChainId): Promise<Lightning<Deployment>>;
111
113
  get deployment(): T;
112
114
  /**
113
115
  * Encrypt a value using the public ECIES key of the Lightning deployment.
@@ -116,15 +118,14 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
116
118
  * @param accountAddress the address of the account interacting with the dapp contract, normally an Externally Owned Account (EOA)
117
119
  * @param dappAddress the address of the dapp contract that interacts with the Inco Lightning contract or library
118
120
  */
119
- encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress }: EncryptionContext): Promise<HexString>;
121
+ encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress }: EncryptionContext, encryptor: Encryptor<EciesScheme>): Promise<HexString>;
120
122
  /**
121
- * Obtain a reencryptor for a particular Externally Owned Account (EOA) to request decrypted values.
122
- * The account associated with the walletClient must have permissions to decrypt the handle or ciphertext passed
123
- * to the reencryptor function.
123
+ * Get the encryptor for a specific ECIES public key.
124
124
  *
125
- * @param walletClient the wallet client to use for signing the reencrypt request.
125
+ * @param eciesPubkey the ECIES public key to use for encryption
126
+ * @returns an Encryptor instance configured for the specified ECIES public key
126
127
  */
127
- getReencryptor(walletClient: WalletClient<Transport, Chain, Account>): Promise<Reencryptor<EciesScheme>>;
128
+ getEncryptor(eciesPubkey: HexString): Encryptor<EciesScheme>;
128
129
  /**
129
130
  * Grants a session key allowance voucher for secure reencryption operations.
130
131
  *
@@ -149,24 +150,6 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
149
150
  * ```
150
151
  */
151
152
  grantSessionKeyAllowanceVoucher(walletClient: WalletClient<Transport, Chain, Account>, granteeAddress: string, expiresAt: Date, sessionVerifierAddress: string): Promise<AllowanceVoucherWithSig>;
152
- /**
153
- * Creates a session key reencryptor for secure data reencryption operations.
154
- *
155
- * This method returns a reencryptor instance that can be used to perform reencryption
156
- * operations using session keys. The reencryptor is configured with the provided
157
- * allowance voucher and ephemeral keypair for secure communication.
158
- *
159
- * @param allowanceVoucherWithSig - The signed allowance voucher obtained from grantSessionKeyAllowanceVoucher
160
- * @param ephemeralKeypair - The ephemeral keypair used for secure communication with the KMS make sure it has allowance to voucher
161
- * @returns A reencryptor instance configured for session key operations
162
- *
163
- * @example
164
- * ```typescript
165
- * const reencryptor = await lightning.getSessionKeyRencryptor(voucher, ephemeralKeypair);
166
- * const decryptedValue = await reencryptor({handle: resultHandle});
167
- * ```
168
- */
169
- getSessionKeyRencryptor(allowanceVoucherWithSig: AllowanceVoucherWithSig, ephemeralKeypair: Secp256k1Keypair): Promise<(<T_1 extends SupportedFheType>({ handle, }: import("../reencryption/types.js").ReencryptFnArgs<EciesScheme, T_1>) => Promise<PlaintextOf<1, 0 | 5 | 7 | 8>>)>;
170
153
  /**
171
154
  * Updates the active session nonce for the given wallet client.
172
155
  *
@@ -178,35 +161,68 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
178
161
  */
179
162
  updateActiveVouchersSessionNonce(walletClient: WalletClient<Transport, Chain, Account>): Promise<HexString>;
180
163
  /**
181
- * Get an attested decryptor for the given wallet client.
164
+ * Requests attested decrypts signed by the covalidator using a wallet client.
182
165
  *
183
- * @param walletClient - The wallet client used for signing the attested decrypt request
184
- * @param handles - The handles to decrypt
185
- * @param backoffConfig - The backoff configuration for the attested decrypt request
186
- * @returns The decryption attestations
166
+ * @param walletClient Wallet used to sign the EIP-712 request.
167
+ * @param handles 32-byte handles to decrypt.
168
+ * @param backoffConfig Optional retry configuration.
187
169
  *
188
- * @example
189
- * ```typescript
190
- * const response = await lightning.attestedDecrypt(walletClient, [handle1, handle2]);
191
- * const { plaintext, covalidatorSignature } = response[0];
170
+ * @example Plaintext results
171
+ * ```ts
172
+ * const attestations = await lightning.attestedDecrypt(walletClient, [handle]);
173
+ * console.log(attestations[0].plaintext.value);
174
+ * ```
175
+ *
176
+ * @example Reencrypt for a delegate
177
+ * ```ts
178
+ * const encrypted = await lightning.attestedDecrypt(walletClient, [handle], delegatePubKey);
179
+ * console.log(encrypted[0].encryptedPlaintext.ciphertext.value);
180
+ * ```
181
+ *
182
+ * @example Reencrypt and decrypt locally
183
+ * ```ts
184
+ * const decrypted = await lightning.attestedDecrypt(
185
+ * walletClient,
186
+ * [handle],
187
+ * keypair.encodePublicKey(),
188
+ * keypair,
189
+ * );
190
+ * console.log(decrypted[0].plaintext.value);
192
191
  * ```
193
192
  */
194
193
  attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
194
+ attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], reencryptPubKey: Uint8Array, backoffConfig?: Partial<BackoffConfig>): Promise<Array<EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
195
+ attestedDecrypt(walletClient: WalletClient<Transport, Chain, Account>, handles: HexString[], reencryptPubKey: Uint8Array, reencryptKeypair: Secp256k1Keypair, backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
195
196
  /**
196
- * @notice Attested decryption using a session key.
197
- * @dev This method is used when you want to perform attested decryption
198
- * via an ephemeral session key and an allowance voucher. The session
199
- * key setup is typically faster and more flexible than using a wallet.
197
+ * Requests attested decrypts using a voucher-backed session key.
198
+ *
199
+ * @param ephemeralKeypair Session keypair matching the voucher grantee.
200
+ * @param allowanceVoucherWithSig Signed allowance voucher.
201
+ * @param handles Handles to decrypt.
202
+ * @param options Optional reencryption/backoff configuration.
200
203
  *
201
- * @param ephemeralKeypair The ephemeral Secp256k1 keypair used for secure communication.
202
- * @param allowanceVoucherWithSig The signed allowance voucher, obtained from
203
- * `grantSessionKeyAllowanceVoucher`, proving the session key's decryption rights.
204
- * @param handles The encrypted handles to be decrypted.
205
- * @param backoffConfig Optional configuration for retry and backoff strategy.
204
+ * @example Plaintext results
205
+ * ```ts
206
+ * const attestations = await lightning.attestedDecryptWithVoucher(
207
+ * ephemeralKeypair,
208
+ * voucher,
209
+ * [handle],
210
+ * );
211
+ * ```
206
212
  *
207
- * @returns A promise that resolves to an array of decryption attestations.
213
+ * @example Reencrypt for a delegate
214
+ * ```ts
215
+ * const encrypted = await lightning.attestedDecryptWithVoucher(
216
+ * ephemeralKeypair,
217
+ * voucher,
218
+ * [handle],
219
+ * { reencryptPubKey: delegateKeypair.encodePublicKey() },
220
+ * );
221
+ * ```
208
222
  */
209
- attestedDecrypt(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
223
+ attestedDecryptWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
224
+ attestedDecryptWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], reencryptPubKey: Uint8Array, backoffConfig?: Partial<BackoffConfig>): Promise<Array<EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
225
+ attestedDecryptWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, handles: HexString[], reencryptPubKey: Uint8Array, reencryptKeypair: Secp256k1Keypair, backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
210
226
  /**
211
227
  * Get an attested compute for the given wallet client.
212
228
  *
@@ -229,29 +245,45 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
229
245
  */
230
246
  attestedCompute(walletClient: WalletClient<Transport, Chain, Account>, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
231
247
  /**
232
- * @notice Attested compute using a session key.
233
- * @dev This method is used when you want to perform attested compute
234
- * via an ephemeral session key and an allowance voucher. The session
235
- * key setup is typically faster and more flexible than using a wallet.
248
+ * Performs attested compute via a voucher-backed session key.
249
+ *
250
+ * @example
251
+ * ```ts
252
+ * const attestation = await lightning.attestedComputeWithVoucher(
253
+ * ephemeralKeypair,
254
+ * voucher,
255
+ * lhsHandle,
256
+ * AttestedComputeSupportedOps.Eq,
257
+ * true,
258
+ * );
259
+ * ```
260
+ */
261
+ attestedComputeWithVoucher(ephemeralKeypair: Secp256k1Keypair, allowanceVoucherWithSig: AllowanceVoucherWithSig, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
262
+ /**
263
+ * Get an decryption of publicly revealed handles.
236
264
  *
237
- * @param ephemeralKeypair The ephemeral Secp256k1 keypair used for secure communication.
238
- * @param lhsHandle The handle to compute on
239
- * @param op The operation to perform
240
- * @param rhsPlaintext The plaintext to compute with
241
- * @param allowanceVoucherWithSig The signed allowance voucher, obtained from
242
- * `grantSessionKeyAllowanceVoucher`, proving the session key's compute rights.
243
- * @param backoffConfig Optional configuration for retry and backoff strategy.
265
+ * @param handles - The handles to decrypt
266
+ * @param backoffConfig - The backoff configuration for the attested decrypt request
267
+ * @returns The decryption attestations
244
268
  *
245
- * @returns A promise that resolves to a compute attestation.
269
+ * @example
270
+ * ```typescript
271
+ * const response = await lightning.attestedReveal([handle1, handle2]);
272
+ * const { plaintext, covalidatorSignature } = response[0];
273
+ * ```
246
274
  */
247
- attestedCompute(ephemeralKeypair: Secp256k1Keypair, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, allowanceVoucherWithSig: AllowanceVoucherWithSig, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
275
+ attestedReveal(handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
248
276
  /**
249
277
  * Get the GRPC endpoint for the covalidator that services this deployment.
250
278
  */
251
- static getCovalidatorUrl(deployment: DeploymentSlice & {
279
+ static getCovalidatorUrls(deployment: DeploymentSlice & {
252
280
  pepper: string;
253
- }): string;
281
+ }, threshold: number): string[];
254
282
  private static isIdByName;
255
283
  private static plaintextFromValue;
284
+ private static getContractThresholdAndSigners;
285
+ private static getThresholdAndSigners;
286
+ private static supportsThresholdRetrieval;
287
+ private static getDefaultThresholdAndSigners;
256
288
  }
257
289
  export {};