@inco/js 0.6.8 → 0.6.9

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 (88) hide show
  1. package/dist/cjs/advancedacl/session-key.d.ts +8 -1
  2. package/dist/cjs/advancedacl/session-key.js +55 -21
  3. package/dist/cjs/attestedcompute/attested-compute.js +11 -4
  4. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +38 -1
  5. package/dist/cjs/attesteddecrypt/attested-decrypt.js +49 -6
  6. package/dist/cjs/attesteddecrypt/types.d.ts +6 -1
  7. package/dist/cjs/attesteddecrypt/types.js +1 -1
  8. package/dist/cjs/attestedreveal/attested-reveal.js +9 -7
  9. package/dist/cjs/encryption/encryption.d.ts +8 -10
  10. package/dist/cjs/encryption/encryption.js +6 -6
  11. package/dist/cjs/generated/abis/add-two.d.ts +1 -1
  12. package/dist/cjs/generated/abis/add-two.js +1 -1
  13. package/dist/cjs/generated/abis/lightning-preview.d.ts +40 -0
  14. package/dist/cjs/generated/abis/lightning-preview.js +29 -1
  15. package/dist/cjs/generated/abis/lightning.d.ts +1 -1
  16. package/dist/cjs/generated/abis/lightning.js +1 -1
  17. package/dist/cjs/generated/abis/verifier.d.ts +126 -67
  18. package/dist/cjs/generated/abis/verifier.js +108 -54
  19. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  20. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +20 -25
  21. package/dist/cjs/generated/lightning.d.ts +0 -32
  22. package/dist/cjs/generated/lightning.js +1 -33
  23. package/dist/cjs/generated/local-node.d.ts +1 -5
  24. package/dist/cjs/generated/local-node.js +2 -6
  25. package/dist/cjs/lite/deployments.d.ts +20 -2
  26. package/dist/cjs/lite/deployments.js +1 -1
  27. package/dist/cjs/lite/index.d.ts +1 -1
  28. package/dist/cjs/lite/index.js +1 -1
  29. package/dist/cjs/lite/lightning.d.ts +24 -12
  30. package/dist/cjs/lite/lightning.js +62 -26
  31. package/dist/cjs/lite/reencrypt.d.ts +5 -7
  32. package/dist/cjs/lite/reencrypt.js +68 -58
  33. package/dist/cjs/test/mocks.d.ts +12 -0
  34. package/dist/cjs/test/mocks.js +27 -0
  35. package/dist/cjs/viem.d.ts +1 -1
  36. package/dist/esm/advancedacl/session-key.d.ts +8 -1
  37. package/dist/esm/advancedacl/session-key.js +58 -24
  38. package/dist/esm/attestedcompute/attested-compute.js +11 -4
  39. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +38 -1
  40. package/dist/esm/attesteddecrypt/attested-decrypt.js +51 -8
  41. package/dist/esm/attesteddecrypt/types.d.ts +6 -1
  42. package/dist/esm/attesteddecrypt/types.js +1 -1
  43. package/dist/esm/attestedreveal/attested-reveal.js +9 -7
  44. package/dist/esm/encryption/encryption.d.ts +8 -10
  45. package/dist/esm/encryption/encryption.js +6 -6
  46. package/dist/esm/generated/abis/add-two.d.ts +1 -1
  47. package/dist/esm/generated/abis/add-two.js +1 -1
  48. package/dist/esm/generated/abis/lightning-preview.d.ts +40 -0
  49. package/dist/esm/generated/abis/lightning-preview.js +29 -1
  50. package/dist/esm/generated/abis/lightning.d.ts +1 -1
  51. package/dist/esm/generated/abis/lightning.js +1 -1
  52. package/dist/esm/generated/abis/verifier.d.ts +126 -67
  53. package/dist/esm/generated/abis/verifier.js +108 -54
  54. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  55. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +19 -24
  56. package/dist/esm/generated/lightning.d.ts +0 -32
  57. package/dist/esm/generated/lightning.js +1 -33
  58. package/dist/esm/generated/local-node.d.ts +1 -5
  59. package/dist/esm/generated/local-node.js +2 -6
  60. package/dist/esm/lite/deployments.d.ts +20 -2
  61. package/dist/esm/lite/deployments.js +1 -1
  62. package/dist/esm/lite/index.d.ts +1 -1
  63. package/dist/esm/lite/index.js +1 -1
  64. package/dist/esm/lite/lightning.d.ts +24 -12
  65. package/dist/esm/lite/lightning.js +59 -23
  66. package/dist/esm/lite/reencrypt.d.ts +5 -7
  67. package/dist/esm/lite/reencrypt.js +67 -58
  68. package/dist/esm/test/mocks.d.ts +12 -0
  69. package/dist/esm/test/mocks.js +23 -0
  70. package/dist/esm/viem.d.ts +1 -1
  71. package/dist/types/advancedacl/session-key.d.ts +8 -1
  72. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +38 -1
  73. package/dist/types/attesteddecrypt/types.d.ts +6 -1
  74. package/dist/types/encryption/encryption.d.ts +8 -10
  75. package/dist/types/generated/abis/add-two.d.ts +1 -1
  76. package/dist/types/generated/abis/lightning-preview.d.ts +40 -0
  77. package/dist/types/generated/abis/lightning.d.ts +1 -1
  78. package/dist/types/generated/abis/verifier.d.ts +126 -67
  79. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  80. package/dist/types/generated/lightning.d.ts +0 -32
  81. package/dist/types/generated/local-node.d.ts +1 -5
  82. package/dist/types/lite/deployments.d.ts +20 -2
  83. package/dist/types/lite/index.d.ts +1 -1
  84. package/dist/types/lite/lightning.d.ts +24 -12
  85. package/dist/types/lite/reencrypt.d.ts +5 -7
  86. package/dist/types/test/mocks.d.ts +12 -0
  87. package/dist/types/viem.d.ts +1 -1
  88. package/package.json +2 -2
