@aztec/pxe 0.0.0-test.1 → 0.0.1-commit.001888fc
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.
- package/README.md +5 -5
- package/dest/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/bin/check_oracle_version.d.ts +2 -0
- package/dest/bin/check_oracle_version.d.ts.map +1 -0
- package/dest/bin/check_oracle_version.js +129 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts +45 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -0
- package/dest/block_synchronizer/block_synchronizer.js +153 -0
- package/dest/block_synchronizer/index.d.ts +2 -0
- package/dest/block_synchronizer/index.d.ts.map +1 -0
- package/dest/block_synchronizer/index.js +1 -0
- package/dest/config/index.d.ts +14 -25
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +36 -34
- package/dest/config/package_info.d.ts +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +114 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.js +459 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts +104 -0
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_note_cache.js +208 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +16 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +34 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts +28 -0
- package/dest/contract_function_simulator/hashed_values_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/hashed_values_cache.js +36 -0
- package/dest/contract_function_simulator/index.d.ts +15 -0
- package/dest/contract_function_simulator/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/index.js +13 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +20 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +41 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +26 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +17 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +63 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +22 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +49 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.js +22 -0
- package/dest/contract_function_simulator/oracle/index.d.ts +14 -0
- package/dest/contract_function_simulator/oracle/index.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/index.js +2 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +111 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/interfaces.js +4 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +43 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +19 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +24 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +28 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +54 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +60 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/oracle.js +417 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +23 -0
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution.js +89 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +218 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +441 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +239 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +440 -0
- package/dest/contract_function_simulator/pick_notes.d.ts +85 -0
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -0
- package/dest/contract_function_simulator/pick_notes.js +51 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +6 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -0
- package/dest/contract_function_simulator/proxied_contract_data_source.js +80 -0
- package/dest/contract_logging.d.ts +22 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +23 -0
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/helpers.js +55 -0
- package/dest/debug/pxe_debug_utils.d.ts +45 -0
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -0
- package/dest/debug/pxe_debug_utils.js +48 -0
- package/dest/entrypoints/client/bundle/index.d.ts +7 -3
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +5 -2
- package/dest/entrypoints/client/bundle/utils.d.ts +10 -10
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +41 -12
- package/dest/entrypoints/client/lazy/index.d.ts +7 -3
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +5 -2
- package/dest/entrypoints/client/lazy/utils.d.ts +10 -10
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +41 -12
- package/dest/entrypoints/pxe_creation_options.d.ts +18 -0
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -0
- package/dest/entrypoints/server/index.d.ts +10 -4
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +8 -3
- package/dest/entrypoints/server/utils.d.ts +8 -16
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +54 -36
- package/dest/error_enriching.d.ts +11 -0
- package/dest/error_enriching.d.ts.map +1 -0
- package/dest/{pxe_service/error_enriching.js → error_enriching.js} +30 -22
- package/dest/events/event_service.d.ts +15 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +44 -0
- package/dest/events/index.d.ts +2 -0
- package/dest/events/index.d.ts.map +1 -0
- package/dest/events/index.js +1 -0
- package/dest/events/private_event_filter_validator.d.ts +9 -0
- package/dest/events/private_event_filter_validator.d.ts.map +1 -0
- package/dest/events/private_event_filter_validator.js +38 -0
- package/dest/job_coordinator/job_coordinator.d.ts +75 -0
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
- package/dest/job_coordinator/job_coordinator.js +94 -0
- package/dest/logs/log_service.d.ts +29 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +118 -0
- package/dest/messages/message_context_service.d.ts +17 -0
- package/dest/messages/message_context_service.d.ts.map +1 -0
- package/dest/messages/message_context_service.js +36 -0
- package/dest/notes/index.d.ts +2 -0
- package/dest/notes/index.d.ts.map +1 -0
- package/dest/notes/index.js +1 -0
- package/dest/notes/note_service.d.ts +49 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +148 -0
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +3 -0
- package/dest/oracle_version.d.ts.map +1 -0
- package/dest/oracle_version.js +11 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.js +41 -0
- package/dest/private_kernel/hints/index.d.ts +3 -0
- package/dest/private_kernel/hints/index.d.ts.map +1 -0
- package/dest/private_kernel/hints/index.js +2 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +29 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +338 -0
- package/dest/private_kernel/hints/test_utils.d.ts +122 -0
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
- package/dest/private_kernel/hints/test_utils.js +203 -0
- package/dest/private_kernel/index.d.ts +3 -0
- package/dest/private_kernel/index.d.ts.map +1 -0
- package/dest/private_kernel/index.js +2 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +45 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_execution_prover.js +293 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts +63 -0
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -0
- package/dest/private_kernel/private_kernel_oracle.js +96 -0
- package/dest/pxe.d.ts +254 -0
- package/dest/pxe.d.ts.map +1 -0
- package/dest/pxe.js +788 -0
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +13 -15
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +17 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.js +26 -0
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +72 -0
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_store.js +253 -0
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/contract_store/contract_store.d.ts +93 -0
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/contract_store/contract_store.js +309 -0
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/contract_store/private_functions_tree.d.ts +27 -0
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/contract_store/private_functions_tree.js +47 -0
- package/dest/storage/index.d.ts +9 -10
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +8 -9
- package/dest/storage/metadata.d.ts +2 -0
- package/dest/storage/metadata.d.ts.map +1 -0
- package/dest/storage/metadata.js +1 -0
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/note_store/note_store.d.ts +83 -0
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/note_store/note_store.js +343 -0
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +91 -0
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/private_event_store/private_event_store.js +273 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +28 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/recipient_tagging_store.js +111 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_address_book_store.js +36 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +78 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/sender_tagging_store.js +374 -0
- package/dest/tagging/constants.d.ts +2 -0
- package/dest/tagging/constants.d.ts.map +1 -0
- package/dest/tagging/constants.js +10 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +60 -0
- package/dest/tagging/index.d.ts +17 -0
- package/dest/tagging/index.d.ts.map +1 -0
- package/dest/tagging/index.js +15 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +33 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +17 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +80 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +12 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +39 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +19 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +72 -0
- package/package.json +46 -34
- package/src/access_scopes.ts +9 -0
- package/src/bin/check_oracle_version.ts +161 -0
- package/src/block_synchronizer/block_synchronizer.ts +178 -0
- package/src/block_synchronizer/index.ts +1 -0
- package/src/config/index.ts +42 -56
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +850 -0
- package/src/contract_function_simulator/execution_note_cache.ts +252 -0
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +37 -0
- package/src/contract_function_simulator/hashed_values_cache.ts +47 -0
- package/src/contract_function_simulator/index.ts +14 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +54 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +28 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +66 -0
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +61 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +23 -0
- package/src/contract_function_simulator/oracle/index.ts +16 -0
- package/src/contract_function_simulator/oracle/interfaces.ts +184 -0
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +142 -0
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +23 -0
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +68 -0
- package/src/contract_function_simulator/oracle/oracle.ts +655 -0
- package/src/contract_function_simulator/oracle/private_execution.ts +141 -0
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +649 -0
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +685 -0
- package/src/contract_function_simulator/pick_notes.ts +141 -0
- package/src/contract_function_simulator/proxied_contract_data_source.ts +83 -0
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/helpers.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +93 -0
- package/src/entrypoints/client/bundle/index.ts +6 -2
- package/src/entrypoints/client/bundle/utils.ts +40 -33
- package/src/entrypoints/client/lazy/index.ts +6 -2
- package/src/entrypoints/client/lazy/utils.ts +41 -29
- package/src/entrypoints/pxe_creation_options.ts +14 -0
- package/src/entrypoints/server/index.ts +9 -3
- package/src/entrypoints/server/utils.ts +55 -55
- package/src/{pxe_service/error_enriching.ts → error_enriching.ts} +40 -39
- package/src/events/event_service.ts +71 -0
- package/src/events/index.ts +1 -0
- package/src/events/private_event_filter_validator.ts +46 -0
- package/src/job_coordinator/job_coordinator.ts +150 -0
- package/src/logs/log_service.ts +213 -0
- package/src/messages/message_context_service.ts +45 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +196 -0
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +12 -0
- package/src/private_kernel/hints/compute_tx_expiration_timestamp.ts +58 -0
- package/src/private_kernel/hints/index.ts +2 -0
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +542 -0
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/index.ts +2 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +440 -0
- package/src/private_kernel/private_kernel_oracle.ts +152 -0
- package/src/pxe.ts +1170 -0
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +15 -21
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{sync_data_provider/sync_data_provider.ts → anchor_block_store/anchor_block_store.ts} +10 -17
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/capsule_store/capsule_store.ts +315 -0
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/contract_store/contract_store.ts +429 -0
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/contract_store/private_functions_tree.ts +67 -0
- package/src/storage/index.ts +8 -10
- package/src/storage/metadata.ts +1 -0
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/note_store/note_store.ts +418 -0
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +384 -0
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +143 -0
- package/src/storage/tagging_store/sender_address_book_store.ts +48 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +476 -0
- package/src/tagging/constants.ts +10 -0
- package/src/tagging/get_all_logs_by_tags.ts +92 -0
- package/src/tagging/index.ts +19 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +140 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +44 -0
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +112 -0
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +51 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +85 -0
- package/dest/bin/index.d.ts +0 -3
- package/dest/bin/index.d.ts.map +0 -1
- package/dest/bin/index.js +0 -28
- package/dest/entrypoints/client/pxe_creation_options.d.ts +0 -11
- package/dest/entrypoints/client/pxe_creation_options.d.ts.map +0 -1
- package/dest/kernel_oracle/index.d.ts +0 -45
- package/dest/kernel_oracle/index.d.ts.map +0 -1
- package/dest/kernel_oracle/index.js +0 -76
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.js +0 -270
- package/dest/kernel_prover/hints/index.d.ts +0 -2
- package/dest/kernel_prover/hints/index.d.ts.map +0 -1
- package/dest/kernel_prover/hints/index.js +0 -1
- package/dest/kernel_prover/index.d.ts +0 -3
- package/dest/kernel_prover/index.d.ts.map +0 -1
- package/dest/kernel_prover/index.js +0 -2
- package/dest/kernel_prover/kernel_prover.d.ts +0 -38
- package/dest/kernel_prover/kernel_prover.d.ts.map +0 -1
- package/dest/kernel_prover/kernel_prover.js +0 -217
- package/dest/kernel_prover/proving_data_oracle.d.ts +0 -73
- package/dest/kernel_prover/proving_data_oracle.d.ts.map +0 -1
- package/dest/kernel_prover/proving_data_oracle.js +0 -4
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts +0 -11
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts.map +0 -1
- package/dest/note_decryption_utils/add_public_values_to_payload.js +0 -47
- package/dest/pxe_http/index.d.ts +0 -2
- package/dest/pxe_http/index.d.ts.map +0 -1
- package/dest/pxe_http/index.js +0 -1
- package/dest/pxe_http/pxe_http_server.d.ts +0 -16
- package/dest/pxe_http/pxe_http_server.d.ts.map +0 -1
- package/dest/pxe_http/pxe_http_server.js +0 -27
- package/dest/pxe_oracle_interface/index.d.ts +0 -159
- package/dest/pxe_oracle_interface/index.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/index.js +0 -692
- package/dest/pxe_oracle_interface/tagging_utils.d.ts +0 -17
- package/dest/pxe_oracle_interface/tagging_utils.d.ts.map +0 -1
- package/dest/pxe_oracle_interface/tagging_utils.js +0 -23
- package/dest/pxe_service/error_enriching.d.ts +0 -11
- package/dest/pxe_service/error_enriching.d.ts.map +0 -1
- package/dest/pxe_service/index.d.ts +0 -3
- package/dest/pxe_service/index.d.ts.map +0 -1
- package/dest/pxe_service/index.js +0 -2
- package/dest/pxe_service/pxe_service.d.ts +0 -111
- package/dest/pxe_service/pxe_service.d.ts.map +0 -1
- package/dest/pxe_service/pxe_service.js +0 -664
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -13
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.d.ts +0 -11
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.d.ts.map +0 -1
- package/dest/storage/auth_witness_data_provider/auth_witness_data_provider.js +0 -20
- package/dest/storage/auth_witness_data_provider/index.d.ts +0 -2
- package/dest/storage/auth_witness_data_provider/index.d.ts.map +0 -1
- package/dest/storage/auth_witness_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +0 -16
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +0 -57
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +0 -109
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +0 -183
- package/dest/storage/contract_data_provider/index.d.ts +0 -3
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -2
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts +0 -66
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.js +0 -99
- package/dest/storage/data_provider.d.ts +0 -4
- package/dest/storage/data_provider.d.ts.map +0 -1
- package/dest/storage/data_provider.js +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -106
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -106
- package/dest/storage/note_data_provider/note_data_provider.d.ts +0 -20
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_data_provider.js +0 -249
- package/dest/storage/sync_data_provider/index.d.ts +0 -2
- package/dest/storage/sync_data_provider/index.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/index.js +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +0 -12
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +0 -1
- package/dest/storage/sync_data_provider/sync_data_provider.js +0 -29
- package/dest/storage/tagging_data_provider/index.d.ts +0 -2
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts +0 -18
- package/dest/storage/tagging_data_provider/tagging_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/tagging_data_provider.js +0 -65
- package/dest/synchronizer/index.d.ts +0 -2
- package/dest/synchronizer/index.d.ts.map +0 -1
- package/dest/synchronizer/index.js +0 -1
- package/dest/synchronizer/synchronizer.d.ts +0 -37
- package/dest/synchronizer/synchronizer.d.ts.map +0 -1
- package/dest/synchronizer/synchronizer.js +0 -103
- package/dest/test/pxe_test_suite.d.ts +0 -3
- package/dest/test/pxe_test_suite.d.ts.map +0 -1
- package/dest/test/pxe_test_suite.js +0 -97
- package/src/bin/index.ts +0 -38
- package/src/entrypoints/client/pxe_creation_options.ts +0 -7
- package/src/kernel_oracle/index.ts +0 -117
- package/src/kernel_prover/hints/build_private_kernel_reset_private_inputs.ts +0 -472
- package/src/kernel_prover/hints/index.ts +0 -1
- package/src/kernel_prover/index.ts +0 -2
- package/src/kernel_prover/kernel_prover.ts +0 -351
- package/src/kernel_prover/proving_data_oracle.ts +0 -83
- package/src/note_decryption_utils/add_public_values_to_payload.ts +0 -64
- package/src/pxe_http/index.ts +0 -1
- package/src/pxe_http/pxe_http_server.ts +0 -29
- package/src/pxe_oracle_interface/index.ts +0 -925
- package/src/pxe_oracle_interface/tagging_utils.ts +0 -32
- package/src/pxe_service/index.ts +0 -2
- package/src/pxe_service/pxe_service.ts +0 -949
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/auth_witness_data_provider/auth_witness_data_provider.ts +0 -34
- package/src/storage/auth_witness_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +0 -80
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/contract_data_provider.ts +0 -261
- package/src/storage/contract_data_provider/index.ts +0 -2
- package/src/storage/contract_data_provider/private_functions_tree.ts +0 -131
- package/src/storage/data_provider.ts +0 -3
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/note_data_provider/note_dao.ts +0 -162
- package/src/storage/note_data_provider/note_data_provider.ts +0 -345
- package/src/storage/sync_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/index.ts +0 -1
- package/src/storage/tagging_data_provider/tagging_data_provider.ts +0 -92
- package/src/synchronizer/index.ts +0 -1
- package/src/synchronizer/synchronizer.ts +0 -121
- package/src/test/pxe_test_suite.ts +0 -111
- /package/dest/entrypoints/{client/pxe_creation_options.js → pxe_creation_options.js} +0 -0
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import type { NoteData } from '@aztec/simulator/client';
|
|
5
|
-
import { NoteSelector } from '@aztec/stdlib/abi';
|
|
6
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import type { PublicKey } from '@aztec/stdlib/keys';
|
|
8
|
-
import { Note } from '@aztec/stdlib/note';
|
|
9
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
13
|
-
* information required to use it during execution and manage its state.
|
|
14
|
-
*/
|
|
15
|
-
export class NoteDao implements NoteData {
|
|
16
|
-
constructor(
|
|
17
|
-
// Note information
|
|
18
|
-
|
|
19
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
20
|
-
public note: Note,
|
|
21
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
22
|
-
public contractAddress: AztecAddress,
|
|
23
|
-
/**
|
|
24
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
25
|
-
* since contracts typically make queries based on it.
|
|
26
|
-
* */
|
|
27
|
-
public storageSlot: Fr,
|
|
28
|
-
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
29
|
-
public nonce: Fr,
|
|
30
|
-
|
|
31
|
-
// Computed values
|
|
32
|
-
/**
|
|
33
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
34
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
35
|
-
*/
|
|
36
|
-
public noteHash: Fr,
|
|
37
|
-
/**
|
|
38
|
-
* The nullifier of the note, siloed by contract address.
|
|
39
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
40
|
-
*/
|
|
41
|
-
public siloedNullifier: Fr,
|
|
42
|
-
|
|
43
|
-
// Metadata
|
|
44
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
45
|
-
* when searching for txEffects.
|
|
46
|
-
*/
|
|
47
|
-
public txHash: TxHash,
|
|
48
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
49
|
-
* reorgs.*/
|
|
50
|
-
public l2BlockNumber: number,
|
|
51
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
52
|
-
* reorgs.*/
|
|
53
|
-
public l2BlockHash: string,
|
|
54
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
55
|
-
public index: bigint,
|
|
56
|
-
/** The public key with which the note log was encrypted during delivery. */
|
|
57
|
-
public addressPoint: PublicKey,
|
|
58
|
-
|
|
59
|
-
/** The note type identifier for the contract.
|
|
60
|
-
* TODO(#12013): remove
|
|
61
|
-
*/
|
|
62
|
-
public noteTypeId: NoteSelector,
|
|
63
|
-
) {}
|
|
64
|
-
|
|
65
|
-
toBuffer(): Buffer {
|
|
66
|
-
return serializeToBuffer([
|
|
67
|
-
this.note,
|
|
68
|
-
this.contractAddress,
|
|
69
|
-
this.storageSlot,
|
|
70
|
-
this.nonce,
|
|
71
|
-
this.noteHash,
|
|
72
|
-
this.siloedNullifier,
|
|
73
|
-
this.txHash,
|
|
74
|
-
this.l2BlockNumber,
|
|
75
|
-
Fr.fromHexString(this.l2BlockHash),
|
|
76
|
-
this.index,
|
|
77
|
-
this.addressPoint,
|
|
78
|
-
this.noteTypeId,
|
|
79
|
-
]);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
83
|
-
const reader = BufferReader.asReader(buffer);
|
|
84
|
-
|
|
85
|
-
const note = Note.fromBuffer(reader);
|
|
86
|
-
const contractAddress = AztecAddress.fromBuffer(reader);
|
|
87
|
-
const storageSlot = Fr.fromBuffer(reader);
|
|
88
|
-
const nonce = Fr.fromBuffer(reader);
|
|
89
|
-
const noteHash = Fr.fromBuffer(reader);
|
|
90
|
-
const siloedNullifier = Fr.fromBuffer(reader);
|
|
91
|
-
const txHash = reader.readObject(TxHash);
|
|
92
|
-
const l2BlockNumber = reader.readNumber();
|
|
93
|
-
const l2BlockHash = Fr.fromBuffer(reader).toString();
|
|
94
|
-
const index = toBigIntBE(reader.readBytes(32));
|
|
95
|
-
const publicKey = Point.fromBuffer(reader);
|
|
96
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
97
|
-
|
|
98
|
-
return new NoteDao(
|
|
99
|
-
note,
|
|
100
|
-
contractAddress,
|
|
101
|
-
storageSlot,
|
|
102
|
-
nonce,
|
|
103
|
-
noteHash,
|
|
104
|
-
siloedNullifier,
|
|
105
|
-
txHash,
|
|
106
|
-
l2BlockNumber,
|
|
107
|
-
l2BlockHash,
|
|
108
|
-
index,
|
|
109
|
-
publicKey,
|
|
110
|
-
noteTypeId,
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
toString() {
|
|
115
|
-
return '0x' + this.toBuffer().toString('hex');
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
static fromString(str: string) {
|
|
119
|
-
const hex = str.replace(/^0x/, '');
|
|
120
|
-
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Returns the size in bytes of the Note Dao.
|
|
125
|
-
* @returns - Its size in bytes.
|
|
126
|
-
*/
|
|
127
|
-
public getSize() {
|
|
128
|
-
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
129
|
-
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
130
|
-
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
static async random({
|
|
134
|
-
note = Note.random(),
|
|
135
|
-
contractAddress = undefined,
|
|
136
|
-
storageSlot = Fr.random(),
|
|
137
|
-
nonce = Fr.random(),
|
|
138
|
-
noteHash = Fr.random(),
|
|
139
|
-
siloedNullifier = Fr.random(),
|
|
140
|
-
txHash = TxHash.random(),
|
|
141
|
-
l2BlockNumber = Math.floor(Math.random() * 1000),
|
|
142
|
-
l2BlockHash = Fr.random().toString(),
|
|
143
|
-
index = Fr.random().toBigInt(),
|
|
144
|
-
addressPoint = undefined,
|
|
145
|
-
noteTypeId = NoteSelector.random(),
|
|
146
|
-
}: Partial<NoteDao> = {}) {
|
|
147
|
-
return new NoteDao(
|
|
148
|
-
note,
|
|
149
|
-
contractAddress ?? (await AztecAddress.random()),
|
|
150
|
-
storageSlot,
|
|
151
|
-
nonce,
|
|
152
|
-
noteHash,
|
|
153
|
-
siloedNullifier,
|
|
154
|
-
txHash,
|
|
155
|
-
l2BlockNumber,
|
|
156
|
-
l2BlockHash,
|
|
157
|
-
index,
|
|
158
|
-
addressPoint ?? (await Point.random()),
|
|
159
|
-
noteTypeId,
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import type { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
4
|
-
import type { AztecAsyncKVStore, AztecAsyncMap, AztecAsyncMultiMap } from '@aztec/kv-store';
|
|
5
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import type { InBlock } from '@aztec/stdlib/block';
|
|
7
|
-
import type { PublicKey } from '@aztec/stdlib/keys';
|
|
8
|
-
import { NoteStatus, type NotesFilter } from '@aztec/stdlib/note';
|
|
9
|
-
|
|
10
|
-
import type { DataProvider } from '../data_provider.js';
|
|
11
|
-
import { NoteDao } from './note_dao.js';
|
|
12
|
-
|
|
13
|
-
export class NoteDataProvider implements DataProvider {
|
|
14
|
-
#store: AztecAsyncKVStore;
|
|
15
|
-
|
|
16
|
-
#notes: AztecAsyncMap<string, Buffer>;
|
|
17
|
-
#nullifiedNotes: AztecAsyncMap<string, Buffer>;
|
|
18
|
-
#nullifierToNoteId: AztecAsyncMap<string, string>;
|
|
19
|
-
#nullifiersByBlockNumber: AztecAsyncMultiMap<number, string>;
|
|
20
|
-
|
|
21
|
-
#nullifiedNotesToScope: AztecAsyncMultiMap<string, string>;
|
|
22
|
-
#nullifiedNotesByContract: AztecAsyncMultiMap<string, string>;
|
|
23
|
-
#nullifiedNotesByStorageSlot: AztecAsyncMultiMap<string, string>;
|
|
24
|
-
#nullifiedNotesByTxHash: AztecAsyncMultiMap<string, string>;
|
|
25
|
-
#nullifiedNotesByAddressPoint: AztecAsyncMultiMap<string, string>;
|
|
26
|
-
#nullifiedNotesByNullifier: AztecAsyncMap<string, string>;
|
|
27
|
-
|
|
28
|
-
#scopes: AztecAsyncMap<string, true>;
|
|
29
|
-
#notesToScope: AztecAsyncMultiMap<string, string>;
|
|
30
|
-
#notesByContractAndScope: Map<string, AztecAsyncMultiMap<string, string>>;
|
|
31
|
-
#notesByStorageSlotAndScope: Map<string, AztecAsyncMultiMap<string, string>>;
|
|
32
|
-
#notesByTxHashAndScope: Map<string, AztecAsyncMultiMap<string, string>>;
|
|
33
|
-
#notesByAddressPointAndScope: Map<string, AztecAsyncMultiMap<string, string>>;
|
|
34
|
-
|
|
35
|
-
private constructor(store: AztecAsyncKVStore) {
|
|
36
|
-
this.#store = store;
|
|
37
|
-
this.#notes = store.openMap('notes');
|
|
38
|
-
this.#nullifiedNotes = store.openMap('nullified_notes');
|
|
39
|
-
this.#nullifierToNoteId = store.openMap('nullifier_to_note');
|
|
40
|
-
this.#nullifiersByBlockNumber = store.openMultiMap('nullifier_to_block_number');
|
|
41
|
-
|
|
42
|
-
this.#nullifiedNotesToScope = store.openMultiMap('nullified_notes_to_scope');
|
|
43
|
-
this.#nullifiedNotesByContract = store.openMultiMap('nullified_notes_by_contract');
|
|
44
|
-
this.#nullifiedNotesByStorageSlot = store.openMultiMap('nullified_notes_by_storage_slot');
|
|
45
|
-
this.#nullifiedNotesByTxHash = store.openMultiMap('nullified_notes_by_tx_hash');
|
|
46
|
-
this.#nullifiedNotesByAddressPoint = store.openMultiMap('nullified_notes_by_address_point');
|
|
47
|
-
this.#nullifiedNotesByNullifier = store.openMap('nullified_notes_by_nullifier');
|
|
48
|
-
|
|
49
|
-
this.#scopes = store.openMap('scopes');
|
|
50
|
-
this.#notesToScope = store.openMultiMap('notes_to_scope');
|
|
51
|
-
this.#notesByContractAndScope = new Map<string, AztecAsyncMultiMap<string, string>>();
|
|
52
|
-
this.#notesByStorageSlotAndScope = new Map<string, AztecAsyncMultiMap<string, string>>();
|
|
53
|
-
this.#notesByTxHashAndScope = new Map<string, AztecAsyncMultiMap<string, string>>();
|
|
54
|
-
this.#notesByAddressPointAndScope = new Map<string, AztecAsyncMultiMap<string, string>>();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public static async create(store: AztecAsyncKVStore): Promise<NoteDataProvider> {
|
|
58
|
-
const pxeDB = new NoteDataProvider(store);
|
|
59
|
-
for await (const scope of pxeDB.#scopes.keysAsync()) {
|
|
60
|
-
pxeDB.#notesByContractAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_contract`));
|
|
61
|
-
pxeDB.#notesByStorageSlotAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_storage_slot`));
|
|
62
|
-
pxeDB.#notesByTxHashAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_tx_hash`));
|
|
63
|
-
pxeDB.#notesByAddressPointAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_address_point`));
|
|
64
|
-
}
|
|
65
|
-
return pxeDB;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public async addScope(scope: AztecAddress): Promise<boolean> {
|
|
69
|
-
const scopeString = scope.toString();
|
|
70
|
-
|
|
71
|
-
if (await this.#scopes.hasAsync(scopeString)) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
await this.#scopes.set(scopeString, true);
|
|
76
|
-
this.#notesByContractAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_contract`));
|
|
77
|
-
this.#notesByStorageSlotAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_storage_slot`));
|
|
78
|
-
this.#notesByTxHashAndScope.set(scopeString, this.#store.openMultiMap(`${scopeString}:notes_by_tx_hash`));
|
|
79
|
-
this.#notesByAddressPointAndScope.set(
|
|
80
|
-
scopeString,
|
|
81
|
-
this.#store.openMultiMap(`${scopeString}:notes_by_address_point`),
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async addNotes(notes: NoteDao[], scope: AztecAddress = AztecAddress.ZERO): Promise<void> {
|
|
88
|
-
if (!(await this.#scopes.hasAsync(scope.toString()))) {
|
|
89
|
-
await this.addScope(scope);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return this.#store.transactionAsync(async () => {
|
|
93
|
-
for (const dao of notes) {
|
|
94
|
-
// store notes by their index in the notes hash tree
|
|
95
|
-
// this provides the uniqueness we need to store individual notes
|
|
96
|
-
// and should also return notes in the order that they were created.
|
|
97
|
-
// Had we stored them by their nullifier, they would be returned in random order
|
|
98
|
-
const noteIndex = toBufferBE(dao.index, 32).toString('hex');
|
|
99
|
-
await this.#notes.set(noteIndex, dao.toBuffer());
|
|
100
|
-
await this.#notesToScope.set(noteIndex, scope.toString());
|
|
101
|
-
await this.#nullifierToNoteId.set(dao.siloedNullifier.toString(), noteIndex);
|
|
102
|
-
|
|
103
|
-
await this.#notesByContractAndScope.get(scope.toString())!.set(dao.contractAddress.toString(), noteIndex);
|
|
104
|
-
await this.#notesByStorageSlotAndScope.get(scope.toString())!.set(dao.storageSlot.toString(), noteIndex);
|
|
105
|
-
await this.#notesByTxHashAndScope.get(scope.toString())!.set(dao.txHash.toString(), noteIndex);
|
|
106
|
-
await this.#notesByAddressPointAndScope.get(scope.toString())!.set(dao.addressPoint.toString(), noteIndex);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
public removeNotesAfter(blockNumber: number): Promise<void> {
|
|
112
|
-
return this.#store.transactionAsync(async () => {
|
|
113
|
-
const notes = await toArray(this.#notes.valuesAsync());
|
|
114
|
-
for (const note of notes) {
|
|
115
|
-
const noteDao = NoteDao.fromBuffer(note);
|
|
116
|
-
if (noteDao.l2BlockNumber > blockNumber) {
|
|
117
|
-
const noteIndex = toBufferBE(noteDao.index, 32).toString('hex');
|
|
118
|
-
await this.#notes.delete(noteIndex);
|
|
119
|
-
await this.#notesToScope.delete(noteIndex);
|
|
120
|
-
await this.#nullifierToNoteId.delete(noteDao.siloedNullifier.toString());
|
|
121
|
-
const scopes = await toArray(this.#scopes.keysAsync());
|
|
122
|
-
for (const scope of scopes) {
|
|
123
|
-
await this.#notesByAddressPointAndScope.get(scope)!.deleteValue(noteDao.addressPoint.toString(), noteIndex);
|
|
124
|
-
await this.#notesByTxHashAndScope.get(scope)!.deleteValue(noteDao.txHash.toString(), noteIndex);
|
|
125
|
-
await this.#notesByContractAndScope.get(scope)!.deleteValue(noteDao.contractAddress.toString(), noteIndex);
|
|
126
|
-
await this.#notesByStorageSlotAndScope.get(scope)!.deleteValue(noteDao.storageSlot.toString(), noteIndex);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
public async unnullifyNotesAfter(blockNumber: number, synchedBlockNumber?: number): Promise<void> {
|
|
134
|
-
const nullifiersToUndo: string[] = [];
|
|
135
|
-
const currentBlockNumber = blockNumber + 1;
|
|
136
|
-
const maxBlockNumber = synchedBlockNumber ?? currentBlockNumber;
|
|
137
|
-
for (let i = currentBlockNumber; i <= maxBlockNumber; i++) {
|
|
138
|
-
nullifiersToUndo.push(...(await toArray(this.#nullifiersByBlockNumber.getValuesAsync(i))));
|
|
139
|
-
}
|
|
140
|
-
const notesIndexesToReinsert = await Promise.all(
|
|
141
|
-
nullifiersToUndo.map(nullifier => this.#nullifiedNotesByNullifier.getAsync(nullifier)),
|
|
142
|
-
);
|
|
143
|
-
const notNullNoteIndexes = notesIndexesToReinsert.filter(noteIndex => noteIndex != undefined);
|
|
144
|
-
const nullifiedNoteBuffers = await Promise.all(
|
|
145
|
-
notNullNoteIndexes.map(noteIndex => this.#nullifiedNotes.getAsync(noteIndex!)),
|
|
146
|
-
);
|
|
147
|
-
const noteDaos = nullifiedNoteBuffers
|
|
148
|
-
.filter(buffer => buffer != undefined)
|
|
149
|
-
.map(buffer => NoteDao.fromBuffer(buffer!));
|
|
150
|
-
|
|
151
|
-
await this.#store.transactionAsync(async () => {
|
|
152
|
-
for (const dao of noteDaos) {
|
|
153
|
-
const noteIndex = toBufferBE(dao.index, 32).toString('hex');
|
|
154
|
-
await this.#notes.set(noteIndex, dao.toBuffer());
|
|
155
|
-
await this.#nullifierToNoteId.set(dao.siloedNullifier.toString(), noteIndex);
|
|
156
|
-
|
|
157
|
-
let scopes = (await toArray(this.#nullifiedNotesToScope.getValuesAsync(noteIndex))) ?? [];
|
|
158
|
-
|
|
159
|
-
if (scopes.length === 0) {
|
|
160
|
-
scopes = [new AztecAddress(dao.addressPoint.x).toString()];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
for (const scope of scopes) {
|
|
164
|
-
await this.#notesByContractAndScope.get(scope.toString())!.set(dao.contractAddress.toString(), noteIndex);
|
|
165
|
-
await this.#notesByStorageSlotAndScope.get(scope.toString())!.set(dao.storageSlot.toString(), noteIndex);
|
|
166
|
-
await this.#notesByTxHashAndScope.get(scope.toString())!.set(dao.txHash.toString(), noteIndex);
|
|
167
|
-
await this.#notesByAddressPointAndScope.get(scope.toString())!.set(dao.addressPoint.toString(), noteIndex);
|
|
168
|
-
await this.#notesToScope.set(noteIndex, scope);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
await this.#nullifiedNotes.delete(noteIndex);
|
|
172
|
-
await this.#nullifiedNotesToScope.delete(noteIndex);
|
|
173
|
-
await this.#nullifiersByBlockNumber.deleteValue(dao.l2BlockNumber, dao.siloedNullifier.toString());
|
|
174
|
-
await this.#nullifiedNotesByContract.deleteValue(dao.contractAddress.toString(), noteIndex);
|
|
175
|
-
await this.#nullifiedNotesByStorageSlot.deleteValue(dao.storageSlot.toString(), noteIndex);
|
|
176
|
-
await this.#nullifiedNotesByTxHash.deleteValue(dao.txHash.toString(), noteIndex);
|
|
177
|
-
await this.#nullifiedNotesByAddressPoint.deleteValue(dao.addressPoint.toString(), noteIndex);
|
|
178
|
-
await this.#nullifiedNotesByNullifier.delete(dao.siloedNullifier.toString());
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
async getNotes(filter: NotesFilter): Promise<NoteDao[]> {
|
|
184
|
-
const publicKey: PublicKey | undefined = filter.owner ? await filter.owner.toAddressPoint() : undefined;
|
|
185
|
-
|
|
186
|
-
filter.status = filter.status ?? NoteStatus.ACTIVE;
|
|
187
|
-
|
|
188
|
-
const candidateNoteSources = [];
|
|
189
|
-
|
|
190
|
-
filter.scopes ??= (await toArray(this.#scopes.keysAsync())).map(addressString =>
|
|
191
|
-
AztecAddress.fromString(addressString),
|
|
192
|
-
);
|
|
193
|
-
|
|
194
|
-
const activeNoteIdsPerScope: string[][] = [];
|
|
195
|
-
|
|
196
|
-
for (const scope of new Set(filter.scopes)) {
|
|
197
|
-
const formattedScopeString = scope.toString();
|
|
198
|
-
if (!(await this.#scopes.hasAsync(formattedScopeString))) {
|
|
199
|
-
throw new Error('Trying to get incoming notes of an scope that is not in the PXE database');
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
activeNoteIdsPerScope.push(
|
|
203
|
-
publicKey
|
|
204
|
-
? await toArray(
|
|
205
|
-
this.#notesByAddressPointAndScope.get(formattedScopeString)!.getValuesAsync(publicKey.toString()),
|
|
206
|
-
)
|
|
207
|
-
: filter.txHash
|
|
208
|
-
? await toArray(
|
|
209
|
-
this.#notesByTxHashAndScope.get(formattedScopeString)!.getValuesAsync(filter.txHash.toString()),
|
|
210
|
-
)
|
|
211
|
-
: filter.contractAddress
|
|
212
|
-
? await toArray(
|
|
213
|
-
this.#notesByContractAndScope
|
|
214
|
-
.get(formattedScopeString)!
|
|
215
|
-
.getValuesAsync(filter.contractAddress.toString()),
|
|
216
|
-
)
|
|
217
|
-
: filter.storageSlot
|
|
218
|
-
? await toArray(
|
|
219
|
-
this.#notesByStorageSlotAndScope.get(formattedScopeString)!.getValuesAsync(filter.storageSlot.toString()),
|
|
220
|
-
)
|
|
221
|
-
: await toArray(this.#notesByAddressPointAndScope.get(formattedScopeString)!.valuesAsync()),
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
candidateNoteSources.push({
|
|
226
|
-
ids: new Set(activeNoteIdsPerScope.flat()),
|
|
227
|
-
notes: this.#notes,
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
if (filter.status == NoteStatus.ACTIVE_OR_NULLIFIED) {
|
|
231
|
-
candidateNoteSources.push({
|
|
232
|
-
ids: publicKey
|
|
233
|
-
? await toArray(this.#nullifiedNotesByAddressPoint.getValuesAsync(publicKey.toString()))
|
|
234
|
-
: filter.txHash
|
|
235
|
-
? await toArray(this.#nullifiedNotesByTxHash.getValuesAsync(filter.txHash.toString()))
|
|
236
|
-
: filter.contractAddress
|
|
237
|
-
? await toArray(this.#nullifiedNotesByContract.getValuesAsync(filter.contractAddress.toString()))
|
|
238
|
-
: filter.storageSlot
|
|
239
|
-
? await toArray(this.#nullifiedNotesByStorageSlot.getValuesAsync(filter.storageSlot.toString()))
|
|
240
|
-
: await toArray(this.#nullifiedNotes.keysAsync()),
|
|
241
|
-
notes: this.#nullifiedNotes,
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const result: NoteDao[] = [];
|
|
246
|
-
for (const { ids, notes } of candidateNoteSources) {
|
|
247
|
-
for (const id of ids) {
|
|
248
|
-
const serializedNote = await notes.getAsync(id);
|
|
249
|
-
if (!serializedNote) {
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
const note = NoteDao.fromBuffer(serializedNote);
|
|
254
|
-
if (filter.contractAddress && !note.contractAddress.equals(filter.contractAddress)) {
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (filter.txHash && !note.txHash.equals(filter.txHash)) {
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (filter.storageSlot && !note.storageSlot.equals(filter.storageSlot!)) {
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (publicKey && !note.addressPoint.equals(publicKey)) {
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
if (filter.siloedNullifier && !note.siloedNullifier.equals(filter.siloedNullifier)) {
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
result.push(note);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return result;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
removeNullifiedNotes(nullifiers: InBlock<Fr>[], accountAddressPoint: Point): Promise<NoteDao[]> {
|
|
282
|
-
if (nullifiers.length === 0) {
|
|
283
|
-
return Promise.resolve([]);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return this.#store.transactionAsync(async () => {
|
|
287
|
-
const nullifiedNotes: NoteDao[] = [];
|
|
288
|
-
|
|
289
|
-
for (const blockScopedNullifier of nullifiers) {
|
|
290
|
-
const { data: nullifier, l2BlockNumber: blockNumber } = blockScopedNullifier;
|
|
291
|
-
const noteIndex = await this.#nullifierToNoteId.getAsync(nullifier.toString());
|
|
292
|
-
if (!noteIndex) {
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const noteBuffer = noteIndex ? await this.#notes.getAsync(noteIndex) : undefined;
|
|
297
|
-
|
|
298
|
-
if (!noteBuffer) {
|
|
299
|
-
// note doesn't exist. Maybe it got nullified already
|
|
300
|
-
continue;
|
|
301
|
-
}
|
|
302
|
-
const noteScopes = (await toArray(this.#notesToScope.getValuesAsync(noteIndex))) ?? [];
|
|
303
|
-
const note = NoteDao.fromBuffer(noteBuffer);
|
|
304
|
-
if (!note.addressPoint.equals(accountAddressPoint)) {
|
|
305
|
-
// tried to nullify someone else's note
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
nullifiedNotes.push(note);
|
|
310
|
-
|
|
311
|
-
await this.#notes.delete(noteIndex);
|
|
312
|
-
await this.#notesToScope.delete(noteIndex);
|
|
313
|
-
|
|
314
|
-
const scopes = await toArray(this.#scopes.keysAsync());
|
|
315
|
-
|
|
316
|
-
for (const scope of scopes) {
|
|
317
|
-
await this.#notesByAddressPointAndScope.get(scope)!.deleteValue(accountAddressPoint.toString(), noteIndex);
|
|
318
|
-
await this.#notesByTxHashAndScope.get(scope)!.deleteValue(note.txHash.toString(), noteIndex);
|
|
319
|
-
await this.#notesByContractAndScope.get(scope)!.deleteValue(note.contractAddress.toString(), noteIndex);
|
|
320
|
-
await this.#notesByStorageSlotAndScope.get(scope)!.deleteValue(note.storageSlot.toString(), noteIndex);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
if (noteScopes !== undefined) {
|
|
324
|
-
for (const scope of noteScopes) {
|
|
325
|
-
await this.#nullifiedNotesToScope.set(noteIndex, scope);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
await this.#nullifiedNotes.set(noteIndex, note.toBuffer());
|
|
329
|
-
await this.#nullifiersByBlockNumber.set(blockNumber, nullifier.toString());
|
|
330
|
-
await this.#nullifiedNotesByContract.set(note.contractAddress.toString(), noteIndex);
|
|
331
|
-
await this.#nullifiedNotesByStorageSlot.set(note.storageSlot.toString(), noteIndex);
|
|
332
|
-
await this.#nullifiedNotesByTxHash.set(note.txHash.toString(), noteIndex);
|
|
333
|
-
await this.#nullifiedNotesByAddressPoint.set(note.addressPoint.toString(), noteIndex);
|
|
334
|
-
await this.#nullifiedNotesByNullifier.set(nullifier.toString(), noteIndex);
|
|
335
|
-
|
|
336
|
-
await this.#nullifierToNoteId.delete(nullifier.toString());
|
|
337
|
-
}
|
|
338
|
-
return nullifiedNotes;
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
async getSize() {
|
|
343
|
-
return (await this.getNotes({})).reduce((sum, note) => sum + note.getSize(), 0);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SyncDataProvider } from './sync_data_provider.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TaggingDataProvider } from './tagging_data_provider.js';
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
3
|
-
import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store';
|
|
4
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { IndexedTaggingSecret } from '@aztec/stdlib/logs';
|
|
6
|
-
|
|
7
|
-
export class TaggingDataProvider {
|
|
8
|
-
#store: AztecAsyncKVStore;
|
|
9
|
-
#addressBook: AztecAsyncMap<string, true>;
|
|
10
|
-
|
|
11
|
-
// Stores the last index used for each tagging secret, taking direction into account
|
|
12
|
-
// This is necessary to avoid reusing the same index for the same secret, which happens if
|
|
13
|
-
// sender and recipient are the same
|
|
14
|
-
#taggingSecretIndexesForSenders: AztecAsyncMap<string, number>;
|
|
15
|
-
#taggingSecretIndexesForRecipients: AztecAsyncMap<string, number>;
|
|
16
|
-
|
|
17
|
-
constructor(store: AztecAsyncKVStore) {
|
|
18
|
-
this.#store = store;
|
|
19
|
-
|
|
20
|
-
this.#addressBook = this.#store.openMap('address_book');
|
|
21
|
-
|
|
22
|
-
this.#taggingSecretIndexesForSenders = this.#store.openMap('tagging_secret_indexes_for_senders');
|
|
23
|
-
this.#taggingSecretIndexesForRecipients = this.#store.openMap('tagging_secret_indexes_for_recipients');
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async setTaggingSecretsIndexesAsSender(indexedSecrets: IndexedTaggingSecret[]): Promise<void> {
|
|
27
|
-
await this.#setTaggingSecretsIndexes(indexedSecrets, this.#taggingSecretIndexesForSenders);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async setTaggingSecretsIndexesAsRecipient(indexedSecrets: IndexedTaggingSecret[]): Promise<void> {
|
|
31
|
-
await this.#setTaggingSecretsIndexes(indexedSecrets, this.#taggingSecretIndexesForRecipients);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async #setTaggingSecretsIndexes(indexedSecrets: IndexedTaggingSecret[], storageMap: AztecAsyncMap<string, number>) {
|
|
35
|
-
await Promise.all(
|
|
36
|
-
indexedSecrets.map(indexedSecret =>
|
|
37
|
-
storageMap.set(indexedSecret.appTaggingSecret.toString(), indexedSecret.index),
|
|
38
|
-
),
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async getTaggingSecretsIndexesAsRecipient(appTaggingSecrets: Fr[]) {
|
|
43
|
-
return await this.#getTaggingSecretsIndexes(appTaggingSecrets, this.#taggingSecretIndexesForRecipients);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async getTaggingSecretsIndexesAsSender(appTaggingSecrets: Fr[]) {
|
|
47
|
-
return await this.#getTaggingSecretsIndexes(appTaggingSecrets, this.#taggingSecretIndexesForSenders);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
#getTaggingSecretsIndexes(appTaggingSecrets: Fr[], storageMap: AztecAsyncMap<string, number>): Promise<number[]> {
|
|
51
|
-
return Promise.all(appTaggingSecrets.map(async secret => (await storageMap.getAsync(`${secret.toString()}`)) ?? 0));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
resetNoteSyncData(): Promise<void> {
|
|
55
|
-
return this.#store.transactionAsync(async () => {
|
|
56
|
-
const recipients = await toArray(this.#taggingSecretIndexesForRecipients.keysAsync());
|
|
57
|
-
await Promise.all(recipients.map(recipient => this.#taggingSecretIndexesForRecipients.delete(recipient)));
|
|
58
|
-
const senders = await toArray(this.#taggingSecretIndexesForSenders.keysAsync());
|
|
59
|
-
await Promise.all(senders.map(sender => this.#taggingSecretIndexesForSenders.delete(sender)));
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async addSenderAddress(address: AztecAddress): Promise<boolean> {
|
|
64
|
-
if (await this.#addressBook.hasAsync(address.toString())) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
await this.#addressBook.set(address.toString(), true);
|
|
69
|
-
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async getSenderAddresses(): Promise<AztecAddress[]> {
|
|
74
|
-
return (await toArray(this.#addressBook.keysAsync())).map(AztecAddress.fromString);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async removeSenderAddress(address: AztecAddress): Promise<boolean> {
|
|
78
|
-
if (!(await this.#addressBook.hasAsync(address.toString()))) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
await this.#addressBook.delete(address.toString());
|
|
83
|
-
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async getSize() {
|
|
88
|
-
const addressesCount = (await toArray(this.#addressBook.keysAsync())).length;
|
|
89
|
-
// All keys are addresses
|
|
90
|
-
return 3 * addressesCount * AztecAddress.SIZE_IN_BYTES;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './synchronizer.js';
|