@aztec/foundation 0.74.0 → 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2

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 (554) hide show
  1. package/dest/abi/abi.js +157 -93
  2. package/dest/abi/buffer.js +9 -9
  3. package/dest/abi/decoder.js +89 -86
  4. package/dest/abi/encoder.js +91 -87
  5. package/dest/abi/event_selector.js +25 -33
  6. package/dest/abi/function_selector.js +28 -33
  7. package/dest/abi/index.js +0 -1
  8. package/dest/abi/note_selector.js +15 -21
  9. package/dest/abi/selector.js +22 -29
  10. package/dest/abi/u128.js +11 -5
  11. package/dest/abi/utils.js +9 -20
  12. package/dest/array/array.js +19 -26
  13. package/dest/array/index.js +0 -1
  14. package/dest/async-map/index.js +2 -4
  15. package/dest/async-pool/index.js +6 -9
  16. package/dest/aztec-address/index.js +14 -19
  17. package/dest/bigint-buffer/index.js +6 -13
  18. package/dest/buffer/buffer32.js +53 -66
  19. package/dest/buffer/index.js +0 -1
  20. package/dest/collection/array.js +47 -59
  21. package/dest/collection/index.js +0 -1
  22. package/dest/collection/object.js +9 -9
  23. package/dest/committable/committable.js +15 -20
  24. package/dest/committable/index.js +0 -1
  25. package/dest/config/env_var.js +1 -2
  26. package/dest/config/index.js +31 -36
  27. package/dest/crypto/index.js +0 -1
  28. package/dest/crypto/keccak/index.js +60 -69
  29. package/dest/crypto/keys/index.js +1 -2
  30. package/dest/crypto/pedersen/index.js +0 -1
  31. package/dest/crypto/pedersen/pedersen.elliptic.js +153 -146
  32. package/dest/crypto/pedersen/pedersen.noble.js +140 -142
  33. package/dest/crypto/pedersen/pedersen.wasm.js +14 -13
  34. package/dest/crypto/poseidon/index.js +10 -14
  35. package/dest/crypto/random/index.js +7 -12
  36. package/dest/crypto/random/randomness_singleton.js +12 -12
  37. package/dest/crypto/secp256k1-signer/index.js +0 -1
  38. package/dest/crypto/secp256k1-signer/secp256k1_signer.js +8 -9
  39. package/dest/crypto/secp256k1-signer/utils.js +11 -16
  40. package/dest/crypto/sha256/index.js +80 -30
  41. package/dest/crypto/sha512/index.js +2 -4
  42. package/dest/crypto/sync/index.js +0 -1
  43. package/dest/crypto/sync/pedersen/index.js +14 -13
  44. package/dest/crypto/sync/poseidon/index.js +10 -14
  45. package/dest/decorators/index.js +0 -1
  46. package/dest/decorators/memoize.js +1 -2
  47. package/dest/error/index.js +6 -19
  48. package/dest/eth-address/index.js +92 -113
  49. package/dest/eth-signature/eth_signature.js +21 -27
  50. package/dest/eth-signature/index.js +0 -1
  51. package/dest/fields/coordinate.js +47 -46
  52. package/dest/fields/fields.js +112 -127
  53. package/dest/fields/index.js +0 -1
  54. package/dest/fields/point.js +119 -129
  55. package/dest/fs/index.js +0 -1
  56. package/dest/fs/run_in_dir.js +6 -6
  57. package/dest/index.js +0 -2
  58. package/dest/iterable/all.js +3 -4
  59. package/dest/iterable/filter.js +10 -11
  60. package/dest/iterable/index.js +0 -1
  61. package/dest/iterable/isAsyncIt.js +1 -3
  62. package/dest/iterable/map.js +10 -11
  63. package/dest/iterable/peek.js +14 -14
  64. package/dest/iterable/sort.js +4 -5
  65. package/dest/iterable/take.js +6 -7
  66. package/dest/iterable/toArray.js +1 -2
  67. package/dest/jest/setup.js +7 -0
  68. package/dest/json-rpc/client/fetch.js +21 -19
  69. package/dest/json-rpc/client/index.js +0 -1
  70. package/dest/json-rpc/client/safe_json_rpc_client.js +16 -8
  71. package/dest/json-rpc/convert.js +10 -20
  72. package/dest/json-rpc/fixtures/class_a.js +8 -5
  73. package/dest/json-rpc/fixtures/class_b.js +8 -5
  74. package/dest/json-rpc/fixtures/test_state.js +53 -40
  75. package/dest/json-rpc/index.js +0 -1
  76. package/dest/json-rpc/js_utils.js +2 -5
  77. package/dest/json-rpc/server/index.js +0 -1
  78. package/dest/json-rpc/server/safe_json_rpc_server.js +145 -101
  79. package/dest/json-rpc/server/telemetry.js +0 -2
  80. package/dest/json-rpc/test/index.js +0 -1
  81. package/dest/json-rpc/test/integration.js +8 -3
  82. package/dest/log/console.js +14 -16
  83. package/dest/log/debug.js +9 -18
  84. package/dest/log/gcloud-logger-config.js +17 -15
  85. package/dest/log/index.js +0 -1
  86. package/dest/log/log-filters.js +13 -11
  87. package/dest/log/log-levels.js +10 -2
  88. package/dest/log/log_fn.js +1 -2
  89. package/dest/log/log_history.js +21 -25
  90. package/dest/log/pino-logger.js +82 -64
  91. package/dest/message/index.js +7 -3
  92. package/dest/mutex/index.js +34 -32
  93. package/dest/mutex/mutex_database.js +4 -2
  94. package/dest/noir/index.js +0 -1
  95. package/dest/noir/noir_package_config.js +13 -8
  96. package/dest/promise/index.js +0 -1
  97. package/dest/promise/running-promise.js +28 -28
  98. package/dest/promise/utils.js +3 -5
  99. package/dest/queue/base_memory_queue.js +51 -59
  100. package/dest/queue/bounded_serial_queue.js +41 -51
  101. package/dest/queue/fifo_memory_queue.js +4 -8
  102. package/dest/queue/index.js +0 -1
  103. package/dest/queue/priority_memory_queue.js +3 -4
  104. package/dest/queue/priority_queue.js +5 -5
  105. package/dest/queue/semaphore.js +15 -19
  106. package/dest/queue/serial_queue.js +37 -47
  107. package/dest/retry/index.js +21 -18
  108. package/dest/running-promise/index.js +0 -1
  109. package/dest/schemas/api.js +2 -7
  110. package/dest/schemas/index.js +0 -1
  111. package/dest/schemas/parse.js +4 -8
  112. package/dest/schemas/schemas.js +33 -48
  113. package/dest/schemas/types.js +1 -2
  114. package/dest/schemas/utils.js +18 -31
  115. package/dest/serialize/buffer_reader.js +164 -188
  116. package/dest/serialize/field_reader.js +70 -79
  117. package/dest/serialize/free_funcs.js +40 -37
  118. package/dest/serialize/index.js +0 -1
  119. package/dest/serialize/serialize.js +72 -83
  120. package/dest/serialize/type_registry.js +10 -14
  121. package/dest/serialize/types.js +4 -5
  122. package/dest/sleep/index.js +25 -29
  123. package/dest/string/index.js +0 -1
  124. package/dest/testing/files/index.js +5 -8
  125. package/dest/testing/index.js +0 -1
  126. package/dest/testing/port_allocator.js +7 -10
  127. package/dest/testing/snapshot_serializer.js +14 -9
  128. package/dest/testing/test_data.js +7 -8
  129. package/dest/timer/date.js +9 -7
  130. package/dest/timer/elapsed.js +10 -7
  131. package/dest/timer/index.js +0 -1
  132. package/dest/timer/timeout.js +34 -34
  133. package/dest/timer/timer.js +17 -21
  134. package/dest/transport/browser/index.js +0 -1
  135. package/dest/transport/browser/message_port_socket.js +26 -30
  136. package/dest/transport/browser/shared_worker_connector.js +8 -10
  137. package/dest/transport/browser/shared_worker_listener.js +13 -17
  138. package/dest/transport/browser/worker_connector.js +12 -12
  139. package/dest/transport/browser/worker_listener.js +13 -17
  140. package/dest/transport/dispatch/create_dispatch_fn.js +2 -4
  141. package/dest/transport/dispatch/create_dispatch_proxy.js +16 -13
  142. package/dest/transport/dispatch/messages.js +4 -3
  143. package/dest/transport/index.js +0 -1
  144. package/dest/transport/interface/connector.js +3 -2
  145. package/dest/transport/interface/listener.js +4 -2
  146. package/dest/transport/interface/socket.js +7 -2
  147. package/dest/transport/interface/transferable.js +7 -9
  148. package/dest/transport/node/index.js +0 -1
  149. package/dest/transport/node/node_connector.js +9 -11
  150. package/dest/transport/node/node_connector_socket.js +21 -25
  151. package/dest/transport/node/node_listener.js +11 -15
  152. package/dest/transport/node/node_listener_socket.js +23 -27
  153. package/dest/transport/transport_client.js +47 -46
  154. package/dest/transport/transport_server.js +68 -55
  155. package/dest/trees/index.js +0 -1
  156. package/dest/trees/unbalanced_merkle_tree.js +26 -16
  157. package/dest/trees/unbalanced_tree_store.js +43 -29
  158. package/dest/types/index.js +1 -3
  159. package/dest/url/index.js +4 -8
  160. package/dest/validation/index.js +2 -5
  161. package/dest/wasm/empty_wasi_sdk.js +142 -160
  162. package/dest/wasm/index.js +0 -1
  163. package/dest/wasm/wasm_module.js +80 -90
  164. package/dest/worker/browser/index.js +0 -1
  165. package/dest/worker/browser/start_web_module.js +9 -5
  166. package/dest/worker/browser/web_data_store.js +12 -15
  167. package/dest/worker/browser/web_worker.js +6 -5
  168. package/dest/worker/data_store.js +3 -2
  169. package/dest/worker/index.js +0 -1
  170. package/dest/worker/node/index.js +0 -1
  171. package/dest/worker/node/node_data_store.js +4 -5
  172. package/dest/worker/node/node_worker.js +6 -5
  173. package/dest/worker/node/start_node_module.js +9 -5
  174. package/dest/worker/wasm_worker.js +3 -2
  175. package/dest/worker/worker_pool.js +32 -43
  176. package/package.json +3 -4
  177. package/src/fields/fields.ts +2 -2
  178. package/src/index.ts +0 -1
  179. package/src/queue/serial_queue.ts +1 -1
  180. package/src/testing/files/index.ts +2 -1
  181. package/src/wasm/index.ts +1 -1
  182. package/src/worker/index.ts +1 -1
  183. package/dest/abi/abi.d.ts +0 -853
  184. package/dest/abi/abi.d.ts.map +0 -1
  185. package/dest/abi/buffer.d.ts +0 -18
  186. package/dest/abi/buffer.d.ts.map +0 -1
  187. package/dest/abi/decoder.d.ts +0 -58
  188. package/dest/abi/decoder.d.ts.map +0 -1
  189. package/dest/abi/encoder.d.ts +0 -16
  190. package/dest/abi/encoder.d.ts.map +0 -1
  191. package/dest/abi/event_selector.d.ts +0 -52
  192. package/dest/abi/event_selector.d.ts.map +0 -1
  193. package/dest/abi/function_selector.d.ts +0 -65
  194. package/dest/abi/function_selector.d.ts.map +0 -1
  195. package/dest/abi/index.d.ts +0 -10
  196. package/dest/abi/index.d.ts.map +0 -1
  197. package/dest/abi/note_selector.d.ts +0 -42
  198. package/dest/abi/note_selector.d.ts.map +0 -1
  199. package/dest/abi/selector.d.ts +0 -42
  200. package/dest/abi/selector.d.ts.map +0 -1
  201. package/dest/abi/u128.d.ts +0 -13
  202. package/dest/abi/u128.d.ts.map +0 -1
  203. package/dest/abi/utils.d.ts +0 -44
  204. package/dest/abi/utils.d.ts.map +0 -1
  205. package/dest/array/array.d.ts +0 -71
  206. package/dest/array/array.d.ts.map +0 -1
  207. package/dest/array/index.d.ts +0 -2
  208. package/dest/array/index.d.ts.map +0 -1
  209. package/dest/async-map/index.d.ts +0 -13
  210. package/dest/async-map/index.d.ts.map +0 -1
  211. package/dest/async-pool/index.d.ts +0 -3
  212. package/dest/async-pool/index.d.ts.map +0 -1
  213. package/dest/aztec-address/index.d.ts +0 -57
  214. package/dest/aztec-address/index.d.ts.map +0 -1
  215. package/dest/bigint-buffer/index.d.ts +0 -42
  216. package/dest/bigint-buffer/index.d.ts.map +0 -1
  217. package/dest/blob/blob.d.ts +0 -154
  218. package/dest/blob/blob.d.ts.map +0 -1
  219. package/dest/blob/blob.js +0 -264
  220. package/dest/blob/encoding.d.ts +0 -53
  221. package/dest/blob/encoding.d.ts.map +0 -1
  222. package/dest/blob/encoding.js +0 -87
  223. package/dest/blob/errors.d.ts +0 -4
  224. package/dest/blob/errors.d.ts.map +0 -1
  225. package/dest/blob/errors.js +0 -7
  226. package/dest/blob/index.d.ts +0 -6
  227. package/dest/blob/index.d.ts.map +0 -1
  228. package/dest/blob/index.js +0 -22
  229. package/dest/blob/interface.d.ts +0 -10
  230. package/dest/blob/interface.d.ts.map +0 -1
  231. package/dest/blob/interface.js +0 -2
  232. package/dest/blob/mocks.d.ts +0 -20
  233. package/dest/blob/mocks.d.ts.map +0 -1
  234. package/dest/blob/mocks.js +0 -42
  235. package/dest/buffer/buffer32.d.ts +0 -91
  236. package/dest/buffer/buffer32.d.ts.map +0 -1
  237. package/dest/buffer/index.d.ts +0 -2
  238. package/dest/buffer/index.d.ts.map +0 -1
  239. package/dest/collection/array.d.ts +0 -101
  240. package/dest/collection/array.d.ts.map +0 -1
  241. package/dest/collection/index.d.ts +0 -3
  242. package/dest/collection/index.d.ts.map +0 -1
  243. package/dest/collection/object.d.ts +0 -14
  244. package/dest/collection/object.d.ts.map +0 -1
  245. package/dest/committable/committable.d.ts +0 -28
  246. package/dest/committable/committable.d.ts.map +0 -1
  247. package/dest/committable/index.d.ts +0 -2
  248. package/dest/committable/index.d.ts.map +0 -1
  249. package/dest/config/env_var.d.ts +0 -2
  250. package/dest/config/env_var.d.ts.map +0 -1
  251. package/dest/config/index.d.ts +0 -66
  252. package/dest/config/index.d.ts.map +0 -1
  253. package/dest/crypto/index.d.ts +0 -9
  254. package/dest/crypto/index.d.ts.map +0 -1
  255. package/dest/crypto/keccak/index.d.ts +0 -28
  256. package/dest/crypto/keccak/index.d.ts.map +0 -1
  257. package/dest/crypto/keys/index.d.ts +0 -5
  258. package/dest/crypto/keys/index.d.ts.map +0 -1
  259. package/dest/crypto/pedersen/index.d.ts +0 -2
  260. package/dest/crypto/pedersen/index.d.ts.map +0 -1
  261. package/dest/crypto/pedersen/pedersen.elliptic.d.ts +0 -13
  262. package/dest/crypto/pedersen/pedersen.elliptic.d.ts.map +0 -1
  263. package/dest/crypto/pedersen/pedersen.noble.d.ts +0 -11
  264. package/dest/crypto/pedersen/pedersen.noble.d.ts.map +0 -1
  265. package/dest/crypto/pedersen/pedersen.wasm.d.ts +0 -21
  266. package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +0 -1
  267. package/dest/crypto/poseidon/index.d.ts +0 -26
  268. package/dest/crypto/poseidon/index.d.ts.map +0 -1
  269. package/dest/crypto/random/index.d.ts +0 -25
  270. package/dest/crypto/random/index.d.ts.map +0 -1
  271. package/dest/crypto/random/randomness_singleton.d.ts +0 -25
  272. package/dest/crypto/random/randomness_singleton.d.ts.map +0 -1
  273. package/dest/crypto/secp256k1-signer/index.d.ts +0 -3
  274. package/dest/crypto/secp256k1-signer/index.d.ts.map +0 -1
  275. package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts +0 -24
  276. package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts.map +0 -1
  277. package/dest/crypto/secp256k1-signer/utils.d.ts +0 -40
  278. package/dest/crypto/secp256k1-signer/utils.d.ts.map +0 -1
  279. package/dest/crypto/sha256/index.d.ts +0 -20
  280. package/dest/crypto/sha256/index.d.ts.map +0 -1
  281. package/dest/crypto/sha512/index.d.ts +0 -11
  282. package/dest/crypto/sha512/index.d.ts.map +0 -1
  283. package/dest/crypto/sync/index.d.ts +0 -3
  284. package/dest/crypto/sync/index.d.ts.map +0 -1
  285. package/dest/crypto/sync/pedersen/index.d.ts +0 -21
  286. package/dest/crypto/sync/pedersen/index.d.ts.map +0 -1
  287. package/dest/crypto/sync/poseidon/index.d.ts +0 -26
  288. package/dest/crypto/sync/poseidon/index.d.ts.map +0 -1
  289. package/dest/decorators/index.d.ts +0 -2
  290. package/dest/decorators/index.d.ts.map +0 -1
  291. package/dest/decorators/memoize.d.ts +0 -2
  292. package/dest/decorators/memoize.d.ts.map +0 -1
  293. package/dest/error/index.d.ts +0 -21
  294. package/dest/error/index.d.ts.map +0 -1
  295. package/dest/eth-address/index.d.ts +0 -134
  296. package/dest/eth-address/index.d.ts.map +0 -1
  297. package/dest/eth-signature/eth_signature.d.ts +0 -62
  298. package/dest/eth-signature/eth_signature.d.ts.map +0 -1
  299. package/dest/eth-signature/index.d.ts +0 -2
  300. package/dest/eth-signature/index.d.ts.map +0 -1
  301. package/dest/fields/coordinate.d.ts +0 -68
  302. package/dest/fields/coordinate.d.ts.map +0 -1
  303. package/dest/fields/fields.d.ts +0 -176
  304. package/dest/fields/fields.d.ts.map +0 -1
  305. package/dest/fields/index.d.ts +0 -4
  306. package/dest/fields/index.d.ts.map +0 -1
  307. package/dest/fields/point.d.ts +0 -175
  308. package/dest/fields/point.d.ts.map +0 -1
  309. package/dest/fs/index.d.ts +0 -2
  310. package/dest/fs/index.d.ts.map +0 -1
  311. package/dest/fs/run_in_dir.d.ts +0 -2
  312. package/dest/fs/run_in_dir.d.ts.map +0 -1
  313. package/dest/index.d.ts +0 -34
  314. package/dest/index.d.ts.map +0 -1
  315. package/dest/iterable/all.d.ts +0 -9
  316. package/dest/iterable/all.d.ts.map +0 -1
  317. package/dest/iterable/filter.d.ts +0 -10
  318. package/dest/iterable/filter.d.ts.map +0 -1
  319. package/dest/iterable/index.d.ts +0 -8
  320. package/dest/iterable/index.d.ts.map +0 -1
  321. package/dest/iterable/isAsyncIt.d.ts +0 -7
  322. package/dest/iterable/isAsyncIt.d.ts.map +0 -1
  323. package/dest/iterable/map.d.ts +0 -12
  324. package/dest/iterable/map.d.ts.map +0 -1
  325. package/dest/iterable/peek.d.ts +0 -19
  326. package/dest/iterable/peek.d.ts.map +0 -1
  327. package/dest/iterable/sort.d.ts +0 -14
  328. package/dest/iterable/sort.d.ts.map +0 -1
  329. package/dest/iterable/take.d.ts +0 -10
  330. package/dest/iterable/take.d.ts.map +0 -1
  331. package/dest/iterable/toArray.d.ts +0 -2
  332. package/dest/iterable/toArray.d.ts.map +0 -1
  333. package/dest/json-rpc/client/fetch.d.ts +0 -21
  334. package/dest/json-rpc/client/fetch.d.ts.map +0 -1
  335. package/dest/json-rpc/client/index.d.ts +0 -3
  336. package/dest/json-rpc/client/index.d.ts.map +0 -1
  337. package/dest/json-rpc/client/safe_json_rpc_client.d.ts +0 -13
  338. package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +0 -1
  339. package/dest/json-rpc/convert.d.ts +0 -20
  340. package/dest/json-rpc/convert.d.ts.map +0 -1
  341. package/dest/json-rpc/fixtures/class_a.d.ts +0 -11
  342. package/dest/json-rpc/fixtures/class_a.d.ts.map +0 -1
  343. package/dest/json-rpc/fixtures/class_b.d.ts +0 -11
  344. package/dest/json-rpc/fixtures/class_b.d.ts.map +0 -1
  345. package/dest/json-rpc/fixtures/test_state.d.ts +0 -89
  346. package/dest/json-rpc/fixtures/test_state.d.ts.map +0 -1
  347. package/dest/json-rpc/index.d.ts +0 -2
  348. package/dest/json-rpc/index.d.ts.map +0 -1
  349. package/dest/json-rpc/js_utils.d.ts +0 -13
  350. package/dest/json-rpc/js_utils.d.ts.map +0 -1
  351. package/dest/json-rpc/server/index.d.ts +0 -2
  352. package/dest/json-rpc/server/index.d.ts.map +0 -1
  353. package/dest/json-rpc/server/safe_json_rpc_server.d.ts +0 -140
  354. package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +0 -1
  355. package/dest/json-rpc/server/telemetry.d.ts +0 -2
  356. package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
  357. package/dest/json-rpc/test/index.d.ts +0 -2
  358. package/dest/json-rpc/test/index.d.ts.map +0 -1
  359. package/dest/json-rpc/test/integration.d.ts +0 -13
  360. package/dest/json-rpc/test/integration.d.ts.map +0 -1
  361. package/dest/log/console.d.ts +0 -11
  362. package/dest/log/console.d.ts.map +0 -1
  363. package/dest/log/debug.d.ts +0 -56
  364. package/dest/log/debug.d.ts.map +0 -1
  365. package/dest/log/gcloud-logger-config.d.ts +0 -14
  366. package/dest/log/gcloud-logger-config.d.ts.map +0 -1
  367. package/dest/log/index.d.ts +0 -6
  368. package/dest/log/index.d.ts.map +0 -1
  369. package/dest/log/log-filters.d.ts +0 -7
  370. package/dest/log/log-filters.d.ts.map +0 -1
  371. package/dest/log/log-levels.d.ts +0 -3
  372. package/dest/log/log-levels.d.ts.map +0 -1
  373. package/dest/log/log_fn.d.ts +0 -7
  374. package/dest/log/log_fn.d.ts.map +0 -1
  375. package/dest/log/log_history.d.ts +0 -31
  376. package/dest/log/log_history.d.ts.map +0 -1
  377. package/dest/log/pino-logger.d.ts +0 -53
  378. package/dest/log/pino-logger.d.ts.map +0 -1
  379. package/dest/message/index.d.ts +0 -32
  380. package/dest/message/index.d.ts.map +0 -1
  381. package/dest/mutex/index.d.ts +0 -53
  382. package/dest/mutex/index.d.ts.map +0 -1
  383. package/dest/mutex/mutex_database.d.ts +0 -10
  384. package/dest/mutex/mutex_database.d.ts.map +0 -1
  385. package/dest/noir/index.d.ts +0 -2
  386. package/dest/noir/index.d.ts.map +0 -1
  387. package/dest/noir/noir_package_config.d.ts +0 -129
  388. package/dest/noir/noir_package_config.d.ts.map +0 -1
  389. package/dest/promise/index.d.ts +0 -3
  390. package/dest/promise/index.d.ts.map +0 -1
  391. package/dest/promise/running-promise.d.ts +0 -41
  392. package/dest/promise/running-promise.d.ts.map +0 -1
  393. package/dest/promise/utils.d.ts +0 -12
  394. package/dest/promise/utils.d.ts.map +0 -1
  395. package/dest/queue/base_memory_queue.d.ts +0 -65
  396. package/dest/queue/base_memory_queue.d.ts.map +0 -1
  397. package/dest/queue/bounded_serial_queue.d.ts +0 -56
  398. package/dest/queue/bounded_serial_queue.d.ts.map +0 -1
  399. package/dest/queue/fifo_memory_queue.d.ts +0 -21
  400. package/dest/queue/fifo_memory_queue.d.ts.map +0 -1
  401. package/dest/queue/index.d.ts +0 -6
  402. package/dest/queue/index.d.ts.map +0 -1
  403. package/dest/queue/priority_memory_queue.d.ts +0 -13
  404. package/dest/queue/priority_memory_queue.d.ts.map +0 -1
  405. package/dest/queue/priority_queue.d.ts +0 -14
  406. package/dest/queue/priority_queue.d.ts.map +0 -1
  407. package/dest/queue/semaphore.d.ts +0 -23
  408. package/dest/queue/semaphore.d.ts.map +0 -1
  409. package/dest/queue/serial_queue.d.ts +0 -49
  410. package/dest/queue/serial_queue.d.ts.map +0 -1
  411. package/dest/retry/index.d.ts +0 -44
  412. package/dest/retry/index.d.ts.map +0 -1
  413. package/dest/running-promise/index.d.ts +0 -2
  414. package/dest/running-promise/index.d.ts.map +0 -1
  415. package/dest/schemas/api.d.ts +0 -21
  416. package/dest/schemas/api.d.ts.map +0 -1
  417. package/dest/schemas/index.d.ts +0 -6
  418. package/dest/schemas/index.d.ts.map +0 -1
  419. package/dest/schemas/parse.d.ts +0 -9
  420. package/dest/schemas/parse.d.ts.map +0 -1
  421. package/dest/schemas/schemas.d.ts +0 -60
  422. package/dest/schemas/schemas.d.ts.map +0 -1
  423. package/dest/schemas/types.d.ts +0 -3
  424. package/dest/schemas/types.d.ts.map +0 -1
  425. package/dest/schemas/utils.d.ts +0 -53
  426. package/dest/schemas/utils.d.ts.map +0 -1
  427. package/dest/serialize/buffer_reader.d.ts +0 -239
  428. package/dest/serialize/buffer_reader.d.ts.map +0 -1
  429. package/dest/serialize/field_reader.d.ts +0 -112
  430. package/dest/serialize/field_reader.d.ts.map +0 -1
  431. package/dest/serialize/free_funcs.d.ts +0 -105
  432. package/dest/serialize/free_funcs.d.ts.map +0 -1
  433. package/dest/serialize/index.d.ts +0 -7
  434. package/dest/serialize/index.d.ts.map +0 -1
  435. package/dest/serialize/serialize.d.ts +0 -182
  436. package/dest/serialize/serialize.d.ts.map +0 -1
  437. package/dest/serialize/type_registry.d.ts +0 -23
  438. package/dest/serialize/type_registry.d.ts.map +0 -1
  439. package/dest/serialize/types.d.ts +0 -33
  440. package/dest/serialize/types.d.ts.map +0 -1
  441. package/dest/sleep/index.d.ts +0 -51
  442. package/dest/sleep/index.d.ts.map +0 -1
  443. package/dest/string/index.d.ts +0 -11
  444. package/dest/string/index.d.ts.map +0 -1
  445. package/dest/testing/files/index.d.ts +0 -19
  446. package/dest/testing/files/index.d.ts.map +0 -1
  447. package/dest/testing/index.d.ts +0 -4
  448. package/dest/testing/index.d.ts.map +0 -1
  449. package/dest/testing/port_allocator.d.ts +0 -10
  450. package/dest/testing/port_allocator.d.ts.map +0 -1
  451. package/dest/testing/snapshot_serializer.d.ts +0 -5
  452. package/dest/testing/snapshot_serializer.d.ts.map +0 -1
  453. package/dest/testing/test_data.d.ts +0 -7
  454. package/dest/testing/test_data.d.ts.map +0 -1
  455. package/dest/timer/date.d.ts +0 -13
  456. package/dest/timer/date.d.ts.map +0 -1
  457. package/dest/timer/elapsed.d.ts +0 -13
  458. package/dest/timer/elapsed.d.ts.map +0 -1
  459. package/dest/timer/index.d.ts +0 -5
  460. package/dest/timer/index.d.ts.map +0 -1
  461. package/dest/timer/timeout.d.ts +0 -41
  462. package/dest/timer/timeout.d.ts.map +0 -1
  463. package/dest/timer/timer.d.ts +0 -37
  464. package/dest/timer/timer.d.ts.map +0 -1
  465. package/dest/transport/browser/index.d.ts +0 -5
  466. package/dest/transport/browser/index.d.ts.map +0 -1
  467. package/dest/transport/browser/message_port_socket.d.ts +0 -37
  468. package/dest/transport/browser/message_port_socket.d.ts.map +0 -1
  469. package/dest/transport/browser/shared_worker_connector.d.ts +0 -19
  470. package/dest/transport/browser/shared_worker_connector.d.ts.map +0 -1
  471. package/dest/transport/browser/shared_worker_listener.d.ts +0 -38
  472. package/dest/transport/browser/shared_worker_listener.d.ts.map +0 -1
  473. package/dest/transport/browser/worker_connector.d.ts +0 -26
  474. package/dest/transport/browser/worker_connector.d.ts.map +0 -1
  475. package/dest/transport/browser/worker_listener.d.ts +0 -39
  476. package/dest/transport/browser/worker_listener.d.ts.map +0 -1
  477. package/dest/transport/dispatch/create_dispatch_fn.d.ts +0 -25
  478. package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +0 -1
  479. package/dest/transport/dispatch/create_dispatch_proxy.d.ts +0 -102
  480. package/dest/transport/dispatch/create_dispatch_proxy.d.ts.map +0 -1
  481. package/dest/transport/dispatch/messages.d.ts +0 -52
  482. package/dest/transport/dispatch/messages.d.ts.map +0 -1
  483. package/dest/transport/index.d.ts +0 -12
  484. package/dest/transport/index.d.ts.map +0 -1
  485. package/dest/transport/interface/connector.d.ts +0 -8
  486. package/dest/transport/interface/connector.d.ts.map +0 -1
  487. package/dest/transport/interface/listener.d.ts +0 -13
  488. package/dest/transport/interface/listener.d.ts.map +0 -1
  489. package/dest/transport/interface/socket.d.ts +0 -13
  490. package/dest/transport/interface/socket.d.ts.map +0 -1
  491. package/dest/transport/interface/transferable.d.ts +0 -68
  492. package/dest/transport/interface/transferable.d.ts.map +0 -1
  493. package/dest/transport/node/index.d.ts +0 -3
  494. package/dest/transport/node/index.d.ts.map +0 -1
  495. package/dest/transport/node/node_connector.d.ts +0 -28
  496. package/dest/transport/node/node_connector.d.ts.map +0 -1
  497. package/dest/transport/node/node_connector_socket.d.ts +0 -42
  498. package/dest/transport/node/node_connector_socket.d.ts.map +0 -1
  499. package/dest/transport/node/node_listener.d.ts +0 -26
  500. package/dest/transport/node/node_listener.d.ts.map +0 -1
  501. package/dest/transport/node/node_listener_socket.d.ts +0 -37
  502. package/dest/transport/node/node_listener_socket.d.ts.map +0 -1
  503. package/dest/transport/transport_client.d.ts +0 -61
  504. package/dest/transport/transport_client.d.ts.map +0 -1
  505. package/dest/transport/transport_server.d.ts +0 -56
  506. package/dest/transport/transport_server.d.ts.map +0 -1
  507. package/dest/trees/index.d.ts +0 -59
  508. package/dest/trees/index.d.ts.map +0 -1
  509. package/dest/trees/unbalanced_merkle_tree.d.ts +0 -17
  510. package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
  511. package/dest/trees/unbalanced_tree_store.d.ts +0 -19
  512. package/dest/trees/unbalanced_tree_store.d.ts.map +0 -1
  513. package/dest/types/index.d.ts +0 -19
  514. package/dest/types/index.d.ts.map +0 -1
  515. package/dest/url/index.d.ts +0 -9
  516. package/dest/url/index.d.ts.map +0 -1
  517. package/dest/validation/index.d.ts +0 -9
  518. package/dest/validation/index.d.ts.map +0 -1
  519. package/dest/wasm/empty_wasi_sdk.d.ts +0 -130
  520. package/dest/wasm/empty_wasi_sdk.d.ts.map +0 -1
  521. package/dest/wasm/index.d.ts +0 -2
  522. package/dest/wasm/index.d.ts.map +0 -1
  523. package/dest/wasm/wasm_module.d.ts +0 -136
  524. package/dest/wasm/wasm_module.d.ts.map +0 -1
  525. package/dest/worker/browser/index.d.ts +0 -3
  526. package/dest/worker/browser/index.d.ts.map +0 -1
  527. package/dest/worker/browser/start_web_module.d.ts +0 -7
  528. package/dest/worker/browser/start_web_module.d.ts.map +0 -1
  529. package/dest/worker/browser/web_data_store.d.ts +0 -24
  530. package/dest/worker/browser/web_data_store.d.ts.map +0 -1
  531. package/dest/worker/browser/web_worker.d.ts +0 -10
  532. package/dest/worker/browser/web_worker.d.ts.map +0 -1
  533. package/dest/worker/data_store.d.ts +0 -21
  534. package/dest/worker/data_store.d.ts.map +0 -1
  535. package/dest/worker/index.d.ts +0 -3
  536. package/dest/worker/index.d.ts.map +0 -1
  537. package/dest/worker/node/index.d.ts +0 -3
  538. package/dest/worker/node/index.d.ts.map +0 -1
  539. package/dest/worker/node/node_data_store.d.ts +0 -13
  540. package/dest/worker/node/node_data_store.d.ts.map +0 -1
  541. package/dest/worker/node/node_worker.d.ts +0 -6
  542. package/dest/worker/node/node_worker.d.ts.map +0 -1
  543. package/dest/worker/node/start_node_module.d.ts +0 -7
  544. package/dest/worker/node/start_node_module.d.ts.map +0 -1
  545. package/dest/worker/wasm_worker.d.ts +0 -9
  546. package/dest/worker/wasm_worker.d.ts.map +0 -1
  547. package/dest/worker/worker_pool.d.ts +0 -40
  548. package/dest/worker/worker_pool.d.ts.map +0 -1
  549. package/src/blob/blob.ts +0 -311
  550. package/src/blob/encoding.ts +0 -98
  551. package/src/blob/errors.ts +0 -6
  552. package/src/blob/index.ts +0 -22
  553. package/src/blob/interface.ts +0 -11
  554. package/src/blob/mocks.ts +0 -48