@@ -43,113 +43,6 @@ export type KeyResponse = Message<"inco.kms.lite.v1.KeyResponse"> & {
43
43
  * Use `create(KeyResponseSchema)` to create a new message.
44
44
  */
45
45
  export declare const KeyResponseSchema: GenMessage<KeyResponse>;
46
- /**
47
- * ReencryptRequest is the request type for the KmsService/Reencrypt RPC method.
48
- *
49
- * @generated from message inco.kms.lite.v1.ReencryptRequest
50
- */
51
- export type ReencryptRequest = Message<"inco.kms.lite.v1.ReencryptRequest"> & {
52
- /**
53
- * user_address is the Ethereum address of the user who requested the
54
- * reencryption, prefixed with 0x.
55
- *
56
- * @generated from field: string user_address = 1;
57
- */
58
- userAddress: string;
59
- /**
60
- * ephemeral_pub_key is the encoding of the user's public ephemeral
61
- * encryption key (secp256k1), generated by the user for this reencryption
62
- * request. It is encoded in its 33-byte compressed format.
63
- *
64
- * @generated from field: bytes ephemeral_pub_key = 2;
65
- */
66
- ephemeralPubKey: Uint8Array;
67
- /**
68
- * eip712_signature is an EIP-712 signature of the following EIP-712 typed data by
69
- * `user_address` (note that we only give a JSON representation for the sake of
70
- * readability, but the actual signed data is defined in the EIP-712 spec):
71
- *
72
- * ```json
73
- * {
74
- * "types": {
75
- * "EIP712Domain": [
76
- * { "name": "name", "type": "string" },
77
- * { "name": "version", "type": "string" },
78
- * { "name": "chainId", "type": "uint256" }
79
- * ],
80
- * "ReencryptionRequest": [
81
- * { "name": "publicKey", "type": "bytes" }
82
- * ]
83
- * },
84
- * "primaryType": "ReencryptionRequest",
85
- * "domain": {
86
- * "name": "IncoReencryption",
87
- * "version": "0.1.0",
88
- * "chainId": "<host_chain_id>",
89
- * "verifyingContract": "<acl_address>",
90
- * "salt": "0x0000000000000000000000000000000000000000000000000000000000000000"
91
- * },
92
- * "message": {
93
- * "publicKey": "<ephemeral_pub_key>"
94
- * }
95
- * }
96
- * ```
97
- *
98
- * @generated from field: bytes eip712_signature = 3;
99
- */
100
- eip712Signature: Uint8Array;
101
- /**
102
- * handles_with_proofs is the list of handles of the ciphertexts to reencrypt,
103
- * along with the ACL proof that the user has access to the ciphertext.
104
- *
105
- * @generated from field: repeated inco.kms.lite.v1.HandleWithProof handles_with_proofs = 4;
106
- */
107
- handlesWithProofs: HandleWithProof[];
108
- };
109
- /**
110
- * Describes the message inco.kms.lite.v1.ReencryptRequest.
111
- * Use `create(ReencryptRequestSchema)` to create a new message.
112
- */
113
- export declare const ReencryptRequestSchema: GenMessage<ReencryptRequest>;
114
- /**
115
- * ReencryptResponse is the response type for the KmsService/Reencrypt RPC method.
116
- *
117
- * @generated from message inco.kms.lite.v1.ReencryptResponse
118
- */
119
- export type ReencryptResponse = Message<"inco.kms.lite.v1.ReencryptResponse"> & {
120
- /**
121
- * payload is the reencryption response payload.
122
- *
123
- * @generated from field: inco.kms.lite.v1.ReencryptionResponsePayload payload = 1;
124
- */
125
- payload?: ReencryptionResponsePayload;
126
- };
127
- /**
128
- * Describes the message inco.kms.lite.v1.ReencryptResponse.
129
- * Use `create(ReencryptResponseSchema)` to create a new message.
130
- */
131
- export declare const ReencryptResponseSchema: GenMessage<ReencryptResponse>;
132
- /**
133
- * ReencryptionResponsePayload is the payload of the ReencryptResponse,
134
- * separated out because it is signed by the KMS using its signing key.
135
- *
136
- * @generated from message inco.kms.lite.v1.ReencryptionResponsePayload
137
- */
138
- export type ReencryptionResponsePayload = Message<"inco.kms.lite.v1.ReencryptionResponsePayload"> & {
139
- /**
140
- * user_ciphertexts is the list of ciphertexts that were reencrypted to the
141
- * user's public key. Each ciphertext at index `i` corresponds to the ciphertext
142
- * at index `i` in the `ReencryptRequest`.
143
- *
144
- * @generated from field: repeated inco.fhe.v1.TypedCiphertext user_ciphertexts = 1;
145
- */
146
- userCiphertexts: TypedCiphertext[];
147
- };
148
- /**
149
- * Describes the message inco.kms.lite.v1.ReencryptionResponsePayload.
150
- * Use `create(ReencryptionResponsePayloadSchema)` to create a new message.
151
- */
152
- export declare const ReencryptionResponsePayloadSchema: GenMessage<ReencryptionResponsePayload>;
153
46
  /**
154
47
  * AttestedDecryptRequest is the request type for the KmsService/AttestedDecrypt RPC method.
155
48
  *
@@ -163,10 +56,21 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
163
56
  * @generated from field: string user_address = 1;
164
57
  */
165
58
  userAddress: string;
59
+ /**
60
+ * reencrypt_pub_key is the encoding of the user's public
61
+ * encryption key (secp256k1) used to reencrypt the result for.
62
+ * It is encoded in its 33-byte compressed format.
63
+ * If empty, the KMS will return plaintext decryption instead of reencryption.
64
+ *
65
+ * @generated from field: bytes reencrypt_pub_key = 2;
66
+ */
67
+ reencryptPubKey: Uint8Array;
166
68
  /**
167
69
  * eip712_signature is an EIP-712 signature of the following EIP-712 typed data by
168
70
  * `user_address` (note that we only give a JSON representation for the sake of
169
- * readability, but the actual signed data is defined in the EIP-712 spec):
71
+ * readability, but the actual signed data is defined in the EIP-712 spec) where:
72
+ * handles - list of 0x prefixed handles to decrypt
73
+ * publicKey - 0x prefixed reencrypt_pub_key (if any). "0x" otherwise if empty.
170
74
  *
171
75
  * ```json
172
76
  * {
@@ -177,7 +81,8 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
177
81
  * { "name": "chainId", "type": "uint256" }
178
82
  * ],
179
83
  * "AttestedDecryptRequest": [
180
- * { "name": "handles", "type": "bytes32[]" }
84
+ * { "name": "handles", "type": "bytes32[]" },
85
+ * { "name": "publicKey", "type": "bytes" },
181
86
  * ]
182
87
  * },
183
88
  * "primaryType": "AttestedDecryptRequest",
@@ -187,12 +92,13 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
187
92
  * "chainId": "<host_chain_id>",
188
93
  * },
189
94
  * "message": {
190
- * "handles": ["<handle1>", "<handle2>", ...]
95
+ * "handles": ["<handle1>", "<handle2>", ...],
96
+ * "publicKey": "0x<reencrypt_pub_key>"
191
97
  * }
192
98
  * }
193
99
  * ```
194
100
  *
195
- * @generated from field: bytes eip712_signature = 2;
101
+ * @generated from field: bytes eip712_signature = 3;
196
102
  */
197
103
  eip712Signature: Uint8Array;
198
104
  /**
@@ -200,7 +106,7 @@ export type AttestedDecryptRequest = Message<"inco.kms.lite.v1.AttestedDecryptRe
200
106
  * Either the user_address or sharer must have ACL access to the handles for the attested
201
107
  * decryption to succeed.
202
108
  *
203
- * @generated from field: repeated inco.kms.lite.v1.HandleWithProof handles_with_proofs = 3;
109
+ * @generated from field: repeated inco.kms.lite.v1.HandleWithProof handles_with_proofs = 4;
204
110
  */
205
111
  handlesWithProofs: HandleWithProof[];
206
112
  };
