@aztec/foundation 0.0.1-fake-ceab37513c → 0.0.2-commit.217f559981

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 (520) hide show
  1. package/dest/array/array.d.ts +1 -9
  2. package/dest/array/array.d.ts.map +1 -1
  3. package/dest/array/array.js +0 -11
  4. package/dest/array/index.d.ts +2 -1
  5. package/dest/array/index.d.ts.map +1 -1
  6. package/dest/array/index.js +1 -0
  7. package/dest/array/sorted_array.d.ts +15 -0
  8. package/dest/array/sorted_array.d.ts.map +1 -0
  9. package/dest/array/sorted_array.js +109 -0
  10. package/dest/async-map/index.d.ts +1 -1
  11. package/dest/async-pool/index.d.ts +1 -1
  12. package/dest/bigint/index.d.ts +1 -1
  13. package/dest/bigint-buffer/index.d.ts +1 -1
  14. package/dest/branded-types/block_number.d.ts +56 -0
  15. package/dest/branded-types/block_number.d.ts.map +1 -0
  16. package/dest/branded-types/block_number.js +78 -0
  17. package/dest/branded-types/checkpoint_number.d.ts +54 -0
  18. package/dest/branded-types/checkpoint_number.d.ts.map +1 -0
  19. package/dest/branded-types/checkpoint_number.js +77 -0
  20. package/dest/branded-types/epoch.d.ts +42 -0
  21. package/dest/branded-types/epoch.d.ts.map +1 -0
  22. package/dest/branded-types/epoch.js +59 -0
  23. package/dest/branded-types/index.d.ts +7 -0
  24. package/dest/branded-types/index.d.ts.map +1 -0
  25. package/dest/branded-types/index.js +5 -0
  26. package/dest/branded-types/index_within_checkpoint.d.ts +42 -0
  27. package/dest/branded-types/index_within_checkpoint.d.ts.map +1 -0
  28. package/dest/branded-types/index_within_checkpoint.js +59 -0
  29. package/dest/branded-types/slot.d.ts +42 -0
  30. package/dest/branded-types/slot.d.ts.map +1 -0
  31. package/dest/branded-types/slot.js +59 -0
  32. package/dest/branded-types/types.d.ts +5 -0
  33. package/dest/branded-types/types.d.ts.map +1 -0
  34. package/dest/branded-types/types.js +1 -0
  35. package/dest/buffer/buffer16.d.ts +2 -2
  36. package/dest/buffer/buffer16.d.ts.map +1 -1
  37. package/dest/buffer/buffer16.js +4 -2
  38. package/dest/buffer/buffer32.d.ts +2 -2
  39. package/dest/buffer/buffer32.d.ts.map +1 -1
  40. package/dest/buffer/buffer32.js +4 -2
  41. package/dest/buffer/index.d.ts +1 -1
  42. package/dest/collection/array.d.ts +14 -1
  43. package/dest/collection/array.d.ts.map +1 -1
  44. package/dest/collection/array.js +63 -3
  45. package/dest/collection/index.d.ts +1 -1
  46. package/dest/collection/object.d.ts +1 -1
  47. package/dest/committable/committable.d.ts +1 -1
  48. package/dest/committable/committable.d.ts.map +1 -1
  49. package/dest/committable/index.d.ts +1 -1
  50. package/dest/config/env_var.d.ts +2 -2
  51. package/dest/config/env_var.d.ts.map +1 -1
  52. package/dest/config/index.d.ts +15 -4
  53. package/dest/config/index.d.ts.map +1 -1
  54. package/dest/config/index.js +32 -9
  55. package/dest/config/network_config.d.ts +13 -1
  56. package/dest/config/network_config.d.ts.map +1 -1
  57. package/dest/config/network_config.js +3 -1
  58. package/dest/config/network_name.d.ts +2 -2
  59. package/dest/config/network_name.d.ts.map +1 -1
  60. package/dest/config/network_name.js +6 -0
  61. package/dest/config/parse-env.d.ts +3 -0
  62. package/dest/config/parse-env.d.ts.map +1 -0
  63. package/dest/config/parse-env.js +7 -0
  64. package/dest/config/secret_value.d.ts +1 -1
  65. package/dest/config/secret_value.d.ts.map +1 -1
  66. package/dest/config/secret_value.js +3 -1
  67. package/dest/crypto/aes128/index.d.ts +1 -1
  68. package/dest/crypto/aes128/index.d.ts.map +1 -1
  69. package/dest/crypto/aes128/index.js +19 -6
  70. package/dest/crypto/bls/bn254_keystore.d.ts +296 -0
  71. package/dest/crypto/bls/bn254_keystore.d.ts.map +1 -0
  72. package/dest/crypto/bls/bn254_keystore.js +218 -0
  73. package/dest/crypto/bls/index.d.ts +13 -0
  74. package/dest/crypto/bls/index.d.ts.map +1 -0
  75. package/dest/crypto/bls/index.js +87 -0
  76. package/dest/crypto/bn254/index.d.ts +39 -0
  77. package/dest/crypto/bn254/index.d.ts.map +1 -0
  78. package/dest/crypto/bn254/index.js +56 -0
  79. package/dest/crypto/ecdsa/index.d.ts +1 -1
  80. package/dest/crypto/ecdsa/index.d.ts.map +1 -1
  81. package/dest/crypto/ecdsa/index.js +58 -48
  82. package/dest/crypto/ecdsa/signature.d.ts +2 -2
  83. package/dest/crypto/ecdsa/signature.d.ts.map +1 -1
  84. package/dest/crypto/ecdsa/signature.js +2 -2
  85. package/dest/crypto/grumpkin/index.d.ts +10 -13
  86. package/dest/crypto/grumpkin/index.d.ts.map +1 -1
  87. package/dest/crypto/grumpkin/index.js +61 -55
  88. package/dest/crypto/keccak/index.d.ts +1 -1
  89. package/dest/crypto/keys/index.d.ts +2 -2
  90. package/dest/crypto/keys/index.d.ts.map +1 -1
  91. package/dest/crypto/keys/index.js +8 -5
  92. package/dest/crypto/pedersen/index.d.ts +1 -1
  93. package/dest/crypto/pedersen/pedersen.noble.d.ts +1 -1
  94. package/dest/crypto/pedersen/pedersen.wasm.d.ts +2 -2
  95. package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
  96. package/dest/crypto/pedersen/pedersen.wasm.js +24 -14
  97. package/dest/crypto/poseidon/index.d.ts +2 -3
  98. package/dest/crypto/poseidon/index.d.ts.map +1 -1
  99. package/dest/crypto/poseidon/index.js +27 -21
  100. package/dest/crypto/random/index.d.ts +1 -1
  101. package/dest/crypto/random/index.d.ts.map +1 -1
  102. package/dest/crypto/random/randomness_singleton.d.ts +4 -3
  103. package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
  104. package/dest/crypto/random/randomness_singleton.js +5 -5
  105. package/dest/crypto/schnorr/index.d.ts +3 -2
  106. package/dest/crypto/schnorr/index.d.ts.map +1 -1
  107. package/dest/crypto/schnorr/index.js +30 -38
  108. package/dest/crypto/schnorr/signature.d.ts +2 -2
  109. package/dest/crypto/schnorr/signature.d.ts.map +1 -1
  110. package/dest/crypto/schnorr/signature.js +2 -2
  111. package/dest/crypto/secp256k1/index.d.ts +1 -1
  112. package/dest/crypto/secp256k1/index.d.ts.map +1 -1
  113. package/dest/crypto/secp256k1/index.js +23 -18
  114. package/dest/crypto/secp256k1-signer/index.d.ts +1 -1
  115. package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts +1 -1
  116. package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts.map +1 -1
  117. package/dest/crypto/secp256k1-signer/utils.d.ts +43 -5
  118. package/dest/crypto/secp256k1-signer/utils.d.ts.map +1 -1
  119. package/dest/crypto/secp256k1-signer/utils.js +76 -8
  120. package/dest/crypto/serialize.d.ts +1 -1
  121. package/dest/crypto/sha256/index.d.ts +2 -2
  122. package/dest/crypto/sha256/index.d.ts.map +1 -1
  123. package/dest/crypto/sha256/index.js +1 -1
  124. package/dest/crypto/sha512/index.d.ts +3 -3
  125. package/dest/crypto/sha512/index.d.ts.map +1 -1
  126. package/dest/crypto/sha512/index.js +1 -1
  127. package/dest/crypto/signature/index.d.ts +2 -2
  128. package/dest/crypto/signature/index.d.ts.map +1 -1
  129. package/dest/crypto/sync/index.d.ts +1 -1
  130. package/dest/crypto/sync/index.js +1 -1
  131. package/dest/crypto/sync/pedersen/index.d.ts +2 -2
  132. package/dest/crypto/sync/pedersen/index.d.ts.map +1 -1
  133. package/dest/crypto/sync/pedersen/index.js +18 -11
  134. package/dest/crypto/sync/poseidon/index.d.ts +2 -3
  135. package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
  136. package/dest/crypto/sync/poseidon/index.js +23 -16
  137. package/dest/{fields/bls12_fields.d.ts → curves/bls12/field.d.ts} +3 -3
  138. package/dest/curves/bls12/field.d.ts.map +1 -0
  139. package/dest/{fields/bls12_fields.js → curves/bls12/field.js} +12 -9
  140. package/dest/curves/bls12/index.d.ts +3 -0
  141. package/dest/curves/bls12/index.d.ts.map +1 -0
  142. package/dest/curves/bls12/index.js +2 -0
  143. package/dest/{fields/bls12_point.d.ts → curves/bls12/point.d.ts} +11 -11
  144. package/dest/curves/bls12/point.d.ts.map +1 -0
  145. package/dest/{fields/bls12_point.js → curves/bls12/point.js} +17 -15
  146. package/dest/curves/bn254/field.d.ts +180 -0
  147. package/dest/curves/bn254/field.d.ts.map +1 -0
  148. package/dest/{fields/fields.js → curves/bn254/field.js} +71 -59
  149. package/dest/curves/bn254/index.d.ts +3 -0
  150. package/dest/curves/bn254/index.d.ts.map +1 -0
  151. package/dest/curves/bn254/index.js +2 -0
  152. package/dest/curves/bn254/point.d.ts +54 -0
  153. package/dest/curves/bn254/point.d.ts.map +1 -0
  154. package/dest/curves/bn254/point.js +143 -0
  155. package/dest/curves/grumpkin/index.d.ts +10 -0
  156. package/dest/curves/grumpkin/index.d.ts.map +1 -0
  157. package/dest/curves/grumpkin/index.js +3 -0
  158. package/dest/{fields → curves/grumpkin}/point.d.ts +12 -3
  159. package/dest/curves/grumpkin/point.d.ts.map +1 -0
  160. package/dest/{fields → curves/grumpkin}/point.js +24 -7
  161. package/dest/decorators/index.d.ts +1 -1
  162. package/dest/decorators/memoize.d.ts +1 -1
  163. package/dest/decorators/memoize.d.ts.map +1 -1
  164. package/dest/error/index.d.ts +1 -1
  165. package/dest/eth-address/index.d.ts +12 -2
  166. package/dest/eth-address/index.d.ts.map +1 -1
  167. package/dest/eth-address/index.js +27 -3
  168. package/dest/eth-signature/eth_signature.d.ts +1 -1
  169. package/dest/eth-signature/eth_signature.d.ts.map +1 -1
  170. package/dest/eth-signature/index.d.ts +1 -1
  171. package/dest/fs/index.d.ts +1 -1
  172. package/dest/fs/run_in_dir.d.ts +1 -1
  173. package/dest/fs/try_rm_dir.d.ts +1 -1
  174. package/dest/iterable/all.d.ts +1 -1
  175. package/dest/iterable/filter.d.ts +1 -1
  176. package/dest/iterable/index.d.ts +1 -1
  177. package/dest/iterable/isAsyncIt.d.ts +1 -1
  178. package/dest/iterable/map.d.ts +1 -1
  179. package/dest/iterable/peek.d.ts +1 -1
  180. package/dest/iterable/sort.d.ts +1 -1
  181. package/dest/iterable/take.d.ts +1 -1
  182. package/dest/iterable/toArray.d.ts +1 -1
  183. package/dest/iterator/filter.d.ts +3 -0
  184. package/dest/iterator/filter.d.ts.map +1 -0
  185. package/dest/iterator/filter.js +7 -0
  186. package/dest/iterator/index.d.ts +2 -0
  187. package/dest/iterator/index.d.ts.map +1 -0
  188. package/dest/iterator/index.js +1 -0
  189. package/dest/jest/setup.js +4 -1
  190. package/dest/json-rpc/client/fetch.d.ts +1 -1
  191. package/dest/json-rpc/client/index.d.ts +1 -1
  192. package/dest/json-rpc/client/safe_json_rpc_client.d.ts +2 -1
  193. package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
  194. package/dest/json-rpc/client/safe_json_rpc_client.js +10 -1
  195. package/dest/json-rpc/client/undici.d.ts +1 -1
  196. package/dest/json-rpc/client/undici.d.ts.map +1 -1
  197. package/dest/json-rpc/client/undici.js +21 -4
  198. package/dest/json-rpc/convert.d.ts +1 -1
  199. package/dest/json-rpc/errors.d.ts +1 -1
  200. package/dest/json-rpc/errors.d.ts.map +1 -1
  201. package/dest/json-rpc/fixtures/class_a.d.ts +1 -1
  202. package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
  203. package/dest/json-rpc/fixtures/class_b.d.ts +1 -1
  204. package/dest/json-rpc/fixtures/class_b.d.ts.map +1 -1
  205. package/dest/json-rpc/fixtures/test_state.d.ts +1 -1
  206. package/dest/json-rpc/fixtures/test_state.d.ts.map +1 -1
  207. package/dest/json-rpc/index.d.ts +1 -1
  208. package/dest/json-rpc/js_utils.d.ts +1 -1
  209. package/dest/json-rpc/js_utils.d.ts.map +1 -1
  210. package/dest/json-rpc/server/api_key_auth.d.ts +19 -0
  211. package/dest/json-rpc/server/api_key_auth.d.ts.map +1 -0
  212. package/dest/json-rpc/server/api_key_auth.js +57 -0
  213. package/dest/json-rpc/server/index.d.ts +2 -1
  214. package/dest/json-rpc/server/index.d.ts.map +1 -1
  215. package/dest/json-rpc/server/index.js +1 -0
  216. package/dest/json-rpc/server/safe_json_rpc_server.d.ts +1 -1
  217. package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +1 -1
  218. package/dest/json-rpc/server/safe_json_rpc_server.js +1 -1
  219. package/dest/json-rpc/test/index.d.ts +1 -1
  220. package/dest/json-rpc/test/integration.d.ts +1 -1
  221. package/dest/log/bigint-utils.d.ts +5 -0
  222. package/dest/log/bigint-utils.d.ts.map +1 -0
  223. package/dest/log/bigint-utils.js +18 -0
  224. package/dest/log/console.d.ts +1 -1
  225. package/dest/log/gcloud-logger-config.d.ts +1 -1
  226. package/dest/log/gcloud-logger-config.d.ts.map +1 -1
  227. package/dest/log/gcloud-logger-config.js +3 -0
  228. package/dest/log/index.d.ts +1 -1
  229. package/dest/log/libp2p_logger.d.ts +5 -2
  230. package/dest/log/libp2p_logger.d.ts.map +1 -1
  231. package/dest/log/libp2p_logger.js +14 -4
  232. package/dest/log/log-filters.d.ts +17 -4
  233. package/dest/log/log-filters.d.ts.map +1 -1
  234. package/dest/log/log-filters.js +26 -12
  235. package/dest/log/log-levels.d.ts +1 -1
  236. package/dest/log/log_fn.d.ts +1 -1
  237. package/dest/log/noir_debug_log_util.d.ts +1 -1
  238. package/dest/log/pino-logger-server.d.ts +9 -0
  239. package/dest/log/pino-logger-server.d.ts.map +1 -0
  240. package/dest/log/pino-logger-server.js +18 -0
  241. package/dest/log/pino-logger.d.ts +38 -9
  242. package/dest/log/pino-logger.d.ts.map +1 -1
  243. package/dest/log/pino-logger.js +122 -30
  244. package/dest/message/index.d.ts +1 -1
  245. package/dest/message/index.d.ts.map +1 -1
  246. package/dest/mutex/index.d.ts +1 -1
  247. package/dest/mutex/index.d.ts.map +1 -1
  248. package/dest/mutex/mutex_database.d.ts +1 -1
  249. package/dest/noir/index.d.ts +1 -1
  250. package/dest/noir/noir_package_config.d.ts +9 -9
  251. package/dest/number/index.d.ts +1 -1
  252. package/dest/profiler/index.d.ts +2 -0
  253. package/dest/profiler/index.d.ts.map +1 -0
  254. package/dest/profiler/index.js +1 -0
  255. package/dest/profiler/profiler.d.ts +8 -0
  256. package/dest/profiler/profiler.d.ts.map +1 -0
  257. package/dest/profiler/profiler.js +97 -0
  258. package/dest/promise/index.d.ts +1 -1
  259. package/dest/promise/running-promise.d.ts +1 -1
  260. package/dest/promise/running-promise.d.ts.map +1 -1
  261. package/dest/promise/utils.d.ts +1 -1
  262. package/dest/queue/base_memory_queue.d.ts +2 -2
  263. package/dest/queue/base_memory_queue.d.ts.map +1 -1
  264. package/dest/queue/batch_queue.d.ts +1 -1
  265. package/dest/queue/batch_queue.d.ts.map +1 -1
  266. package/dest/queue/bounded_serial_queue.d.ts +1 -1
  267. package/dest/queue/bounded_serial_queue.d.ts.map +1 -1
  268. package/dest/queue/fifo_memory_queue.d.ts +1 -1
  269. package/dest/queue/fifo_memory_queue.d.ts.map +1 -1
  270. package/dest/queue/index.d.ts +1 -1
  271. package/dest/queue/priority_memory_queue.d.ts +1 -1
  272. package/dest/queue/priority_memory_queue.d.ts.map +1 -1
  273. package/dest/queue/priority_queue.d.ts +1 -1
  274. package/dest/queue/priority_queue.d.ts.map +1 -1
  275. package/dest/queue/semaphore.d.ts +5 -1
  276. package/dest/queue/semaphore.d.ts.map +1 -1
  277. package/dest/queue/serial_queue.d.ts +1 -1
  278. package/dest/queue/serial_queue.d.ts.map +1 -1
  279. package/dest/retry/index.d.ts +11 -1
  280. package/dest/retry/index.d.ts.map +1 -1
  281. package/dest/retry/index.js +11 -0
  282. package/dest/running-promise/index.d.ts +1 -1
  283. package/dest/schemas/api.d.ts +1 -1
  284. package/dest/schemas/index.d.ts +1 -1
  285. package/dest/schemas/parse.d.ts +1 -1
  286. package/dest/schemas/schemas.d.ts +15 -17
  287. package/dest/schemas/schemas.d.ts.map +1 -1
  288. package/dest/schemas/schemas.js +14 -10
  289. package/dest/schemas/types.d.ts +31 -1
  290. package/dest/schemas/types.d.ts.map +1 -1
  291. package/dest/schemas/types.js +25 -1
  292. package/dest/schemas/utils.d.ts +4 -4
  293. package/dest/schemas/utils.d.ts.map +1 -1
  294. package/dest/schemas/utils.js +15 -5
  295. package/dest/serialize/buffer_reader.d.ts +14 -4
  296. package/dest/serialize/buffer_reader.d.ts.map +1 -1
  297. package/dest/serialize/buffer_reader.js +26 -4
  298. package/dest/serialize/field_reader.d.ts +2 -2
  299. package/dest/serialize/field_reader.d.ts.map +1 -1
  300. package/dest/serialize/field_reader.js +1 -1
  301. package/dest/serialize/free_funcs.d.ts +2 -2
  302. package/dest/serialize/free_funcs.d.ts.map +1 -1
  303. package/dest/serialize/free_funcs.js +1 -1
  304. package/dest/serialize/index.d.ts +1 -1
  305. package/dest/serialize/serialize.d.ts +20 -2
  306. package/dest/serialize/serialize.d.ts.map +1 -1
  307. package/dest/serialize/serialize.js +32 -1
  308. package/dest/serialize/type_registry.d.ts +1 -1
  309. package/dest/serialize/type_registry.d.ts.map +1 -1
  310. package/dest/serialize/types.d.ts +1 -1
  311. package/dest/sleep/index.d.ts +3 -1
  312. package/dest/sleep/index.d.ts.map +1 -1
  313. package/dest/sleep/index.js +4 -0
  314. package/dest/string/index.d.ts +5 -1
  315. package/dest/string/index.d.ts.map +1 -1
  316. package/dest/string/index.js +1 -1
  317. package/dest/testing/files/index.d.ts +2 -1
  318. package/dest/testing/files/index.d.ts.map +1 -1
  319. package/dest/testing/files/index.js +1 -1
  320. package/dest/testing/formatting.d.ts +4 -0
  321. package/dest/testing/formatting.d.ts.map +1 -0
  322. package/dest/testing/formatting.js +3 -0
  323. package/dest/testing/index.d.ts +2 -1
  324. package/dest/testing/index.d.ts.map +1 -1
  325. package/dest/testing/index.js +1 -0
  326. package/dest/testing/port_allocator.d.ts +1 -1
  327. package/dest/testing/snapshot_serializer.d.ts +1 -1
  328. package/dest/testing/test_data.d.ts +1 -1
  329. package/dest/timer/date.d.ts +26 -1
  330. package/dest/timer/date.d.ts.map +1 -1
  331. package/dest/timer/date.js +36 -0
  332. package/dest/timer/elapsed.d.ts +1 -1
  333. package/dest/timer/index.d.ts +1 -1
  334. package/dest/timer/timeout.d.ts +1 -1
  335. package/dest/timer/timeout.d.ts.map +1 -1
  336. package/dest/timer/timer.d.ts +1 -1
  337. package/dest/timer/timer.d.ts.map +1 -1
  338. package/dest/transport/dispatch/create_dispatch_fn.d.ts +1 -1
  339. package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +1 -1
  340. package/dest/transport/dispatch/create_dispatch_proxy.d.ts +1 -1
  341. package/dest/transport/dispatch/messages.d.ts +1 -1
  342. package/dest/transport/index.d.ts +1 -1
  343. package/dest/transport/interface/connector.d.ts +1 -1
  344. package/dest/transport/interface/listener.d.ts +1 -1
  345. package/dest/transport/interface/socket.d.ts +1 -1
  346. package/dest/transport/interface/transferable.d.ts +1 -1
  347. package/dest/transport/node/index.d.ts +1 -1
  348. package/dest/transport/node/node_connector.d.ts +1 -1
  349. package/dest/transport/node/node_connector.d.ts.map +1 -1
  350. package/dest/transport/node/node_connector_socket.d.ts +1 -1
  351. package/dest/transport/node/node_connector_socket.d.ts.map +1 -1
  352. package/dest/transport/node/node_listener.d.ts +1 -1
  353. package/dest/transport/node/node_listener.d.ts.map +1 -1
  354. package/dest/transport/node/node_listener_socket.d.ts +1 -1
  355. package/dest/transport/node/node_listener_socket.d.ts.map +1 -1
  356. package/dest/transport/transport_client.d.ts +1 -1
  357. package/dest/transport/transport_client.d.ts.map +1 -1
  358. package/dest/transport/transport_server.d.ts +1 -10
  359. package/dest/transport/transport_server.d.ts.map +1 -1
  360. package/dest/trees/balanced_merkle_tree_root.d.ts +17 -0
  361. package/dest/trees/balanced_merkle_tree_root.d.ts.map +1 -0
  362. package/dest/trees/balanced_merkle_tree_root.js +51 -0
  363. package/dest/trees/hasher.d.ts +3 -1
  364. package/dest/trees/hasher.d.ts.map +1 -1
  365. package/dest/trees/hasher.js +10 -5
  366. package/dest/trees/index.d.ts +4 -3
  367. package/dest/trees/index.d.ts.map +1 -1
  368. package/dest/trees/index.js +3 -2
  369. package/dest/trees/indexed_merkle_tree.d.ts +1 -1
  370. package/dest/trees/indexed_merkle_tree.d.ts.map +1 -1
  371. package/dest/trees/indexed_merkle_tree.js +1 -1
  372. package/dest/trees/indexed_merkle_tree_calculator.d.ts +1 -1
  373. package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -1
  374. package/dest/trees/indexed_tree_leaf.d.ts +1 -1
  375. package/dest/trees/membership_witness.d.ts +7 -18
  376. package/dest/trees/membership_witness.d.ts.map +1 -1
  377. package/dest/trees/membership_witness.js +10 -1
  378. package/dest/trees/merkle_tree.d.ts +1 -1
  379. package/dest/trees/merkle_tree.d.ts.map +1 -1
  380. package/dest/trees/merkle_tree_calculator.d.ts +2 -12
  381. package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
  382. package/dest/trees/merkle_tree_calculator.js +2 -32
  383. package/dest/trees/sibling_path.d.ts +5 -38
  384. package/dest/trees/sibling_path.d.ts.map +1 -1
  385. package/dest/trees/sibling_path.js +3 -3
  386. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +26 -23
  387. package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -1
  388. package/dest/trees/unbalanced_merkle_tree_calculator.js +119 -97
  389. package/dest/trees/unbalanced_merkle_tree_root.d.ts +28 -0
  390. package/dest/trees/unbalanced_merkle_tree_root.d.ts.map +1 -0
  391. package/dest/trees/unbalanced_merkle_tree_root.js +84 -0
  392. package/dest/trees/unbalanced_tree_store.d.ts +6 -1
  393. package/dest/trees/unbalanced_tree_store.d.ts.map +1 -1
  394. package/dest/trees/unbalanced_tree_store.js +55 -1
  395. package/dest/types/index.d.ts +6 -2
  396. package/dest/types/index.d.ts.map +1 -1
  397. package/dest/types/index.js +6 -0
  398. package/dest/url/index.d.ts +1 -1
  399. package/dest/validation/index.d.ts +1 -1
  400. package/package.json +53 -8
  401. package/src/array/array.ts +0 -16
  402. package/src/array/index.ts +1 -0
  403. package/src/array/sorted_array.ts +138 -0
  404. package/src/branded-types/block_number.ts +117 -0
  405. package/src/branded-types/checkpoint_number.ts +115 -0
  406. package/src/branded-types/epoch.ts +88 -0
  407. package/src/branded-types/index.ts +7 -0
  408. package/src/branded-types/index_within_checkpoint.ts +88 -0
  409. package/src/branded-types/slot.ts +88 -0
  410. package/src/branded-types/types.ts +2 -0
  411. package/src/buffer/buffer16.ts +2 -2
  412. package/src/buffer/buffer32.ts +2 -2
  413. package/src/collection/array.ts +67 -3
  414. package/src/config/env_var.ts +82 -15
  415. package/src/config/index.ts +39 -6
  416. package/src/config/network_config.ts +2 -0
  417. package/src/config/network_name.ts +15 -1
  418. package/src/config/parse-env.ts +4 -0
  419. package/src/crypto/aes128/index.ts +19 -10
  420. package/src/crypto/bls/bn254_keystore.ts +287 -0
  421. package/src/crypto/bls/index.ts +77 -0
  422. package/src/crypto/bn254/index.ts +64 -0
  423. package/src/crypto/ecdsa/index.ts +40 -37
  424. package/src/crypto/ecdsa/signature.ts +2 -2
  425. package/src/crypto/grumpkin/index.ts +38 -46
  426. package/src/crypto/keys/index.ts +6 -6
  427. package/src/crypto/pedersen/pedersen.wasm.ts +23 -19
  428. package/src/crypto/poseidon/index.ts +27 -29
  429. package/src/crypto/random/randomness_singleton.ts +6 -4
  430. package/src/crypto/schnorr/index.ts +22 -18
  431. package/src/crypto/schnorr/signature.ts +2 -2
  432. package/src/crypto/secp256k1/index.ts +15 -11
  433. package/src/crypto/secp256k1-signer/utils.ts +102 -10
  434. package/src/crypto/sha256/index.ts +1 -1
  435. package/src/crypto/sha512/index.ts +1 -1
  436. package/src/crypto/signature/index.ts +1 -1
  437. package/src/crypto/sync/index.ts +1 -1
  438. package/src/crypto/sync/pedersen/index.ts +17 -16
  439. package/src/crypto/sync/poseidon/index.ts +23 -27
  440. package/src/{fields/bls12_fields.ts → curves/bls12/field.ts} +6 -6
  441. package/src/curves/bls12/index.ts +2 -0
  442. package/src/{fields/bls12_point.ts → curves/bls12/point.ts} +14 -14
  443. package/src/{fields/fields.ts → curves/bn254/field.ts} +69 -62
  444. package/src/curves/bn254/index.ts +2 -0
  445. package/src/curves/bn254/point.ts +170 -0
  446. package/src/curves/grumpkin/index.ts +11 -0
  447. package/src/{fields → curves/grumpkin}/point.ts +26 -7
  448. package/src/eth-address/index.ts +27 -2
  449. package/src/iterator/filter.ts +11 -0
  450. package/src/iterator/index.ts +1 -0
  451. package/src/jest/setup.mjs +4 -1
  452. package/src/json-rpc/client/safe_json_rpc_client.ts +11 -0
  453. package/src/json-rpc/client/undici.ts +21 -3
  454. package/src/json-rpc/server/api_key_auth.ts +63 -0
  455. package/src/json-rpc/server/index.ts +1 -0
  456. package/src/json-rpc/server/safe_json_rpc_server.ts +1 -1
  457. package/src/log/bigint-utils.ts +22 -0
  458. package/src/log/gcloud-logger-config.ts +5 -0
  459. package/src/log/libp2p_logger.ts +12 -5
  460. package/src/log/log-filters.ts +29 -11
  461. package/src/log/pino-logger-server.ts +25 -0
  462. package/src/log/pino-logger.ts +144 -40
  463. package/src/profiler/index.ts +1 -0
  464. package/src/profiler/profiler.ts +125 -0
  465. package/src/queue/base_memory_queue.ts +1 -1
  466. package/src/queue/semaphore.ts +5 -0
  467. package/src/retry/index.ts +18 -0
  468. package/src/schemas/schemas.ts +24 -13
  469. package/src/schemas/types.ts +33 -0
  470. package/src/schemas/utils.ts +21 -8
  471. package/src/serialize/buffer_reader.ts +36 -9
  472. package/src/serialize/field_reader.ts +1 -1
  473. package/src/serialize/free_funcs.ts +1 -1
  474. package/src/serialize/serialize.ts +33 -1
  475. package/src/sleep/index.ts +6 -0
  476. package/src/string/index.ts +3 -0
  477. package/src/testing/files/index.ts +1 -1
  478. package/src/testing/formatting.ts +3 -0
  479. package/src/testing/index.ts +1 -0
  480. package/src/timer/date.ts +52 -0
  481. package/src/trees/balanced_merkle_tree_root.ts +68 -0
  482. package/src/trees/hasher.ts +9 -0
  483. package/src/trees/index.ts +3 -2
  484. package/src/trees/indexed_merkle_tree.ts +1 -1
  485. package/src/trees/membership_witness.ts +9 -1
  486. package/src/trees/merkle_tree_calculator.ts +2 -35
  487. package/src/trees/sibling_path.ts +3 -3
  488. package/src/trees/unbalanced_merkle_tree_calculator.ts +123 -93
  489. package/src/trees/unbalanced_merkle_tree_root.ts +115 -0
  490. package/src/trees/unbalanced_tree_store.ts +62 -3
  491. package/src/types/index.ts +11 -1
  492. package/dest/crypto/index.d.ts +0 -15
  493. package/dest/crypto/index.d.ts.map +0 -1
  494. package/dest/crypto/index.js +0 -14
  495. package/dest/fields/bls12_fields.d.ts.map +0 -1
  496. package/dest/fields/bls12_point.d.ts.map +0 -1
  497. package/dest/fields/coordinate.d.ts +0 -66
  498. package/dest/fields/coordinate.d.ts.map +0 -1
  499. package/dest/fields/coordinate.js +0 -96
  500. package/dest/fields/fields.d.ts +0 -174
  501. package/dest/fields/fields.d.ts.map +0 -1
  502. package/dest/fields/index.d.ts +0 -6
  503. package/dest/fields/index.d.ts.map +0 -1
  504. package/dest/fields/index.js +0 -5
  505. package/dest/fields/point.d.ts.map +0 -1
  506. package/dest/index.d.ts +0 -29
  507. package/dest/index.d.ts.map +0 -1
  508. package/dest/index.js +0 -29
  509. package/dest/json-rpc/server/telemetry.d.ts +0 -2
  510. package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
  511. package/dest/json-rpc/server/telemetry.js +0 -0
  512. package/dest/trees/unbalanced_merkle_tree.d.ts +0 -29
  513. package/dest/trees/unbalanced_merkle_tree.d.ts.map +0 -1
  514. package/dest/trees/unbalanced_merkle_tree.js +0 -99
  515. package/src/crypto/index.ts +0 -14
  516. package/src/fields/coordinate.ts +0 -104
  517. package/src/fields/index.ts +0 -5
  518. package/src/index.ts +0 -29
  519. package/src/json-rpc/server/telemetry.ts +0 -0
  520. package/src/trees/unbalanced_merkle_tree.ts +0 -111
