@inco/lightning-js 0.0.0-bootstrap.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +587 -0
  3. package/dist/cjs/advancedacl/index.d.ts +2 -0
  4. package/dist/cjs/advancedacl/index.js +19 -0
  5. package/dist/cjs/advancedacl/session-key.d.ts +95 -0
  6. package/dist/cjs/advancedacl/session-key.js +376 -0
  7. package/dist/cjs/advancedacl/types.d.ts +16 -0
  8. package/dist/cjs/advancedacl/types.js +3 -0
  9. package/dist/cjs/attestedcompute/attested-compute.d.ts +65 -0
  10. package/dist/cjs/attestedcompute/attested-compute.js +80 -0
  11. package/dist/cjs/attestedcompute/types.d.ts +35 -0
  12. package/dist/cjs/attestedcompute/types.js +46 -0
  13. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +61 -0
  14. package/dist/cjs/attesteddecrypt/attested-decrypt.js +118 -0
  15. package/dist/cjs/attesteddecrypt/index.d.ts +1 -0
  16. package/dist/cjs/attesteddecrypt/index.js +18 -0
  17. package/dist/cjs/attesteddecrypt/types.d.ts +27 -0
  18. package/dist/cjs/attesteddecrypt/types.js +16 -0
  19. package/dist/cjs/attestedreveal/attested-reveal.d.ts +21 -0
  20. package/dist/cjs/attestedreveal/attested-reveal.js +31 -0
  21. package/dist/cjs/attestedreveal/index.d.ts +2 -0
  22. package/dist/cjs/attestedreveal/index.js +21 -0
  23. package/dist/cjs/attestedreveal/types.d.ts +4 -0
  24. package/dist/cjs/attestedreveal/types.js +13 -0
  25. package/dist/cjs/binary.d.ts +104 -0
  26. package/dist/cjs/binary.js +171 -0
  27. package/dist/cjs/chain.d.ts +50 -0
  28. package/dist/cjs/chain.js +62 -0
  29. package/dist/cjs/eip712/eip712.d.ts +18 -0
  30. package/dist/cjs/eip712/eip712.js +51 -0
  31. package/dist/cjs/eip712/index.d.ts +1 -0
  32. package/dist/cjs/eip712/index.js +8 -0
  33. package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.d.ts +51 -0
  34. package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.js +94 -0
  35. package/dist/cjs/elistattesteddecrypt/index.d.ts +2 -0
  36. package/dist/cjs/elistattesteddecrypt/index.js +22 -0
  37. package/dist/cjs/elistattesteddecrypt/types.d.ts +31 -0
  38. package/dist/cjs/elistattesteddecrypt/types.js +16 -0
  39. package/dist/cjs/encryption/encryption.d.ts +235 -0
  40. package/dist/cjs/encryption/encryption.js +226 -0
  41. package/dist/cjs/encryption/index.d.ts +1 -0
  42. package/dist/cjs/encryption/index.js +19 -0
  43. package/dist/cjs/generated/abis/add-two.d.ts +117 -0
  44. package/dist/cjs/generated/abis/add-two.js +80 -0
  45. package/dist/cjs/generated/abis/lightning.d.ts +3362 -0
  46. package/dist/cjs/generated/abis/lightning.js +2445 -0
  47. package/dist/cjs/generated/abis/test-elist.d.ts +276 -0
  48. package/dist/cjs/generated/abis/test-elist.js +168 -0
  49. package/dist/cjs/generated/abis/verifier.d.ts +1353 -0
  50. package/dist/cjs/generated/abis/verifier.js +954 -0
  51. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +1494 -0
  52. package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +395 -0
  53. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +247 -0
  54. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +80 -0
  55. package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.d.ts +77 -0
  56. package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +28 -0
  57. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +685 -0
  58. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +100 -0
  59. package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.d.ts +289 -0
  60. package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +136 -0
  61. package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +371 -0
  62. package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +88 -0
  63. package/dist/cjs/generated/lightning.d.ts +830 -0
  64. package/dist/cjs/generated/lightning.js +872 -0
  65. package/dist/cjs/generated/local-node.d.ts +50 -0
  66. package/dist/cjs/generated/local-node.js +107 -0
  67. package/dist/cjs/handle.d.ts +123 -0
  68. package/dist/cjs/handle.js +221 -0
  69. package/dist/cjs/index.d.ts +5 -0
  70. package/dist/cjs/index.js +31 -0
  71. package/dist/cjs/kms/client.d.ts +12 -0
  72. package/dist/cjs/kms/client.js +47 -0
  73. package/dist/cjs/kms/quorumClient.d.ts +65 -0
  74. package/dist/cjs/kms/quorumClient.js +463 -0
  75. package/dist/cjs/kms/quorumConsistency.d.ts +82 -0
  76. package/dist/cjs/kms/quorumConsistency.js +269 -0
  77. package/dist/cjs/kms/signatureVerification.d.ts +35 -0
  78. package/dist/cjs/kms/signatureVerification.js +88 -0
  79. package/dist/cjs/kms/thresholdPromises.d.ts +8 -0
  80. package/dist/cjs/kms/thresholdPromises.js +62 -0
  81. package/dist/cjs/lite/attested-compute.d.ts +6 -0
  82. package/dist/cjs/lite/attested-compute.js +8 -0
  83. package/dist/cjs/lite/attested-decrypt.d.ts +4 -0
  84. package/dist/cjs/lite/attested-decrypt.js +6 -0
  85. package/dist/cjs/lite/deployments.d.ts +24 -0
  86. package/dist/cjs/lite/deployments.js +21 -0
  87. package/dist/cjs/lite/hadu.d.ts +4 -0
  88. package/dist/cjs/lite/hadu.js +28 -0
  89. package/dist/cjs/lite/index.d.ts +13 -0
  90. package/dist/cjs/lite/index.js +31 -0
  91. package/dist/cjs/lite/lightning.d.ts +459 -0
  92. package/dist/cjs/lite/lightning.js +696 -0
  93. package/dist/cjs/lite/types.d.ts +47 -0
  94. package/dist/cjs/lite/types.js +3 -0
  95. package/dist/cjs/lite/xwing.d.ts +154 -0
  96. package/dist/cjs/lite/xwing.js +326 -0
  97. package/dist/cjs/local/index.d.ts +1 -0
  98. package/dist/cjs/local/index.js +18 -0
  99. package/dist/cjs/local/local-node.d.ts +37 -0
  100. package/dist/cjs/local/local-node.js +80 -0
  101. package/dist/cjs/reencryption/eip712.d.ts +56 -0
  102. package/dist/cjs/reencryption/eip712.js +90 -0
  103. package/dist/cjs/reencryption/index.d.ts +2 -0
  104. package/dist/cjs/reencryption/index.js +19 -0
  105. package/dist/cjs/reencryption/types.d.ts +48 -0
  106. package/dist/cjs/reencryption/types.js +3 -0
  107. package/dist/cjs/retry.d.ts +30 -0
  108. package/dist/cjs/retry.js +87 -0
  109. package/dist/cjs/schema.d.ts +4 -0
  110. package/dist/cjs/schema.js +19 -0
  111. package/dist/cjs/test/mocks.d.ts +20 -0
  112. package/dist/cjs/test/mocks.js +72 -0
  113. package/dist/cjs/viem.d.ts +1141 -0
  114. package/dist/cjs/viem.js +36 -0
  115. package/dist/esm/advancedacl/index.d.ts +2 -0
  116. package/dist/esm/advancedacl/index.js +3 -0
  117. package/dist/esm/advancedacl/session-key.d.ts +95 -0
  118. package/dist/esm/advancedacl/session-key.js +367 -0
  119. package/dist/esm/advancedacl/types.d.ts +16 -0
  120. package/dist/esm/advancedacl/types.js +2 -0
  121. package/dist/esm/attestedcompute/attested-compute.d.ts +65 -0
  122. package/dist/esm/attestedcompute/attested-compute.js +76 -0
  123. package/dist/esm/attestedcompute/types.d.ts +35 -0
  124. package/dist/esm/attestedcompute/types.js +42 -0
  125. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +61 -0
  126. package/dist/esm/attesteddecrypt/attested-decrypt.js +112 -0
  127. package/dist/esm/attesteddecrypt/index.d.ts +1 -0
  128. package/dist/esm/attesteddecrypt/index.js +2 -0
  129. package/dist/esm/attesteddecrypt/types.d.ts +27 -0
  130. package/dist/esm/attesteddecrypt/types.js +12 -0
  131. package/dist/esm/attestedreveal/attested-reveal.d.ts +21 -0
  132. package/dist/esm/attestedreveal/attested-reveal.js +28 -0
  133. package/dist/esm/attestedreveal/index.d.ts +2 -0
  134. package/dist/esm/attestedreveal/index.js +3 -0
  135. package/dist/esm/attestedreveal/types.d.ts +4 -0
  136. package/dist/esm/attestedreveal/types.js +9 -0
  137. package/dist/esm/binary.d.ts +104 -0
  138. package/dist/esm/binary.js +155 -0
  139. package/dist/esm/chain.d.ts +50 -0
  140. package/dist/esm/chain.js +58 -0
  141. package/dist/esm/eip712/eip712.d.ts +18 -0
  142. package/dist/esm/eip712/eip712.js +46 -0
  143. package/dist/esm/eip712/index.d.ts +1 -0
  144. package/dist/esm/eip712/index.js +2 -0
  145. package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.d.ts +51 -0
  146. package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.js +89 -0
  147. package/dist/esm/elistattesteddecrypt/index.d.ts +2 -0
  148. package/dist/esm/elistattesteddecrypt/index.js +3 -0
  149. package/dist/esm/elistattesteddecrypt/types.d.ts +31 -0
  150. package/dist/esm/elistattesteddecrypt/types.js +12 -0
  151. package/dist/esm/encryption/encryption.d.ts +235 -0
  152. package/dist/esm/encryption/encryption.js +214 -0
  153. package/dist/esm/encryption/index.d.ts +1 -0
  154. package/dist/esm/encryption/index.js +2 -0
  155. package/dist/esm/generated/abis/add-two.d.ts +117 -0
  156. package/dist/esm/generated/abis/add-two.js +77 -0
  157. package/dist/esm/generated/abis/lightning.d.ts +3362 -0
  158. package/dist/esm/generated/abis/lightning.js +2442 -0
  159. package/dist/esm/generated/abis/test-elist.d.ts +276 -0
  160. package/dist/esm/generated/abis/test-elist.js +165 -0
  161. package/dist/esm/generated/abis/verifier.d.ts +1353 -0
  162. package/dist/esm/generated/abis/verifier.js +951 -0
  163. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +1494 -0
  164. package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +392 -0
  165. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +247 -0
  166. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +77 -0
  167. package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.d.ts +77 -0
  168. package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +25 -0
  169. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +685 -0
  170. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +97 -0
  171. package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.d.ts +289 -0
  172. package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +133 -0
  173. package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +371 -0
  174. package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +85 -0
  175. package/dist/esm/generated/lightning.d.ts +830 -0
  176. package/dist/esm/generated/lightning.js +869 -0
  177. package/dist/esm/generated/local-node.d.ts +50 -0
  178. package/dist/esm/generated/local-node.js +104 -0
  179. package/dist/esm/handle.d.ts +123 -0
  180. package/dist/esm/handle.js +212 -0
  181. package/dist/esm/index.d.ts +5 -0
  182. package/dist/esm/index.js +6 -0
  183. package/dist/esm/kms/client.d.ts +12 -0
  184. package/dist/esm/kms/client.js +40 -0
  185. package/dist/esm/kms/quorumClient.d.ts +65 -0
  186. package/dist/esm/kms/quorumClient.js +459 -0
  187. package/dist/esm/kms/quorumConsistency.d.ts +82 -0
  188. package/dist/esm/kms/quorumConsistency.js +260 -0
  189. package/dist/esm/kms/signatureVerification.d.ts +35 -0
  190. package/dist/esm/kms/signatureVerification.js +84 -0
  191. package/dist/esm/kms/thresholdPromises.d.ts +8 -0
  192. package/dist/esm/kms/thresholdPromises.js +59 -0
  193. package/dist/esm/lite/attested-compute.d.ts +6 -0
  194. package/dist/esm/lite/attested-compute.js +4 -0
  195. package/dist/esm/lite/attested-decrypt.d.ts +4 -0
  196. package/dist/esm/lite/attested-decrypt.js +3 -0
  197. package/dist/esm/lite/deployments.d.ts +24 -0
  198. package/dist/esm/lite/deployments.js +17 -0
  199. package/dist/esm/lite/hadu.d.ts +4 -0
  200. package/dist/esm/lite/hadu.js +24 -0
  201. package/dist/esm/lite/index.d.ts +13 -0
  202. package/dist/esm/lite/index.js +10 -0
  203. package/dist/esm/lite/lightning.d.ts +459 -0
  204. package/dist/esm/lite/lightning.js +692 -0
  205. package/dist/esm/lite/types.d.ts +47 -0
  206. package/dist/esm/lite/types.js +2 -0
  207. package/dist/esm/lite/xwing.d.ts +154 -0
  208. package/dist/esm/lite/xwing.js +311 -0
  209. package/dist/esm/local/index.d.ts +1 -0
  210. package/dist/esm/local/index.js +2 -0
  211. package/dist/esm/local/local-node.d.ts +37 -0
  212. package/dist/esm/local/local-node.js +76 -0
  213. package/dist/esm/reencryption/eip712.d.ts +56 -0
  214. package/dist/esm/reencryption/eip712.js +87 -0
  215. package/dist/esm/reencryption/index.d.ts +2 -0
  216. package/dist/esm/reencryption/index.js +3 -0
  217. package/dist/esm/reencryption/types.d.ts +48 -0
  218. package/dist/esm/reencryption/types.js +2 -0
  219. package/dist/esm/retry.d.ts +30 -0
  220. package/dist/esm/retry.js +82 -0
  221. package/dist/esm/schema.d.ts +4 -0
  222. package/dist/esm/schema.js +15 -0
  223. package/dist/esm/test/mocks.d.ts +20 -0
  224. package/dist/esm/test/mocks.js +64 -0
  225. package/dist/esm/viem.d.ts +1141 -0
  226. package/dist/esm/viem.js +32 -0
  227. package/dist/types/advancedacl/index.d.ts +2 -0
  228. package/dist/types/advancedacl/session-key.d.ts +95 -0
  229. package/dist/types/advancedacl/types.d.ts +16 -0
  230. package/dist/types/attestedcompute/attested-compute.d.ts +65 -0
  231. package/dist/types/attestedcompute/types.d.ts +35 -0
  232. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +61 -0
  233. package/dist/types/attesteddecrypt/index.d.ts +1 -0
  234. package/dist/types/attesteddecrypt/types.d.ts +27 -0
  235. package/dist/types/attestedreveal/attested-reveal.d.ts +21 -0
  236. package/dist/types/attestedreveal/index.d.ts +2 -0
  237. package/dist/types/attestedreveal/types.d.ts +4 -0
  238. package/dist/types/binary.d.ts +104 -0
  239. package/dist/types/chain.d.ts +50 -0
  240. package/dist/types/eip712/eip712.d.ts +18 -0
  241. package/dist/types/eip712/index.d.ts +1 -0
  242. package/dist/types/elistattesteddecrypt/elist-attested-decrypt.d.ts +51 -0
  243. package/dist/types/elistattesteddecrypt/index.d.ts +2 -0
  244. package/dist/types/elistattesteddecrypt/types.d.ts +31 -0
  245. package/dist/types/encryption/encryption.d.ts +235 -0
  246. package/dist/types/encryption/index.d.ts +1 -0
  247. package/dist/types/generated/abis/add-two.d.ts +117 -0
  248. package/dist/types/generated/abis/lightning.d.ts +3362 -0
  249. package/dist/types/generated/abis/test-elist.d.ts +276 -0
  250. package/dist/types/generated/abis/verifier.d.ts +1353 -0
  251. package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +1494 -0
  252. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +247 -0
  253. package/dist/types/generated/es/inco/helioswrapper/v1/helioswrapper_pb.d.ts +77 -0
  254. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +685 -0
  255. package/dist/types/generated/es/inco/kms/lite/v1/types_pb.d.ts +289 -0
  256. package/dist/types/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +371 -0
  257. package/dist/types/generated/lightning.d.ts +830 -0
  258. package/dist/types/generated/local-node.d.ts +50 -0
  259. package/dist/types/handle.d.ts +123 -0
  260. package/dist/types/index.d.ts +5 -0
  261. package/dist/types/kms/client.d.ts +12 -0
  262. package/dist/types/kms/quorumClient.d.ts +65 -0
  263. package/dist/types/kms/quorumConsistency.d.ts +82 -0
  264. package/dist/types/kms/signatureVerification.d.ts +35 -0
  265. package/dist/types/kms/thresholdPromises.d.ts +8 -0
  266. package/dist/types/lite/attested-compute.d.ts +6 -0
  267. package/dist/types/lite/attested-decrypt.d.ts +4 -0
  268. package/dist/types/lite/deployments.d.ts +24 -0
  269. package/dist/types/lite/hadu.d.ts +4 -0
  270. package/dist/types/lite/index.d.ts +13 -0
  271. package/dist/types/lite/lightning.d.ts +459 -0
  272. package/dist/types/lite/types.d.ts +47 -0
  273. package/dist/types/lite/xwing.d.ts +154 -0
  274. package/dist/types/local/index.d.ts +1 -0
  275. package/dist/types/local/local-node.d.ts +37 -0
  276. package/dist/types/reencryption/eip712.d.ts +56 -0
  277. package/dist/types/reencryption/index.d.ts +2 -0
  278. package/dist/types/reencryption/types.d.ts +48 -0
  279. package/dist/types/retry.d.ts +30 -0
  280. package/dist/types/schema.d.ts +4 -0
  281. package/dist/types/test/mocks.d.ts +20 -0
  282. package/dist/types/viem.d.ts +1141 -0
  283. package/package.json +129 -0