@@ -367,6 +273,40 @@ export type AttestedComputeResponse = Message<"inco.kms.lite.v1.AttestedComputeR
367
273
  * Use `create(AttestedComputeResponseSchema)` to create a new message.
368
274
  */
369
275
  export declare const AttestedComputeResponseSchema: GenMessage<AttestedComputeResponse>;
276
+ /**
277
+ * Plaintext contains the decrypted plaintext value.
278
+ *
279
+ * @generated from message inco.kms.lite.v1.Plaintext
280
+ */
281
+ export type Plaintext = Message<"inco.kms.lite.v1.Plaintext"> & {
282
+ /**
283
+ * value is the decrypted plaintext value as a 32-byte word.
284
+ *
285
+ * @generated from field: bytes value = 1;
286
+ */
287
+ value: Uint8Array;
288
+ };
289
+ /**
290
+ * Describes the message inco.kms.lite.v1.Plaintext.
291
+ * Use `create(PlaintextSchema)` to create a new message.
292
+ */
293
+ export declare const PlaintextSchema: GenMessage<Plaintext>;
294
+ /**
295
+ * Reencryption contains the reencrypted ciphertext value.
296
+ *
297
+ * @generated from message inco.kms.lite.v1.Reencryption
298
+ */
299
+ export type Reencryption = Message<"inco.kms.lite.v1.Reencryption"> & {
300
+ /**
301
+ * @generated from field: inco.fhe.v1.TypedCiphertext user_ciphertext = 1;
302
+ */
303
+ userCiphertext?: TypedCiphertext;
304
+ };
305
+ /**
306
+ * Describes the message inco.kms.lite.v1.Reencryption.
307
+ * Use `create(ReencryptionSchema)` to create a new message.
308
+ */
309
+ export declare const ReencryptionSchema: GenMessage<Reencryption>;
370
310
  /**
371
311
  * DecryptionAttestation contains the attestation for the decryption of a single handle.
372
312
  *
@@ -380,11 +320,28 @@ export type DecryptionAttestation = Message<"inco.kms.lite.v1.DecryptionAttestat
380
320
  */