@@ -0,0 +1,115 @@
1
+ import { computeBalancedMerkleTreeRoot, computeBalancedMerkleTreeRootAsync } from './balanced_merkle_tree_root.js';
2
+ import { poseidonMerkleHash, shaMerkleHash } from './hasher.js';
3
+ import { UnbalancedMerkleTreeCalculator } from './unbalanced_merkle_tree_calculator.js';
4
+
5
+ export const computeUnbalancedShaRoot = (leaves: Buffer[]) => computeUnbalancedMerkleTreeRoot(leaves, shaMerkleHash);
6
+
7
+ export const computeUnbalancedPoseidonRoot = async (leaves: Buffer[]) =>
8
+ await computeUnbalancedMerkleTreeRootAsync(leaves, poseidonMerkleHash);
9
+
10
+ export const computeWonkyShaRoot = (leaves: Buffer[]) => computeWonkyMerkleTreeRoot(leaves);
11
+
12
+ /**
13
+ * Computes the Merkle root of an unbalanced tree.
14
+ *
15
+ * Unlike a balanced Merkle tree, which requires the number of leaves to be a power of two, an unbalanced tree can have
16
+ * any number of leaves.
17
+ *
18
+ * The tree is constructed by iteratively extracting the smallest power-of-two-sized subtrees from **right to left**.
19
+ * For each such subtree, it computes the subtree root and then combines all subtree roots (again from right to left)
20
+ * into a single root using the provided hash function.
21
+ *
22
+ * Note: We need the final tree to be as shallow as possible, to minimize the size of the sibling path required to prove
23
+ * membership of a leaf. Therefor, the computation proceeds from right to left - smaller subtrees must always be
24
+ * combined before being merged with a larger sibling on their left.
25
+ *
26
+ * For example, consider an unbalanced tree made of three subtrees of sizes 2, 4, and 8. If we combine the size-2 and
27
+ * size-4 subtrees first (producing a subtree of depth 3), and then merge it with the size-8 subtree (also depth 3), the
28
+ * resulting tree has a maximum depth of 4.
29
+ *
30
+ * But if we instead combine the size-4 and size-8 subtrees first (depth 4), and then merge with the size-2 subtree
31
+ * (depth 1), the final tree has a depth of 5.
32
+ */
33
+ export function computeUnbalancedMerkleTreeRoot(
34
+ leaves: Buffer[],
35
+ hasher = shaMerkleHash,
36
+ emptyRoot = Buffer.alloc(32),
37
+ ): Buffer {
38
+ if (!leaves.length) {
39
+ return emptyRoot;
40
+ }
41
+
42
+ if (leaves.length === 1) {
43
+ return leaves[0];
44
+ }
45
+
46
+ let numRemainingLeaves = leaves.length;
47
+ let subtreeSize = 1;
48
+ let root: Buffer | undefined;
49
+ while (numRemainingLeaves > 1) {
50
+ if ((numRemainingLeaves & subtreeSize) !== 0) {
51
+ const subtreeLeaves = leaves.slice(numRemainingLeaves - subtreeSize, numRemainingLeaves);
52
+ const subtreeRoot = computeBalancedMerkleTreeRoot(subtreeLeaves, hasher);
53
+ if (!root) {
54
+ root = subtreeRoot;
55
+ } else {
56
+ root = hasher(subtreeRoot, root);
57
+ }
58
+
59
+ numRemainingLeaves -= subtreeSize;
60
+ }
61
+
62
+ subtreeSize *= 2;
63
+ }
64
+
65
+ return root!;
66
+ }
67
+
68
+ export async function computeUnbalancedMerkleTreeRootAsync(
69
+ leaves: Buffer[],
70
+ hasher = poseidonMerkleHash,
71
+ emptyRoot = Buffer.alloc(32),
72
+ ): Promise<Buffer> {
73
+ if (!leaves.length) {
74
+ return emptyRoot;
75
+ }
76
+
77
+ if (leaves.length === 1) {
78
+ return leaves[0];
79
+ }
80
+
81
+ let numRemainingLeaves = leaves.length;
82
+ let subtreeSize = 1;
83
+ let root: Buffer | undefined;
84
+ while (numRemainingLeaves > 1) {
85
+ if ((numRemainingLeaves & subtreeSize) !== 0) {
86
+ const subtreeLeaves = leaves.slice(numRemainingLeaves - subtreeSize, numRemainingLeaves);
87
+ const subtreeRoot = await computeBalancedMerkleTreeRootAsync(subtreeLeaves, hasher);
88
+ if (!root) {
89
+ root = subtreeRoot;
90
+ } else {
91
+ root = await hasher(subtreeRoot, root);
92
+ }
93
+
94
+ numRemainingLeaves -= subtreeSize;
95
+ }
96
+
97
+ subtreeSize *= 2;
98
+ }
99
+
100
+ return root!;
101
+ }
102
+
103
+ // A **wonky** tree is a "compressed" unbalanced Merkle tree.
104
+ // It is constructed in the same way as an unbalanced tree: by first creating the largest possible left subtree, with
105
+ // the remaining leaves forming a right subtree that follows the same process recursively.
106
+ // During construction, leaves equal to `valueToCompress` are skipped (compressed) and do not contribute to the tree.
107
+ export function computeWonkyMerkleTreeRoot(
108
+ leaves: Buffer[],
109
+ valueToCompress = Buffer.alloc(32),
110
+ emptyRoot = Buffer.alloc(32),
111
+ hasher = shaMerkleHash,
112
+ ): Buffer {
113
+ const calculator = UnbalancedMerkleTreeCalculator.create(leaves, valueToCompress, emptyRoot, hasher);
114
+ return calculator.getRoot();
115
+ }
@@ -1,5 +1,3 @@
1
- import { findLeafLevelAndIndex } from './unbalanced_merkle_tree.js';
2
-
3
1
  export interface TreeNodeLocation {
4
2
  level: number;
5
3
  index: number;
@@ -68,7 +66,7 @@ export class UnbalancedTreeStore<T> {
68
66
  return [left, right];
69
67
  }
70
68
 
71
- getLeaf(leafIndex: number) {
69
+ getLeaf(leafIndex: number): T | undefined {
72
70
  const { level, indexAtLevel } = findLeafLevelAndIndex(this.#numLeaves, leafIndex);
73
71
  const location = {
74
72
  level,
@@ -81,6 +79,10 @@ export class UnbalancedTreeStore<T> {
81
79
  return this.#nodeMapping.get(this.#getKey(location))?.value;
82
80
  }
83
81
 
82
+ getRoot(): T | undefined {
83
+ return this.getNode({ level: 0, index: 0 });
84
+ }
85
+
84
86
  getParent(location: TreeNodeLocation): T | undefined {
85
87
  const parentLocation = this.getParentLocation(location);
86
88
  return this.getNode(parentLocation);
@@ -100,3 +102,60 @@ export class UnbalancedTreeStore<T> {
100
102
  return `${location.level}-${location.index}`;
101
103
  }
102
104
  }
105
+
106
+ /// Get the depth of the maximum balanced tree that can be created with the given number of leaves. The subtree will be
107
+ /// the left most subtree of the unbalanced tree with a total of `numLeaves` leaves.
108
+ ///
109
+ /// Note: All the leaves may not be used to form the tree. For example, if there are 5 leaves, the maximum depth is 2,
110
+ /// only 4 leaves are used to form a balanced tree.
111
+ function getMaxBalancedSubtreeDepth(numLeaves: number) {
112
+ return Math.floor(Math.log2(numLeaves));
113
+ }
114
+
115
+ /// Get the maximum depth of an unbalanced tree that can be created with the given number of leaves.
116
+ function getMaxUnbalancedTreeDepth(numLeaves: number) {
117
+ return Math.ceil(Math.log2(numLeaves));
118
+ }
119
+
120
+ function findPosition(
121
+ rootLevel: number,
122
+ leafLevel: number,
123
+ numLeaves: number,
124
+ indexOffset: number,
125
+ targetIndex: number,
126
+ ): { level: number; indexAtLevel: number } {
127
+ if (numLeaves <= 1) {
128
+ // Single leaf.
129
+ return { level: rootLevel, indexAtLevel: indexOffset };
130
+ }
131
+
132
+ // The largest balanced tree that can be created with the given number of leaves.
133
+ const maxBalancedTreeDepth = getMaxBalancedSubtreeDepth(numLeaves);
134
+ const numBalancedLeaves = 2 ** maxBalancedTreeDepth;
135
+ const numRemainingLeaves = numLeaves - numBalancedLeaves;
136
+
137
+ if (targetIndex < numBalancedLeaves) {
138
+ // Target is in the balanced tree.
139
+
140
+ // - If numRemainingLeaves is 0: this balanced tree is grown from the current root.
141
+ // - If numRemainingLeaves is not 0: the remaining leaves will form another tree, which will become the right child of the root.
142
+ // And the balanced tree will be the left child of the root.
143
+ // There will be an extra level between the root of the balanced tree and the current root.
144
+ const extraLevel = numRemainingLeaves ? 1 : 0;
145
+
146
+ return { level: rootLevel + maxBalancedTreeDepth + extraLevel, indexAtLevel: indexOffset + targetIndex };
147
+ } else {
148
+ // Target is in the right branch.
149
+ const rightBranchMaxLevel = getMaxUnbalancedTreeDepth(numRemainingLeaves);
150
+ const shiftedUp = leafLevel - rootLevel - rightBranchMaxLevel - 1;
151
+ const nextLeafLevel = leafLevel - shiftedUp;
152
+ const newIndexOffset = (indexOffset + numBalancedLeaves) >> shiftedUp;
153
+ const shiftedTargetIndex = targetIndex - numBalancedLeaves;
154
+ return findPosition(rootLevel + 1, nextLeafLevel, numRemainingLeaves, newIndexOffset, shiftedTargetIndex);
155
+ }
156
+ }
157
+
158
+ export function findLeafLevelAndIndex(numLeaves: number, leafIndex: number) {
159
+ const maxLevel = getMaxUnbalancedTreeDepth(numLeaves);
160
+ return findPosition(0, maxLevel, numLeaves, 0, leafIndex);
161
+ }
@@ -19,6 +19,16 @@ export function unfreeze<T>(obj: T): Writeable<T> {
19
19
  return obj as Writeable<T>;
20
20
  }
21
21
 
22
+ /** Is defined type guard */
23
+ export function isDefined<T>(value: T | undefined): value is T {
24
+ return value !== undefined;
25
+ }
26
+
27
+ /** Type guard for error classes */
28
+ export function isErrorClass<T extends Error>(value: unknown, errorClass: new (...args: any[]) => T): value is T {
29
+ return value instanceof errorClass || (value instanceof Error && value.name === errorClass.name);
30
+ }
31
+
22
32
  /** Resolves a record-like type. Lifted from viem. */
23
33
  export type Prettify<T> = {
24
34
  [K in keyof T]: T[K];
@@ -28,7 +38,7 @@ export type Prettify<T> = {
28
38
  * Type-safe Event Emitter type
29
39
  * @example
30
40
  * export type ArchiverEmitter = TypedEventEmitter<{
31
- * [L2BlockSourceEvents.L2PruneDetected]: (args: L2BlockSourceEvent) => void;
41
+ * [L2BlockSourceEvents.L2PruneUnproven]: (args: L2BlockSourceEvent) => void;
32
42
  * [L2BlockSourceEvents.L2BlockProven]: (args: L2BlockSourceEvent) => void;
33
43
  * }>;
34
44
  * class Archiver extends (EventEmitter as new () => ArchiverEmitter) {
@@ -1,15 +0,0 @@
1
- export * from './keccak/index.js';
2
- export * from './random/index.js';
3
- export * from './sha256/index.js';
4
- export * from './sha512/index.js';
5
- export * from './pedersen/index.js';
6
- export * from './poseidon/index.js';
7
- export * from './secp256k1-signer/index.js';
8
- export * from './keys/index.js';
9
- export * from './aes128/index.js';
10
- export * from './grumpkin/index.js';
11
- export * from './ecdsa/index.js';
12
- export * from './secp256k1/index.js';
13
- export * from './schnorr/index.js';
14
- export * from './signature/index.js';
15
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crypto/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
@@ -1,14 +0,0 @@
1
- export * from './keccak/index.js';
2
- export * from './random/index.js';
3
- export * from './sha256/index.js';
4
- export * from './sha512/index.js';
5
- export * from './pedersen/index.js';
6
- export * from './poseidon/index.js';
7
- export * from './secp256k1-signer/index.js';
8
- export * from './keys/index.js';
9
- export * from './aes128/index.js';
10
- export * from './grumpkin/index.js';
11
- export * from './ecdsa/index.js';
12
- export * from './secp256k1/index.js';
13
- export * from './schnorr/index.js';
14
- export * from './signature/index.js';
@@ -1 +0,0 @@
1
- {"version":3,"file":"bls12_fields.d.ts","sourceRoot":"","sources":["../../src/fields/bls12_fields.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAK/B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAcjC;;GAEG;AACH,8BAAsB,UAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,CAAS;IAE1B,SAAS,aAAa,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAmBrD,SAAS,CAAC,QAAQ,CAAC,OAAO,IAAI,MAAM;IACpC,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM;IAEjC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAOlB,QAAQ,IAAI,KAAK,MAAM,EAAE;IAIzB,QAAQ,IAAI,MAAM;IAUlB,YAAY,IAAI;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE;IAYnC,MAAM,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO;IAIhC,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO;IAI5B,MAAM,IAAI,O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CAAC;IAS5D;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;IAgB7C;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO;IAIzC;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI;IAOzC;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO;IAavC;;;OAGG;IACH,eAAe;IAIf;;;;OAIG;IACH,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IAIhC;;;OAGG;IACH,SAAS;;;;;IAQT;;;;OAIG;IACH,QAAQ;IAQR;;;;;;OAMG;IACH,QAAQ;IAIR;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,UAAU;IAItB;;OAEG;IACH,MAAM;IAIN;;;OAGG;IACH,IAAW,GAAG,YAEb;IAED,+CAA+C;IAE/C,sBAAsB;IAItB,GAAG,CAAC,GAAG,EAAE,UAAU;IAInB,MAAM;IAIN,GAAG,CAAC,GAAG,EAAE,UAAU;IAInB;;;;;;;OAOG;IACH,GAAG,CAAC,GAAG,EAAE,OAAO;IAQhB;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,OAAO;IAItB;;;;;OAKG;IACH,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU;CAQtD;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO;CAIpC"}
@@ -1,66 +0,0 @@
1
- import type { Tuple } from '../serialize/types.js';
2
- import { Fr } from './fields.js';
3
- /**
4
- * Class to wrap a single point coordinate.
5
- * This class handles the complexities of representing point coordinates as 32 byte buffers as well as fields.
6
- * The coordinate value is split across 2 fields to ensure that the max size of a field is not breached.
7
- * This is achieved by placing the most significant byte of the lower field into the least significant byte of the higher field.
8
- * Calls to 'toBuffer' or 'toBigInt' undo this change and simply return the original 32 byte value.
9
- * Calls to 'toFieldsBuffer' will return a 64 bytes buffer containing the serialized fields.
10
- */
11
- export declare class Coordinate {
12
- /**
13
- * The fields of the coordinate value. Least significant limb at index 0.
14
- */
15
- fields: Tuple<Fr, 2>;
16
- static ZERO: Coordinate;
17
- constructor(
18
- /**
19
- * The fields of the coordinate value. Least significant limb at index 0.
20
- */
21
- fields: Tuple<Fr, 2>);
22
- /**
23
- * Converts the coordinate data into a tuple of fields
24
- * @returns A tuple of the coordinate fields
25
- */
26
- toFields(): Tuple<Fr, 2>;
27
- /**
28
- * Generates a random coordinate value
29
- * @returns The random coordinate
30
- */
31
- static random(): Coordinate;
32
- /**
33
- * serializes the object to buffer of 2 fields.
34
- * @returns A buffer serialization of the object.
35
- */
36
- toFieldsBuffer(): Buffer;
37
- /**
38
- * serializes the coordinate to a single 32 byte buffer.
39
- * @returns A buffer serialization of the object.
40
- */
41
- toBuffer(): Buffer;
42
- /**
43
- * Returns true if this coordinate is equal to the one provided
44
- * @param other - The coordinate against which to compare
45
- * @returns True if the coordinates are the same, false otherwise
46
- */
47
- equals(other: Coordinate): boolean;
48
- /**
49
- * Returns the coordinate's value as a bigint
50
- * @returns The coordinate value as a bigint
51
- */
52
- toBigInt(): bigint;
53
- /**
54
- * Creates a coordinate object from a 32 byte coordinate value
55
- * @param coordinate - A buffer containing the 32 byte coordinate value
56
- * @returns The new coordinate object
57
- */
58
- static fromBuffer(coordinate: Buffer): Coordinate;
59
- /**
60
- * Creates a coordinate object from a field
61
- * @param coordinate - The field containing the coordinate
62
- * @returns The new coordinate object
63
- */
64
- static fromField(coordinate: Fr): Coordinate;
65
- }
66
- //# sourceMappingURL=coordinate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coordinate.d.ts","sourceRoot":"","sources":["../../src/fields/coordinate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;;;;;GAOG;AACH,qBAAa,UAAU;IAInB;;OAEG;IACI,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAN7B,MAAM,CAAC,IAAI,aAAsC;;IAG/C;;OAEG;IACI,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAG7B;;;OAGG;IACH,QAAQ,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAIxB;;;OAGG;IACH,MAAM,CAAC,MAAM,IAAI,UAAU;IAI3B;;;OAGG;IACH,cAAc,IAAI,MAAM;IAIxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAOlB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAIlC;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM;IAYpC;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE;CAOhC"}
@@ -1,96 +0,0 @@
1
- import { toBigIntBE } from '../bigint-buffer/index.js';
2
- import { Fr } from './fields.js';
3
- /**
4
- * Class to wrap a single point coordinate.
5
- * This class handles the complexities of representing point coordinates as 32 byte buffers as well as fields.
6
- * The coordinate value is split across 2 fields to ensure that the max size of a field is not breached.
7
- * This is achieved by placing the most significant byte of the lower field into the least significant byte of the higher field.
8
- * Calls to 'toBuffer' or 'toBigInt' undo this change and simply return the original 32 byte value.
9
- * Calls to 'toFieldsBuffer' will return a 64 bytes buffer containing the serialized fields.
10
- */ export class Coordinate {
11
- fields;
12
- static ZERO = new Coordinate([
13
- Fr.ZERO,
14
- Fr.ZERO
15
- ]);
16
- constructor(/**
17
- * The fields of the coordinate value. Least significant limb at index 0.
18
- */ fields){
19
- this.fields = fields;
20
- }
21
- /**
22
- * Converts the coordinate data into a tuple of fields
23
- * @returns A tuple of the coordinate fields
24
- */ toFields() {
25
- return this.fields;
26
- }
27
- /**
28
- * Generates a random coordinate value
29
- * @returns The random coordinate
30
- */ static random() {
31
- return this.fromField(Fr.random());
32
- }
33
- /**
34
- * serializes the object to buffer of 2 fields.
35
- * @returns A buffer serialization of the object.
36
- */ toFieldsBuffer() {
37
- return Buffer.concat([
38
- this.fields[0].toBuffer(),
39
- this.fields[1].toBuffer()
40
- ]);
41
- }
42
- /**
43
- * serializes the coordinate to a single 32 byte buffer.
44
- * @returns A buffer serialization of the object.
45
- */ toBuffer() {
46
- const buf0 = this.fields[0].toBuffer();
47
- const buf1 = this.fields[1].toBuffer();
48
- buf0[0] = buf1[31];
49
- return buf0;
50
- }
51
- /**
52
- * Returns true if this coordinate is equal to the one provided
53
- * @param other - The coordinate against which to compare
54
- * @returns True if the coordinates are the same, false otherwise
55
- */ equals(other) {
56
- return this.toBigInt() === other.toBigInt();
57
- }
58
- /**
59
- * Returns the coordinate's value as a bigint
60
- * @returns The coordinate value as a bigint
61
- */ toBigInt() {
62
- return toBigIntBE(this.toBuffer());
63
- }
64
- /**
65
- * Creates a coordinate object from a 32 byte coordinate value
66
- * @param coordinate - A buffer containing the 32 byte coordinate value
67
- * @returns The new coordinate object
68
- */ static fromBuffer(coordinate) {
69
- if (coordinate.length != 32) {
70
- throw new Error(`Invalid size of coordinate buffer`);
71
- }
72
- const buf0 = Buffer.alloc(32);
73
- coordinate.copy(buf0, 0, 0, 32);
74
- const buf1 = Buffer.alloc(32);
75
- buf1[31] = buf0[0];
76
- buf0[0] = 0;
77
- return new Coordinate([
78
- Fr.fromBuffer(buf0),
79
- Fr.fromBuffer(buf1)
80
- ]);
81
- }
82
- /**
83
- * Creates a coordinate object from a field
84
- * @param coordinate - The field containing the coordinate
85
- * @returns The new coordinate object
86
- */ static fromField(coordinate) {
87
- const buf0 = coordinate.toBuffer();
88
- const buf1 = Buffer.alloc(32);
89
- buf1[31] = buf0[0];
90
- buf0[0] = 0;
91
- return new Coordinate([
92
- Fr.fromBuffer(buf0),
93
- Fr.fromBuffer(buf1)
94
- ]);
95
- }
96
- }
@@ -1,174 +0,0 @@
1
- import { inspect } from 'util';
2
- import { BufferReader } from '../serialize/buffer_reader.js';
3
- /**
4
- * Represents a field derived from BaseField.
5
- */
6
- type DerivedField<T extends BaseField> = {
7
- new (value: any): T;
8
- /**
9
- * All derived fields will specify a MODULUS.
10
- */
11
- MODULUS: bigint;
12
- };
13
- /**
14
- * Base field class.
15
- * Conversions from Buffer to BigInt and vice-versa are not cheap.
16
- * We allow construction with either form and lazily convert to other as needed.
17
- * We only check we are within the field modulus when initializing with bigint.
18
- */
19
- declare abstract class BaseField {
20
- static SIZE_IN_BYTES: number;
21
- private asBuffer?;
22
- private asBigInt?;
23
- /**
24
- * Return bigint representation.
25
- * @deprecated Just to get things compiling. Use toBigInt().
26
- * */
27
- get value(): bigint;
28
- /** Returns the size in bytes. */
29
- get size(): number;
30
- protected constructor(value: number | bigint | boolean | BaseField | Buffer);
31
- protected abstract modulus(): bigint;
32
- /**
33
- * We return a copy of the Buffer to ensure this remains immutable.
34
- */
35
- toBuffer(): Buffer;
36
- toString(): `0x${string}`;
37
- toBigInt(): bigint;
38
- toBool(): boolean;
39
- /**
40
- * Converts this field to a number.
41
- * Throws if the underlying value is greater than MAX_SAFE_INTEGER.
42
- */
43
- toNumber(): number;
44
- /**
45
- * Converts this field to a number.
46
- * May cause loss of precision if the underlying value is greater than MAX_SAFE_INTEGER.
47
- */
48
- toNumberUnsafe(): number;
49
- toShortString(): string;
50
- equals(rhs: BaseField): boolean;
51
- lt(rhs: BaseField): boolean;
52
- cmp(rhs: BaseField): -1 | 0 | 1;
53
- isZero(): boolean;
54
- isEmpty(): boolean;
55
- toFriendlyJSON(): string;
56
- toField(): this;
57
- }
58
- /**
59
- * Constructs a field from a Buffer of BufferReader.
60
- * It maybe not read the full 32 bytes if the Buffer is shorter, but it will padded in BaseField constructor.
61
- */
62
- export declare function fromBuffer<T extends BaseField>(buffer: Buffer | BufferReader, f: DerivedField<T>): T;
63
- /** Branding to ensure fields are not interchangeable types. */
64
- export interface Fr {
65
- /** Brand. */
66
- _branding: 'Fr';
67
- }
68
- /**
69
- * Fr field class.
70
- * @dev This class is used to represent elements of BN254 scalar field or elements in the base field of Grumpkin.
71
- * (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)
72
- */
73
- export declare class Fr extends BaseField {
74
- static ZERO: Fr;
75
- static ONE: Fr;
76
- static MODULUS: bigint;
77
- static MAX_FIELD_VALUE: Fr;
78
- constructor(value: number | bigint | boolean | Fr | Buffer);
79
- [inspect.custom](): string;
80
- protected modulus(): bigint;
81
- static random(): Fr;
82
- static zero(): Fr;
83
- static isZero(value: Fr): boolean;
84
- static fromBuffer(buffer: Buffer | BufferReader): Fr;
85
- static fromBufferReduce(buffer: Buffer): Fr;
86
- /**
87
- * Creates a Fr instance from a string.
88
- * @param buf - the string to create a Fr from.
89
- * @returns the Fr instance
90
- * @remarks if the string only consists of numbers, we assume we are parsing a bigint,
91
- * otherwise we require the hex string to be prepended with "0x", to ensure there is no misunderstanding
92
- * as to what is being parsed.
93
- */
94
- static fromString(buf: string): Fr;
95
- /**
96
- * Creates a Fr instance from a hex string.
97
- * @param buf - a hex encoded string.
98
- * @returns the Fr instance
99
- */
100
- static fromHexString(buf: string): Fr;
101
- /** Arithmetic */
102
- add(rhs: Fr): Fr;
103
- square(): Fr;
104
- negate(): Fr;
105
- sub(rhs: Fr): Fr;
106
- mul(rhs: Fr): Fr;
107
- div(rhs: Fr): Fr;
108
- ediv(rhs: Fr): Fr;
109
- /**
110
- * Computes a square root of the field element.
111
- * @returns A square root of the field element (null if it does not exist).
112
- */
113
- sqrt(): Promise<Fr | null>;
114
- toJSON(): `0x${string}`;
115
- static get schema(): import("zod").ZodType<Fr, any, string>;
116
- }
117
- /**
118
- * Branding to ensure fields are not interchangeable types.
119
- */
120
- export interface Fq {
121
- /** Brand. */
122
- _branding: 'Fq';
123
- }
124
- /**
125
- * Fq field class.
126
- * @dev This class is used to represent elements of BN254 base field or elements in the scalar field of Grumpkin.
127
- * (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)
128
- */
129
- export declare class Fq extends BaseField {
130
- static ZERO: Fq;
131
- static MODULUS: bigint;
132
- private static HIGH_SHIFT;
133
- private static LOW_MASK;
134
- [inspect.custom](): string;
135
- get lo(): Fr;
136
- get hi(): Fr;
137
- constructor(value: number | bigint | boolean | Fq | Buffer);
138
- protected modulus(): bigint;
139
- static random(): Fq;
140
- static zero(): Fq;
141
- static fromBuffer(buffer: Buffer | BufferReader): Fq;
142
- static fromBufferReduce(buffer: Buffer): Fq;
143
- /**
144
- * Creates a Fq instance from a string.
145
- * @param buf - the string to create a Fq from.
146
- * @returns the Fq instance
147
- * @remarks if the string only consists of numbers, we assume we are parsing a bigint,
148
- * otherwise we require the hex string to be prepended with "0x", to ensure there is no misunderstanding
149
- * as to what is being parsed.
150
- */
151
- static fromString(buf: string): Fq;
152
- /**
153
- * Creates a Fq instance from a hex string.
154
- * @param buf - a hex encoded string.
155
- * @returns the Fq instance
156
- */
157
- static fromHexString(buf: string): Fq;
158
- static fromHighLow(high: Fr, low: Fr): Fq;
159
- add(rhs: Fq): Fq;
160
- toJSON(): `0x${string}`;
161
- toFields(): Fr[];
162
- static get schema(): import("zod").ZodType<Fq, any, string>;
163
- }
164
- /**
165
- * GrumpkinScalar is an Fq.
166
- * @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in
167
- * the Aztec Protocol Specs.
168
- */
169
- export type GrumpkinScalar = Fq;
170
- export declare const GrumpkinScalar: typeof Fq;
171
- /** Wraps a function that returns a buffer so that all results are reduced into a field of the given type. */
172
- export declare function reduceFn<TInput, TField extends BaseField>(fn: (input: TInput) => Buffer, field: DerivedField<TField>): (input: TInput) => TField;
173
- export {};
174
- //# sourceMappingURL=fields.d.ts.map
@@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ACtB"}
@@ -1,6 +0,0 @@
1
- export * from './fields.js';
2
- export * from './point.js';
3
- export * from './coordinate.js';
4
- export * from './bls12_fields.js';
5
- export * from './bls12_point.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './fields.js';
2
- export * from './point.js';
3
- export * from './coordinate.js';
4
- export * from './bls12_fields.js';
5
- export * from './bls12_point.js';
@@ -1 +0,0 @@
1
- {"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/fields/point.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;;;GAKG;AACH,qBAAa,KAAK;IASd;;OAEG;aACa,CAAC,EAAE,EAAE;IACrB;;OAEG;aACa,CAAC,EAAE,EAAE;IACrB;;OAEG;aACa,UAAU,EAAE,OAAO;IAnBrC,MAAM,CAAC,IAAI,QAAsC;IACjD,MAAM,CAAC,aAAa,SAAwB;IAC5C,MAAM,CAAC,wBAAwB,SAAoB;IAEnD,yDAAyD;IACzD,SAAgB,IAAI,WAAW;;IAG7B;;OAEG;IACa,CAAC,EAAE,EAAE;IACrB;;OAEG;IACa,CAAC,EAAE,EAAE;IACrB;;OAEG;IACa,UAAU,EAAE,OAAO;IAKrC,MAAM;IAIN,MAAM,KAAK,MAAM,8CAEhB;IAED;;;;OAIG;WACU,MAAM;IAcnB;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C;;;;;;OAMG;IACH,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