@inco/js 0.6.9 → 0.7.1

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 (115) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/advancedacl/session-key.d.ts +39 -26
  3. package/dist/cjs/advancedacl/session-key.js +53 -136
  4. package/dist/cjs/attestedcompute/attested-compute.d.ts +6 -6
  5. package/dist/cjs/attestedcompute/attested-compute.js +5 -35
  6. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +36 -21
  7. package/dist/cjs/attesteddecrypt/attested-decrypt.js +107 -108
  8. package/dist/cjs/attesteddecrypt/types.d.ts +4 -4
  9. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  10. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  11. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
  12. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -4
  13. package/dist/cjs/generated/lightning.d.ts +40 -0
  14. package/dist/cjs/generated/lightning.js +43 -1
  15. package/dist/cjs/generated/local-node.d.ts +11 -7
  16. package/dist/cjs/generated/local-node.js +28 -8
  17. package/dist/cjs/kms/client.d.ts +8 -4
  18. package/dist/cjs/kms/client.js +9 -4
  19. package/dist/cjs/kms/quorumClient.d.ts +58 -0
  20. package/dist/cjs/kms/quorumClient.js +378 -0
  21. package/dist/cjs/kms/thresholdPromises.d.ts +7 -0
  22. package/dist/cjs/kms/thresholdPromises.js +52 -0
  23. package/dist/cjs/lite/ecies.d.ts +2 -0
  24. package/dist/cjs/lite/ecies.js +5 -2
  25. package/dist/cjs/lite/index.d.ts +0 -1
  26. package/dist/cjs/lite/index.js +1 -2
  27. package/dist/cjs/lite/lightning.d.ts +110 -74
  28. package/dist/cjs/lite/lightning.js +272 -127
  29. package/dist/cjs/local/local-node.d.ts +1 -2
  30. package/dist/cjs/local/local-node.js +2 -3
  31. package/dist/cjs/test/mocks.d.ts +3 -0
  32. package/dist/cjs/test/mocks.js +19 -1
  33. package/dist/cjs/viem.d.ts +2 -4
  34. package/dist/cjs/viem.js +6 -2
  35. package/dist/esm/advancedacl/session-key.d.ts +39 -26
  36. package/dist/esm/advancedacl/session-key.js +44 -126
  37. package/dist/esm/attestedcompute/attested-compute.d.ts +6 -6
  38. package/dist/esm/attestedcompute/attested-compute.js +6 -36
  39. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +36 -21
  40. package/dist/esm/attesteddecrypt/attested-decrypt.js +106 -108
  41. package/dist/esm/attesteddecrypt/types.d.ts +4 -4
  42. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  43. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  44. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
  45. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +2 -3
  46. package/dist/esm/generated/lightning.d.ts +40 -0
  47. package/dist/esm/generated/lightning.js +43 -1
  48. package/dist/esm/generated/local-node.d.ts +11 -7
  49. package/dist/esm/generated/local-node.js +28 -8
  50. package/dist/esm/kms/client.d.ts +8 -4
  51. package/dist/esm/kms/client.js +8 -4
  52. package/dist/esm/kms/quorumClient.d.ts +58 -0
  53. package/dist/esm/kms/quorumClient.js +374 -0
  54. package/dist/esm/kms/thresholdPromises.d.ts +7 -0
  55. package/dist/esm/kms/thresholdPromises.js +49 -0
  56. package/dist/esm/lite/ecies.d.ts +2 -0
  57. package/dist/esm/lite/ecies.js +4 -2
  58. package/dist/esm/lite/index.d.ts +0 -1
  59. package/dist/esm/lite/index.js +1 -2
  60. package/dist/esm/lite/lightning.d.ts +110 -74
  61. package/dist/esm/lite/lightning.js +276 -131
  62. package/dist/esm/local/local-node.d.ts +1 -2
  63. package/dist/esm/local/local-node.js +2 -3
  64. package/dist/esm/test/mocks.d.ts +3 -0
  65. package/dist/esm/test/mocks.js +17 -1
  66. package/dist/esm/viem.d.ts +2 -4
  67. package/dist/esm/viem.js +6 -2
  68. package/dist/types/advancedacl/session-key.d.ts +39 -26
  69. package/dist/types/attestedcompute/attested-compute.d.ts +6 -6
  70. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +36 -21
  71. package/dist/types/attesteddecrypt/types.d.ts +4 -4
  72. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  73. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
  74. package/dist/types/generated/lightning.d.ts +40 -0
  75. package/dist/types/generated/local-node.d.ts +11 -7
  76. package/dist/types/kms/client.d.ts +8 -4
  77. package/dist/types/kms/quorumClient.d.ts +58 -0
  78. package/dist/types/kms/thresholdPromises.d.ts +7 -0
  79. package/dist/types/lite/ecies.d.ts +2 -0
  80. package/dist/types/lite/index.d.ts +0 -1
  81. package/dist/types/lite/lightning.d.ts +110 -74
  82. package/dist/types/local/local-node.d.ts +1 -2
  83. package/dist/types/test/mocks.d.ts +3 -0
  84. package/dist/types/viem.d.ts +2 -4
  85. package/package.json +6 -3
  86. package/dist/cjs/attestedreveal/attested-reveal.d.ts +0 -21
  87. package/dist/cjs/attestedreveal/attested-reveal.js +0 -69
  88. package/dist/cjs/attestedreveal/index.d.ts +0 -1
  89. package/dist/cjs/attestedreveal/index.js +0 -18
  90. package/dist/cjs/attestedreveal/types.d.ts +0 -7
  91. package/dist/cjs/attestedreveal/types.js +0 -16
  92. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  93. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +0 -118
  94. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  95. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +0 -136
  96. package/dist/cjs/lite/reencrypt.d.ts +0 -21
  97. package/dist/cjs/lite/reencrypt.js +0 -141
  98. package/dist/esm/attestedreveal/attested-reveal.d.ts +0 -21
  99. package/dist/esm/attestedreveal/attested-reveal.js +0 -66
  100. package/dist/esm/attestedreveal/index.d.ts +0 -1
  101. package/dist/esm/attestedreveal/index.js +0 -2
  102. package/dist/esm/attestedreveal/types.d.ts +0 -7
  103. package/dist/esm/attestedreveal/types.js +0 -12
  104. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  105. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +0 -115
  106. package/dist/esm/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  107. package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +0 -133
  108. package/dist/esm/lite/reencrypt.d.ts +0 -21
  109. package/dist/esm/lite/reencrypt.js +0 -131
  110. package/dist/types/attestedreveal/attested-reveal.d.ts +0 -21
  111. package/dist/types/attestedreveal/index.d.ts +0 -1
  112. package/dist/types/attestedreveal/types.d.ts +0 -7
  113. package/dist/types/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  114. package/dist/types/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  115. package/dist/types/lite/reencrypt.d.ts +0 -21