@@ -0,0 +1,50 @@
1
+ export declare const localNodeLightningConfig: {
2
+ readonly mainnet: {
3
+ readonly executorAddress: "0x4b9911b0191B0b6a6eA8F2Ed562e20Cff5AC8624";
4
+ readonly chainId: 31337;
5
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
6
+ readonly signers: readonly ["0xDD166476574D64D54A8d65810478007eDccc1d1d"];
7
+ readonly hostChainRpcUrls: readonly ["http://localhost:8545"];
8
+ readonly senderPrivateKey: "0x7f2a092a3ecab2e11400fc235b8d3d6b76fb7ec14c71b64baf5a6885a36c1b3a";
9
+ };
10
+ readonly demonet: {
11
+ readonly executorAddress: "0xad9Af2e804FbF14d69391167F1FCDf918A3980fb";
12
+ readonly chainId: 31337;
13
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
14
+ readonly signers: readonly ["0x9cDbDc8E83F84B9D6d3c19356B8C590f0CE1F549"];
15
+ readonly hostChainRpcUrls: readonly ["http://localhost:8545"];
16
+ readonly senderPrivateKey: "0x8e6681c7870f0adc53511b6f38515a5b0f4e3a3fa62a62505f58c61e64c92497";
17
+ };
18
+ readonly testnet: {
19
+ readonly executorAddress: "0xe9CB49A5b16C6D4a093E5900AA8b450FD40541B6";
20
+ readonly chainId: 31337;
21
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
22
+ readonly signers: readonly ["0x8A853ACC000D50bfb59e1D04635959957e28Db38"];
23
+ readonly hostChainRpcUrls: readonly ["http://localhost:8545"];
24
+ readonly senderPrivateKey: "0x835c46722a63e5132eaf24d0a1dad8689d43b85bdcc0e592c23e55fa603895d7";
25
+ };
26
+ readonly devnet: {
27
+ readonly executorAddress: "0xB3C06f0Ed967a7E366ba31C67927DDf93d7c1154";
28
+ readonly chainId: 31337;
29
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
30
+ readonly signers: readonly ["0x29C5a8C17d8c0A2B2036365EA6908291A35dDadF"];
31
+ readonly hostChainRpcUrls: readonly ["http://localhost:8545"];
32
+ readonly senderPrivateKey: "0xbea2b6c911de6a581e7e5fab9da94edbb00c5ddba7ab1645c100b012997c842e";
33
+ };
34
+ readonly alphanet: {
35
+ readonly executorAddress: "0xc0d693DeEF0A91CE39208676b6da09B822abd199";
36
+ readonly chainId: 31337;
37
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
38
+ readonly signers: readonly ["0x8E873085348a3406A07907E5d1465B9824bA07cd"];
39
+ readonly hostChainRpcUrls: readonly ["http://localhost:8545"];
40
+ readonly senderPrivateKey: "0x279c172cf3638a79642daa5f7666c600befde318550d7579cf96280920e318b6";
41
+ };
42
+ readonly scratch: {
43
+ readonly executorAddress: "0xb390b23b8fa1761a85035E7C135bf93713d1d4d1";
44
+ readonly chainId: 31337;
45
+ readonly covalidatorUrls: readonly ["http://localhost:50055"];
46
+ readonly signers: readonly ["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"];
47
+ readonly hostChainRpcUrls: readonly ["http://127.0.0.1:8567"];
48
+ readonly senderPrivateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
49
+ };
50
+ };
@@ -0,0 +1,123 @@
1
+ import { Schema } from 'effect';
2
+ import { HexString } from './binary.js';
3
+ /** Current handle version byte, appended as the last byte of every handle. */
4
+ export declare const HANDLE_VERSION = 0;
5
+ /**
6
+ * Domain separators for handle derivation. Must be kept in sync with Solidity
7
+ * (contracts/lightning/src/Types.sol) and Go (pkg/hostchain/handle.go). Prefixing every
8
+ * keccak256 preimage with a unique constant string makes cross-derivation-path
9
+ * collision resistance structural rather than incidental.
10
+ */
11
+ export declare const SEP_INPUT_HANDLE = "inco/handle/input-handle";
12
+ export declare const SEP_INPUT_CONTEXT = "inco/handle/input-context";
13
+ export declare const SEP_OP_RESULT = "inco/handle/op-result";
14
+ export declare const SEP_ELIST_OP_RESULT = "inco/handle/elist-result";
15
+ export declare const BYTE_ELIST_ELEMENT_TYPE_INDEX = 29;
16
+ /**
17
+ * Map of ENCRYPTION type names to their integer identifiers.
18
+ *
19
+ * Keys provide a semantic interpretation over the underlying integral type.
20
+ * For example, `ebool` interprets a `uint16` as a boolean, `ebytes64` interprets
21
+ * a `uint512` as a 64-byte array, etc.
22
+ */
23
+ export declare const handleTypes: Readonly<{
24
+ ebool: 0;
25
+ euint4: 1;
26
+ euint8: 2;
27
+ euint16: 3;
28
+ euint32: 4;
29
+ euint64: 5;
30
+ euint128: 6;
31
+ euint160: 7;
32
+ euint256: 8;
33
+ ebytes64: 9;
34
+ ebytes128: 10;
35
+ ebytes256: 11;
36
+ }>;
37
+ /** Schema that validates a string is one of the known ENCRYPTION type names (e.g. `"ebool"`, `"euint256"`). */
38
+ export declare const HandleTypeName: Schema.SchemaClass<"ebool" | "euint4" | "euint8" | "euint16" | "euint32" | "euint64" | "euint128" | "euint160" | "euint256" | "ebytes64" | "ebytes128" | "ebytes256", "ebool" | "euint4" | "euint8" | "euint16" | "euint32" | "euint64" | "euint128" | "euint160" | "euint256" | "ebytes64" | "ebytes128" | "ebytes256", never>;
39
+ /** A valid ENCRYPTION type name string (e.g. `"ebool"`, `"euint32"`, `"ebytes64"`). */
40
+ export type HandleTypeName = typeof HandleTypeName.Type;
41
+ /** The typeof {@link handleTypes} — mapping from ENCRYPTION type names to integer IDs. */
42
+ export type HandleTypes = typeof handleTypes;
43
+ /** Integer identifier of an ENCRYPTION type (0–11), corresponding to a {@link HandleTypeName}. */
44
+ export type TeeType = HandleTypes[keyof HandleTypes];
45
+ /**
46
+ * Type guard that checks whether a number is a valid {@link TeeType} identifier.
47
+ * @param value - The number to check.
48
+ * @returns `true` if `value` is a known ENCRYPTION type integer (0–11).
49
+ */
50
+ export declare function isTeeType(value: number): value is TeeType;
51
+ /** Schema for the context required to compute a deterministic ENCRYPTION handle. */
52
+ export declare const InputContext: Schema.Struct<{
53
+ hostChainId: typeof Schema.BigInt;
54
+ aclAddress: Schema.TemplateLiteral<`0x${string}`>;
55
+ userAddress: Schema.TemplateLiteral<`0x${string}`>;
56
+ contractAddress: Schema.TemplateLiteral<`0x${string}`>;
57
+ version: typeof Schema.Number;
58
+ inputType: typeof Schema.Number;
59
+ }>;
60
+ /** Context fields (chain ID, ACL address, user/contract addresses, version, on-chain inputType) used to derive a deterministic handle. */
61
+ export type InputContext = typeof InputContext.Type;
62
+ /**
63
+ * A 32-byte hex string representing an ENCRYPTION ciphertext handle.
64
+ *
65
+ * Format: `keccak_hash[0:29] || index_handle || handle_type || handle_version`
66
+ *
67
+ * @see pkg/hostchain/handle.md for the handle format spec.
68
+ */
69
+ export type Handle = HexString;
70
+ /**
71
+ * Expected length of a handle in bytes.
72
+ * Handle format: 29 bytes hash + 1 byte index + 1 byte type + 1 byte version = 32 bytes
73
+ */
74
+ export declare const HANDLE_LENGTH_BYTES = 32;
75
+ /**
76
+ * Validates handle integrity by checking format, length, and version.
77
+ * Matches the validation in Go's HandleFromBytes (pkg/hostchain/handle.go).
78
+ * @param handle - The handle to validate
79
+ * @throws Error if handle is malformed (wrong format, length, or unsupported version)
80
+ */
81
+ export declare function validateHandle(handle: HexString): void;
82
+ /**
83
+ * Extracts the {@link TeeType} from byte 30 of a validated handle.
84
+ * @param handle - A 32-byte hex handle string.
85
+ * @returns The ENCRYPTION type identifier stored in the handle.
86
+ * @throws If the handle is malformed or contains an invalid ENCRYPTION type.
87
+ * @see pkg/hostchain/handle.md for the handle format spec.
88
+ */
89
+ export declare function getHandleType(handle: HexString): TeeType;
90
+ /**
91
+ * Extracts the elist element {@link TeeType} from byte 29 of a validated handle.
92
+ * @param handle - A 32-byte hex handle string for an elist.
93
+ * @returns The ENCRYPTION type identifier of the elist elements.
94
+ * @throws If the handle is malformed or contains an invalid ENCRYPTION type at byte 29.
95
+ */
96
+ export declare function getEListElementType(handle: HexString): TeeType;
97
+ /**
98
+ * Computes the final handle for an input based on the ciphertext and the input context, matches the handle generation
99
+ * in Go and Solidity.
100
+ *
101
+ * @param ciphertext Note this is different from the input which has the external handle prepended
102
+ * @param indexHandle
103
+ * @param handleType
104
+ * @param handleVersion
105
+ * @param context
106
+ */
107
+ export declare function computeHandle({ ciphertext, indexHandle, handleType, handleVersion, context, }: {
108
+ ciphertext: Uint8Array;
109
+ indexHandle: number;
110
+ handleType: TeeType;
111
+ handleVersion: number;
112
+ context: InputContext;
113
+ }): Buffer;
114
+ /**
115
+ * Computes the Keccak-256 hash of an ABI-packed {@link InputContext}.
116
+ *
117
+ * The context is packed as: `"evm/" || SEP_INPUT_CONTEXT || HANDLE_VERSION || inputType ||
118
+ * chainId || aclAddress || userAddress || contractAddress || version`.
119
+ *
120
+ * @param context - The input context to hash.
121
+ * @returns A 32-byte `Buffer` containing the Keccak-256 digest.
122
+ */
123
+ export declare function hashInputContext(context: InputContext): Buffer;
@@ -0,0 +1,5 @@
1
+ export * from './binary.js';
2
+ export * from './chain.js';
3
+ export { HANDLE_LENGTH_BYTES, HANDLE_VERSION, HandleTypeName, InputContext, getHandleType, handleTypes, isTeeType, validateHandle, type Handle, type HandleTypes, type TeeType, } from './handle.js';
4
+ export * from './schema.js';
5
+ export * from './viem.js';
@@ -0,0 +1,12 @@
1
+ import { type Client } from '@connectrpc/connect';
2
+ import type { Address } from 'viem';
3
+ import type { SupportedChain } from '../chain.js';
4
+ import { KmsService } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
5
+ export declare const TEST_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;
10
+ export declare function defaultCovalidatorGrpc(chain: SupportedChain): string;
11
+ export declare function lightningDevnetCovalidatorGrpc(chain: SupportedChain): string;
12
+ export declare function lightningTestnetCovalidatorGrpc(chain: SupportedChain): string;
@@ -0,0 +1,65 @@
1
+ import { type Address } from 'viem';
2
+ import type { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attesteddecrypt/types.js';
3
+ import { type EListDecryptionAttestation, type EncryptedEListDecryptionAttestation } from '../elistattesteddecrypt/types.js';
4
+ import type { EncryptionScheme, SupportedTeeType } from '../encryption/encryption.js';
5
+ import type { AttestedComputeRequest, AttestedDecryptRequest, AttestedRevealRequest, EListAttestedDecryptRequest, EListAttestedRevealRequest } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
6
+ import { type XwingKeypair } from '../lite/xwing.js';
7
+ import type { BackoffConfig } from '../retry.js';
8
+ import { type KmsClient } from './client.js';
9
+ import type { ViemClient } from '../viem.js';
10
+ export declare class KmsQuorumClient {
11
+ private readonly kmss;
12
+ private readonly threshold;
13
+ private constructor();
14
+ private constructor();
15
+ /**
16
+ * Creates a KmsQuorumClient from an array of URLs.
17
+ * Requires signer addresses and threshold to be explicitly provided.
18
+ *
19
+ * @param urls - Array of KMS endpoint URLs
20
+ * @param signers - Array of signer addresses, must match the length of URLs
21
+ * @param threshold - Number of successful responses required (must be between 1 and urls.length)
22
+ * @throws {Error} If URLs array is empty, signers length doesn't match URLs length, or threshold is invalid
23
+ */
24
+ static fromUrls(urls: string[], signers: Address[], threshold: number): KmsQuorumClient;
25
+ /**
26
+ * Creates a KmsQuorumClient from an array of KmsClient instances.
27
+ * Each KmsClient must have a signerAddress property.
28
+ *
29
+ * @param kmsClients - Array of KMS client instances
30
+ * @param threshold - Number of successful responses required (must be between 1 and kmsClients.length)
31
+ * @throws {Error} If KMS clients array is empty or threshold is invalid
32
+ */
33
+ static fromKmsClients(kmsClients: KmsClient[], threshold: number): KmsQuorumClient;
34
+ attestedDecrypt(request: AttestedDecryptRequest, executorAddress: Address, client: ViemClient, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair): Promise<(DecryptionAttestation<EncryptionScheme, SupportedTeeType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>)[]>;
35
+ attestedCompute(request: AttestedComputeRequest, executorAddress: Address, client: ViemClient, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair): Promise<DecryptionAttestation<EncryptionScheme, SupportedTeeType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
36
+ attestedReveal(request: AttestedRevealRequest, executorAddress: Address, client: ViemClient, backoffConfig?: Partial<BackoffConfig>): Promise<(DecryptionAttestation<EncryptionScheme, SupportedTeeType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedTeeType>)[]>;
37
+ eListAttestedDecrypt(request: EListAttestedDecryptRequest, executorAddress: Address, client: ViemClient, backoffConfig?: Partial<BackoffConfig>, reencryptKeypair?: XwingKeypair): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedTeeType> | EncryptedEListDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
38
+ eListAttestedReveal(request: EListAttestedRevealRequest, executorAddress: Address, client: ViemClient, backoffConfig?: Partial<BackoffConfig>): Promise<EListDecryptionAttestation<EncryptionScheme, SupportedTeeType>>;
39
+ /**
40
+ * Generic method to execute a KMS operation across all clients with retry and threshold logic.
41
+ * Returns results with both the response and signer address.
42
+ */
43
+ private executeKmsOperationWithThreshold;
44
+ /**
45
+ * Collects signatures from responses and sorts them by signer address (ascending).
46
+ * This is required by SignatureVerifier.
47
+ */
48
+ private collectAndSortSignatures;
49
+ /**
50
+ * Builds a plaintext attestation from a DecryptionAttestation proto message.
51
+ */
52
+ private buildPlaintextAttestation;
53
+ private buildAggregatedAttestations;
54
+ private buildAggregatedComputeAttestation;
55
+ private buildAggregatedEListAttestation;
56
+ /**
57
+ * Verifies proof hashes at two levels:
58
+ * 1. Aggregate: keccak256(concat(proofHashes)) must equal the attested commitmentProof
59
+ * 2. Per-element:
60
+ * - For plaintext (reveal): proofHash[i] = keccak256(value[i])
61
+ * - For reencryption (decrypt): proofHash[i] = keccak256(commitment[i] || plaintext[i])
62
+ * — requires reencryptKeypair to decrypt the ciphertext first.
63
+ */
64
+ private verifyElementProofHashes;
65
+ }
@@ -0,0 +1,82 @@
1
+ import type { Address } from 'viem';
2
+ import type { AttestedComputeRequest, AttestedComputeResponse, AttestedDecryptResponse, AttestedRevealResponse, EListAttestedDecryptResponse, EListAttestedRevealResponse, DecryptionAttestation as ProtoDecryptionAttestation } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
3
+ import type { XwingKeypair } from '../lite/xwing.js';
4
+ /**
5
+ * Computes a canonical key for a single attestation.
6
+ * For plaintext/reencryption+keypair, the key is handle:hex(value).
7
+ * For reencryption without a keypair (XWing ciphertexts are non-deterministic),
8
+ * falls back to handle:op-type as a structural stand-in.
9
+ */
10
+ export declare function computeAttestationKey(att: ProtoDecryptionAttestation, reencryptKeypair?: XwingKeypair): Promise<string>;
11
+ /**
12
+ * Validates that all responses in a winning bucket have the same attestation
13
+ * count and types as the quorum-elected reference (bucket[0]).
14
+ */
15
+ export declare function validateDecryptResponseStructure<T extends AttestedDecryptResponse | AttestedRevealResponse>(bucket: Array<{
16
+ response: T;
17
+ signer: Address;
18
+ }>): void;
19
+ /**
20
+ * Validates that all responses in a winning bucket have a decryption
21
+ * attestation with the same case as the quorum-elected reference (bucket[0]),
22
+ * and that the case is consistent with the request's reencryptPubKey.
23
+ */
24
+ export declare function validateComputeResponseStructure(bucket: Array<{
25
+ response: AttestedComputeResponse;
26
+ signer: Address;
27
+ }>, request?: AttestedComputeRequest): void;
28
+ /**
29
+ * Verifies decrypt/reveal response consistency using hash-bucket voting.
30
+ * Collects all N responses, buckets them by content key, and returns the
31
+ * winning bucket (the first one with >= threshold votes).
32
+ *
33
+ * This is robust against a faulty first-responding node: even if responses[0]
34
+ * disagrees, a quorum of agreeing responses will form a winning bucket.
35
+ */
36
+ export declare function verifyDecryptResponseConsistency<T extends AttestedDecryptResponse | AttestedRevealResponse>(allResults: Array<{
37
+ response: T;
38
+ signer: Address;
39
+ }>, threshold: number, reencryptKeypair?: XwingKeypair): Promise<{
40
+ reference: T;
41
+ winningResults: Array<{
42
+ response: T;
43
+ signer: Address;
44
+ }>;
45
+ }>;
46
+ type EListResponse = EListAttestedDecryptResponse | EListAttestedRevealResponse;
47
+ /**
48
+ * Validates that all elist responses in a winning bucket have the same
49
+ * number of values and matching indices.
50
+ */
51
+ export declare function validateEListResponseStructure<T extends EListResponse>(bucket: Array<{
52
+ response: T;
53
+ signer: Address;
54
+ }>): void;
55
+ /**
56
+ * Verifies elist response consistency using hash-bucket voting.
57
+ * Works for both EListAttestedDecryptResponse and EListAttestedRevealResponse.
58
+ */
59
+ export declare function verifyEListResponseConsistency<T extends EListResponse>(allResults: Array<{
60
+ response: T;
61
+ signer: Address;
62
+ }>, threshold: number, reencryptKeypair?: XwingKeypair): Promise<{
63
+ reference: T;
64
+ winningResults: Array<{
65
+ response: T;
66
+ signer: Address;
67
+ }>;
68
+ }>;
69
+ /**
70
+ * Verifies compute response consistency using hash-bucket voting.
71
+ */
72
+ export declare function verifyComputeResponseConsistency(allResults: Array<{
73
+ response: AttestedComputeResponse;
74
+ signer: Address;
75
+ }>, threshold: number, request?: AttestedComputeRequest, reencryptKeypair?: XwingKeypair): Promise<{
76
+ reference: AttestedComputeResponse;
77
+ winningResults: Array<{
78
+ response: AttestedComputeResponse;
79
+ signer: Address;
80
+ }>;
81
+ }>;
82
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { Address } from 'viem';
2
+ import { ViemClient } from '../viem.js';
3
+ /**
4
+ * Verifies covalidator signatures for a plaintext DecryptionAttestation
5
+ * by calling `isValidDecryptionAttestation` on the IncoVerifier contract.
6
+ *
7
+ * This delegates all verification logic (EIP-712 digest computation,
8
+ * ECDSA recovery, signer authorization, threshold check) to the contract,
9
+ * ensuring exact parity with on-chain verification.
10
+ *
11
+ * @param handle - The handle hex string (bytes32)
12
+ * @param rawValueBytes - The raw plaintext value bytes (will be left-padded to 32 bytes)
13
+ * @param signatures - The covalidator ECDSA signatures to verify
14
+ * @param executorAddress - The Lightning contract address (executor)
15
+ * @param client - A viem client capable of reading contract state
16
+ * @throws If the contract returns false (insufficient valid signatures)
17
+ */
18
+ export declare function verifyPlaintextAttestationSignatures(handle: string, rawValueBytes: Uint8Array, signatures: Uint8Array[], executorAddress: Address, client: ViemClient): Promise<void>;
19
+ /**
20
+ * Verifies covalidator envelope signatures for reencryption attestations
21
+ * by calling `isValidReencryptionAttestation` on the IncoVerifier contract.
22
+ *
23
+ * Each covalidator signs over its own unique (userCiphertext, handle, encryptedSignature)
24
+ * tuple, so all three per-covalidator arrays must be aligned by index and sorted
25
+ * by signer address in ascending order.
26
+ *
27
+ * @param handle - The handle hex string (bytes32)
28
+ * @param userCiphertexts - Per-covalidator ciphertexts (sorted by signer address)
29
+ * @param encryptedSignatures - Per-covalidator encrypted inner signatures (sorted by signer address)
30
+ * @param envelopeSignatures - Per-covalidator envelope signatures (sorted by signer address)
31
+ * @param executorAddress - The Lightning contract address (executor)
32
+ * @param client - A viem client capable of reading contract state
33
+ * @throws If the contract returns false (insufficient valid signatures)
34
+ */
35
+ export declare function verifyReencryptionAttestationSignatures(handle: string, userCiphertexts: Uint8Array[], encryptedSignatures: Uint8Array[], envelopeSignatures: Uint8Array[], executorAddress: Address, client: ViemClient): Promise<void>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Executes all promises and returns all successful results.
3
+ * Rejects early if it becomes mathematically impossible to reach the threshold.
4
+ * @param promises Array of promises to execute
5
+ * @param threshold Minimum number of successful responses required
6
+ * @returns Promise that resolves with all successful results (length >= threshold)
7
+ */
8
+ export declare function executeWithThreshold<T>(promises: Promise<T>[], threshold: number): Promise<T[]>;
@@ -0,0 +1,6 @@
1
+ import { ATTESTED_COMPUTE_DOMAIN_NAME, type IncoLiteAttestedComputeArgs } from '../attestedcompute/attested-compute.js';
2
+ import type { AttestedCompute, AttestedComputeFnArgs } from '../attestedcompute/types.js';
3
+ import { AttestedComputeSupportedOps } from '../attestedcompute/types.js';
4
+ import type { AttestedDecryptFnArgs } from '../attesteddecrypt/types.js';
5
+ export { ATTESTED_COMPUTE_DOMAIN_NAME, AttestedComputeSupportedOps };
6
+ export type { AttestedCompute, AttestedComputeFnArgs, AttestedDecryptFnArgs, IncoLiteAttestedComputeArgs, };
@@ -0,0 +1,4 @@
1
+ import { type IncoLiteAttestedDecryptorArgs } from '../attesteddecrypt/attested-decrypt.js';
2
+ export type { IncoLiteAttestedDecryptorArgs };
3
+ import { ATTESTED_DECRYPT_DOMAIN_NAME } from '../attesteddecrypt/attested-decrypt.js';
4
+ export { ATTESTED_DECRYPT_DOMAIN_NAME };
@@ -0,0 +1,24 @@
1
+ import { Chainish } from '../chain.js';
2
+ export type Address = `0x${string}`;
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
+ };
23
+ export declare function getActiveLightningDeployment(chain: Chainish): IncoLiteDeployment;
24
+ export declare function getLightningDeployments(chainId: Chainish): readonly IncoLiteDeployment[];
@@ -0,0 +1,4 @@
1
+ import { PlaintextWithContext } from '../encryption/encryption.js';
2
+ import { InputPayload } from '../generated/es/inco/covalidator/compute/v1/types_pb.js';
3
+ export declare function encodeInput({ plaintext, context, }: PlaintextWithContext): Uint8Array;
4
+ export declare function decodeInput(input: Uint8Array): InputPayload;
@@ -0,0 +1,13 @@
1
+ export { AttestedComputeError } from '../attestedcompute/types.js';
2
+ export { AttestedDecryptError } from '../attesteddecrypt/types.js';
3
+ export { AttestedRevealError } from '../attestedreveal/types.js';
4
+ export * from '../generated/abis/lightning.js';
5
+ export type { AttestedComputeRequest, AttestedDecryptRequest, KmsService, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
6
+ export type { HandleWithProof } from '../generated/es/inco/kms/lite/v1/types_pb.js';
7
+ export * from './attested-compute.js';
8
+ export * from './attested-decrypt.js';
9
+ export * from './deployments.js';
10
+ export * from './lightning.js';
11
+ export type { AttestedOpts, AttestedOptsDecrypted, AttestedOptsEncrypted, AttestedOptsEphemeral, AttestedRevealOpts, AttestedWithVoucherOpts, AttestedWithVoucherOptsDecrypted, AttestedWithVoucherOptsEncrypted, AttestedWithVoucherOptsEphemeral, } from './types.js';
12
+ export { generateXwingKeypair } from './xwing.js';
13
+ export type { XwingKeypair } from './xwing.js';