@inco/js 0.6.1 → 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 (124) 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/binary.d.ts +1 -0
  10. package/dist/cjs/binary.js +6 -2
  11. package/dist/cjs/encryption/encryption.d.ts +17 -22
  12. package/dist/cjs/encryption/encryption.js +34 -16
  13. package/dist/cjs/generated/abis/add-two.d.ts +1 -1
  14. package/dist/cjs/generated/abis/add-two.js +1 -1
  15. package/dist/cjs/generated/abis/lightning-preview.d.ts +48 -106
  16. package/dist/cjs/generated/abis/lightning-preview.js +33 -55
  17. package/dist/cjs/generated/abis/lightning.d.ts +55 -116
  18. package/dist/cjs/generated/abis/lightning.js +33 -66
  19. package/dist/cjs/generated/abis/verifier.d.ts +193 -84
  20. package/dist/cjs/generated/abis/verifier.js +151 -61
  21. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +2 -2
  22. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +775 -0
  23. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +261 -0
  24. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +186 -0
  25. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +47 -0
  26. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +2 -2
  27. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  28. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +21 -26
  29. package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +2 -2
  30. package/dist/cjs/generated/lightning.d.ts +0 -32
  31. package/dist/cjs/generated/lightning.js +1 -33
  32. package/dist/cjs/generated/local-node.d.ts +1 -5
  33. package/dist/cjs/generated/local-node.js +2 -6
  34. package/dist/cjs/handle.d.ts +16 -0
  35. package/dist/cjs/handle.js +28 -3
  36. package/dist/cjs/lite/deployments.d.ts +20 -2
  37. package/dist/cjs/lite/deployments.js +1 -1
  38. package/dist/cjs/lite/ecies.d.ts +0 -2
  39. package/dist/cjs/lite/ecies.js +24 -13
  40. package/dist/cjs/lite/hadu.d.ts +3 -23
  41. package/dist/cjs/lite/hadu.js +26 -29
  42. package/dist/cjs/lite/index.d.ts +1 -1
  43. package/dist/cjs/lite/index.js +1 -1
  44. package/dist/cjs/lite/lightning.d.ts +24 -12
  45. package/dist/cjs/lite/lightning.js +62 -27
  46. package/dist/cjs/lite/reencrypt.d.ts +5 -7
  47. package/dist/cjs/lite/reencrypt.js +68 -58
  48. package/dist/cjs/test/mocks.d.ts +12 -0
  49. package/dist/cjs/test/mocks.js +27 -0
  50. package/dist/cjs/viem.d.ts +45 -48
  51. package/dist/esm/advancedacl/session-key.d.ts +8 -1
  52. package/dist/esm/advancedacl/session-key.js +58 -24
  53. package/dist/esm/attestedcompute/attested-compute.js +11 -4
  54. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +38 -1
  55. package/dist/esm/attesteddecrypt/attested-decrypt.js +51 -8
  56. package/dist/esm/attesteddecrypt/types.d.ts +6 -1
  57. package/dist/esm/attesteddecrypt/types.js +1 -1
  58. package/dist/esm/attestedreveal/attested-reveal.js +9 -7
  59. package/dist/esm/binary.d.ts +1 -0
  60. package/dist/esm/binary.js +5 -2
  61. package/dist/esm/encryption/encryption.d.ts +17 -22
  62. package/dist/esm/encryption/encryption.js +30 -16
  63. package/dist/esm/generated/abis/add-two.d.ts +1 -1
  64. package/dist/esm/generated/abis/add-two.js +1 -1
  65. package/dist/esm/generated/abis/lightning-preview.d.ts +48 -106
  66. package/dist/esm/generated/abis/lightning-preview.js +33 -55
  67. package/dist/esm/generated/abis/lightning.d.ts +55 -116
  68. package/dist/esm/generated/abis/lightning.js +33 -66
  69. package/dist/esm/generated/abis/verifier.d.ts +193 -84
  70. package/dist/esm/generated/abis/verifier.js +151 -61
  71. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +2 -2
  72. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +775 -0
  73. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +258 -0
  74. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +186 -0
  75. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +44 -0
  76. package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +2 -2
  77. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  78. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +20 -25
  79. package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +2 -2
  80. package/dist/esm/generated/lightning.d.ts +0 -32
  81. package/dist/esm/generated/lightning.js +1 -33
  82. package/dist/esm/generated/local-node.d.ts +1 -5
  83. package/dist/esm/generated/local-node.js +2 -6
  84. package/dist/esm/handle.d.ts +16 -0
  85. package/dist/esm/handle.js +27 -3
  86. package/dist/esm/lite/deployments.d.ts +20 -2
  87. package/dist/esm/lite/deployments.js +1 -1
  88. package/dist/esm/lite/ecies.d.ts +0 -2
  89. package/dist/esm/lite/ecies.js +26 -15
  90. package/dist/esm/lite/hadu.d.ts +3 -23
  91. package/dist/esm/lite/hadu.js +28 -30
  92. package/dist/esm/lite/index.d.ts +1 -1
  93. package/dist/esm/lite/index.js +1 -1
  94. package/dist/esm/lite/lightning.d.ts +24 -12
  95. package/dist/esm/lite/lightning.js +59 -24
  96. package/dist/esm/lite/reencrypt.d.ts +5 -7
  97. package/dist/esm/lite/reencrypt.js +67 -58
  98. package/dist/esm/test/mocks.d.ts +12 -0
  99. package/dist/esm/test/mocks.js +23 -0
  100. package/dist/esm/viem.d.ts +45 -48
  101. package/dist/types/advancedacl/session-key.d.ts +8 -1
  102. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +38 -1
  103. package/dist/types/attesteddecrypt/types.d.ts +6 -1
  104. package/dist/types/binary.d.ts +1 -0
  105. package/dist/types/encryption/encryption.d.ts +17 -22
  106. package/dist/types/generated/abis/add-two.d.ts +1 -1
  107. package/dist/types/generated/abis/lightning-preview.d.ts +48 -106
  108. package/dist/types/generated/abis/lightning.d.ts +55 -116
  109. package/dist/types/generated/abis/verifier.d.ts +193 -84
  110. package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +775 -0
  111. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +186 -0
  112. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +76 -129
  113. package/dist/types/generated/lightning.d.ts +0 -32
  114. package/dist/types/generated/local-node.d.ts +1 -5
  115. package/dist/types/handle.d.ts +16 -0
  116. package/dist/types/lite/deployments.d.ts +20 -2
  117. package/dist/types/lite/ecies.d.ts +0 -2
  118. package/dist/types/lite/hadu.d.ts +3 -23
  119. package/dist/types/lite/index.d.ts +1 -1
  120. package/dist/types/lite/lightning.d.ts +24 -12
  121. package/dist/types/lite/reencrypt.d.ts +5 -7
  122. package/dist/types/test/mocks.d.ts +12 -0
  123. package/dist/types/viem.d.ts +45 -48
  124. package/package.json +3 -1
