@aztec/pxe 0.0.1-fake-ceab37513c → 0.0.6-commit.a2d1860fe9

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 (442) hide show
  1. package/README.md +5 -5
  2. package/dest/access_scopes.d.ts +9 -0
  3. package/dest/access_scopes.d.ts.map +1 -0
  4. package/dest/access_scopes.js +6 -0
  5. package/dest/bin/check_oracle_version.d.ts +1 -1
  6. package/dest/bin/check_oracle_version.js +110 -10
  7. package/dest/block_synchronizer/block_synchronizer.d.ts +45 -0
  8. package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
  9. package/dest/block_synchronizer/block_synchronizer.js +153 -0
  10. package/dest/block_synchronizer/index.d.ts +2 -0
  11. package/dest/block_synchronizer/index.d.ts.map +1 -0
  12. package/dest/block_synchronizer/index.js +1 -0
  13. package/dest/config/index.d.ts +11 -17
  14. package/dest/config/index.d.ts.map +1 -1
  15. package/dest/config/index.js +27 -16
  16. package/dest/config/package_info.d.ts +1 -1
  17. package/dest/config/package_info.js +1 -1
  18. package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
  19. package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
  20. package/dest/contract_function_simulator/benchmarked_node.js +77 -0
  21. package/dest/contract_function_simulator/contract_function_simulator.d.ts +79 -27
  22. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/contract_function_simulator.js +287 -87
  24. package/dest/contract_function_simulator/execution_note_cache.d.ts +26 -15
  25. package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/execution_note_cache.js +65 -37
  27. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
  28. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
  29. package/dest/contract_function_simulator/execution_tagging_index_cache.js +26 -0
  30. package/dest/contract_function_simulator/hashed_values_cache.d.ts +2 -2
  31. package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -1
  32. package/dest/contract_function_simulator/index.d.ts +5 -3
  33. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  34. package/dest/contract_function_simulator/index.js +3 -2
  35. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +5 -4
  36. package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
  37. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +7 -4
  38. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +5 -4
  39. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
  40. package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
  41. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +3 -3
  42. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
  43. package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +8 -4
  44. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +7 -4
  45. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  46. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +13 -4
  47. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +16 -0
  48. package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
  49. package/dest/contract_function_simulator/noir-structs/utility_context.js +22 -0
  50. package/dest/contract_function_simulator/oracle/index.d.ts +2 -2
  51. package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -1
  52. package/dest/contract_function_simulator/oracle/index.js +1 -1
  53. package/dest/contract_function_simulator/oracle/interfaces.d.ts +107 -0
  54. package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
  55. package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
  56. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +2 -2
  57. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
  58. package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -1
  59. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +14 -8
  60. package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
  61. package/dest/contract_function_simulator/oracle/note_packing_utils.js +16 -11
  62. package/dest/contract_function_simulator/oracle/oracle.d.ts +26 -22
  63. package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
  64. package/dest/contract_function_simulator/oracle/oracle.js +156 -113
  65. package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -27
  66. package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
  67. package/dest/contract_function_simulator/oracle/private_execution.js +3 -48
  68. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +72 -52
  69. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  70. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +173 -68
  71. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +116 -53
  72. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  73. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +217 -94
  74. package/dest/contract_function_simulator/pick_notes.d.ts +2 -2
  75. package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
  76. package/dest/contract_function_simulator/pick_notes.js +1 -1
  77. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
  78. package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
  79. package/dest/contract_function_simulator/proxied_contract_data_source.js +23 -5
  80. package/dest/contract_logging.d.ts +22 -0
  81. package/dest/contract_logging.d.ts.map +1 -0
  82. package/dest/contract_logging.js +23 -0
  83. package/dest/contract_sync/contract_sync_service.d.ts +43 -0
  84. package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
  85. package/dest/contract_sync/contract_sync_service.js +97 -0
  86. package/dest/contract_sync/helpers.d.ts +29 -0
  87. package/dest/contract_sync/helpers.d.ts.map +1 -0
  88. package/dest/contract_sync/helpers.js +55 -0
  89. package/dest/debug/pxe_debug_utils.d.ts +45 -0
  90. package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
  91. package/dest/debug/pxe_debug_utils.js +48 -0
  92. package/dest/entrypoints/client/bundle/index.d.ts +7 -3
  93. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  94. package/dest/entrypoints/client/bundle/index.js +5 -2
  95. package/dest/entrypoints/client/bundle/utils.d.ts +9 -9
  96. package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
  97. package/dest/entrypoints/client/bundle/utils.js +40 -17
  98. package/dest/entrypoints/client/lazy/index.d.ts +7 -3
  99. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  100. package/dest/entrypoints/client/lazy/index.js +5 -2
  101. package/dest/entrypoints/client/lazy/utils.d.ts +9 -9
  102. package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
  103. package/dest/entrypoints/client/lazy/utils.js +40 -17
  104. package/dest/entrypoints/pxe_creation_options.d.ts +7 -3
  105. package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
  106. package/dest/entrypoints/server/index.d.ts +9 -3
  107. package/dest/entrypoints/server/index.d.ts.map +1 -1
  108. package/dest/entrypoints/server/index.js +7 -2
  109. package/dest/entrypoints/server/utils.d.ts +5 -24
  110. package/dest/entrypoints/server/utils.d.ts.map +1 -1
  111. package/dest/entrypoints/server/utils.js +42 -51
  112. package/dest/error_enriching.d.ts +11 -0
  113. package/dest/error_enriching.d.ts.map +1 -0
  114. package/dest/{pxe_service/error_enriching.js → error_enriching.js} +9 -6
  115. package/dest/events/event_service.d.ts +15 -0
  116. package/dest/events/event_service.d.ts.map +1 -0
  117. package/dest/events/event_service.js +44 -0
  118. package/dest/events/index.d.ts +2 -0
  119. package/dest/events/index.d.ts.map +1 -0
  120. package/dest/events/index.js +1 -0
  121. package/dest/events/private_event_filter_validator.d.ts +9 -0
  122. package/dest/events/private_event_filter_validator.d.ts.map +1 -0
  123. package/dest/events/private_event_filter_validator.js +38 -0
  124. package/dest/job_coordinator/job_coordinator.d.ts +75 -0
  125. package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
  126. package/dest/job_coordinator/job_coordinator.js +94 -0
  127. package/dest/logs/log_service.d.ts +29 -0
  128. package/dest/logs/log_service.d.ts.map +1 -0
  129. package/dest/logs/log_service.js +118 -0
  130. package/dest/notes/index.d.ts +2 -0
  131. package/dest/notes/index.d.ts.map +1 -0
  132. package/dest/notes/index.js +1 -0
  133. package/dest/notes/note_service.d.ts +49 -0
  134. package/dest/notes/note_service.d.ts.map +1 -0
  135. package/dest/notes/note_service.js +148 -0
  136. package/dest/notes_filter.d.ts +25 -0
  137. package/dest/notes_filter.d.ts.map +1 -0
  138. package/dest/notes_filter.js +4 -0
  139. package/dest/oracle_version.d.ts +3 -3
  140. package/dest/oracle_version.d.ts.map +1 -1
  141. package/dest/oracle_version.js +4 -3
  142. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
  143. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
  144. package/dest/private_kernel/hints/compute_tx_expiration_timestamp.js +41 -0
  145. package/dest/private_kernel/hints/index.d.ts +3 -3
  146. package/dest/private_kernel/hints/index.d.ts.map +1 -1
  147. package/dest/private_kernel/hints/index.js +2 -2
  148. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
  149. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
  150. package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +22 -16
  151. package/dest/private_kernel/index.d.ts +1 -1
  152. package/dest/private_kernel/private_kernel_execution_prover.d.ts +11 -3
  153. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  154. package/dest/private_kernel/private_kernel_execution_prover.js +48 -43
  155. package/dest/private_kernel/private_kernel_oracle.d.ts +26 -25
  156. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  157. package/dest/private_kernel/private_kernel_oracle.js +94 -2
  158. package/dest/pxe.d.ts +250 -0
  159. package/dest/pxe.d.ts.map +1 -0
  160. package/dest/pxe.js +774 -0
  161. package/dest/storage/address_store/address_store.d.ts +11 -0
  162. package/dest/storage/address_store/address_store.d.ts.map +1 -0
  163. package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -15
  164. package/dest/storage/address_store/index.d.ts +2 -0
  165. package/dest/storage/address_store/index.d.ts.map +1 -0
  166. package/dest/storage/address_store/index.js +1 -0
  167. package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
  168. package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
  169. package/dest/storage/{sync_data_provider/sync_data_provider.js → anchor_block_store/anchor_block_store.js} +10 -13
  170. package/dest/storage/anchor_block_store/index.d.ts +2 -0
  171. package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
  172. package/dest/storage/anchor_block_store/index.js +1 -0
  173. package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
  174. package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
  175. package/dest/storage/capsule_store/capsule_store.js +253 -0
  176. package/dest/storage/capsule_store/index.d.ts +2 -0
  177. package/dest/storage/capsule_store/index.d.ts.map +1 -0
  178. package/dest/storage/capsule_store/index.js +1 -0
  179. package/dest/storage/contract_store/contract_store.d.ts +93 -0
  180. package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
  181. package/dest/storage/contract_store/contract_store.js +309 -0
  182. package/dest/storage/contract_store/index.d.ts +2 -0
  183. package/dest/storage/contract_store/index.d.ts.map +1 -0
  184. package/dest/storage/contract_store/index.js +1 -0
  185. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
  186. package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
  187. package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +1 -1
  188. package/dest/storage/index.d.ts +8 -9
  189. package/dest/storage/index.d.ts.map +1 -1
  190. package/dest/storage/index.js +7 -8
  191. package/dest/storage/metadata.d.ts +2 -2
  192. package/dest/storage/metadata.js +1 -1
  193. package/dest/storage/note_store/index.d.ts +3 -0
  194. package/dest/storage/note_store/index.d.ts.map +1 -0
  195. package/dest/storage/note_store/index.js +2 -0
  196. package/dest/storage/note_store/note_store.d.ts +83 -0
  197. package/dest/storage/note_store/note_store.d.ts.map +1 -0
  198. package/dest/storage/note_store/note_store.js +343 -0
  199. package/dest/storage/note_store/stored_note.d.ts +16 -0
  200. package/dest/storage/note_store/stored_note.d.ts.map +1 -0
  201. package/dest/storage/note_store/stored_note.js +43 -0
  202. package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
  203. package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
  204. package/dest/storage/private_event_store/private_event_store.js +273 -0
  205. package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
  206. package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
  207. package/dest/storage/private_event_store/stored_private_event.js +56 -0
  208. package/dest/storage/tagging_store/index.d.ts +4 -0
  209. package/dest/storage/tagging_store/index.d.ts.map +1 -0
  210. package/dest/storage/tagging_store/index.js +3 -0
  211. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
  212. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
  213. package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
  214. package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
  215. package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
  216. package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
  217. package/dest/storage/tagging_store/sender_tagging_store.d.ts +77 -0
  218. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
  219. package/dest/storage/tagging_store/sender_tagging_store.js +348 -0
  220. package/dest/tagging/constants.d.ts +2 -0
  221. package/dest/tagging/constants.d.ts.map +1 -0
  222. package/dest/tagging/constants.js +10 -0
  223. package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
  224. package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
  225. package/dest/tagging/get_all_logs_by_tags.js +60 -0
  226. package/dest/tagging/index.d.ts +17 -0
  227. package/dest/tagging/index.d.ts.map +1 -0
  228. package/dest/tagging/index.js +15 -0
  229. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +15 -0
  230. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
  231. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
  232. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
  233. package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
  234. package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
  235. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +15 -0
  236. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
  237. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +32 -0
  238. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +21 -0
  239. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
  240. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +74 -0
  241. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +11 -0
  242. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
  243. package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +29 -0
  244. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +21 -0
  245. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
  246. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +60 -0
  247. package/package.json +30 -23
  248. package/src/access_scopes.ts +9 -0
  249. package/src/bin/check_oracle_version.ts +135 -10
  250. package/src/block_synchronizer/block_synchronizer.ts +178 -0
  251. package/src/block_synchronizer/index.ts +1 -0
  252. package/src/config/index.ts +32 -32
  253. package/src/config/package_info.ts +1 -1
  254. package/src/contract_function_simulator/benchmarked_node.ts +103 -0
  255. package/src/contract_function_simulator/contract_function_simulator.ts +505 -140
  256. package/src/contract_function_simulator/execution_note_cache.ts +67 -32
  257. package/src/contract_function_simulator/execution_tagging_index_cache.ts +32 -0
  258. package/src/contract_function_simulator/hashed_values_cache.ts +1 -1
  259. package/src/contract_function_simulator/index.ts +4 -2
  260. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +7 -3
  261. package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +6 -5
  262. package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +10 -5
  263. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +15 -3
  264. package/src/contract_function_simulator/noir-structs/utility_context.ts +23 -0
  265. package/src/contract_function_simulator/oracle/index.ts +1 -1
  266. package/src/contract_function_simulator/oracle/interfaces.ts +185 -0
  267. package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +1 -1
  268. package/src/contract_function_simulator/oracle/note_packing_utils.ts +30 -14
  269. package/src/contract_function_simulator/oracle/oracle.ts +197 -110
  270. package/src/contract_function_simulator/oracle/private_execution.ts +4 -78
  271. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +248 -122
  272. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +372 -138
  273. package/src/contract_function_simulator/pick_notes.ts +1 -1
  274. package/src/contract_function_simulator/proxied_contract_data_source.ts +24 -7
  275. package/src/contract_logging.ts +39 -0
  276. package/src/contract_sync/contract_sync_service.ts +152 -0
  277. package/src/contract_sync/helpers.ts +98 -0
  278. package/src/debug/pxe_debug_utils.ts +93 -0
  279. package/src/entrypoints/client/bundle/index.ts +6 -2
  280. package/src/entrypoints/client/bundle/utils.ts +31 -32
  281. package/src/entrypoints/client/lazy/index.ts +6 -2
  282. package/src/entrypoints/client/lazy/utils.ts +31 -32
  283. package/src/entrypoints/pxe_creation_options.ts +6 -2
  284. package/src/entrypoints/server/index.ts +8 -2
  285. package/src/entrypoints/server/utils.ts +39 -91
  286. package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +11 -15
  287. package/src/events/event_service.ts +71 -0
  288. package/src/events/index.ts +1 -0
  289. package/src/events/private_event_filter_validator.ts +46 -0
  290. package/src/job_coordinator/job_coordinator.ts +150 -0
  291. package/src/logs/log_service.ts +208 -0
  292. package/src/notes/index.ts +1 -0
  293. package/src/notes/note_service.ts +196 -0
  294. package/src/notes_filter.ts +26 -0
  295. package/src/oracle_version.ts +4 -3
  296. package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +16 -16
  297. package/src/private_kernel/hints/index.ts +2 -2
  298. package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +44 -37
  299. package/src/private_kernel/private_kernel_execution_prover.ts +64 -55
  300. package/src/private_kernel/private_kernel_oracle.ts +118 -37
  301. package/src/pxe.ts +1137 -0
  302. package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +15 -21
  303. package/src/storage/address_store/index.ts +1 -0
  304. package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +10 -17
  305. package/src/storage/anchor_block_store/index.ts +1 -0
  306. package/src/storage/capsule_store/capsule_store.ts +315 -0
  307. package/src/storage/capsule_store/index.ts +1 -0
  308. package/src/storage/contract_store/contract_store.ts +429 -0
  309. package/src/storage/contract_store/index.ts +1 -0
  310. package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +1 -1
  311. package/src/storage/index.ts +7 -8
  312. package/src/storage/metadata.ts +1 -1
  313. package/src/storage/note_store/index.ts +2 -0
  314. package/src/storage/note_store/note_store.ts +418 -0
  315. package/src/storage/note_store/stored_note.ts +48 -0
  316. package/src/storage/private_event_store/private_event_store.ts +384 -0
  317. package/src/storage/private_event_store/stored_private_event.ts +73 -0
  318. package/src/storage/tagging_store/index.ts +3 -0
  319. package/src/storage/tagging_store/recipient_tagging_store.ts +139 -0
  320. package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
  321. package/src/storage/tagging_store/sender_tagging_store.ts +429 -0
  322. package/src/tagging/constants.ts +10 -0
  323. package/src/tagging/get_all_logs_by_tags.ts +92 -0
  324. package/src/tagging/index.ts +19 -0
  325. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +143 -0
  326. package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
  327. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +49 -0
  328. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +99 -0
  329. package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +36 -0
  330. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +84 -0
  331. package/dest/bin/index.d.ts +0 -3
  332. package/dest/bin/index.d.ts.map +0 -1
  333. package/dest/bin/index.js +0 -48
  334. package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -285
  335. package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
  336. package/dest/contract_function_simulator/execution_data_provider.js +0 -14
  337. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts +0 -87
  338. package/dest/contract_function_simulator/oracle/typed_oracle.d.ts.map +0 -1
  339. package/dest/contract_function_simulator/oracle/typed_oracle.js +0 -146
  340. package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
  341. package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
  342. package/dest/contract_function_simulator/proxied_node.js +0 -27
  343. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -158
  344. package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
  345. package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -701
  346. package/dest/contract_function_simulator/tagging_utils.d.ts +0 -17
  347. package/dest/contract_function_simulator/tagging_utils.d.ts.map +0 -1
  348. package/dest/contract_function_simulator/tagging_utils.js +0 -23
  349. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
  350. package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
  351. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
  352. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
  353. package/dest/private_kernel/hints/compute_tx_include_by_timestamp.js +0 -41
  354. package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -45
  355. package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
  356. package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
  357. package/dest/pxe_service/error_enriching.d.ts +0 -11
  358. package/dest/pxe_service/error_enriching.d.ts.map +0 -1
  359. package/dest/pxe_service/index.d.ts +0 -3
  360. package/dest/pxe_service/index.d.ts.map +0 -1
  361. package/dest/pxe_service/index.js +0 -2
  362. package/dest/pxe_service/pxe_service.d.ts +0 -101
  363. package/dest/pxe_service/pxe_service.d.ts.map +0 -1
  364. package/dest/pxe_service/pxe_service.js +0 -791
  365. package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -13
  366. package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
  367. package/dest/storage/address_data_provider/index.d.ts +0 -2
  368. package/dest/storage/address_data_provider/index.d.ts.map +0 -1
  369. package/dest/storage/address_data_provider/index.js +0 -1
  370. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -27
  371. package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
  372. package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -122
  373. package/dest/storage/capsule_data_provider/index.d.ts +0 -2
  374. package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
  375. package/dest/storage/capsule_data_provider/index.js +0 -1
  376. package/dest/storage/contract_data_provider/contract_data_provider.d.ts +0 -75
  377. package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
  378. package/dest/storage/contract_data_provider/contract_data_provider.js +0 -208
  379. package/dest/storage/contract_data_provider/index.d.ts +0 -2
  380. package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
  381. package/dest/storage/contract_data_provider/index.js +0 -1
  382. package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
  383. package/dest/storage/data_provider.d.ts +0 -4
  384. package/dest/storage/data_provider.d.ts.map +0 -1
  385. package/dest/storage/data_provider.js +0 -1
  386. package/dest/storage/note_data_provider/index.d.ts +0 -3
  387. package/dest/storage/note_data_provider/index.d.ts.map +0 -1
  388. package/dest/storage/note_data_provider/index.js +0 -2
  389. package/dest/storage/note_data_provider/note_dao.d.ts +0 -100
  390. package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
  391. package/dest/storage/note_data_provider/note_dao.js +0 -102
  392. package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -20
  393. package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
  394. package/dest/storage/note_data_provider/note_data_provider.js +0 -260
  395. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts +0 -37
  396. package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
  397. package/dest/storage/private_event_data_provider/private_event_data_provider.js +0 -96
  398. package/dest/storage/sync_data_provider/index.d.ts +0 -2
  399. package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
  400. package/dest/storage/sync_data_provider/index.js +0 -1
  401. package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -12
  402. package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
  403. package/dest/storage/tagging_data_provider/index.d.ts +0 -2
  404. package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
  405. package/dest/storage/tagging_data_provider/index.js +0 -1
  406. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -18
  407. package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
  408. package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -82
  409. package/dest/synchronizer/index.d.ts +0 -2
  410. package/dest/synchronizer/index.d.ts.map +0 -1
  411. package/dest/synchronizer/index.js +0 -1
  412. package/dest/synchronizer/synchronizer.d.ts +0 -35
  413. package/dest/synchronizer/synchronizer.d.ts.map +0 -1
  414. package/dest/synchronizer/synchronizer.js +0 -102
  415. package/dest/test/pxe_test_suite.d.ts +0 -3
  416. package/dest/test/pxe_test_suite.d.ts.map +0 -1
  417. package/dest/test/pxe_test_suite.js +0 -97
  418. package/src/bin/index.ts +0 -62
  419. package/src/contract_function_simulator/execution_data_provider.ts +0 -361
  420. package/src/contract_function_simulator/oracle/typed_oracle.ts +0 -289
  421. package/src/contract_function_simulator/proxied_node.ts +0 -33
  422. package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -1020
  423. package/src/contract_function_simulator/tagging_utils.ts +0 -32
  424. package/src/private_kernel/private_kernel_oracle_impl.ts +0 -132
  425. package/src/pxe_service/index.ts +0 -2
  426. package/src/pxe_service/pxe_service.ts +0 -1139
  427. package/src/storage/address_data_provider/index.ts +0 -1
  428. package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -157
  429. package/src/storage/capsule_data_provider/index.ts +0 -1
  430. package/src/storage/contract_data_provider/contract_data_provider.ts +0 -300
  431. package/src/storage/contract_data_provider/index.ts +0 -1
  432. package/src/storage/data_provider.ts +0 -3
  433. package/src/storage/note_data_provider/index.ts +0 -2
  434. package/src/storage/note_data_provider/note_dao.ts +0 -154
  435. package/src/storage/note_data_provider/note_data_provider.ts +0 -350
  436. package/src/storage/private_event_data_provider/private_event_data_provider.ts +0 -134
  437. package/src/storage/sync_data_provider/index.ts +0 -1
  438. package/src/storage/tagging_data_provider/index.ts +0 -1
  439. package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -123
  440. package/src/synchronizer/index.ts +0 -1
  441. package/src/synchronizer/synchronizer.ts +0 -121
  442. package/src/test/pxe_test_suite.ts +0 -113