381
321
  handle: string;
382
322
  /**
383
- * plaintext is the decrypted plaintext value as a 32-byte word.
384
- *
385
- * @generated from field: bytes plaintext = 2;
386
- */
387
- plaintext: Uint8Array;
323
+ * @generated from oneof inco.kms.lite.v1.DecryptionAttestation.value
324
+ */
325
+ value: {
326
+ /**
327
+ * Returns plaintext if reencrypt_pub_key was empty in the request
328
+ *
329
+ * @generated from field: inco.kms.lite.v1.Plaintext plaintext = 2;
330
+ */
331
+ value: Plaintext;
332
+ case: "plaintext";
333
+ } | {
334
+ /**
335
+ * Returns encrypted ciphertext if reencrypt_pub_key was set in the request
336
+ *
337
+ * @generated from field: inco.kms.lite.v1.Reencryption reencryption = 3;
338
+ */
339
+ value: Reencryption;
340
+ case: "reencryption";
341
+ } | {
342
+ case: undefined;
343
+ value?: undefined;
344
+ };
388
345
  /**
389
346
  * signature is the attestation from the covalidator for the (handle,plaintext) pair.
390
347
  * This signature will be verified on the host chain.
@@ -421,7 +378,7 @@ export type DecryptionAttestation = Message<"inco.kms.lite.v1.DecryptionAttestat
421
378
  * }
422
379
  * ```
423
380
  *
424
- * @generated from field: bytes signature = 3;
381
+ * @generated from field: bytes signature = 4;
425
382
  */
426
383
  signature: Uint8Array;
427
384
  };
@@ -536,20 +493,10 @@ export declare const KmsService: GenService<{
536
493
  input: typeof KeyRequestSchema;
537
494
  output: typeof KeyResponseSchema;
538
495
  };
539
- /**
540
- * Reencrypt reencrypts a ciphertext using the ephemeral public key of the
541
- * user.
542
- *
543
- * @generated from rpc inco.kms.lite.v1.KmsService.Reencrypt
544
- */
545
- reencrypt: {
546
- methodKind: "unary";
547
- input: typeof ReencryptRequestSchema;
548
- output: typeof ReencryptResponseSchema;
549
- };
550
496
  /**
551
497
  * AttestedDecrypt decrypts multiple ciphertexts and provides an attestation
552
498
  * that the decryption was performed correctly.
499
+ * Can optionally reencrypt the result of the decryption to a desired public key.
553
500
  *
554
501
  * @generated from rpc inco.kms.lite.v1.KmsService.AttestedDecrypt
555
502
  */