@@ -1,42 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import { type Worker } from 'worker_threads';
3
- import { type Socket } from '../interface/socket.js';
4
- /**
5
- * NodeConnectorSocket is a wrapper class that implements the Socket interface for messaging between
6
- * the main thread and worker threads in a Node.js environment. It uses the Worker API for
7
- * communication by sending and receiving messages through postMessage and handling messages using
8
- * event listeners.
9
- *
10
- * The send method sends messages to the worker thread, and the registerHandler method registers a
11
- * callback function to handle incoming messages from the worker. The close method cleans up
12
- * resources when the socket is no longer needed.
13
- */
14
- export declare class NodeConnectorSocket implements Socket {
15
- private worker;
16
- constructor(worker: Worker);
17
- /**
18
- * Sends a message from the NodeConnectorSocket instance to the associated worker thread.
19
- * The 'msg' can be any data type and 'transfer' is an optional array of transferable objects
20
- * that can be transferred with zero-copy semantics. The function returns a resolved Promise
21
- * once the message has been posted.
22
- *
23
- * @param msg - The message to send to the worker thread.
24
- * @param transfer - Optional array of Transferable objects to transfer ownership alongside the message.
25
- * @returns A Promise that resolves when the message has been posted.
26
- */
27
- send(msg: any, transfer?: Transferable[]): Promise<void>;
28
- /**
29
- * Registers a callback function to handle incoming messages from the worker.
30
- * The provided callback will be executed whenever a message is received from
31
- * the worker, passing the message as its single argument.
32
- *
33
- * @param cb - The callback function to be called when a message is received.
34
- */
35
- registerHandler(cb: (msg: any) => any): void;
36
- /**
37
- * Closes the worker connection and removes all event listeners.
38
- * Sends an undefined message to the worker for graceful termination.
39
- */
40
- close(): void;
41
- }
42
- //# sourceMappingURL=node_connector_socket.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_connector_socket.d.ts","sourceRoot":"","sources":["../../../src/transport/node/node_connector_socket.ts"],"names":[],"mappings":";AAAA,OAAO,EAAyB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,YAAW,MAAM;IACpC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAElC;;;;;;;;;OASG;IACH,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,GAAE,YAAY,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI;IAI5C;;;OAGG;IACH,KAAK;CAIN"}
@@ -1,26 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import EventEmitter from 'events';
3
- import { type Listener } from '../interface/listener.js';
4
- /**
5
- * NodeListener is an event-driven class that extends EventEmitter and implements the Listener interface.
6
- * It provides methods to open and close communication with a worker thread using the NodeListenerSocket.
7
- * The 'new_socket' event is emitted when a new NodeListenerSocket instance is created, allowing for
8
- * efficient processing of incoming messages from the parent thread.
9
- */
10
- export declare class NodeListener extends EventEmitter implements Listener {
11
- constructor();
12
- /**
13
- * Opens a new connection to a parent worker thread and emits an event with the created NodeListenerSocket instance.
14
- * The 'new_socket' event can be listened for, providing access to the newly created NodeListenerSocket.
15
- *
16
- * Fires NodeListener#new_socket.
17
- */
18
- open(): void;
19
- /**
20
- * Closes the NodeListener instance.
21
- * This method currently has no implementation, as there is no need to perform any actions
22
- * when closing a NodeListener. It exists for compatibility with the Listener interface.
23
- */
24
- close(): void;
25
- }
26
- //# sourceMappingURL=node_listener.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_listener.d.ts","sourceRoot":"","sources":["../../../src/transport/node/node_listener.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,YAAa,YAAW,QAAQ;;IAKhE;;;;;OAKG;IACH,IAAI;IAIJ;;;;OAIG;IACH,KAAK;CACN"}
@@ -1,37 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import { type MessagePort } from 'worker_threads';
3
- import { type Socket } from '../interface/socket.js';
4
- /**
5
- * An implementation of a TransportSocket using MessagePorts.
6
- */
7
- export declare class NodeListenerSocket implements Socket {
8
- private port;
9
- constructor(port: MessagePort);
10
- /**
11
- * Sends a message through the MessagePort along with any provided Transferables.
12
- * The transfer list allows for efficient sending of certain types of data,
13
- * such as ArrayBuffer, ImageBitmap, and MessagePort.
14
- * The Promise resolves once the message has been successfully sent.
15
- *
16
- * @param msg - The message to be sent through the MessagePort.
17
- * @param transfer - An optional array of Transferable objects to be transferred.
18
- * @returns A Promise that resolves once the message has been sent.
19
- */
20
- send(msg: any, transfer?: Transferable[]): Promise<void>;
21
- /**
22
- * Registers a callback function to handle incoming messages from the MessagePort.
23
- * When a message is received, the provided callback function will be invoked with
24
- * the received message as its argument. This method allows for efficient and
25
- * dynamic handling of incoming data in a NodeListenerSocket instance.
26
- *
27
- * @param cb - The callback function to process incoming messages.
28
- */
29
- registerHandler(cb: (msg: any) => any): void;
30
- /**
31
- * Closes the NodeListenerSocket instance, removing all listeners and closing the underlying MessagePort.
32
- * Sends an undefined message to notify any connected ports about the closure before removing event listeners
33
- * and cleaning up resources. This method should be called when the socket is no longer needed to avoid memory leaks.
34
- */
35
- close(): void;
36
- }
37
- //# sourceMappingURL=node_listener_socket.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_listener_socket.d.ts","sourceRoot":"","sources":["../../../src/transport/node/node_listener_socket.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,qBAAa,kBAAmB,YAAW,MAAM;IACnC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC;;;;;;;;;OASG;IACH,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,GAAE,YAAY,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI;IAI5C;;;;OAIG;IACH,KAAK;CAKN"}
@@ -1,61 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- import EventEmitter from 'events';
3
- import { type Connector } from './interface/connector.js';
4
- /**
5
- * Represents a transport client for communication between TransportServer and clients.
6
- * Provides request/response functionality, event handling, and multiplexing support
7
- * for efficient and concurrent communication with a corresponding TransportServer.
8
- */
9
- export interface ITransportClient<Payload> extends EventEmitter {
10
- on(name: 'event_msg', handler: (payload: Payload) => void): this;
11
- emit(name: 'event_msg', payload: Payload): boolean;
12
- }
13
- /**
14
- * A TransportClient provides a request/response and event api to a corresponding TransportServer.
15
- * If `broadcast` is called on TransportServer, TransportClients will emit an `event_msg`.
16
- * The `request` method will block until a response is returned from the TransportServer's dispatch function.
17
- * Request multiplexing is supported.
18
- */
19
- export declare class TransportClient<Payload> extends EventEmitter {
20
- private transportConnect;
21
- private msgId;
22
- private pendingRequests;
23
- private socket?;
24
- constructor(transportConnect: Connector);
25
- /**
26
- * Initializes and opens the socket connection for the TransportClient.
27
- * This method creates a new Socket instance using the provided Connector,
28
- * registers a handler for incoming messages, and establishes the connection.
29
- * It should be called before making any requests or handling events.
30
- *
31
- * @throws An error if the socket is already open or there's an issue opening the connection.
32
- * @returns A Promise that resolves when the socket connection is successfully opened.
33
- */
34
- open(): Promise<void>;
35
- /**
36
- * Close the transport client's socket connection and remove all event listeners.
37
- * This method should be called when the client is no longer needed to ensure proper cleanup
38
- * and prevent potential memory leaks. Once closed, the client cannot be reused and a new
39
- * instance must be created if another connection is needed.
40
- */
41
- close(): void;
42
- /**
43
- * Sends a request to the TransportServer with the given payload and transferable objects.
44
- * The method will block until a response from the TransportServer's dispatch function is returned.
45
- * Request multiplexing is supported, allowing multiple requests to be sent concurrently.
46
- *
47
- * @param payload - The message payload to send to the server.
48
- * @param transfer - An optional array of ArrayBuffer, MessagePort, or ImageBitmap objects to transfer ownership.
49
- * @returns A Promise that resolves with the server's response data or rejects with an error message.
50
- */
51
- request(payload: Payload, transfer?: Transferable[]): Promise<any>;
52
- /**
53
- * Handles incoming socket messages from the TransportServer, such as ResponseMessage and EventMessage.
54
- * If it's an EventMessage, emits an 'event_msg' event with the payload.
55
- * If it's a ResponseMessage, resolves or rejects the corresponding pending request based on the message content.
56
- *
57
- * @param msg - The ResponseMessage or EventMessage received from the TransportServer, or undefined if the remote socket closed.
58
- */
59
- private handleSocketMessage;
60
- }
61
- //# sourceMappingURL=transport_client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport_client.d.ts","sourceRoot":"","sources":["../../src/transport/transport_client.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAKlC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAqB1D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,CAAE,SAAQ,YAAY;IAE7D,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IAEjE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;CACpD;AAED;;;;;GAKG;AACH,qBAAa,eAAe,CAAC,OAAO,CAAE,SAAQ,YAAY;IAK5C,OAAO,CAAC,gBAAgB;IAJpC,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEJ,gBAAgB,EAAE,SAAS;IAI/C;;;;;;;;OAQG;IACG,IAAI;IAKV;;;;;OAKG;IACH,KAAK;IAML;;;;;;;;OAQG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE;IAanD;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;CAsB5B"}
@@ -1,56 +0,0 @@
1
- import { type Listener } from './interface/listener.js';
2
- /**
3
- * Keeps track of clients, providing a broadcast, and request/response api with multiplexing.
4
- */
5
- export declare class TransportServer<Payload> {
6
- private listener;
7
- private msgHandlerFn;
8
- private sockets;
9
- constructor(listener: Listener, msgHandlerFn: (msg: Payload) => Promise<any>);
10
- /**
11
- * Starts the TransportServer, allowing it to accept new connections and handle incoming messages.
12
- * The server will listen for 'new_socket' events from the underlying listener and invoke the provided message handler function
13
- * for each received message. The server remains active until the 'stop' method is called.
14
- */
15
- start(): void;
16
- /**
17
- * Stops accepting new connections. It doesn't close existing sockets.
18
- * It's expected the clients will gracefully complete by closing their end, sending an `undefined` message.
19
- */
20
- stop(): void;
21
- /**
22
- * Sends a broadcast message to all connected clients.
23
- * The given payload will be sent to all the clients currently connected to the TransportServer.
24
- * It waits for all the messages to be sent and resolves when they are all sent successfully.
25
- *
26
- * @param msg - The payload to broadcast to all connected clients.
27
- * @returns A Promise that resolves when all messages have been sent successfully.
28
- */
29
- broadcast(msg: Payload): Promise<void>;
30
- /**
31
- * Handles the addition of a new socket to the server by registering a message handler for the client
32
- * and adding the socket to the list of active sockets. The message handler processes incoming messages
33
- * from the client, including detecting client disconnection and removing the closed socket.
34
- *
35
- * @param socket - The new Socket instance that has connected to the server.
36
- */
37
- private handleNewSocket;
38
- /**
39
- * Detect the 'transferables' argument to our socket from our message
40
- * handler return type.
41
- * @param data - The compound payload data.
42
- * @returns The split data and transferables.
43
- */
44
- private getPayloadAndTransfers;
45
- /**
46
- * Handles incoming socket messages, processing the request and sending back a response.
47
- * This function is responsible for invoking the registered message handler function with the received
48
- * payload, extracting the result and transferables, and sending a response message back to the client.
49
- * In case of an error during message handling, it sends an error response with the stack trace.
50
- *
51
- * @param socket - The Socket instance from which the message was received.
52
- * @param msg - The RequestMessage object containing the message ID and payload.
53
- */
54
- private handleSocketMessage;
55
- }
56
- //# sourceMappingURL=transport_server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport_server.d.ts","sourceRoot":"","sources":["../../src/transport/transport_server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD;;GAEG;AACH,qBAAa,eAAe,CAAC,OAAO;IAGtB,OAAO,CAAC,QAAQ;IAAY,OAAO,CAAC,YAAY;IAF5D,OAAO,CAAC,OAAO,CAAgB;gBAEX,QAAQ,EAAE,QAAQ,EAAU,YAAY,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC;IAE5F;;;;OAIG;IACH,KAAK;IAKL;;;OAGG;IACH,IAAI;IAIJ;;;;;;;OAOG;IACG,SAAS,CAAC,GAAG,EAAE,OAAO;IAI5B;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAcvB;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;;;;;;;OAQG;YACW,mBAAmB;CAalC"}
@@ -1,59 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- export * from './unbalanced_merkle_tree.js';
4
- export * from './unbalanced_tree_store.js';
5
- /**
6
- * A leaf of an indexed merkle tree.
7
- */
8
- export interface IndexedTreeLeaf {
9
- /**
10
- * Returns key of the leaf. It's used for indexing.
11
- */
12
- getKey(): bigint;
13
- /**
14
- * Serializes the leaf into a buffer.
15
- */
16
- toBuffer(): Buffer;
17
- /**
18
- * Returns true if the leaf is empty.
19
- */
20
- isEmpty(): boolean;
21
- /**
22
- * Updates the leaf with the data of another leaf.
23
- * @param another - The leaf to update to.
24
- * @returns The updated leaf.
25
- */
26
- updateTo(another: IndexedTreeLeaf): IndexedTreeLeaf;
27
- }
28
- /**
29
- * Preimage of a merkle tree leaf.
30
- */
31
- export interface TreeLeafPreimage {
32
- /**
33
- * Returns key of the leaf corresponding to this preimage.
34
- */
35
- getKey(): bigint;
36
- /**
37
- * Returns the preimage as a leaf.
38
- */
39
- asLeaf(): IndexedTreeLeaf;
40
- /**
41
- * Serializes the preimage into a buffer.
42
- */
43
- toBuffer(): Buffer;
44
- /**
45
- * Serializes the preimage to an array of buffers for hashing.
46
- */
47
- toHashInputs(): Buffer[];
48
- }
49
- /**
50
- * Preimage of an indexed merkle tree leaf.
51
- */
52
- export interface IndexedTreeLeafPreimage extends TreeLeafPreimage {
53
- getNextKey(): bigint;
54
- /**
55
- * Returns the index of the next leaf.
56
- */
57
- getNextIndex(): bigint;
58
- }
59
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trees/index.ts"],"names":[],"mappings":";;AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,IAAI,eAAe,CAAC;IAC1B;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D,UAAU,IAAI,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,IAAI,MAAM,CAAC;CACxB"}
@@ -1,17 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import { sha256Trunc } from '@aztec/foundation/crypto';
4
- /**
5
- * Computes the merkle root for an unbalanced tree.
6
- *
7
- * @dev Adapted from unbalanced_tree.ts.
8
- * Calculates the tree upwards layer by layer until we reach the root.
9
- * The L1 calculation instead computes the tree from right to left (slightly cheaper gas).
10
- * TODO: A more thorough investigation of which method is cheaper, then use that method everywhere.
11
- */
12
- export declare function computeUnbalancedMerkleRoot(leaves: Buffer[], emptyLeaf?: Buffer, hasher?: typeof sha256Trunc): Buffer;
13
- export declare function findLeafLevelAndIndex(numLeaves: number, leafIndex: number): {
14
- level: number;
15
- indexAtLevel: number;
16
- };
17
- //# sourceMappingURL=unbalanced_merkle_tree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unbalanced_merkle_tree.d.ts","sourceRoot":"","sources":["../../src/trees/unbalanced_merkle_tree.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,qBAAc,GAAG,MAAM,CAwC9G;AAgDD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;EAGzE"}
@@ -1,19 +0,0 @@
1
- export interface TreeNodeLocation {
2
- level: number;
3
- index: number;
4
- }
5
- export declare class UnbalancedTreeStore<T> {
6
- #private;
7
- constructor(numLeaves: number);
8
- setLeaf(leafIndex: number, value: T): TreeNodeLocation;
9
- setNode({ level, index }: TreeNodeLocation, value: T): void;
10
- getParentLocation({ level, index }: TreeNodeLocation): TreeNodeLocation;
11
- getSiblingLocation({ level, index }: TreeNodeLocation): TreeNodeLocation;
12
- getChildLocations({ level, index }: TreeNodeLocation): [TreeNodeLocation, TreeNodeLocation];
13
- getLeaf(leafIndex: number): T | undefined;
14
- getNode(location: TreeNodeLocation): T | undefined;
15
- getParent(location: TreeNodeLocation): T | undefined;
16
- getSibling(location: TreeNodeLocation): T | undefined;
17
- getChildren(location: TreeNodeLocation): [T | undefined, T | undefined];
18
- }
19
- //# sourceMappingURL=unbalanced_tree_store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unbalanced_tree_store.d.ts","sourceRoot":"","sources":["../../src/trees/unbalanced_tree_store.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAOD,qBAAa,mBAAmB,CAAC,CAAC;;gBAIpB,SAAS,EAAE,MAAM;IAI7B,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,gBAAgB;IAiBtD,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC;IAWpD,iBAAiB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,gBAAgB;IAQvE,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,gBAAgB;IAQxE,iBAAiB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAM3F,OAAO,CAAC,SAAS,EAAE,MAAM;IASzB,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,CAAC,GAAG,SAAS;IAIlD,SAAS,CAAC,QAAQ,EAAE,gBAAgB,GAAG,CAAC,GAAG,SAAS;IAKpD,UAAU,CAAC,QAAQ,EAAE,gBAAgB,GAAG,CAAC,GAAG,SAAS;IAKrD,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,GAAG,SAAS,CAAC;CAQxE"}
@@ -1,19 +0,0 @@
1
- /** Strips methods of a type. */
2
- export type FieldsOf<T> = {
3
- [P in keyof T as T[P] extends Function ? never : P]: T[P];
4
- };
5
- /** Extracts methods of a type. */
6
- export type FunctionsOf<T> = {
7
- [P in keyof T as T[P] extends Function ? P : never]: T[P];
8
- };
9
- /** Marks a set of properties of a type as optional. */
10
- export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
11
- /** Removes readonly modifiers for a type. */
12
- export type Writeable<T> = {
13
- -readonly [P in keyof T]: T[P];
14
- };
15
- /** Removes readonly modifiers for an object. */
16
- export declare function unfreeze<T>(obj: T): Writeable<T>;
17
- /** Maybe exists, maybe not. */
18
- export type Maybe<T extends object> = T | unknown;
19
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAEvB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,kCAAkC;AAClC,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CAC1D,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE/E,6CAA6C;AAC7C,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IAAE,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE9D,gDAAgD;AAChD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAEhD;AAED,+BAA+B;AAC/B,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,OAAO,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * File URI to Path function.
3
- *
4
- * @param {String} uri
5
- * @return {String} path
6
- * @api public
7
- */
8
- export declare function fileURLToPath(uri: string): string;
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/url/index.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA4CjD"}
@@ -1,9 +0,0 @@
1
- /** Utility function to throw an error if a required value is missing. */
2
- export declare function required<T>(value: T | undefined, errMsg?: string): T;
3
- /**
4
- * Helper function to assert a condition is truthy
5
- * @param x - A boolean condition to assert.
6
- * @param err - Error message to throw if x isn't met.
7
- */
8
- export declare function assert(x: any, err: string): asserts x;
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAKpE;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAIrD"}
@@ -1,130 +0,0 @@
1
- /**
2
- * Dummy implementation of a necessary part of the wasi api:
3
- * https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md
4
- * We don't use these functions, but the environment expects them.
5
- * TODO find a way to update off of wasi 12.
6
- */
7
- export declare const getEmptyWasiSdk: (debug?: import("../log/log_fn.js").LogFn) => {
8
- /**
9
- * Retrieves the current time from the system clock.
10
- * This function is a dummy implementation of the WASI API's `clock_time_get` method,
11
- * which is expected by the environment but not used in this context.
12
- *
13
- * No input parameters or return values are required, as the purpose of this function
14
- * is solely to satisfy the environment expectations and provide debugging information.
15
- */
16
- clock_time_get(): void;
17
- /**
18
- * Dummy implementation of WASI's environ_get function.
19
- * This function is used to obtain a snapshot of the current environment variables.
20
- * In this dummy implementation, no actual actions are performed, but the debug logger logs 'environ_get' when called.
21
- * Environment variables are not used in this context, so the real implementation is not required.
22
- *
23
- * @see https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#environ_get
24
- */
25
- environ_get(): void;
26
- /**
27
- * Retrieves the environment variable sizes from the WebAssembly environment.
28
- * This function is part of the WASI API and provides a dummy implementation to fulfill the expected APIs.
29
- * It does not have any actual functionality, but serves as a placeholder in the environment.
30
- */
31
- environ_sizes_get(): void;
32
- /**
33
- * Closes a file descriptor, releasing any resources associated with it.
34
- * This function does not perform any actual closing operation, but exists to
35
- * satisfy the requirements of the WebAssembly System Interface (WASI) API,
36
- * which expects certain functions to be present for compatibility purposes.
37
- *
38
- * @see https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md
39
- */
40
- fd_close(): void;
41
- /**
42
- * A dummy implementation of the 'fd_read' function from the WASI API.
43
- * This function is required by the environment, but not used in this context.
44
- * It would normally read data from a file descriptor into an array buffer,
45
- * but here it simply logs the invocation for debugging purposes.
46
- */
47
- fd_read(): void;
48
- /**
49
- * Handles the file descriptor write operation.
50
- * This dummy implementation of the WASI 'fd_write' function is part of the wasi API:
51
- * https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md
52
- * The environment expects this function, but it is not used in the current implementation.
53
- * It is used to write data from WebAssembly memory to a file descriptor.
54
- */
55
- fd_write(): void;
56
- /**
57
- * Perform a file seek operation on the given file descriptor to change its current position.
58
- * The new position is calculated using the provided offset and whence values.
59
- * Throws an error if the file descriptor is invalid or the operation cannot be performed.
60
- *
61
- * @param fd - The file descriptor of the file to perform the seek operation on.
62
- * @param offset - The relative offset to apply, based on the whence value.
63
- * @param whence - The reference point from which the offset should be calculated. One of SEEK_SET (start), SEEK_CUR (current), or SEEK_END (end).
64
- * @returns The new position in the file after the seek operation has been performed.
65
- */
66
- fd_seek(): void;
67
- /**
68
- * This function is a dummy implementation of the 'fd_fdstat_get' function in the WebAssembly System Interface (WASI) API.
69
- * Although not actually used in this context, it is present due to the environment's expectation of its existence.
70
- * The 'fd_fdstat_get' function is typically responsible for obtaining file descriptor status information.
71
- */
72
- fd_fdstat_get(): void;
73
- /**
74
- * Sets the file descriptor flags for a given file descriptor.
75
- * This function is a dummy implementation of the WASI API function 'fd_fdstat_set_flags'.
76
- * It currently does not perform any operation but logs the function call with a debug instance.
77
- * This is provided since the environment expects this function to be present.
78
- */
79
- fd_fdstat_set_flags(): void;
80
- /**
81
- * Handles the `fd_prestat_get` function call for the dummy WebAssembly System Interface (WASI) implementation.
82
- * This function is expected by the WASI environment, although it is not used in this implementation.
83
- * The `fd_prestat_get` function retrieves pre-opened file descriptor properties.
84
- *
85
- * @returns A constant integer value indicating successful completion of the function call.
86
- */
87
- fd_prestat_get(): number;
88
- /**
89
- * Provides a dummy implementation for the `fd_prestat_dir_name` function, which is expected to be called by the WASI environment.
90
- * This function is intended to retrieve the pre-opened directory's path associated with the given file descriptor. However, since it's a dummy implementation,
91
- * it doesn't perform any actual operation and only logs the function call with the provided debug logger.
92
- *
93
- * @returns A constant number representing a dummy return value for the function call.
94
- */
95
- fd_prestat_dir_name(): number;
96
- /**
97
- * Handles the opening of a file path within the WASI environment.
98
- * This function is a dummy implementation required for compatibility with
99
- * the WebAssembly System Interface (WASI) API, but it does not perform any
100
- * actual file opening operation. It is mainly used for debugging purposes.
101
- */
102
- path_open(): void;
103
- /**
104
- * Retrieve file system information of the specified path.
105
- * This function retrieves statistics, such as size and permissions, associated with the file or directory
106
- * identified by the given path. In case of an error or non-existing path, appropriate debug logs will be generated.
107
- *
108
- * @returns An object containing file statistics like size, permissions, etc.
109
- */
110
- path_filestat_get(): void;
111
- /**
112
- * Terminate the process normally, performing the regular cleanup for terminating programs.
113
- * The input 'status' represents the exit code and is used to indicate success or failure
114
- * of the program execution. A zero value typically indicates successful execution,
115
- * while non-zero values are treated as errors by the operating system.
116
- *
117
- * @param status - The exit code representing the success or failure of the program execution.
118
- * @returns The exit status code.
119
- */
120
- proc_exit(): number;
121
- /**
122
- * Generates a random number and returns it.
123
- * This dummy implementation of 'random_get' method in the wasi API is expected by the environment.
124
- * In this case, the function always returns 1 to maintain consistency with the environment's expectations.
125
- *
126
- * @returns A random number. In this implementation, always returns 1.
127
- */
128
- random_get(): number;
129
- };
130
- //# sourceMappingURL=empty_wasi_sdk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"empty_wasi_sdk.d.ts","sourceRoot":"","sources":["../../src/wasm/empty_wasi_sdk.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,eAAO,MAAM,eAAe;IAC1B;;;;;;;OAOG;;IAIH;;;;;;;OAOG;;IAIH;;;;OAIG;;IAIH;;;;;;;OAOG;;IAIH;;;;;OAKG;;IAIH;;;;;;OAMG;;IAIH;;;;;;;;;OASG;;IAIH;;;;OAIG;;IAIH;;;;;OAKG;;IAIH;;;;;;OAMG;;IAKH;;;;;;OAMG;;IAKH;;;;;OAKG;;IAIH;;;;;;OAMG;;IAIH;;;;;;;;OAQG;;IAKH;;;;;;OAMG;;CAKH,CAAC"}
@@ -1,2 +0,0 @@
1
- export { WasmModule, IWasmModule } from './wasm_module.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wasm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}