@@ -1,13 +0,0 @@
1
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
- import { CompleteAddress } from '@aztec/stdlib/contract';
4
- import type { DataProvider } from '../data_provider.js';
5
- export declare class AddressDataProvider implements DataProvider {
6
- #private;
7
- constructor(store: AztecAsyncKVStore);
8
- addCompleteAddress(completeAddress: CompleteAddress): Promise<boolean>;
9
- getCompleteAddress(account: AztecAddress): Promise<CompleteAddress | undefined>;
10
- getCompleteAddresses(): Promise<CompleteAddress[]>;
11
- getSize(): Promise<number>;
12
- }
13
- //# sourceMappingURL=address_data_provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"address_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/address_data_provider/address_data_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,mBAAoB,YAAW,YAAY;;gBAK1C,KAAK,EAAE,iBAAiB;IAOpC,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAsCtE,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAIzE,oBAAoB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAMlD,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;CAGjC"}
@@ -1,2 +0,0 @@
1
- export { AddressDataProvider } from './address_data_provider.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/address_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1 +0,0 @@
1
- export { AddressDataProvider } from './address_data_provider.js';
@@ -1,27 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { type Logger } from '@aztec/foundation/log';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
- import type { DataProvider } from '../data_provider.js';
6
- export declare class CapsuleDataProvider implements DataProvider {
7
- #private;
8
- logger: Logger;
9
- constructor(store: AztecAsyncKVStore);
10
- storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void>;
11
- loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
12
- deleteCapsule(contractAddress: AztecAddress, slot: Fr): Promise<void>;
13
- copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
14
- /**
15
- * Appends multiple capsules to a capsule array stored at the base slot.
16
- * The array length is stored at the base slot, and elements are stored in consecutive slots after it.
17
- * All operations are performed in a single transaction.
18
- * @param contractAddress - The contract address that owns the capsule array
19
- * @param baseSlot - The slot where the array length is stored
20
- * @param content - Array of capsule data to append
21
- */
22
- appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
23
- readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr): Promise<Fr[][]>;
24
- setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
25
- getSize(): Promise<number>;
26
- }
27
- //# sourceMappingURL=capsule_data_provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capsule_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_data_provider/capsule_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,mBAAoB,YAAW,YAAY;;IAMtD,MAAM,EAAE,MAAM,CAAC;gBAEH,KAAK,EAAE,iBAAiB;IAQ9B,YAAY,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAInF,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC;IAa1E,aAAa,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,WAAW,CAAC,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BvG;;;;;;;OAOG;IACH,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBjG,gBAAgB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC;IAwB9E,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;IAqB/D,OAAO;CAMrB"}
@@ -1,122 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { toArray } from '@aztec/foundation/iterable';
3
- import { createLogger } from '@aztec/foundation/log';
4
- export class CapsuleDataProvider {
5
- #store;
6
- // Arbitrary data stored by contracts. Key is computed as `${contractAddress}:${key}`
7
- #capsules;
8
- logger;
9
- constructor(store){
10
- this.#store = store;
11
- this.#capsules = this.#store.openMap('capsules');
12
- this.logger = createLogger('pxe:capsule-data-provider');
13
- }
14
- async storeCapsule(contractAddress, slot, capsule) {
15
- await this.#capsules.set(dbSlotToKey(contractAddress, slot), Buffer.concat(capsule.map((value)=>value.toBuffer())));
16
- }
17
- async loadCapsule(contractAddress, slot) {
18
- const dataBuffer = await this.#capsules.getAsync(dbSlotToKey(contractAddress, slot));
19
- if (!dataBuffer) {
20
- this.logger.trace(`Data not found for contract ${contractAddress.toString()} and slot ${slot.toString()}`);
21
- return null;
22
- }
23
- const capsule = [];
24
- for(let i = 0; i < dataBuffer.length; i += Fr.SIZE_IN_BYTES){
25
- capsule.push(Fr.fromBuffer(dataBuffer.subarray(i, i + Fr.SIZE_IN_BYTES)));
26
- }
27
- return capsule;
28
- }
29
- async deleteCapsule(contractAddress, slot) {
30
- await this.#capsules.delete(dbSlotToKey(contractAddress, slot));
31
- }
32
- copyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
33
- return this.#store.transactionAsync(async ()=>{
34
- // In order to support overlapping source and destination regions, we need to check the relative positions of source
35
- // and destination. If destination is ahead of source, then by the time we overwrite source elements using forward
36
- // indexes we'll have already read those. On the contrary, if source is ahead of destination we need to use backward
37
- // indexes to avoid reading elements that've been overwritten.
38
- const indexes = Array.from(Array(numEntries).keys());
39
- if (srcSlot.lt(dstSlot)) {
40
- indexes.reverse();
41
- }
42
- for (const i of indexes){
43
- const currentSrcSlot = dbSlotToKey(contractAddress, srcSlot.add(new Fr(i)));
44
- const currentDstSlot = dbSlotToKey(contractAddress, dstSlot.add(new Fr(i)));
45
- const toCopy = await this.#capsules.getAsync(currentSrcSlot);
46
- if (!toCopy) {
47
- throw new Error(`Attempted to copy empty slot ${currentSrcSlot} for contract ${contractAddress.toString()}`);
48
- }
49
- await this.#capsules.set(currentDstSlot, toCopy);
50
- }
51
- });
52
- }
53
- /**
54
- * Appends multiple capsules to a capsule array stored at the base slot.
55
- * The array length is stored at the base slot, and elements are stored in consecutive slots after it.
56
- * All operations are performed in a single transaction.
57
- * @param contractAddress - The contract address that owns the capsule array
58
- * @param baseSlot - The slot where the array length is stored
59
- * @param content - Array of capsule data to append
60
- */ appendToCapsuleArray(contractAddress, baseSlot, content) {
61
- return this.#store.transactionAsync(async ()=>{
62
- // Load current length, defaulting to 0 if not found
63
- const lengthData = await this.loadCapsule(contractAddress, baseSlot);
64
- const currentLength = lengthData ? lengthData[0].toNumber() : 0;
65
- // Store each capsule at consecutive slots after baseSlot + 1 + currentLength
66
- for(let i = 0; i < content.length; i++){
67
- const nextSlot = arraySlot(baseSlot, currentLength + i);
68
- await this.storeCapsule(contractAddress, nextSlot, content[i]);
69
- }
70
- // Update length to include all new capsules
71
- const newLength = currentLength + content.length;
72
- await this.storeCapsule(contractAddress, baseSlot, [
73
- new Fr(newLength)
74
- ]);
75
- });
76
- }
77
- readCapsuleArray(contractAddress, baseSlot) {
78
- return this.#store.transactionAsync(async ()=>{
79
- // Load length, defaulting to 0 if not found
80
- const maybeLength = await this.loadCapsule(contractAddress, baseSlot);
81
- const length = maybeLength ? maybeLength[0].toBigInt() : 0n;
82
- const values = [];
83
- // Read each capsule at consecutive slots after baseSlot
84
- for(let i = 0; i < length; i++){
85
- const currentValue = await this.loadCapsule(contractAddress, arraySlot(baseSlot, i));
86
- if (currentValue == undefined) {
87
- throw new Error(`Expected non-empty value at capsule array in base slot ${baseSlot} at index ${i} for contract ${contractAddress}`);
88
- }
89
- values.push(currentValue);
90
- }
91
- return values;
92
- });
93
- }
94
- setCapsuleArray(contractAddress, baseSlot, content) {
95
- return this.#store.transactionAsync(async ()=>{
96
- // Load current length, defaulting to 0 if not found
97
- const maybeLength = await this.loadCapsule(contractAddress, baseSlot);
98
- const originalLength = maybeLength ? maybeLength[0].toNumber() : 0;
99
- // Set the new length
100
- await this.storeCapsule(contractAddress, baseSlot, [
101
- new Fr(content.length)
102
- ]);
103
- // Store the new content, possibly overwriting existing values
104
- for(let i = 0; i < content.length; i++){
105
- await this.storeCapsule(contractAddress, arraySlot(baseSlot, i), content[i]);
106
- }
107
- // Clear any stragglers
108
- for(let i = content.length; i < originalLength; i++){
109
- await this.deleteCapsule(contractAddress, arraySlot(baseSlot, i));
110
- }
111
- });
112
- }
113
- async getSize() {
114
- return (await toArray(this.#capsules.valuesAsync())).reduce((sum, value)=>sum + value.length * Fr.SIZE_IN_BYTES, 0);
115
- }
116
- }
117
- function dbSlotToKey(contractAddress, slot) {
118
- return `${contractAddress.toString()}:${slot.toString()}`;
119
- }
120
- function arraySlot(baseSlot, index) {
121
- return baseSlot.add(new Fr(1)).add(new Fr(index));
122
- }
@@ -1,2 +0,0 @@
1
- export { CapsuleDataProvider } from './capsule_data_provider.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1 +0,0 @@
1
- export { CapsuleDataProvider } from './capsule_data_provider.js';
@@ -1,75 +0,0 @@
1
- import type { Fr } from '@aztec/foundation/fields';
2
- import type { MembershipWitness } from '@aztec/foundation/trees';
3
- import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
- import { type ContractArtifact, type FunctionAbi, type FunctionArtifact, type FunctionArtifactWithContractName, type FunctionDebugMetadata, FunctionSelector } from '@aztec/stdlib/abi';
5
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
6
- import { type ContractClass, type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
7
- import type { DataProvider } from '../data_provider.js';
8
- /**
9
- * ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
10
- * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
11
- * from a given contract address and function selector. The class maintains a cache of ContractTree instances
12
- * to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
13
- * the required information and facilitate cryptographic proof generation.
14
- */
15
- export declare class ContractDataProvider implements DataProvider {
16
- #private;
17
- constructor(store: AztecAsyncKVStore);
18
- addContractArtifact(id: Fr, contract: ContractArtifact): Promise<void>;
19
- addContractInstance(contract: ContractInstanceWithAddress): Promise<void>;
20
- getContractsAddresses(): Promise<AztecAddress[]>;
21
- /** Returns a contract instance for a given address. Throws if not found. */
22
- getContractInstance(contractAddress: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
23
- getContractArtifact(contractClassId: Fr): Promise<ContractArtifact | undefined>;
24
- /** Returns a contract class for a given class id. Throws if not found. */
25
- getContractClass(contractClassId: Fr): Promise<ContractClass | undefined>;
26
- getContract(address: AztecAddress): Promise<(ContractInstanceWithAddress & ContractArtifact) | undefined>;
27
- /**
28
- * Retrieves the artifact of a specified function within a given contract.
29
- * The function is identified by its selector, which is a unique code generated from the function's signature.
30
- * Throws an error if the contract address or function selector are invalid or not found.
31
- *
32
- * @param contractAddress - The AztecAddress representing the contract containing the function.
33
- * @param selector - The function selector.
34
- * @returns The corresponding function's artifact as an object.
35
- */
36
- getFunctionArtifact(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionArtifactWithContractName | undefined>;
37
- getPublicFunctionArtifact(contractAddress: AztecAddress): Promise<FunctionArtifactWithContractName | undefined>;
38
- /**
39
- * Retrieves the artifact of a specified function within a given contract.
40
- * The function is identified by its name, which is unique within a contract.
41
- * Throws if the contract has not been added to the database.
42
- *
43
- * @param contractAddress - The AztecAddress representing the contract containing the function.
44
- * @param functionName - The name of the function.
45
- * @returns The corresponding function's artifact as an object
46
- */
47
- getFunctionArtifactByName(contractAddress: AztecAddress, functionName: string): Promise<FunctionArtifact | undefined>;
48
- getFunctionAbi(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionAbi | undefined>;
49
- /**
50
- * Retrieves the debug metadata of a specified function within a given contract.
51
- * The function is identified by its selector, which is a unique code generated from the function's signature.
52
- * Returns undefined if the debug metadata for the given function is not found.
53
- * Throws if the contract has not been added to the database.
54
- *
55
- * @param contractAddress - The AztecAddress representing the contract containing the function.
56
- * @param selector - The function selector.
57
- * @returns The corresponding function's artifact as an object.
58
- */
59
- getFunctionDebugMetadata(contractAddress: AztecAddress, selector: FunctionSelector): Promise<FunctionDebugMetadata | undefined>;
60
- getPublicFunctionDebugMetadata(contractAddress: AztecAddress): Promise<FunctionDebugMetadata | undefined>;
61
- /**
62
- * Retrieve the function membership witness for the given contract class and function selector.
63
- * The function membership witness represents a proof that the function belongs to the specified contract.
64
- * Throws an error if the contract address or function selector is unknown.
65
- *
66
- * @param contractClassId - The id of the class.
67
- * @param selector - The function selector.
68
- * @returns A promise that resolves with the MembershipWitness instance for the specified contract's function.
69
- */
70
- getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector): Promise<MembershipWitness<5> | undefined>;
71
- getDebugContractName(contractAddress: AztecAddress): Promise<string | undefined>;
72
- getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
73
- getSize(): Promise<number>;
74
- }
75
- //# sourceMappingURL=contract_data_provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/contract_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,gBAAgB,EAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAGjC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD;;;;;;GAMG;AACH,qBAAa,oBAAqB,YAAW,YAAY;;gBAW3C,KAAK,EAAE,iBAAiB;IAOvB,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB7E,mBAAmB,CAAC,QAAQ,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmDzE,qBAAqB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAKtD,4EAA4E;IAC/D,mBAAmB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;IAKpG,mBAAmB,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAM5F,0EAA0E;IAC7D,gBAAgB,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAKzE,WAAW,CACtB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,CAAC,2BAA2B,GAAG,gBAAgB,CAAC,GAAG,SAAS,CAAC;IAYxE;;;;;;;;OAQG;IACU,mBAAmB,CAC9B,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,gCAAgC,GAAG,SAAS,CAAC;IAM3C,yBAAyB,CACpC,eAAe,EAAE,YAAY,GAC5B,OAAO,CAAC,gCAAgC,GAAG,SAAS,CAAC;IAMxD;;;;;;;;OAQG;IACU,yBAAyB,CACpC,eAAe,EAAE,YAAY,EAC7B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAK3B,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAKnC;;;;;;;;;OASG;IACU,wBAAwB,CACnC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAMhC,8BAA8B,CACzC,eAAe,EAAE,YAAY,GAC5B,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAM7C;;;;;;;;OAQG;IACU,4BAA4B,CACvC,eAAe,EAAE,EAAE,EACnB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAK/B,oBAAoB,CAAC,eAAe,EAAE,YAAY;IAKlD,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB;IAM9E,OAAO;CAiCrB"}
@@ -1,208 +0,0 @@
1
- import { toArray } from '@aztec/foundation/iterable';
2
- import { FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
3
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
5
- import { PrivateFunctionsTree } from './private_functions_tree.js';
6
- /**
7
- * ContractDataProvider serves as a data manager and retriever for Aztec.nr contracts.
8
- * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
9
- * from a given contract address and function selector. The class maintains a cache of ContractTree instances
10
- * to efficiently serve the requested data. It interacts with the ContractDatabase and AztecNode to fetch
11
- * the required information and facilitate cryptographic proof generation.
12
- */ export class ContractDataProvider {
13
- /** Map from contract class id to private function tree. */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
14
- #privateFunctionTrees = new Map();
15
- /** Map from contract address to contract class id */ #contractClassIdMap = new Map();
16
- #contractArtifacts;
17
- #contractInstances;
18
- constructor(store){
19
- this.#contractArtifacts = store.openMap('contract_artifacts');
20
- this.#contractInstances = store.openMap('contracts_instances');
21
- }
22
- // Setters
23
- async addContractArtifact(id, contract) {
24
- const privateFunctions = contract.functions.filter((functionArtifact)=>functionArtifact.functionType === FunctionType.PRIVATE);
25
- const privateSelectors = await Promise.all(privateFunctions.map(async (privateFunctionArtifact)=>(await FunctionSelector.fromNameAndParameters(privateFunctionArtifact.name, privateFunctionArtifact.parameters)).toString()));
26
- if (privateSelectors.length !== new Set(privateSelectors).size) {
27
- throw new Error('Repeated function selectors of private functions');
28
- }
29
- await this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract));
30
- }
31
- async addContractInstance(contract) {
32
- this.#contractClassIdMap.set(contract.address.toString(), contract.currentContractClassId);
33
- await this.#contractInstances.set(contract.address.toString(), new SerializableContractInstance(contract).toBuffer());
34
- }
35
- // Private getters
36
- async #getContractClassId(contractAddress) {
37
- if (!this.#contractClassIdMap.has(contractAddress.toString())) {
38
- const instance = await this.getContractInstance(contractAddress);
39
- if (!instance) {
40
- return;
41
- }
42
- this.#contractClassIdMap.set(contractAddress.toString(), instance.currentContractClassId);
43
- }
44
- return this.#contractClassIdMap.get(contractAddress.toString());
45
- }
46
- /**
47
- * Retrieve or create a ContractTree instance based on the provided class id.
48
- * If an existing tree with the same class id is found in the cache, it will be returned.
49
- * Otherwise, a new ContractTree instance will be created using the contract data from the database
50
- * and added to the cache before returning.
51
- *
52
- * @param classId - The class id of the contract for which the ContractTree is required.
53
- * @returns A ContractTree instance associated with the specified contract address.
54
- * @throws An Error if the contract is not found in the ContractDatabase.
55
- */ async #getPrivateFunctionTreeForClassId(classId) {
56
- if (!this.#privateFunctionTrees.has(classId.toString())) {
57
- const artifact = await this.getContractArtifact(classId);
58
- if (!artifact) {
59
- return;
60
- }
61
- const tree = await PrivateFunctionsTree.create(artifact);
62
- this.#privateFunctionTrees.set(classId.toString(), tree);
63
- }
64
- return this.#privateFunctionTrees.get(classId.toString());
65
- }
66
- async #getContractArtifactByAddress(contractAddress) {
67
- const contractClassId = await this.#getContractClassId(contractAddress);
68
- return contractClassId && this.getContractArtifact(contractClassId);
69
- }
70
- // Public getters
71
- async getContractsAddresses() {
72
- const keys = await toArray(this.#contractInstances.keysAsync());
73
- return keys.map(AztecAddress.fromString);
74
- }
75
- /** Returns a contract instance for a given address. Throws if not found. */ async getContractInstance(contractAddress) {
76
- const contract = await this.#contractInstances.getAsync(contractAddress.toString());
77
- return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
78
- }
79
- async getContractArtifact(contractClassId) {
80
- const contract = await this.#contractArtifacts.getAsync(contractClassId.toString());
81
- // TODO(@spalladino): AztecAsyncMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from.
82
- return contract && contractArtifactFromBuffer(Buffer.from(contract));
83
- }
84
- /** Returns a contract class for a given class id. Throws if not found. */ async getContractClass(contractClassId) {
85
- const artifact = await this.getContractArtifact(contractClassId);
86
- return artifact && getContractClassFromArtifact(artifact);
87
- }
88
- async getContract(address) {
89
- const instance = await this.getContractInstance(address);
90
- if (!instance) {
91
- return;
92
- }
93
- const artifact = await this.getContractArtifact(instance.currentContractClassId);
94
- if (!artifact) {
95
- return;
96
- }
97
- return {
98
- ...instance,
99
- ...artifact
100
- };
101
- }
102
- /**
103
- * Retrieves the artifact of a specified function within a given contract.
104
- * The function is identified by its selector, which is a unique code generated from the function's signature.
105
- * Throws an error if the contract address or function selector are invalid or not found.
106
- *
107
- * @param contractAddress - The AztecAddress representing the contract containing the function.
108
- * @param selector - The function selector.
109
- * @returns The corresponding function's artifact as an object.
110
- */ async getFunctionArtifact(contractAddress, selector) {
111
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
112
- const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
113
- return fnArtifact && {
114
- ...fnArtifact,
115
- contractName: artifact.name
116
- };
117
- }
118
- async getPublicFunctionArtifact(contractAddress) {
119
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
120
- const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
121
- return fnArtifact && {
122
- ...fnArtifact,
123
- contractName: artifact.name
124
- };
125
- }
126
- /**
127
- * Retrieves the artifact of a specified function within a given contract.
128
- * The function is identified by its name, which is unique within a contract.
129
- * Throws if the contract has not been added to the database.
130
- *
131
- * @param contractAddress - The AztecAddress representing the contract containing the function.
132
- * @param functionName - The name of the function.
133
- * @returns The corresponding function's artifact as an object
134
- */ async getFunctionArtifactByName(contractAddress, functionName) {
135
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
136
- return artifact?.functions.find((fn)=>fn.name === functionName);
137
- }
138
- async getFunctionAbi(contractAddress, selector) {
139
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
140
- return artifact && await this.#findFunctionAbiBySelector(artifact, selector);
141
- }
142
- /**
143
- * Retrieves the debug metadata of a specified function within a given contract.
144
- * The function is identified by its selector, which is a unique code generated from the function's signature.
145
- * Returns undefined if the debug metadata for the given function is not found.
146
- * Throws if the contract has not been added to the database.
147
- *
148
- * @param contractAddress - The AztecAddress representing the contract containing the function.
149
- * @param selector - The function selector.
150
- * @returns The corresponding function's artifact as an object.
151
- */ async getFunctionDebugMetadata(contractAddress, selector) {
152
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
153
- const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
154
- return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
155
- }
156
- async getPublicFunctionDebugMetadata(contractAddress) {
157
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
158
- const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
159
- return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
160
- }
161
- /**
162
- * Retrieve the function membership witness for the given contract class and function selector.
163
- * The function membership witness represents a proof that the function belongs to the specified contract.
164
- * Throws an error if the contract address or function selector is unknown.
165
- *
166
- * @param contractClassId - The id of the class.
167
- * @param selector - The function selector.
168
- * @returns A promise that resolves with the MembershipWitness instance for the specified contract's function.
169
- */ async getFunctionMembershipWitness(contractClassId, selector) {
170
- const tree = await this.#getPrivateFunctionTreeForClassId(contractClassId);
171
- return tree?.getFunctionMembershipWitness(selector);
172
- }
173
- async getDebugContractName(contractAddress) {
174
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
175
- return artifact?.name;
176
- }
177
- async getDebugFunctionName(contractAddress, selector) {
178
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
179
- const fnArtifact = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
180
- return `${artifact?.name ?? contractAddress}:${fnArtifact?.name ?? selector}`;
181
- }
182
- async getSize() {
183
- return (await toArray(this.#contractInstances.valuesAsync())).concat(await toArray(this.#contractArtifacts.valuesAsync())).reduce((sum, value)=>sum + value.length, 0);
184
- }
185
- async #findFunctionArtifactBySelector(artifact, selector) {
186
- const functions = artifact.functions;
187
- for(let i = 0; i < functions.length; i++){
188
- const fn = functions[i];
189
- const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
190
- if (fnSelector.equals(selector)) {
191
- return fn;
192
- }
193
- }
194
- }
195
- async #findFunctionAbiBySelector(artifact, selector) {
196
- const functions = [
197
- ...artifact.functions,
198
- ...artifact.nonDispatchPublicFunctions ?? []
199
- ];
200
- for(let i = 0; i < functions.length; i++){
201
- const fn = functions[i];
202
- const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
203
- if (fnSelector.equals(selector)) {
204
- return fn;
205
- }
206
- }
207
- }
208
- }
@@ -1,2 +0,0 @@
1
- export { ContractDataProvider } from './contract_data_provider.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1 +0,0 @@
1
- export { ContractDataProvider } from './contract_data_provider.js';
@@ -1 +0,0 @@
1
- {"version":3,"file":"private_functions_tree.d.ts","sourceRoot":"","sources":["../../../src/storage/contract_data_provider/private_functions_tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AAQ1F;;;;;GAKG;AACH,qBAAa,oBAAoB;IAGX,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAFrD,OAAO,CAAC,IAAI,CAAC,CAAa;IAE1B,OAAO;WAEM,MAAM,CAAC,QAAQ,EAAE,gBAAgB;IAS9C;;;;;;;;OAQG;IACU,4BAA4B,CACvC,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,OAAO,oBAAoB,CAAC,CAAC;YAiB5C,OAAO;CAMtB"}
@@ -1,4 +0,0 @@
1
- export interface DataProvider {
2
- getSize(): Promise<number>;
3
- }
4
- //# sourceMappingURL=data_provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data_provider.d.ts","sourceRoot":"","sources":["../../src/storage/data_provider.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B"}
@@ -1 +0,0 @@
1
- export { };
@@ -1,3 +0,0 @@
1
- export { NoteDao } from './note_dao.js';
2
- export { NoteDataProvider } from './note_data_provider.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { NoteDao } from './note_dao.js';
2
- export { NoteDataProvider } from './note_data_provider.js';
@@ -1,100 +0,0 @@
1
- import { Fr } from '@aztec/foundation/fields';
2
- import { BufferReader } from '@aztec/foundation/serialize';
3
- import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import { Note } from '@aztec/stdlib/note';
5
- import { TxHash } from '@aztec/stdlib/tx';
6
- import type { NoteData } from '../../contract_function_simulator/oracle/typed_oracle.js';
7
- /**
8
- * A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
9
- * information required to use it during execution and manage its state.
10
- */
11
- export declare class NoteDao implements NoteData {
12
- /** The packed content of the note, as will be returned in the getNotes oracle. */
13
- note: Note;
14
- /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
15
- contractAddress: AztecAddress;
16
- /**
17
- * The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
18
- * since contracts typically make queries based on it.
19
- */
20
- storageSlot: Fr;
21
- /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
22
- noteNonce: Fr;
23
- /**
24
- * The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
25
- * be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
26
- */
27
- noteHash: Fr;
28
- /**
29
- * The nullifier of the note, siloed by contract address.
30
- * Note: Might be set as 0 if the note was added to PXE as nullified.
31
- */
32
- siloedNullifier: Fr;
33
- /** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
34
- * when searching for txEffects.
35
- */
36
- txHash: TxHash;
37
- /** The L2 block number in which the tx with this note was included. Used for note management while processing
38
- * reorgs.*/
39
- l2BlockNumber: number;
40
- /** The L2 block hash in which the tx with this note was included. Used for note management while processing
41
- * reorgs.*/
42
- l2BlockHash: string;
43
- /** The index of the leaf in the global note hash tree the note is stored at */
44
- index: bigint;
45
- /**
46
- * The address whose public key was used to encrypt the note log during delivery.
47
- * (This is the x-coordinate of the public key.)
48
- */
49
- recipient: AztecAddress;
50
- constructor(
51
- /** The packed content of the note, as will be returned in the getNotes oracle. */
52
- note: Note,
53
- /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
54
- contractAddress: AztecAddress,
55
- /**
56
- * The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
57
- * since contracts typically make queries based on it.
58
- */
59
- storageSlot: Fr,
60
- /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
61
- noteNonce: Fr,
62
- /**
63
- * The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
64
- * be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
65
- */
66
- noteHash: Fr,
67
- /**
68
- * The nullifier of the note, siloed by contract address.
69
- * Note: Might be set as 0 if the note was added to PXE as nullified.
70
- */
71
- siloedNullifier: Fr,
72
- /** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
73
- * when searching for txEffects.
74
- */
75
- txHash: TxHash,
76
- /** The L2 block number in which the tx with this note was included. Used for note management while processing
77
- * reorgs.*/
78
- l2BlockNumber: number,
79
- /** The L2 block hash in which the tx with this note was included. Used for note management while processing
80
- * reorgs.*/
81
- l2BlockHash: string,
82
- /** The index of the leaf in the global note hash tree the note is stored at */
83
- index: bigint,
84
- /**
85
- * The address whose public key was used to encrypt the note log during delivery.
86
- * (This is the x-coordinate of the public key.)
87
- */
88
- recipient: AztecAddress);
89
- toBuffer(): Buffer;
90
- static fromBuffer(buffer: Buffer | BufferReader): NoteDao;
91
- toString(): string;
92
- static fromString(str: string): NoteDao;
93
- /**
94
- * Returns the size in bytes of the Note Dao.
95
- * @returns - Its size in bytes.
96
- */
97
- getSize(): number;
98
- static random({ note, contractAddress, storageSlot, noteNonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, recipient, }?: Partial<NoteDao>): Promise<NoteDao>;
99
- }
100
- //# sourceMappingURL=note_dao.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_dao.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAS,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAC;AAEzF;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IAIpC,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;OAGG;IACI,WAAW,EAAE,EAAE;IACtB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGpB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IACpB;;;OAGG;IACI,SAAS,EAAE,YAAY;;IAzC9B,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;OAGG;IACI,WAAW,EAAE,EAAE;IACtB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGpB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IACpB;;;OAGG;IACI,SAAS,EAAE,YAAY;IAGhC,QAAQ,IAAI,MAAM;IAgBlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IA8B/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,SAAuB,EACvB,QAAsB,EACtB,eAA6B,EAC7B,MAAwB,EACxB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,EAC9B,SAAqB,GACtB,GAAE,OAAO,CAAC,OAAO,CAAM;CAezB"}