@@ -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;
@@ -116,7 +116,7 @@ export declare const chains: {
116
116
  formatters: {
117
117
  readonly block: {
118
118
  exclude: [] | undefined;
119
- format: (args: import("viem/chains").OpStackRpcBlock) => {
119
+ format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => {
120
120
  baseFeePerGas: bigint | null;
121
121
  blobGasUsed: bigint;
122
122
  difficulty: bigint;
@@ -126,7 +126,7 @@ export declare const chains: {
126
126
  gasUsed: bigint;
127
127
  hash: `0x${string}` | null;
128
128
  logsBloom: `0x${string}` | null;
129
- miner: import("abitype").Address;
129
+ miner: import("viem").Address;
130
130
  mixHash: import("viem").Hash;
131
131
  nonce: `0x${string}` | null;
132
132
  number: bigint | null;
@@ -149,17 +149,17 @@ export declare const chains: {
149
149
  };
150
150
  readonly transaction: {
151
151
  exclude: [] | undefined;
152
- format: (args: import("viem/chains").OpStackRpcTransaction) => ({
152
+ format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => ({
153
153
  blockHash: `0x${string}` | null;
154
154
  blockNumber: bigint | null;
155
- from: import("abitype").Address;
155
+ from: import("viem").Address;
156
156
  gas: bigint;
157
157
  hash: import("viem").Hash;
158
158
  input: import("viem").Hex;
159
159
  nonce: number;
160
160
  r: import("viem").Hex;
161
161
  s: import("viem").Hex;
162
- to: import("abitype").Address | null;
162
+ to: import("viem").Address | null;
163
163
  transactionIndex: number | null;
164
164
  typeHex: import("viem").Hex | null;
165
165
  v: bigint;
@@ -179,8 +179,8 @@ export declare const chains: {
179
179
  v: bigint;
180
180
  value: bigint;
181
181
  gas: bigint;
182
- to: import("abitype").Address | null;
183
- from: import("abitype").Address;
182
+ to: import("viem").Address | null;
183
+ from: import("viem").Address;
184
184
  nonce: number;
185
185
  blockHash: `0x${string}` | null;
186
186
  blockNumber: bigint | null;
@@ -204,14 +204,14 @@ export declare const chains: {
204
204
  } | {
205
205
  blockHash: `0x${string}` | null;
206
206
  blockNumber: bigint | null;
207
- from: import("abitype").Address;
207
+ from: import("viem").Address;
208
208
  gas: bigint;
209
209
  hash: import("viem").Hash;
210
210
  input: import("viem").Hex;
211
211
  nonce: number;
212
212
  r: import("viem").Hex;
213
213
  s: import("viem").Hex;
214
- to: import("abitype").Address | null;
214
+ to: import("viem").Address | null;
215
215
  transactionIndex: number | null;
216
216
  typeHex: import("viem").Hex | null;
217
217
  v: bigint;
@@ -232,14 +232,14 @@ export declare const chains: {
232
232
  } | {
233
233
  blockHash: `0x${string}` | null;
234
234
  blockNumber: bigint | null;
235
- from: import("abitype").Address;
235
+ from: import("viem").Address;
236
236
  gas: bigint;
237
237
  hash: import("viem").Hash;
238
238
  input: import("viem").Hex;
239
239
  nonce: number;
240
240
  r: import("viem").Hex;
241
241
  s: import("viem").Hex;
242
- to: import("abitype").Address | null;
242
+ to: import("viem").Address | null;
243
243
  transactionIndex: number | null;
244
244
  typeHex: import("viem").Hex | null;
245
245
  v: bigint;
@@ -260,14 +260,14 @@ export declare const chains: {
260
260
  } | {
261
261
  blockHash: `0x${string}` | null;
262
262
  blockNumber: bigint | null;
263
- from: import("abitype").Address;
263
+ from: import("viem").Address;
264
264
  gas: bigint;
265
265
  hash: import("viem").Hash;
266
266
  input: import("viem").Hex;
267
267
  nonce: number;
268
268
  r: import("viem").Hex;
269
269
  s: import("viem").Hex;
270
- to: import("abitype").Address | null;
270
+ to: import("viem").Address | null;
271
271
  transactionIndex: number | null;
272
272
  typeHex: import("viem").Hex | null;
273
273
  v: bigint;
@@ -288,14 +288,14 @@ export declare const chains: {
288
288
  } | {
289
289
  blockHash: `0x${string}` | null;
290
290
  blockNumber: bigint | null;
291
- from: import("abitype").Address;
291
+ from: import("viem").Address;
292
292
  gas: bigint;
293
293
  hash: import("viem").Hash;
294
294
  input: import("viem").Hex;
295
295
  nonce: number;
296
296
  r: import("viem").Hex;
297
297
  s: import("viem").Hex;
298
- to: import("abitype").Address | null;
298
+ to: import("viem").Address | null;
299
299
  transactionIndex: number | null;
300
300
  typeHex: import("viem").Hex | null;
301
301
  v: bigint;
@@ -318,21 +318,21 @@ export declare const chains: {
318
318
  };
319
319
  readonly transactionReceipt: {
320
320
  exclude: [] | undefined;
321
- format: (args: import("viem/chains").OpStackRpcTransactionReceipt) => {
321
+ format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => {
322
322
  blobGasPrice?: bigint | undefined;
323
323
  blobGasUsed?: bigint | undefined;
324
324
  blockHash: import("viem").Hash;
325
325
  blockNumber: bigint;
326
- contractAddress: import("abitype").Address | null | undefined;
326
+ contractAddress: import("viem").Address | null | undefined;
327
327
  cumulativeGasUsed: bigint;
328
328
  effectiveGasPrice: bigint;
329
- from: import("abitype").Address;
329
+ from: import("viem").Address;
330
330
  gasUsed: bigint;
331
331
  logs: import("viem").Log<bigint, number, false>[];
332
332
  logsBloom: import("viem").Hex;
333
333
  root?: `0x${string}` | undefined;
334
334
  status: "success" | "reverted";
335
- to: import("abitype").Address | null;
335
+ to: import("viem").Address | null;
336
336
  transactionHash: import("viem").Hash;
337
337
  transactionIndex: number;
338
338
  type: import("viem").TransactionType;
@@ -392,15 +392,12 @@ export declare const chains: {
392
392
  };
393
393
  };
394
394
  blockTime?: number | undefined | undefined;
395
- contracts?: {
396
- [x: string]: import("viem").ChainContract | {
397
- [sourceId: number]: import("viem").ChainContract | undefined;
398
- } | undefined;
399
- ensRegistry?: import("viem").ChainContract | undefined;
400
- ensUniversalResolver?: import("viem").ChainContract | undefined;
401
- multicall3?: import("viem").ChainContract | undefined;
402
- erc6492Verifier?: import("viem").ChainContract | undefined;
403
- } | undefined;
395
+ contracts: {
396
+ readonly multicall3: {
397
+ readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
398
+ readonly blockCreated: 0;
399
+ };
400
+ };
404
401
  ensTlds?: readonly string[] | undefined;
405
402
  id: 9746;
406
403
  name: "Plasma Testnet";
@@ -546,7 +543,7 @@ export declare const chains: {
546
543
  formatters: {
547
544
  readonly block: {
548
545
  exclude: [] | undefined;
549
- format: (args: import("viem/chains").OpStackRpcBlock) => {
546
+ format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => {
550
547
  baseFeePerGas: bigint | null;
551
548
  blobGasUsed: bigint;
552
549
  difficulty: bigint;
@@ -556,7 +553,7 @@ export declare const chains: {
556
553
  gasUsed: bigint;
557
554
  hash: `0x${string}` | null;
558
555
  logsBloom: `0x${string}` | null;
559
- miner: import("abitype").Address;
556
+ miner: import("viem").Address;
560
557
  mixHash: import("viem").Hash;
561
558
  nonce: `0x${string}` | null;
562
559
  number: bigint | null;
@@ -579,17 +576,17 @@ export declare const chains: {
579
576
  };
580
577
  readonly transaction: {
581
578
  exclude: [] | undefined;
582
- format: (args: import("viem/chains").OpStackRpcTransaction) => ({
579
+ format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => ({
583
580
  blockHash: `0x${string}` | null;
584
581
  blockNumber: bigint | null;
585
- from: import("abitype").Address;
582
+ from: import("viem").Address;
586
583
  gas: bigint;
587
584
  hash: import("viem").Hash;
588
585
  input: import("viem").Hex;
589
586
  nonce: number;
590
587
  r: import("viem").Hex;
591
588
  s: import("viem").Hex;
592
- to: import("abitype").Address | null;
589
+ to: import("viem").Address | null;
593
590
  transactionIndex: number | null;
594
591
  typeHex: import("viem").Hex | null;
595
592
  v: bigint;
@@ -609,8 +606,8 @@ export declare const chains: {
609
606
  v: bigint;
610
607
  value: bigint;
611
608
  gas: bigint;
612
- to: import("abitype").Address | null;
613
- from: import("abitype").Address;
609
+ to: import("viem").Address | null;
610
+ from: import("viem").Address;
614
611
  nonce: number;
615
612
  blockHash: `0x${string}` | null;
616
613
  blockNumber: bigint | null;
@@ -634,14 +631,14 @@ export declare const chains: {
634
631
  } | {
635
632
  blockHash: `0x${string}` | null;
636
633
  blockNumber: bigint | null;
637
- from: import("abitype").Address;
634
+ from: import("viem").Address;
638
635
  gas: bigint;
639
636
  hash: import("viem").Hash;
640
637
  input: import("viem").Hex;
641
638
  nonce: number;
642
639
  r: import("viem").Hex;
643
640
  s: import("viem").Hex;
644
- to: import("abitype").Address | null;
641
+ to: import("viem").Address | null;
645
642
  transactionIndex: number | null;
646
643
  typeHex: import("viem").Hex | null;
647
644
  v: bigint;
@@ -662,14 +659,14 @@ export declare const chains: {
662
659
  } | {
663
660
  blockHash: `0x${string}` | null;
664
661
  blockNumber: bigint | null;
665
- from: import("abitype").Address;
662
+ from: import("viem").Address;
666
663
  gas: bigint;
667
664
  hash: import("viem").Hash;
668
665
  input: import("viem").Hex;
669
666
  nonce: number;
670
667
  r: import("viem").Hex;
671
668
  s: import("viem").Hex;
672
- to: import("abitype").Address | null;
669
+ to: import("viem").Address | null;
673
670
  transactionIndex: number | null;
674
671
  typeHex: import("viem").Hex | null;
675
672
  v: bigint;
@@ -690,14 +687,14 @@ export declare const chains: {
690
687
  } | {
691
688
  blockHash: `0x${string}` | null;
692
689
  blockNumber: bigint | null;
693
- from: import("abitype").Address;
690
+ from: import("viem").Address;
694
691
  gas: bigint;
695
692
  hash: import("viem").Hash;
696
693
  input: import("viem").Hex;
697
694
  nonce: number;
698
695
  r: import("viem").Hex;
699
696
  s: import("viem").Hex;
700
- to: import("abitype").Address | null;
697
+ to: import("viem").Address | null;
701
698
  transactionIndex: number | null;
702
699
  typeHex: import("viem").Hex | null;
703
700
  v: bigint;
@@ -718,14 +715,14 @@ export declare const chains: {
718
715
  } | {
719
716
  blockHash: `0x${string}` | null;
720
717
  blockNumber: bigint | null;
721
- from: import("abitype").Address;
718
+ from: import("viem").Address;
722
719
  gas: bigint;
723
720
  hash: import("viem").Hash;
724
721
  input: import("viem").Hex;
725
722
  nonce: number;
726
723
  r: import("viem").Hex;
727
724
  s: import("viem").Hex;
728
- to: import("abitype").Address | null;
725
+ to: import("viem").Address | null;
729
726
  transactionIndex: number | null;
730
727
  typeHex: import("viem").Hex | null;
731
728
  v: bigint;
@@ -748,21 +745,21 @@ export declare const chains: {
748
745
  };
749
746
  readonly transactionReceipt: {
750
747
  exclude: [] | undefined;
751
- format: (args: import("viem/chains").OpStackRpcTransactionReceipt) => {
748
+ format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => {
752
749
  blobGasPrice?: bigint | undefined;
753
750
  blobGasUsed?: bigint | undefined;
754
751
  blockHash: import("viem").Hash;
755
752
  blockNumber: bigint;
756
- contractAddress: import("abitype").Address | null | undefined;
753
+ contractAddress: import("viem").Address | null | undefined;
757
754
  cumulativeGasUsed: bigint;
758
755
  effectiveGasPrice: bigint;
759
- from: import("abitype").Address;
756
+ from: import("viem").Address;
760
757
  gasUsed: bigint;
761
758
  logs: import("viem").Log<bigint, number, false>[];
762
759
  logsBloom: import("viem").Hex;
763
760
  root?: `0x${string}` | undefined;
764
761
  status: "success" | "reverted";
765
- to: import("abitype").Address | null;
762
+ to: import("viem").Address | null;
766
763
  transactionHash: import("viem").Hash;
767
764
  transactionIndex: number;
768
765
  type: import("viem").TransactionType;
@@ -29,6 +29,11 @@ export interface SessionKeyReencryptorArgs {
29
29
  kmsConnectRpcEndpointOrClient: string | Client<typeof KmsService>;
30
30
  allowanceVoucherWithSig: AllowanceVoucherWithSig;
31
31
  }
32
+ /**
33
+ * The sessionKeyReencryptor function is a reencryptor that uses a session key
34
+ * to reencrypt data.
35
+ *
36
+ */
32
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>>)>;
33
38
  export declare function updateActiveVouchersSessionNonce(incoLiteAddress: Address, sharerWalletClient: WalletClient<Transport, Chain, Account>): Promise<`0x${string}`>;
34
39
  export interface SessionKeyAttestedComputeArgs {
@@ -53,5 +58,7 @@ export interface SessionKeyAttestedDecryptArgs {
53
58
  allowanceVoucherWithSig: AllowanceVoucherWithSig;
54
59
  handles: HexString[];
55
60
  backoffConfig?: Partial<BackoffConfig> | undefined;
61
+ reencryptPubKey?: Uint8Array;
62
+ reencryptKeypair?: Secp256k1Keypair;
56
63
  }
57
- export declare function sessionKeyAttestedDecrypt({ chainId, kmsConnectRpcEndpointOrClient, handles, ephemeralKeypair, allowanceVoucherWithSig, backoffConfig, }: SessionKeyAttestedDecryptArgs): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
64
+ export declare function sessionKeyAttestedDecrypt({ chainId, kmsConnectRpcEndpointOrClient, handles, ephemeralKeypair, allowanceVoucherWithSig, backoffConfig, reencryptPubKey, reencryptKeypair, }: SessionKeyAttestedDecryptArgs): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
@@ -3,8 +3,9 @@ import { HexString } from '../binary.js';
3
3
  import { SupportedChainId } from '../chain.js';
4
4
  import { EciesScheme, SupportedFheType } from '../encryption/encryption.js';
5
5
  import type { KmsClient } from '../kms/client.js';
6
+ import { Secp256k1Keypair } from '../lite/ecies.js';
6
7
  import type { BackoffConfig } from '../retry.js';
7
- import { DecryptionAttestation } from './types.js';
8
+ import { DecryptionAttestation, EncryptedDecryptionAttestation } from './types.js';
8
9
  export declare const ATTESTED_DECRYPT_DOMAIN_NAME = "IncoAttestedDecrypt";
9
10
  export declare const ATTESTED_DECRYPT_DOMAIN_VERSION = "0.1.0";
10
11
  /**
@@ -24,6 +25,40 @@ export interface IncoLiteAttestedDecryptorArgs {
24
25
  /** The chain ID to use */
25
26
  chainId: SupportedChainId;
26
27
  }
28
+ /**
29
+ * Decrypt multiple handles in a single attested request.
30
+ * Returns an array of attestations aligned with the response ordering.
31
+ *
32
+ * @param args - The arguments for creating the attested decrypt function
33
+ * @returns A function that can decrypt handles and return an attestation
34
+ * @throws {AttestedDecryptError} If the creation fails
35
+ */
36
+ export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, reencryptPubKey, reencryptKeypair, kmsConnectRpcEndpointOrClient, }: {
37
+ handles: HexString[];
38
+ backoffConfig?: Partial<BackoffConfig> | undefined;
39
+ walletClient: WalletClient<Transport, Chain, Account>;
40
+ chainId: SupportedChainId;
41
+ reencryptPubKey: Uint8Array;
42
+ reencryptKeypair: Secp256k1Keypair;
43
+ kmsConnectRpcEndpointOrClient?: string | KmsClient;
44
+ }): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
45
+ /**
46
+ * Decrypt multiple handles in a single attested request.
47
+ * Returns an array of attestations aligned with the response ordering.
48
+ *
49
+ * @param args - The arguments for creating the attested decrypt function
50
+ * @returns A function that can decrypt handles and return an attestation
51
+ * @throws {AttestedDecryptError} If the creation fails
52
+ */
53
+ export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, reencryptPubKey, kmsConnectRpcEndpointOrClient, }: {
54
+ handles: HexString[];
55
+ backoffConfig?: Partial<BackoffConfig> | undefined;
56
+ walletClient: WalletClient<Transport, Chain, Account>;
57
+ chainId: SupportedChainId;
58
+ reencryptPubKey: Uint8Array;
59
+ reencryptKeypair?: never;
60
+ kmsConnectRpcEndpointOrClient?: string | KmsClient;
61
+ }): Promise<Array<EncryptedDecryptionAttestation<EciesScheme, SupportedFheType>>>;
27
62
  /**
28
63
  * Decrypt multiple handles in a single attested request.
29
64
  * Returns an array of attestations aligned with the response ordering.
@@ -37,5 +72,7 @@ export declare function attestedDecrypt({ handles, backoffConfig, walletClient,
37
72
  backoffConfig?: Partial<BackoffConfig> | undefined;
38
73
  walletClient: WalletClient<Transport, Chain, Account>;
39
74
  chainId: SupportedChainId;
75
+ reencryptPubKey?: never;
76
+ reencryptKeypair?: never;
40
77
  kmsConnectRpcEndpointOrClient?: string | KmsClient;
41
78
  }): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
@@ -1,5 +1,5 @@
1
1
  import { HexString } from '../binary.js';
2
- import { EncryptionScheme, PlaintextOf, SupportedFheType } from '../encryption/encryption.js';
2
+ import { 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.
@@ -13,6 +13,11 @@ export type DecryptionAttestation<S extends EncryptionScheme, T extends Supporte
13
13
  plaintext: PlaintextOf<S, T>;
14
14
  covalidatorSignature: Uint8Array;
15
15
  };
16
+ export type EncryptedDecryptionAttestation<S extends EncryptionScheme, T extends SupportedFheType> = {
17
+ handle: HexString;
18
+ encryptedPlaintext: EncryptResultOf<S, T>;
19
+ covalidatorSignature: Uint8Array;
20
+ };
16
21
  export type AttestedDecryptor<S extends EncryptionScheme> = <T extends SupportedFheType>(args: AttestedDecryptFnArgs<S, T>) => Promise<DecryptionAttestation<S, T>>;
17
22
  export type AttestedDecryptFnArgs<S extends EncryptionScheme, T extends SupportedFheType> = {
18
23
  /** The handle to decrypt */
@@ -5,6 +5,7 @@ export type HexString = typeof HexString.Type;
5
5
  export type BytesIsh = string | Uint8Array;
6
6
  export declare function bytesToBigInt(byteArray: Uint8Array): bigint;
7
7
  export declare function bufferToBigInt(buffer: Buffer): bigint;
8
+ export declare function bigintToBytes(value: bigint): Buffer;
8
9
  export declare function bigintToBytes32(value: bigint): Bytes32;
9
10
  export declare function padLeft(bs: Uint8Array, n: number): Buffer;
10
11
  export declare function bytes32ToBigint(bs: BytesIsh): bigint;
@@ -1,8 +1,8 @@
1
1
  import { Schema } from 'effect';
2
+ import { ByteArray, Hex } from 'viem';
2
3
  import { Bytes32 } from '../binary.js';
3
- import { InputContext } from '../handle.js';
4
4
  export type Encryptor<S extends EncryptionScheme = EncryptionScheme> = <T extends SupportedFheType>(plaintext: PlaintextWithContextOf<S, T>) => Promise<EncryptResultOf<S, T>>;
5
- export type Decryptor<S extends EncryptionScheme = EncryptionScheme> = <T extends SupportedFheType>(ciphertext: CiphertextOf<S, T>, context?: InputContext) => Promise<PlaintextOf<S, T>>;
5
+ export type Decryptor<S extends EncryptionScheme = EncryptionScheme> = <T extends SupportedFheType>(ciphertext: CiphertextOf<S, T>) => Promise<PlaintextOf<S, T>>;
6
6
  export declare const supportedFheTypes: {
7
7
  readonly euint64: 5;
8
8
  readonly euint160: 7;
@@ -14,40 +14,29 @@ export type SupportedFheTypeName = typeof SupportedFheTypeName.Type;
14
14
  export declare const SupportedFheType: Schema.SchemaClass<0 | 5 | 7 | 8, 0 | 5 | 7 | 8, never>;
15
15
  export type SupportedFheType = typeof SupportedFheType.Type;
16
16
  export declare const encryptionSchemes: {
17
- readonly tfhe: 0;
18
17
  readonly ecies: 1;
19
- readonly cryptobox: 2;
20
18
  };
21
19
  export declare function getEncryptionSchemeName(scheme: number): string;
22
20
  export type EncryptionSchemes = typeof encryptionSchemes;
23
21
  export type EciesScheme = EncryptionSchemes['ecies'];
24
- export type TfheScheme = EncryptionSchemes['tfhe'];
25
- export type CryptoboxScheme = EncryptionSchemes['cryptobox'];
26
- export declare const EncryptionScheme: Schema.Literal<[0, 1, 2]>;
22
+ export declare const EncryptionScheme: Schema.Literal<[1]>;
27
23
  export type EncryptionScheme = typeof EncryptionScheme.Type;
28
24
  type DistType<P, S extends EncryptionScheme, T extends SupportedFheType> = P extends any ? P & {
29
25
  scheme: S;
30
26
  type: T;
31
27
  } : never;
32
- export declare const ciphertextEnvelopes: {
33
- readonly none: 0;
34
- readonly hadu: 1;
35
- };
36
- export declare const CiphertextEnvelope: Schema.SchemaClass<0 | 1, 0 | 1, never>;
37
28
  export declare const Ciphertext: Schema.Struct<{
38
- scheme: Schema.Literal<[0, 1, 2]>;
29
+ scheme: Schema.Literal<[1]>;
39
30
  type: Schema.SchemaClass<0 | 5 | 7 | 8, 0 | 5 | 7 | 8, never>;
40
31
  value: Schema.TemplateLiteral<`0x${string}`>;
41
- envelope: Schema.optional<Schema.SchemaClass<0 | 1, 0 | 1, never>>;
42
32
  }>;
43
33
  export type Ciphertext = typeof Ciphertext.Type;
44
34
  export type CiphertextOf<S extends EncryptionScheme, T extends SupportedFheType> = DistType<Ciphertext, S, T>;
45
35
  export declare const CiphertextWithContext: Schema.Struct<{
46
36
  ciphertext: Schema.Struct<{
47
- scheme: Schema.Literal<[0, 1, 2]>;
37
+ scheme: Schema.Literal<[1]>;
48
38
  type: Schema.SchemaClass<0 | 5 | 7 | 8, 0 | 5 | 7 | 8, never>;
49
39
  value: Schema.TemplateLiteral<`0x${string}`>;
50
- envelope: Schema.optional<Schema.SchemaClass<0 | 1, 0 | 1, never>>;
51
40
  }>;
52
41
  context: Schema.Struct<{
53
42
  hostChainId: typeof Schema.BigInt;
@@ -62,10 +51,9 @@ export type CiphertextWithContextOf<S extends EncryptionScheme, T extends Suppor
62
51
  };
63
52
  export declare const EncryptResult: Schema.Struct<{
64
53
  ciphertext: Schema.Struct<{
65
- scheme: Schema.Literal<[0, 1, 2]>;
54
+ scheme: Schema.Literal<[1]>;
66
55
  type: Schema.SchemaClass<0 | 5 | 7 | 8, 0 | 5 | 7 | 8, never>;
67
56
  value: Schema.TemplateLiteral<`0x${string}`>;
68
- envelope: Schema.optional<Schema.SchemaClass<0 | 1, 0 | 1, never>>;
69
57
  }>;
70
58
  context: Schema.Struct<{
71
59
  hostChainId: typeof Schema.BigInt;
@@ -81,11 +69,11 @@ export type EncryptResultOf<S extends EncryptionScheme, T extends SupportedFheTy
81
69
  ciphertext: CiphertextOf<S, T>;
82
70
  };
83
71
  export declare const Plaintext: Schema.Union<[Schema.Struct<{
84
- scheme: Schema.Literal<[0, 1, 2]>;
72
+ scheme: Schema.Literal<[1]>;
85
73
  type: Schema.Literal<[5, 7, 8]>;
86
74
  value: typeof Schema.BigInt;
87
75
  }>, Schema.Struct<{
88
- scheme: Schema.Literal<[0, 1, 2]>;
76
+ scheme: Schema.Literal<[1]>;
89
77
  type: Schema.Literal<[0]>;
90
78
  value: typeof Schema.Boolean;
91
79
  }>]>;
@@ -93,11 +81,11 @@ export type Plaintext = typeof Plaintext.Type;
93
81
  export type PlaintextOf<S extends EncryptionScheme, T extends SupportedFheType> = DistType<Plaintext, S, T>;
94
82
  export declare const PlaintextWithContext: Schema.Struct<{
95
83
  plaintext: Schema.Union<[Schema.Struct<{
96
- scheme: Schema.Literal<[0, 1, 2]>;
84
+ scheme: Schema.Literal<[1]>;
97
85
  type: Schema.Literal<[5, 7, 8]>;
98
86
  value: typeof Schema.BigInt;
99
87
  }>, Schema.Struct<{
100
- scheme: Schema.Literal<[0, 1, 2]>;
88
+ scheme: Schema.Literal<[1]>;
101
89
  type: Schema.Literal<[0]>;
102
90
  value: typeof Schema.Boolean;
103
91
  }>]>;
@@ -113,7 +101,14 @@ export type PlaintextWithContextOf<S extends EncryptionScheme, T extends Support
113
101
  plaintext: PlaintextOf<S, T>;
114
102
  };
115
103
  export declare function bigintToPlaintext<S extends EncryptionScheme, T extends SupportedFheType>(scheme: S, type: T, bigPt: bigint): PlaintextOf<S, T>;
104
+ export declare function decodeCiphertextInput(input: ByteArray | Hex): {
105
+ handle: Hex;
106
+ ciphertext: Hex;
107
+ };
108
+ export declare function encodeCiphertextInput(handle: Hex, ciphertext: Hex): Hex;
116
109
  export declare function plaintextToBigint(plaintext: Plaintext): bigint;
117
110
  export declare function plaintextToBytes32(plaintext: Plaintext): Bytes32;
111
+ export declare function plaintextToBytes(plaintext: Plaintext): Buffer;
118
112
  export declare function bytes32ToPlaintext(plaintext: Bytes32, scheme: EncryptionScheme, type: SupportedFheType): Plaintext;
113
+ export declare function bytesToPlaintext(plaintext: Uint8Array, scheme: EncryptionScheme, type: SupportedFheType): Plaintext;
119
114
  export {};
@@ -44,7 +44,7 @@ export declare const addTwoAbi: readonly [{
44
44
  readonly internalType: "bytes";
45
45
  readonly type: "bytes";
46
46
  }];
47
- readonly name: "addTwoEOA";
47
+ readonly name: "addTwoEoa";
48
48
  readonly outputs: readonly [{
49
49
  readonly name: "result";
50
50
  readonly internalType: "euint256";