@@ -13,8 +13,6 @@ export declare const lightningDeployments: readonly [{
13
13
  readonly patch: 2;
14
14
  readonly shortSalt: "725458969";
15
15
  };
16
- readonly decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95";
17
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
18
16
  readonly blockNumber: 32124925;
19
17
  readonly deployDate: "2025-10-09T13:55:42.997Z";
20
18
  readonly commit: "v0.5.3-10-ga4f2312d";
@@ -34,8 +32,6 @@ export declare const lightningDeployments: readonly [{
34
32
  readonly patch: 2;
35
33
  readonly shortSalt: "904635675";
36
34
  };
37
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
38
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
39
35
  readonly blockNumber: 3696905;
40
36
  readonly deployDate: "2025-10-03T13:24:44.682Z";
41
37
  readonly commit: "v0.5.3-6-g8db0f27f-dirty";
@@ -55,8 +51,6 @@ export declare const lightningDeployments: readonly [{
55
51
  readonly patch: 0;
56
52
  readonly shortSalt: "904635675";
57
53
  };
58
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
59
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
60
54
  readonly blockNumber: 3344310;
61
55
  readonly deployDate: "2025-09-29T11:14:02.599Z";
62
56
  readonly commit: "v0.5.1-5-g4135c790-dirty";
@@ -76,8 +70,6 @@ export declare const lightningDeployments: readonly [{
76
70
  readonly patch: 0;
77
71
  readonly shortSalt: "183408998";
78
72
  };
79
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
80
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
81
73
  readonly blockNumber: 26296576;
82
74
  readonly deployDate: "2025-05-27T15:57:24.175Z";
83
75
  readonly commit: "v5-3-gec8b6aae-dirty";
@@ -97,8 +89,6 @@ export declare const lightningDeployments: readonly [{
97
89
  readonly patch: 29;
98
90
  readonly shortSalt: "183408998";
99
91
  };
100
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
101
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
102
92
  readonly blockNumber: 13464615;
103
93
  readonly deployDate: "2025-04-22T16:01:14.380Z";
104
94
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -118,8 +108,6 @@ export declare const lightningDeployments: readonly [{
118
108
  readonly patch: 29;
119
109
  readonly shortSalt: "183408998";
120
110
  };
121
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
122
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
123
111
  readonly blockNumber: 24784654;
124
112
  readonly deployDate: "2025-04-22T16:00:02.028Z";
125
113
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -139,8 +127,6 @@ export declare const lightningDeployments: readonly [{
139
127
  readonly patch: 0;
140
128
  readonly shortSalt: "863421733";
141
129
  };
142
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
143
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
144
130
  readonly blockNumber: 25737175;
145
131
  readonly deployDate: "2025-05-14T17:10:44.285Z";
146
132
  readonly commit: "v4-11-g4a1f413a-dirty";
@@ -160,8 +146,6 @@ export declare const lightningDeployments: readonly [{
160
146
  readonly patch: 29;
161
147
  readonly shortSalt: "863421733";
162
148
  };
163
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
164
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
165
149
  readonly blockNumber: 25719113;
166
150
  readonly deployDate: "2025-05-14T07:08:39.059Z";
167
151
  readonly commit: "v4";
@@ -181,8 +165,6 @@ export declare const lightningDeployments: readonly [{
181
165
  readonly patch: 1;
182
166
  readonly shortSalt: "297966649";
183
167
  };
184
- readonly decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95";
185
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
186
168
  readonly blockNumber: 27543410;
187
169
  readonly deployDate: "2025-06-25T12:38:32.856Z";
188
170
  readonly commit: "v5-17-ga03e4b32-dirty";
@@ -202,8 +184,6 @@ export declare const lightningDeployments: readonly [{
202
184
  readonly patch: 0;
203
185
  readonly shortSalt: "297966649";
204
186
  };
205
- readonly decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95";
206
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
207
187
  readonly blockNumber: 26894782;
208
188
  readonly deployDate: "2025-06-10T12:17:35.790Z";
209
189
  readonly commit: "v5-13-gd6b19c10-dirty";
@@ -223,8 +203,6 @@ export declare const lightningDeployments: readonly [{
223
203
  readonly patch: 1;
224
204
  readonly shortSalt: "340846814";
225
205
  };
226
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
227
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
228
206
  readonly blockNumber: 1718868;
229
207
  readonly deployDate: "2025-09-10T15:20:25.654Z";
230
208
  readonly commit: "v6-7-gf96f358e-dirty";
@@ -244,8 +222,6 @@ export declare const lightningDeployments: readonly [{
244
222
  readonly patch: 1;
245
223
  readonly shortSalt: "340846814";
246
224
  };
247
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
248
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
249
225
  readonly blockNumber: 1717229;
250
226
  readonly deployDate: "2025-09-10T14:53:07.218Z";
251
227
  readonly commit: "v6-7-gf96f358e-dirty";
@@ -265,8 +241,6 @@ export declare const lightningDeployments: readonly [{
265
241
  readonly patch: 1;
266
242
  readonly shortSalt: "340846814";
267
243
  };
268
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
269
- readonly eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1";
270
244
  readonly blockNumber: 17365942;
271
245
  readonly deployDate: "2025-08-15T17:35:15.208Z";
272
246
  readonly commit: "v0.2.17-35-g8cca6b4e-dirty";
@@ -286,8 +260,6 @@ export declare const lightningDeployments: readonly [{
286
260
  readonly patch: 0;
287
261
  readonly shortSalt: "340846814";
288
262
  };
289
- readonly decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f";
290
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
291
263
  readonly blockNumber: 26122863;
292
264
  readonly deployDate: "2025-05-23T15:26:57.031Z";
293
265
  readonly commit: "v5-2-g8957c16b-dirty";
@@ -307,8 +279,6 @@ export declare const lightningDeployments: readonly [{
307
279
  readonly patch: 29;
308
280
  readonly shortSalt: "340846814";
309
281
  };
310
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
311
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
312
282
  readonly blockNumber: 13464197;
313
283
  readonly deployDate: "2025-04-22T15:57:26.862Z";
314
284
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -328,8 +298,6 @@ export declare const lightningDeployments: readonly [{
328
298
  readonly patch: 29;
329
299
  readonly shortSalt: "340846814";
330
300
  };
331
- readonly decryptSigner: "0xA8822DE8910f66D3d03F1eAfe2C0141dBc327Ee0";
332
- readonly eciesPublicKey: "0x048a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1e647a9e377175fcb66bda05087c93b05e1fd53a704d0914bb23a0b2a69e9f235";
333
301
  readonly blockNumber: 24784527;
334
302
  readonly deployDate: "2025-04-22T15:55:47.828Z";
335
303
  readonly commit: "v3-28-g93c05a49-dirty";
@@ -1,7 +1,6 @@
1
1
  export declare const localNodeLightningConfig: {
2
2
  readonly testnet: {
3
3
  readonly executorAddress: "0x63D8135aF4D393B1dB43B649010c8D3EE19FC9fd";
4
- readonly eciesPublicKey: "0x0235692e009a07315b5505fbfb44144553b2b163e0d9eddc705a1c49ba4d0dcb91";
5
4
  readonly chainId: 31337;
6
5
  readonly covalidatorUrl: "http://localhost:50055";
7
6
  readonly hostChainRpcUrl: "http://localhost:8545";
@@ -9,7 +8,6 @@ export declare const localNodeLightningConfig: {
9
8
  };
10
9
  readonly devnet: {
11
10
  readonly executorAddress: "0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6";
12
- readonly eciesPublicKey: "0x0232aae7e5deffacd4e682821a95f4200d4327b7ac1e288d147cfa343f751e3f61";
13
11
  readonly chainId: 31337;
14
12
  readonly covalidatorUrl: "http://localhost:50055";
15
13
  readonly hostChainRpcUrl: "http://localhost:8545";
@@ -17,15 +15,13 @@ export declare const localNodeLightningConfig: {
17
15
  };
18
16
  readonly alphanet: {
19
17
  readonly executorAddress: "0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A";
20
- readonly eciesPublicKey: "0x034bc20c48ff1b8e86563dff8dd2ec3936bdea0ab570986780971cdc4c3871fe09";
21
18
  readonly chainId: 31337;
22
19
  readonly covalidatorUrl: "http://localhost:50055";
23
20
  readonly hostChainRpcUrl: "http://localhost:8545";
24
- readonly senderPrivateKey: "0xa0b9f1fb7c6803e5692b73bd08ccc5c468b15eebe7df4398d048e9a58f785706";
21
+ readonly senderPrivateKey: "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d";
25
22
  };
26
23
  readonly scratch: {
27
24
  readonly executorAddress: "0x195ec7fDf68fD835b9F78d6eb13E280cC2e25fdD";
28
- readonly eciesPublicKey: "0x02516bda9e68a1c3dce74dc1b6ed7d91a91d51c1e1933947f06331cef59631e9eb";
29
25
  readonly chainId: 31337;
30
26
  readonly covalidatorUrl: "http://localhost:50055";
31
27
  readonly hostChainRpcUrl: "http://127.0.0.1:8567";
@@ -1,6 +1,24 @@
1
1
  import { Chainish } from '../chain.js';
2
- import { lightningDeployments } from '../generated/lightning.js';
3
2
  export type Address = `0x${string}`;
4
- export type IncoLiteDeployment = (typeof lightningDeployments)[number];
3
+ export type IncoLiteDeployment = {
4
+ active: boolean;
5
+ blockNumber: number;
6
+ chainId: number;
7
+ chainName: string;
8
+ commit: string;
9
+ deployDate: string;
10
+ deployer: string;
11
+ executorAddress: string;
12
+ majorVersion: number;
13
+ name: string;
14
+ pepper: string;
15
+ salt: string;
16
+ version: {
17
+ major: number;
18
+ minor: number;
19
+ patch: number;
20
+ shortSalt: string;
21
+ };
22
+ };
5
23
  export declare function getActiveLightningDeployment(chain: Chainish): IncoLiteDeployment;
6
24
  export declare function getLightningDeployments(chainId: Chainish): readonly IncoLiteDeployment[];
@@ -1,5 +1,5 @@
1
1
  export * from '../generated/abis/lightning.js';
2
- export type { AttestedComputeRequest, AttestedDecryptRequest, KmsService, ReencryptRequest, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
2
+ export type { AttestedComputeRequest, AttestedDecryptRequest, KmsService, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
3
3
  export type { HandleWithProof } from '../generated/es/inco/kms/lite/v1/types_pb.js';
4
4
  export * from './attested-compute.js';
5
5
  export * from './attested-decrypt.js';
@@ -1,9 +1,9 @@
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
4
  import { DecryptionAttestation } 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, PlaintextOf, 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';
@@ -26,12 +26,10 @@ export type EncryptionContext = {
26
26
  };
27
27
  export type DeploymentSlice = {
28
28
  executorAddress: string;
29
- eciesPublicKey: string;
30
29
  chainId: number;
31
30
  };
32
31
  export type CustomConfig = {
33
32
  executorAddress: string;
34
- eciesPublicKey: string;
35
33
  chainId: number;
36
34
  covalidatorUrl: string;
37
35
  hostChainRpcUrl?: string;
@@ -46,16 +44,14 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
46
44
  private readonly _deployment;
47
45
  readonly covalidatorUrl: string;
48
46
  readonly executorAddress: Address;
49
- readonly eciesPublicKey: HexString;
50
47
  readonly chainId: bigint;
51
- private readonly encryptor;
52
48
  private readonly ephemeralKeypair;
53
49
  private readonly kmsClient;
54
50
  private constructor();
55
51
  /**
56
52
  * Get a Lightning instance bound to the latest Lightning deployment for the Base Sepolia testnet.
57
53
  */
58
- static baseSepoliaTestnet(): Lightning<Deployment>;
54
+ static baseSepoliaTestnet(): Promise<Lightning<Deployment>>;
59
55
  /**
60
56
  * Get a Lightning instance bound to our canonical Anvil-based test node and test Covalidator node
61
57
  *
@@ -71,7 +67,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
71
67
  * corresponding Pepper.
72
68
  *
73
69
  */
74
- static localNode(env?: LocalNodeEnv | LocalNodePepper): Lightning<CustomDeployment>;
70
+ static localNode(env?: LocalNodeEnv | LocalNodePepper): Promise<Lightning<CustomDeployment>>;
75
71
  /**
76
72
  * Get a Lightning instance bound to a local node from a file containing a LocalNodeEnv environment .
77
73
  *
@@ -83,14 +79,15 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
83
79
  *
84
80
  * @param id this is an object containing either the pair of name and chainId or the executorAddress and chainId
85
81
  */
86
- static at(id: DeploymentId): Lightning<Deployment>;
82
+ static at(id: DeploymentId): Promise<Lightning<Deployment>>;
87
83
  /**
88
84
  * Get a Lightning deployment for a local or custom node
89
85
  *
90
86
  * @param config this is an object containing the executorAddress, eciesPublicKey, chainId and covalidatorUrl.
91
87
  * additional fields past will be made available as part of the `deployment` property.
92
88
  */
93
- static custom<T extends CustomConfig>(config: T): Lightning<DeploymentSlice & T>;
89
+ static custom<T extends CustomConfig>(config: T): Promise<Lightning<DeploymentSlice & T>>;
90
+ static getEciesPublicKey(client: PublicClient, executorAddress: Address): Promise<HexString>;
94
91
  /**
95
92
  * Get the latest deployment for a given pepper, which usually denotes a family of deployments distinct from their
96
93
  * version such as 'devnet', 'testnet', 'mainnet', etc.
@@ -107,7 +104,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
107
104
  * @param pepper the pepper to use to filter the deployments
108
105
  * @param chainId the chainId to use to filter the deployments
109
106
  */
110
- static latest<P extends Pepper>(pepper: P, chainId: ChainId): Lightning<Deployment>;
107
+ static latest<P extends Pepper>(pepper: P, chainId: ChainId): Promise<Lightning<Deployment>>;
111
108
  get deployment(): T;
112
109
  /**
113
110
  * Encrypt a value using the public ECIES key of the Lightning deployment.
@@ -116,7 +113,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
116
113
  * @param accountAddress the address of the account interacting with the dapp contract, normally an Externally Owned Account (EOA)
117
114
  * @param dappAddress the address of the dapp contract that interacts with the Inco Lightning contract or library
118
115
  */
119
- encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress }: EncryptionContext): Promise<HexString>;
116
+ encrypt<T extends SupportedNativeType>(value: T, { accountAddress, dappAddress }: EncryptionContext, encryptor: Encryptor<EciesScheme>): Promise<HexString>;
120
117
  /**
121
118
  * Obtain a reencryptor for a particular Externally Owned Account (EOA) to request decrypted values.
122
119
  * The account associated with the walletClient must have permissions to decrypt the handle or ciphertext passed
@@ -125,6 +122,7 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
125
122
  * @param walletClient the wallet client to use for signing the reencrypt request.
126
123
  */
127
124
  getReencryptor(walletClient: WalletClient<Transport, Chain, Account>): Promise<Reencryptor<EciesScheme>>;
125
+ getEncryptor(eciesPubkey: HexString): Encryptor<EciesScheme>;
128
126
  /**
129
127
  * Grants a session key allowance voucher for secure reencryption operations.
130
128
  *
@@ -245,6 +243,20 @@ export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
245
243
  * @returns A promise that resolves to a compute attestation.
246
244
  */
247
245
  attestedCompute(ephemeralKeypair: Secp256k1Keypair, lhsHandle: HexString, op: AttestedComputeOP, rhsPlaintext: bigint | boolean, allowanceVoucherWithSig: AllowanceVoucherWithSig, backoffConfig?: Partial<BackoffConfig>): Promise<DecryptionAttestation<EciesScheme, SupportedFheType>>;
246
+ /**
247
+ * Get an decryption of publicly revealed handles.
248
+ *
249
+ * @param handles - The handles to decrypt
250
+ * @param backoffConfig - The backoff configuration for the attested decrypt request
251
+ * @returns The decryption attestations
252
+ *
253
+ * @example
254
+ * ```typescript
255
+ * const response = await lightning.attestedReveal([handle1, handle2]);
256
+ * const { plaintext, covalidatorSignature } = response[0];
257
+ * ```
258
+ */
259
+ attestedReveal(handles: HexString[], backoffConfig?: Partial<BackoffConfig>): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
248
260
  /**
249
261
  * Get the GRPC endpoint for the covalidator that services this deployment.
250
262
  */
@@ -1,10 +1,9 @@
1
1
  import { Client } from '@connectrpc/connect';
2
- import { Account, Chain, Hex, Transport, WalletClient } from 'viem';
2
+ import { Account, Chain, Transport, WalletClient } from 'viem';
3
3
  import { SupportedChain } from '../chain.js';
4
4
  import { EciesScheme, PlaintextOf, SupportedFheType } from '../encryption/encryption.js';
5
- import { KmsService, ReencryptResponse } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
5
+ import { AttestedDecryptResponse, DecryptionAttestation as DecryptionAttestationProto, KmsService } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
6
6
  import { Handle } from '../handle.js';
7
- import type { EIP712 } from '../reencryption/eip712.js';
8
7
  import type { Reencryptor, ReencryptorArgs } from '../reencryption/types.js';
9
8
  import { Secp256k1Keypair } from './ecies.js';
10
9
  export interface IncoLiteReencryptorArgs extends ReencryptorArgs {
@@ -12,12 +11,11 @@ export interface IncoLiteReencryptorArgs extends ReencryptorArgs {
12
11
  kmsConnectRpcEndpointOrClient?: string | Client<typeof KmsService>;
13
12
  ephemeralKeypair?: Secp256k1Keypair;
14
13
  }
15
- export declare function reencryptEIP712(chainId: bigint, ephemeralPubKey: Uint8Array): EIP712<{
16
- publicKey: Hex;
17
- }>;
18
14
  export declare function incoLiteReencryptor({ kmsConnectRpcEndpointOrClient, chainId, walletClient, ephemeralKeypair, }: IncoLiteReencryptorArgs): Promise<Reencryptor<EciesScheme>>;
19
15
  export declare function getKmsClient(kmsConnectRpcEndpointOrClient: string | Client<typeof KmsService>): Client<typeof KmsService>;
20
- export declare function decryptGrpcResponse<T extends SupportedFheType>(response: ReencryptResponse, ephemeralKeypair: Secp256k1Keypair, handle: Handle): Promise<PlaintextOf<1, T>>;
16
+ export declare function decryptGrpcResponse<T extends SupportedFheType>(response: AttestedDecryptResponse, ephemeralKeypair: Secp256k1Keypair, handle: Handle): Promise<PlaintextOf<1, T>>;
17
+ export declare function decryptGrpcDecryptionAttestation(attestation: DecryptionAttestationProto, reencryptKeypair: Secp256k1Keypair): Promise<DecryptionAttestationProto>;
18
+ export declare function decryptGrpcDecryptResponse(response: AttestedDecryptResponse, reencryptKeypair: Secp256k1Keypair): Promise<AttestedDecryptResponse>;
21
19
  export declare function defaultCovalidatorGrpc(chain: SupportedChain): string;
22
20
  export declare function lightningDevnetCovalidatorGrpc(chain: SupportedChain): string;
23
21
  export declare function lightningTestnetCovalidatorGrpc(chain: SupportedChain): string;
@@ -0,0 +1,12 @@
1
+ import { Account, Chain, Transport, WalletClient } from 'viem';
2
+ import { vi } from 'vitest';
3
+ import { KmsClient } from '../kms/client.js';
4
+ interface MinimalKmsClient {
5
+ attestedCompute: ReturnType<typeof vi.fn>;
6
+ attestedDecrypt: ReturnType<typeof vi.fn>;
7
+ key: ReturnType<typeof vi.fn>;
8
+ reencrypt: ReturnType<typeof vi.fn>;
9
+ }
10
+ export declare function createMockKmsClient(): MinimalKmsClient & KmsClient;
11
+ export declare function createTestWalletClient(): WalletClient<Transport, Chain, Account>;
12
+ export {};
@@ -30,7 +30,7 @@ export declare const chains: {
30
30
  experimental_preconfirmationTime?: number | undefined | undefined;
31
31
  rpcUrls: {
32
32
  readonly default: {
33
- readonly http: readonly ["https://sepolia.drpc.org"];
33
+ readonly http: readonly ["https://11155111.rpc.thirdweb.com"];
34
34
  };
35
35
  };
36
36
  sourceId?: number | undefined | undefined;