@@ -5,13 +5,12 @@ export const LocalNodeEnv = Schema.Struct({
5
5
  STATE_DUMP: Schema.String,
6
6
  EXECUTOR_ADDRESS: Address,
7
7
  ECIES_PUBLIC_KEY: HexString,
8
- CALLBACK_ADDRESS: HexString,
9
8
  SENDER_ADDRESS: Address,
10
9
  SENDER_PRIVATE_KEY: HexString,
10
+ EIP712_SIGNER_ADDRESS: Schema.optional(HexString),
11
11
  PEPPER: Schema.String,
12
12
  COVALIDATOR_ECIES_PRIVATE_KEY: HexString,
13
13
  COVALIDATOR_EIP712_PRIVATE_SIGNING_KEY: HexString,
14
- COVALIDATOR_CALLBACK_PRIVATE_KEY: HexString,
15
14
  COVALIDATOR_ACL_ADDR: Address,
16
15
  COVALIDATOR_INCO_EXECUTOR_ADDR: Address,
17
16
  COVALIDATOR_DECRYPTION_HANDLER_ADDR: Address,
@@ -57,4 +56,4 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BRUQsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIn0=
@@ -1,6 +1,7 @@
1
1
  import { Account, Chain, Transport, WalletClient } from 'viem';
2
2
  import { vi } from 'vitest';
3
3
  import { KmsClient } from '../kms/client.js';
4
+ import { KmsQuorumClient } from '../kms/quorumClient.js';
4
5
  interface MinimalKmsClient {
5
6
  attestedCompute: ReturnType<typeof vi.fn>;
6
7
  attestedDecrypt: ReturnType<typeof vi.fn>;
@@ -8,5 +9,7 @@ interface MinimalKmsClient {
8
9
  reencrypt: ReturnType<typeof vi.fn>;
9
10
  }
10
11
  export declare function createMockKmsClient(): MinimalKmsClient & KmsClient;
12
+ export declare function createMockQuorumClient(): KmsQuorumClient;
13
+ export declare function setupMockInQuorumClient(quorumClient: KmsQuorumClient, mockKmsClient: MinimalKmsClient & KmsClient): void;
11
14
  export declare function createTestWalletClient(): WalletClient<Transport, Chain, Account>;
12
15
  export {};
@@ -2,6 +2,8 @@ import { createWalletClient, http, } from 'viem';
2
2
  import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
3
3
  import { sepolia } from 'viem/chains';
4
4
  import { vi } from 'vitest';
5
+ import { DEFAULT_COVALIDATOR_SIGNER } from '../kms/client.js';
6
+ import { KmsQuorumClient } from '../kms/quorumClient.js';
5
7
  // Create a mock that satisfies our minimal interface
6
8
  export function createMockKmsClient() {
7
9
  return {
@@ -11,6 +13,20 @@ export function createMockKmsClient() {
11
13
  reencrypt: vi.fn(),
12
14
  };
13
15
  }
16
+ // Create a mock KmsQuorumClient from a mock KmsClient for testing
17
+ export function createMockQuorumClient() {
18
+ // Use the private constructor via type casting (similar to quorumClient.test.ts)
19
+ const AnyClass = KmsQuorumClient;
20
+ return new AnyClass([{ url: 'https://mock-kms', signer: DEFAULT_COVALIDATOR_SIGNER }], 1);
21
+ }
22
+ // Helper to set up the mock client inside the quorum client
23
+ export function setupMockInQuorumClient(quorumClient, mockKmsClient) {
24
+ // Access private kmss array and replace the client
25
+ const anyQuorumClient = quorumClient;
26
+ if (anyQuorumClient.kmss && anyQuorumClient.kmss.length > 0) {
27
+ anyQuorumClient.kmss[0].client = mockKmsClient;
28
+ }
29
+ }
14
30
  // Create a real wallet client for testing
15
31
  export function createTestWalletClient() {
16
32
  const account = privateKeyToAccount(generatePrivateKey());
@@ -20,4 +36,4 @@ export function createTestWalletClient() {
20
36
  account,
21
37
  });
22
38
  }
23
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ja3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVzdC9tb2Nrcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBR0wsa0JBQWtCLEVBQ2xCLElBQUksR0FHTCxNQUFNLE1BQU0sQ0FBQztBQUNkLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN4RSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3RDLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFZNUIscURBQXFEO0FBQ3JELE1BQU0sVUFBVSxtQkFBbUI7SUFDakMsT0FBTztRQUNMLGVBQWUsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ3hCLGVBQWUsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ3hCLEdBQUcsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ1osU0FBUyxFQUFFLEVBQUUsQ0FBQyxFQUFFLEVBQUU7S0FDYSxDQUFDO0FBQ3BDLENBQUM7QUFFRCwwQ0FBMEM7QUFDMUMsTUFBTSxVQUFVLHNCQUFzQjtJQUtwQyxNQUFNLE9BQU8sR0FBRyxtQkFBbUIsQ0FBQyxrQkFBa0IsRUFBRSxDQUFDLENBQUM7SUFDMUQ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EMsaUZBQWlGO0lBQ2pGLE1BQU0sUUFBUSxHQUFRLGVBQWUsQ0FBQztJQUN0QyxPQUFPLElBQUksUUFBUSxDQUNqQixDQUFDLEVBQUUsR0FBRyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sRUFBRSwwQkFBMEIsRUFBRSxDQUFDLEVBQ2pFLENBQUMsQ0FDRixDQUFDO0FBQ0osQ0FBQztBQUVELDREQUE0RDtBQUM1RCxNQUFNLFVBQVUsdUJBQXVCLENBQ3JDLFlBQTZCLEVBQzdCLGFBQTJDO0lBRTNDLG1EQUFtRDtJQUNuRCxNQUFNLGVBQWUsR0FBRyxZQUFtQixDQUFDO0lBQzVDLElBQUksZUFBZSxDQUFDLElBQUksSUFBSSxlQUFlLENBQUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQztRQUM1RCxlQUFlLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sR0FBRyxhQUFhLENBQUM7SUFDakQsQ0FBQztBQUNILENBQUM7QUFFRCwwQ0FBMEM7QUFDMUMsTUFBTSxVQUFVLHNCQUFzQjtJQUtwQyxNQUFNLE9BQU8sR0FBRyxtQkFBbUIsQ0FBQyxrQkFBa0IsRUFBRSxDQUFDLENBQUM7SUFDMUQsT0FBTyxrQkFBa0IsQ0FBQztRQUN4QixLQUFLLEVBQUUsT0FBTyxFQUFFLHdDQUF3QztRQUN4RCxTQUFTLEVBQUUsSUFBSSxDQUFDLGdCQUFnQixDQUFDO1FBQ2pDLE9BQU87S0FDUixDQUFDLENBQUM7QUFDTCxDQUFDIn0=
@@ -1,3 +1,4 @@
1
+ import { Chain } from 'viem';
1
2
  import { Chainish } from './chain.js';
2
3
  export declare const chains: {
3
4
  sepolia: {
@@ -777,7 +778,4 @@ export declare const chains: {
777
778
  readonly network: "worldchain-sepolia";
778
779
  };
779
780
  };
780
- type ChainName = keyof typeof chains;
781
- export type ViemChain = (typeof chains)[ChainName];
782
- export declare function getViemChain(chainish: Chainish): ViemChain;
783
- export {};
781
+ export declare function getViemChain(chainish: Chainish): Chain;
package/dist/esm/viem.js CHANGED
@@ -10,6 +10,10 @@ export const chains = {
10
10
  };
11
11
  export function getViemChain(chainish) {
12
12
  const { name } = getSupportedChain(chainish);
13
- return chains[name];
13
+ const chain = chains[name];
14
+ if (!chain) {
15
+ throw new Error(`Unable to get viem chain: ${name}`);
16
+ }
17
+ return chain;
14
18
  }
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmllbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92aWVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLEVBQ0wsV0FBVyxFQUNYLFlBQVksRUFDWixhQUFhLEVBQ2IsT0FBTyxFQUNQLGlCQUFpQixHQUNsQixNQUFNLGFBQWEsQ0FBQztBQUNyQixPQUFPLEVBQVksaUJBQWlCLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFekQsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHO0lBQ3BCLE9BQU87SUFDUCxXQUFXO0lBQ1gsWUFBWTtJQUNaLGFBQWE7SUFDYixLQUFLO0lBQ0wsaUJBQWlCO0NBQ2xCLENBQUM7QUFNRixNQUFNLFVBQVUsWUFBWSxDQUFDLFFBQWtCO0lBQzdDLE1BQU0sRUFBRSxJQUFJLEVBQUUsR0FBRyxpQkFBaUIsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUM3QyxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUN0QixDQUFDIn0=
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmllbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92aWVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFDTCxLQUFLLEVBQ0wsV0FBVyxFQUNYLFlBQVksRUFDWixhQUFhLEVBQ2IsT0FBTyxFQUNQLGlCQUFpQixHQUNsQixNQUFNLGFBQWEsQ0FBQztBQUNyQixPQUFPLEVBQVksaUJBQWlCLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFekQsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHO0lBQ3BCLE9BQU87SUFDUCxXQUFXO0lBQ1gsWUFBWTtJQUNaLGFBQWE7SUFDYixLQUFLO0lBQ0wsaUJBQWlCO0NBQ2xCLENBQUM7QUFFRixNQUFNLFVBQVUsWUFBWSxDQUFDLFFBQWtCO0lBQzdDLE1BQU0sRUFBRSxJQUFJLEVBQUUsR0FBRyxpQkFBaUIsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUM3QyxNQUFNLEtBQUssR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDM0IsSUFBSSxDQUFDLEtBQUssRUFBRSxDQUFDO1FBQ1gsTUFBTSxJQUFJLEtBQUssQ0FBQyw2QkFBNkIsSUFBSSxFQUFFLENBQUMsQ0FBQztJQUN2RCxDQUFDO0lBQ0QsT0FBTyxLQUFLLENBQUM7QUFDZixDQUFDIn0=
@@ -1,14 +1,13 @@
1
- import type { Client } from '@connectrpc/connect';
2
1
  import { type Account, type Address, type Chain, type Hex, type Transport, type WalletClient } from 'viem';
3
- import { DecryptionAttestation } from '../attesteddecrypt/index.js';
2
+ import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/index.js';
4
3
  import { SupportedChainId } from '../chain.js';
5
4
  import { type EciesScheme, SupportedFheType } from '../encryption/encryption.js';
6
5
  import { HexString } from '../index.js';
7
- import type { KmsService, Secp256k1Keypair } from '../lite/index.js';
8
- import { type ReencryptFnArgs } from '../reencryption/index.js';
6
+ import type { Secp256k1Keypair } from '../lite/index.js';
9
7
  import { BackoffConfig } from '../retry.js';
10
8
  import type { AllowanceVoucher, AllowanceVoucherWithSig } from './types.js';
11
9
  import { AttestedComputeOP } from '../attestedcompute/types.js';
10
+ import { KmsQuorumClient } from '../kms/quorumClient.js';
12
11
  export interface Session {
13
12
  decrypter: Address;
14
13
  expiresAt: bigint;
@@ -23,42 +22,56 @@ export interface GrantSessionKeyArgs {
23
22
  expiresAt: Date;
24
23
  }
25
24
  export declare function grantSessionKey({ chainId, incoLiteAddress, sessionVerifierContractAddress, granteeAddress, sharerWalletClient, expiresAt, }: GrantSessionKeyArgs): Promise<AllowanceVoucherWithSig>;
26
- export interface SessionKeyReencryptorArgs {
27
- chainId: bigint;
28
- ephemeralKeypair: Secp256k1Keypair;
29
- kmsConnectRpcEndpointOrClient: string | Client<typeof KmsService>;
30
- allowanceVoucherWithSig: AllowanceVoucherWithSig;
31
- }
32
- /**
33
- * The sessionKeyReencryptor function is a reencryptor that uses a session key
34
- * to reencrypt data.
35
- *
36
- */
37
- export declare function sessionKeyReencryptor({ chainId, kmsConnectRpcEndpointOrClient, ephemeralKeypair, allowanceVoucherWithSig, }: SessionKeyReencryptorArgs): Promise<(<T extends SupportedFheType>({ handle, }: ReencryptFnArgs<EciesScheme, T>) => Promise<import("../encryption/encryption.js").PlaintextOf<1, 0 | 5 | 7 | 8>>)>;
38
25
  export declare function updateActiveVouchersSessionNonce(incoLiteAddress: Address, sharerWalletClient: WalletClient<Transport, Chain, Account>): Promise<`0x${string}`>;
39
26
  export interface SessionKeyAttestedComputeArgs {
40
27
  chainId: SupportedChainId;
41
28
  ephemeralKeypair: Secp256k1Keypair;
42
- kmsConnectRpcEndpointOrClient: string | Client<typeof KmsService>;
29
+ kmsQuorumClient: KmsQuorumClient;
43
30
  allowanceVoucherWithSig: AllowanceVoucherWithSig;
44
31
  lhsHandle: HexString;
45
32
  op: AttestedComputeOP;
46
33
  rhsPlaintext: bigint | boolean;
47
34
  backoffConfig?: Partial<BackoffConfig> | undefined;
48
35
  }
49
- export declare function sessionKeyAttestedCompute<T extends SupportedFheType>({ lhsHandle, op, rhsPlaintext, backoffConfig, chainId, kmsConnectRpcEndpointOrClient, ephemeralKeypair, allowanceVoucherWithSig, }: SessionKeyAttestedComputeArgs): Promise<{
50
- handle: HexString;
51
- plaintext: import("../encryption/encryption.js").PlaintextOf<1, T>;
52
- covalidatorSignature: Uint8Array<ArrayBufferLike>;
53
- }>;
36
+ export declare function sessionKeyAttestedCompute<T extends SupportedFheType>({ lhsHandle, op, rhsPlaintext, backoffConfig, chainId, kmsQuorumClient, ephemeralKeypair, allowanceVoucherWithSig, }: SessionKeyAttestedComputeArgs): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
54
37
  export interface SessionKeyAttestedDecryptArgs {
55
38
  chainId: SupportedChainId;
56
39
  ephemeralKeypair: Secp256k1Keypair;
57
- kmsConnectRpcEndpointOrClient: string | Client<typeof KmsService>;
40
+ kmsQuorumClient: KmsQuorumClient;
58
41
  allowanceVoucherWithSig: AllowanceVoucherWithSig;
59
42
  handles: HexString[];
60
43
  backoffConfig?: Partial<BackoffConfig> | undefined;
61
- reencryptPubKey?: Uint8Array;
62
- reencryptKeypair?: Secp256k1Keypair;
44
+ reencryptPubKey?: Uint8Array | undefined;
45
+ reencryptKeypair?: Secp256k1Keypair | undefined;
63
46
  }
64
- export declare function sessionKeyAttestedDecrypt({ chainId, kmsConnectRpcEndpointOrClient, handles, ephemeralKeypair, allowanceVoucherWithSig, backoffConfig, reencryptPubKey, reencryptKeypair, }: SessionKeyAttestedDecryptArgs): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
47
+ /**
48
+ * Performs attested decrypts using a voucher-backed session key.
49
+ *
50
+ * @example Plaintext results
51
+ * ```ts
52
+ * const attestations = await sessionKeyAttestedDecrypt({
53
+ * chainId,
54
+ * kmsConnectRpcEndpointOrClient: covalidatorUrl,
55
+ * allowanceVoucherWithSig: voucher,
56
+ * ephemeralKeypair,
57
+ * handles,
58
+ * });
59
+ * console.log(attestations[0].plaintext.value);
60
+ * ```
61
+ *
62
+ * @example Encrypted results
63
+ * ```ts
64
+ * const encryptedResults = await sessionKeyAttestedDecrypt({
65
+ * chainId,
66
+ * kmsConnectRpcEndpointOrClient: covalidatorUrl,
67
+ * allowanceVoucherWithSig: voucher,
68
+ * ephemeralKeypair,
69
+ * handles,
70
+ * reencryptPubKey: recipientPubKey,
71
+ * });
72
+ * console.log(
73
+ * encryptedResults[0].encryptedPlaintext.ciphertext.value,
74
+ * );
75
+ * ```
76
+ */
77
+ export declare function sessionKeyAttestedDecrypt({ chainId, kmsQuorumClient, handles, ephemeralKeypair, allowanceVoucherWithSig, backoffConfig, reencryptPubKey, reencryptKeypair, }: SessionKeyAttestedDecryptArgs): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType> | EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
@@ -3,19 +3,19 @@ import { DecryptionAttestation } from '../attesteddecrypt/types.js';
3
3
  import { HexString } from '../binary.js';
4
4
  import { SupportedChainId } from '../chain.js';
5
5
  import { EciesScheme, SupportedFheType } from '../encryption/encryption.js';
6
- import type { KmsClient } from '../kms/client.js';
6
+ import { KmsQuorumClient } from '../kms/quorumClient.js';
7
7
  import type { BackoffConfig } from '../retry.js';
8
8
  import { AttestedComputeOP } from './types.js';
9
9
  export declare const ATTESTED_COMPUTE_DOMAIN_NAME = "IncoAttestedCompute";
10
- export declare const ATTESTED_COMPUTE_DOMAIN_VERSION = "0.1.0";
10
+ export declare const ATTESTED_COMPUTE_DOMAIN_VERSION = "1";
11
11
  /**
12
12
  * Arguments for creating an attested compute.
13
13
  */
14
14
  export interface IncoLiteAttestedComputeArgs {
15
15
  /** The wallet used to interact with the blockchain and sign the compute request */
16
16
  walletClient: WalletClient<Transport, Chain, Account>;
17
- /** The KMS connect RPC endpoint or client instance */
18
- kmsConnectRpcEndpointOrClient?: string | KmsClient;
17
+ /** The KMS quorum client instance */
18
+ kmsQuorumClient: KmsQuorumClient;
19
19
  /** The chain ID to use */
20
20
  chainId: SupportedChainId;
21
21
  }
@@ -27,12 +27,12 @@ export interface IncoLiteAttestedComputeArgs {
27
27
  *
28
28
  * @todo Support multiple operations in a single request.
29
29
  */
30
- export declare function attestedCompute<T extends SupportedFheType>({ lhsHandle, op, rhsPlaintext, backoffConfig, walletClient, kmsConnectRpcEndpointOrClient, chainId, }: {
30
+ export declare function attestedCompute<T extends SupportedFheType>({ lhsHandle, op, rhsPlaintext, backoffConfig, walletClient, kmsQuorumClient, chainId, }: {
31
31
  lhsHandle: HexString;
32
32
  op: AttestedComputeOP;
33
33
  rhsPlaintext: bigint | boolean;
34
34
  backoffConfig?: Partial<BackoffConfig> | undefined;
35
35
  walletClient: WalletClient<Transport, Chain, Account>;
36
- kmsConnectRpcEndpointOrClient?: string | KmsClient;
36
+ kmsQuorumClient: KmsQuorumClient;
37
37
  chainId: SupportedChainId;
38
38
  }): Promise<DecryptionAttestation<EciesScheme, T>>;
@@ -1,30 +1,38 @@
1
1
  import type { Account, Chain, Transport, WalletClient } from 'viem';
2
- import { HexString } from '../binary.js';
3
- import { SupportedChainId } from '../chain.js';
4
- import { EciesScheme, SupportedFheType } from '../encryption/encryption.js';
5
- import type { KmsClient } from '../kms/client.js';
6
- import { Secp256k1Keypair } from '../lite/ecies.js';
2
+ import { type HexString } from '../binary.js';
3
+ import { type SupportedChainId } from '../chain.js';
4
+ import { type EciesScheme, type SupportedFheType } from '../encryption/encryption.js';
5
+ import { KmsQuorumClient } from '../kms/quorumClient.js';
6
+ import type { Secp256k1Keypair } from '../lite/ecies.js';
7
7
  import type { BackoffConfig } from '../retry.js';
8
- import { DecryptionAttestation, EncryptedDecryptionAttestation } from './types.js';
8
+ import { type DecryptionAttestation, type EncryptedDecryptionAttestation } from './types.js';
9
9
  export declare const ATTESTED_DECRYPT_DOMAIN_NAME = "IncoAttestedDecrypt";
10
- export declare const ATTESTED_DECRYPT_DOMAIN_VERSION = "0.1.0";
11
- /**
12
- * Validates a handle format.
13
- * @param handle - The handle to validate
14
- * @throws {AttestedDecryptError} If the handle format is invalid
15
- */
16
- export declare function validateHandle(handle: HexString): void;
10
+ export declare const ATTESTED_DECRYPT_DOMAIN_VERSION = "1";
17
11
  /**
18
12
  * Arguments for creating an attested decrypt request.
19
13
  */
20
14
  export interface IncoLiteAttestedDecryptorArgs {
21
15
  /** The wallet used to interact with the blockchain and sign the decrypt request */
22
16
  walletClient: WalletClient<Transport, Chain, Account>;
23
- /** The KMS connect RPC endpoint or client instance */
24
- kmsConnectRpcEndpointOrClient?: string | KmsClient;
17
+ /** The KMS quorum client instance */
18
+ kmsQuorumClient: KmsQuorumClient;
25
19
  /** The chain ID to use */
26
20
  chainId: SupportedChainId;
27
21
  }
22
+ /**
23
+ * Decrypt multiple handles in a single attested request without wallet authentication.
24
+ * Returns an array of attestations aligned with the response ordering.
25
+ *
26
+ * @param args - The arguments for creating the attested decrypt function
27
+ * @returns A function that can decrypt handles and return an attestation
28
+ * @throws {AttestedDecryptError} If the creation fails
29
+ */
30
+ export declare function attestedDecrypt({ handles, backoffConfig, chainId, kmsQuorumClient, }: {
31
+ handles: HexString[];
32
+ backoffConfig?: Partial<BackoffConfig> | undefined;
33
+ chainId: SupportedChainId;
34
+ kmsQuorumClient: KmsQuorumClient;
35
+ }): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
28
36
  /**
29
37
  * Decrypt multiple handles in a single attested request.
30
38
  * Returns an array of attestations aligned with the response ordering.
@@ -33,14 +41,14 @@ export interface IncoLiteAttestedDecryptorArgs {
33
41
  * @returns A function that can decrypt handles and return an attestation
34
42
  * @throws {AttestedDecryptError} If the creation fails
35
43
  */
36
- export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, reencryptPubKey, reencryptKeypair, kmsConnectRpcEndpointOrClient, }: {
44
+ export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, reencryptPubKey, reencryptKeypair, kmsQuorumClient, }: {
37
45
  handles: HexString[];
38
46
  backoffConfig?: Partial<BackoffConfig> | undefined;
39
47
  walletClient: WalletClient<Transport, Chain, Account>;
40
48
  chainId: SupportedChainId;
41
49
  reencryptPubKey: Uint8Array;
42
50
  reencryptKeypair: Secp256k1Keypair;
43
- kmsConnectRpcEndpointOrClient?: string | KmsClient;
51
+ kmsQuorumClient: KmsQuorumClient;
44
52
  }): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
45
53
  /**
46
54
  * Decrypt multiple handles in a single attested request.
@@ -50,14 +58,14 @@ export declare function attestedDecrypt({ handles, backoffConfig, walletClient,
50
58
  * @returns A function that can decrypt handles and return an attestation
51
59
  * @throws {AttestedDecryptError} If the creation fails
52
60
  */
53
- export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, reencryptPubKey, kmsConnectRpcEndpointOrClient, }: {
61
+ export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, reencryptPubKey, kmsQuorumClient, }: {
54
62
  handles: HexString[];
55
63
  backoffConfig?: Partial<BackoffConfig> | undefined;
56
64
  walletClient: WalletClient<Transport, Chain, Account>;
57
65
  chainId: SupportedChainId;
58
66
  reencryptPubKey: Uint8Array;
59
67
  reencryptKeypair?: never;
60
- kmsConnectRpcEndpointOrClient?: string | KmsClient;
68
+ kmsQuorumClient: KmsQuorumClient;
61
69
  }): Promise<Array<EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
62
70
  /**
63
71
  * Decrypt multiple handles in a single attested request.
@@ -67,12 +75,19 @@ export declare function attestedDecrypt({ handles, backoffConfig, walletClient,
67
75
  * @returns A function that can decrypt handles and return an attestation
68
76
  * @throws {AttestedDecryptError} If the creation fails
69
77
  */
70
- export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, kmsConnectRpcEndpointOrClient, }: {
78
+ export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, kmsQuorumClient, }: {
71
79
  handles: HexString[];
72
80
  backoffConfig?: Partial<BackoffConfig> | undefined;
73
81
  walletClient: WalletClient<Transport, Chain, Account>;
74
82
  chainId: SupportedChainId;
75
83
  reencryptPubKey?: never;
76
84
  reencryptKeypair?: never;
77
- kmsConnectRpcEndpointOrClient?: string | KmsClient;
85
+ kmsQuorumClient: KmsQuorumClient;
78
86
  }): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
87
+ export declare function decryptEncryptedAttestations(attestations: Array<DecryptionAttestation<EciesScheme, SupportedFheType> | EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>, reencryptKeypair: Secp256k1Keypair): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
88
+ /**
89
+ * Validates a handle format.
90
+ * @param handle - The handle to validate
91
+ * @throws {AttestedDecryptError} If the handle format is invalid
92
+ */
93
+ export declare function validateHandle(handle: HexString): void;
@@ -1,5 +1,5 @@
1
- import { HexString } from '../binary.js';
2
- import { EncryptionScheme, EncryptResultOf, PlaintextOf, SupportedFheType } from '../encryption/encryption.js';
1
+ import type { HexString } from '../binary.js';
2
+ import type { EncryptionScheme, EncryptResultOf, PlaintextOf, SupportedFheType } from '../encryption/encryption.js';
3
3
  import type { BackoffConfig } from '../retry.js';
4
4
  /**
5
5
  * Custom error class for attested decrypt operations.
@@ -11,12 +11,12 @@ export declare class AttestedDecryptError extends Error {
11
11
  export type DecryptionAttestation<S extends EncryptionScheme, T extends SupportedFheType> = {
12
12
  handle: HexString;
13
13
  plaintext: PlaintextOf<S, T>;
14
- covalidatorSignature: Uint8Array;
14
+ covalidatorSignatures: Uint8Array[];
15
15
  };
16
16
  export type EncryptedDecryptionAttestation<S extends EncryptionScheme, T extends SupportedFheType> = {
17
17
  handle: HexString;
18
18
  encryptedPlaintext: EncryptResultOf<S, T>;
19
- covalidatorSignature: Uint8Array;
19
+ covalidatorSignatures: Uint8Array[];
20
20
  };
21
21
  export type AttestedDecryptor<S extends EncryptionScheme> = <T extends SupportedFheType>(args: AttestedDecryptFnArgs<S, T>) => Promise<DecryptionAttestation<S, T>>;
22
22
  export type AttestedDecryptFnArgs<S extends EncryptionScheme, T extends SupportedFheType> = {
@@ -118,7 +118,21 @@ export declare const AnyValueSchema: GenMessage<AnyValue>;
118
118
  */
119
119
  export type Scalar = Message<"inco.covalidator.compute.v1.Scalar"> & {
120
120
  /**
121
- * The type of the scalar
121
+ * The type of the scalar.
122
+ *
123
+ * The possible values are:
124
+ * Bool = 0
125
+ * Uint4 = 1
126
+ * Uint8 = 2
127
+ * Uint16 = 3
128
+ * Uint32 = 4
129
+ * Uint64 = 5
130
+ * Uint128 = 6
131
+ * Uint160 = 7
132
+ * Uint256 = 8
133
+ * Bytes64 = 9
134
+ * Bytes128 = 10
135
+ * Bytes256 = 11
122
136
  *
123
137
  * @generated from field: int32 type = 1;
124
138
  */
@@ -1,5 +1,4 @@
1
1
  import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
- import type { TypedCiphertext } from "../../../fhe/v1/types_pb";
3
2
  import type { ACLProof, ECIESKeyset, HandleWithProof } from "./types_pb";
4
3
  import type { Message } from "@bufbuild/protobuf";
5
4
  /**
@@ -88,7 +87,7 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
88
87
  * "primaryType": "AttestedDecryptRequest",
89
88
  * "domain": {
90
89
  * "name": "IncoAttestedDecrypt",
91
- * "version": "0.1.0",
90
+ * "version": "1",
92
91
  * "chainId": "<host_chain_id>",
93
92
  * },
94
93
  * "message": {
@@ -169,7 +168,7 @@ export type AttestedComputeRequest = Message<"inco.kms.lite.v1.AttestedComputeRe
169
168
  * "primaryType": "AttestedComputeRequest",
170
169
  * "domain": {
171
170
  * "name": "IncoAttestedCompute",
172
- * "version": "0.1.0",
171
+ * "version": "1",
173
172
  * "chainId": "<host_chain_id>",
174
173
  * },
175
174
  * "message": {
@@ -298,9 +297,18 @@ export declare const PlaintextSchema: GenMessage<Plaintext>;
298
297
  */
299
298
  export type Reencryption = Message<"inco.kms.lite.v1.Reencryption"> & {
300
299
  /**
301
- * @generated from field: inco.fhe.v1.TypedCiphertext user_ciphertext = 1;
300
+ * The ciphertext that was reencrypted to the user's public key.
301
+ *
302
+ * @generated from field: bytes user_ciphertext = 1;
302
303
  */
303
- userCiphertext?: TypedCiphertext;
304
+ userCiphertext: Uint8Array;
305
+ /**
306
+ * The handle of the ciphertext, encoded as a 0x-prefixed hex string, any case.
307
+ * TODO scalar declaration.
308
+ *
309
+ * @generated from field: string handle = 2;
310
+ */
311
+ handle: string;
304
312
  };
305
313
  /**
306
314
  * Describes the message inco.kms.lite.v1.Reencryption.
@@ -1,4 +1,44 @@
1
1
  export declare const lightningDeployments: readonly [{
2
+ readonly name: "incoLightningPreview_2_0_0__976644394";
3
+ readonly majorVersion: 2;
4
+ readonly deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC";
5
+ readonly pepper: "alphanet";
6
+ readonly executorAddress: "0xc0d693DeEF0A91CE39208676b6da09B822abd199";
7
+ readonly salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc000822f11f6e30f933e76d2a";
8
+ readonly chainId: 84532;
9
+ readonly chainName: "Base Sepolia";
10
+ readonly version: {
11
+ readonly major: 2;
12
+ readonly minor: 0;
13
+ readonly patch: 0;
14
+ readonly shortSalt: "976644394";
15
+ };
16
+ readonly blockNumber: 34459258;
17
+ readonly deployDate: "2025-12-02T14:46:46.026Z";
18
+ readonly commit: "v0.6.9-17-g217794f3-dirty";
19
+ readonly active: true;
20
+ readonly includesPreviewFeatures: true;
21
+ }, {
22
+ readonly name: "incoLightningPreview_1_1_0__725458969";
23
+ readonly majorVersion: 1;
24
+ readonly deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC";
25
+ readonly pepper: "alphanet";
26
+ readonly executorAddress: "0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A";
27
+ readonly salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc004dfbe338c6966a22bcca19";
28
+ readonly chainId: 84532;
29
+ readonly chainName: "Base Sepolia";
30
+ readonly version: {
31
+ readonly major: 1;
32
+ readonly minor: 1;
33
+ readonly patch: 0;
34
+ readonly shortSalt: "725458969";
35
+ };
36
+ readonly blockNumber: 34456535;
37
+ readonly deployDate: "2025-12-02T13:16:00.594Z";
38
+ readonly commit: "v0.6.9-16-g428d1837-dirty";
39
+ readonly active: true;
40
+ readonly includesPreviewFeatures: true;
41
+ }, {
2
42
  readonly name: "incoLightningPreview_1_0_2__725458969";
3
43
  readonly majorVersion: 1;
4
44
  readonly deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC";
@@ -2,28 +2,32 @@ export declare const localNodeLightningConfig: {
2
2
  readonly testnet: {
3
3
  readonly executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd";
4
4
  readonly chainId: 31337;
5
- readonly covalidatorUrl: "http://localhost:50055";
5
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
6
+ readonly signers: readonly ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"];
6
7
  readonly hostChainRpcUrl: "http://localhost:8545";
7
8
  readonly senderPrivateKey: "0x78a25e2a0b5148290cc4d93ae12338dabd6ccd6dd98276514c4168dc4100df7c";
8
9
  };
9
10
  readonly devnet: {
10
11
  readonly executorAddress: "0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6";
11
12
  readonly chainId: 31337;
12
- readonly covalidatorUrl: "http://localhost:50055";
13
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
14
+ readonly signers: readonly ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"];
13
15
  readonly hostChainRpcUrl: "http://localhost:8545";
14
16
  readonly senderPrivateKey: "0x6f2539401f377d76bafd39b580e0f95b9bf7d39dec8fd3ada4abe41ad2ae1e18";
15
17
  };
16
18
  readonly alphanet: {
17
- readonly executorAddress: "0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A";
19
+ readonly executorAddress: "0xc0d693DeEF0A91CE39208676b6da09B822abd199";
18
20
  readonly chainId: 31337;
19
- readonly covalidatorUrl: "http://localhost:50055";
21
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
22
+ readonly signers: readonly ["0x8E873085348a3406A07907E5d1465B9824bA07cd"];
20
23
  readonly hostChainRpcUrl: "http://localhost:8545";
21
- readonly senderPrivateKey: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d";
24
+ readonly senderPrivateKey: "0x279c172cf3638a79642daa5f7666c600befde318550d7579cf96280920e318b6";
22
25
  };
23
26
  readonly scratch: {
24
- readonly executorAddress: "0x195ec7fDf68fD835b9F78d6eb13E280cC2e25fdD";
27
+ readonly executorAddress: "0x230b8fb0201E621Be3612ab7387d164f8AdC863f";
25
28
  readonly chainId: 31337;
26
- readonly covalidatorUrl: "http://localhost:50055";
29
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
30
+ readonly signers: readonly ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"];
27
31
  readonly hostChainRpcUrl: "http://127.0.0.1:8567";
28
32
  readonly senderPrivateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
29
33
  };
@@ -1,8 +1,12 @@
1
- import { Client } from '@connectrpc/connect';
2
- import { SupportedChain } from '../chain.js';
1
+ import { type Client } from '@connectrpc/connect';
2
+ import type { Address } from 'viem';
3
+ import type { SupportedChain } from '../chain.js';
3
4
  import { KmsService } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
4
- export type KmsClient = Client<typeof KmsService>;
5
- export declare function getKmsClient(kmsConnectRpcEndpointOrClient: string | KmsClient): KmsClient;
5
+ export declare const DEFAULT_COVALIDATOR_SIGNER: Address;
6
+ export type KmsClient = Client<typeof KmsService> & {
7
+ signerAddress: Address;
8
+ };
9
+ export declare function getKmsClient(kmsConnectRpcEndpointOrClient: string | KmsClient, signerAddress: Address): KmsClient;
6
10
  export declare function defaultCovalidatorGrpc(chain: SupportedChain): string;
7
11
  export declare function lightningDevnetCovalidatorGrpc(chain: SupportedChain): string;
8
12
  export declare function lightningTestnetCovalidatorGrpc(chain: SupportedChain): string;
@@ -0,0 +1,58 @@
1
+ import type { Address } from 'viem';
2
+ import type { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/types.js';
3
+ import type { EciesScheme, SupportedFheType } from '../encryption/encryption.js';
4
+ import type { AttestedComputeRequest, AttestedDecryptRequest, AttestedRevealRequest } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
5
+ import type { BackoffConfig } from '../retry.js';
6
+ import { type KmsClient } from './client.js';
7
+ export declare class KmsQuorumClient {
8
+ private readonly kmss;
9
+ private readonly threshold;
10
+ private constructor();
11
+ private constructor();
12
+ /**
13
+ * Creates a KmsQuorumClient from an array of URLs.
14
+ * Requires signer addresses and threshold to be explicitly provided.
15
+ *
16
+ * @param urls - Array of KMS endpoint URLs
17
+ * @param signers - Array of signer addresses, must match the length of URLs
18
+ * @param threshold - Number of successful responses required (must be between 1 and urls.length)
19
+ * @throws {Error} If URLs array is empty, signers length doesn't match URLs length, or threshold is invalid
20
+ */
21
+ static fromUrls(urls: string[], signers: Address[], threshold: number): KmsQuorumClient;
22
+ /**
23
+ * Creates a KmsQuorumClient from an array of KmsClient instances.
24
+ * Each KmsClient must have a signerAddress property.
25
+ *
26
+ * @param kmsClients - Array of KMS client instances
27
+ * @param threshold - Number of successful responses required (must be between 1 and kmsClients.length)
28
+ * @throws {Error} If KMS clients array is empty or threshold is invalid
29
+ */
30
+ static fromKmsClients(kmsClients: KmsClient[], threshold: number): KmsQuorumClient;
31
+ attestedDecrypt(request: AttestedDecryptRequest, backoffConfig?: Partial<BackoffConfig>): Promise<(DecryptionAttestation<EciesScheme, SupportedFheType> | EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>)[]>;
32
+ attestedCompute(request: AttestedComputeRequest, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
33
+ attestedReveal(request: AttestedRevealRequest, backoffConfig?: Partial<BackoffConfig>): Promise<(DecryptionAttestation<EciesScheme, SupportedFheType> | EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>)[]>;
34
+ /**
35
+ * Generic method to execute a KMS operation across all clients with retry and threshold logic.
36
+ * Returns results with both the response and signer address.
37
+ */
38
+ private executeKmsOperationWithThreshold;
39
+ /**
40
+ * Collects signatures from responses and sorts them by signer address (ascending).
41
+ * This is required by SignatureVerifier.
42
+ */
43
+ private collectAndSortSignatures;
44
+ /**
45
+ * Builds a plaintext attestation from a DecryptionAttestation proto message.
46
+ */
47
+ private buildPlaintextAttestation;
48
+ private buildAggregatedAttestations;
49
+ private buildAggregatedComputeAttestation;
50
+ private verifyResponseConsistency;
51
+ private verifyComputeResponseConsistency;
52
+ /**
53
+ * Verifies that two plaintext byte arrays are identical.
54
+ */
55
+ private verifyPlaintextBytesConsistency;
56
+ private verifyPlaintextConsistency;
57
+ private verifyCiphertextConsistency;
58
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Executes promises and returns results as soon as threshold is reached
3
+ * @param promises Array of promises to execute
4
+ * @param threshold Number of successful responses needed
5
+ * @returns Promise that resolves with threshold number of results
6
+ */
7
+ export declare function executeWithThreshold<T>(promises: Promise<T>[], threshold: number): Promise<T[]>;
@@ -1,6 +1,8 @@
1
1
  import * as ellipticPkg from 'elliptic';
2
2
  import { Decryptor, EciesScheme, Encryptor } from '../encryption/encryption.js';
3
3
  import { PubKeyEncodable } from '../reencryption/index.js';
4
+ export declare const TEST_ECIES_PUB_KEY = "0x02516bda9e68a1c3dce74dc1b6ed7d91a91d51c1e1933947f06331cef59631e9eb";
5
+ export declare const TEST_ECIES_PRIVATE_KEY = "0x384a707568ab63ad2ad9f10135faa0699801db3174f33f7846badc11affb8f57";
4
6
  export interface Secp256k1Keypair extends PubKeyEncodable {
5
7
  scheme: EciesScheme;
6
8
  kp: ellipticPkg.ec.KeyPair;