@aztec/foundation 4.0.0-nightly.20250907 → 4.0.0-nightly.20260108
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/dest/array/array.d.ts +1 -9
- package/dest/array/array.d.ts.map +1 -1
- package/dest/array/array.js +0 -11
- package/dest/array/index.d.ts +2 -1
- package/dest/array/index.d.ts.map +1 -1
- package/dest/array/index.js +1 -0
- package/dest/array/sorted_array.d.ts +10 -0
- package/dest/array/sorted_array.d.ts.map +1 -0
- package/dest/array/sorted_array.js +106 -0
- package/dest/async-map/index.d.ts +1 -1
- package/dest/async-pool/index.d.ts +1 -1
- package/dest/bigint/index.d.ts +1 -1
- package/dest/bigint-buffer/index.d.ts +1 -1
- package/dest/branded-types/block_number.d.ts +53 -0
- package/dest/branded-types/block_number.d.ts.map +1 -0
- package/dest/branded-types/block_number.js +75 -0
- package/dest/branded-types/checkpoint_number.d.ts +46 -0
- package/dest/branded-types/checkpoint_number.d.ts.map +1 -0
- package/dest/branded-types/checkpoint_number.js +68 -0
- package/dest/branded-types/epoch.d.ts +42 -0
- package/dest/branded-types/epoch.d.ts.map +1 -0
- package/dest/branded-types/epoch.js +59 -0
- package/dest/branded-types/index.d.ts +6 -0
- package/dest/branded-types/index.d.ts.map +1 -0
- package/dest/branded-types/index.js +4 -0
- package/dest/branded-types/slot.d.ts +42 -0
- package/dest/branded-types/slot.d.ts.map +1 -0
- package/dest/branded-types/slot.js +59 -0
- package/dest/branded-types/types.d.ts +5 -0
- package/dest/branded-types/types.d.ts.map +1 -0
- package/dest/branded-types/types.js +1 -0
- package/dest/buffer/buffer16.d.ts +2 -5
- package/dest/buffer/buffer16.d.ts.map +1 -1
- package/dest/buffer/buffer16.js +4 -2
- package/dest/buffer/buffer32.d.ts +2 -5
- package/dest/buffer/buffer32.d.ts.map +1 -1
- package/dest/buffer/buffer32.js +4 -2
- package/dest/buffer/index.d.ts +1 -1
- package/dest/collection/array.d.ts +3 -1
- package/dest/collection/array.d.ts.map +1 -1
- package/dest/collection/array.js +12 -3
- package/dest/collection/index.d.ts +1 -1
- package/dest/collection/object.d.ts +5 -1
- package/dest/collection/object.d.ts.map +1 -1
- package/dest/collection/object.js +6 -0
- package/dest/committable/committable.d.ts +1 -1
- package/dest/committable/committable.d.ts.map +1 -1
- package/dest/committable/index.d.ts +1 -1
- package/dest/config/env_var.d.ts +2 -2
- package/dest/config/env_var.d.ts.map +1 -1
- package/dest/config/index.d.ts +12 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +17 -2
- package/dest/config/network_config.d.ts +54 -0
- package/dest/config/network_config.d.ts.map +1 -0
- package/dest/config/network_config.js +11 -0
- package/dest/config/network_name.d.ts +2 -2
- package/dest/config/network_name.d.ts.map +1 -1
- package/dest/config/network_name.js +10 -2
- package/dest/config/secret_value.d.ts +1 -1
- package/dest/config/secret_value.d.ts.map +1 -1
- package/dest/config/secret_value.js +3 -1
- package/dest/crypto/aes128/index.d.ts +1 -1
- package/dest/crypto/aes128/index.d.ts.map +1 -1
- package/dest/crypto/aes128/index.js +19 -6
- package/dest/crypto/bls/bn254_keystore.d.ts +296 -0
- package/dest/crypto/bls/bn254_keystore.d.ts.map +1 -0
- package/dest/crypto/bls/bn254_keystore.js +218 -0
- package/dest/crypto/bls/index.d.ts +13 -0
- package/dest/crypto/bls/index.d.ts.map +1 -0
- package/dest/crypto/bls/index.js +87 -0
- package/dest/crypto/bn254/index.d.ts +39 -0
- package/dest/crypto/bn254/index.d.ts.map +1 -0
- package/dest/crypto/bn254/index.js +56 -0
- package/dest/crypto/ecdsa/index.d.ts +1 -1
- package/dest/crypto/ecdsa/index.d.ts.map +1 -1
- package/dest/crypto/ecdsa/index.js +58 -48
- package/dest/crypto/ecdsa/signature.d.ts +2 -11
- package/dest/crypto/ecdsa/signature.d.ts.map +1 -1
- package/dest/crypto/ecdsa/signature.js +2 -2
- package/dest/crypto/grumpkin/index.d.ts +10 -13
- package/dest/crypto/grumpkin/index.d.ts.map +1 -1
- package/dest/crypto/grumpkin/index.js +61 -55
- package/dest/crypto/keccak/index.d.ts +1 -1
- package/dest/crypto/keys/index.d.ts +2 -2
- package/dest/crypto/keys/index.d.ts.map +1 -1
- package/dest/crypto/keys/index.js +8 -5
- package/dest/crypto/pedersen/index.d.ts +1 -1
- package/dest/crypto/pedersen/pedersen.noble.d.ts +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.d.ts +2 -2
- package/dest/crypto/pedersen/pedersen.wasm.d.ts.map +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.js +24 -14
- package/dest/crypto/poseidon/index.d.ts +2 -2
- package/dest/crypto/poseidon/index.d.ts.map +1 -1
- package/dest/crypto/poseidon/index.js +33 -18
- package/dest/crypto/random/index.d.ts +1 -1
- package/dest/crypto/random/index.d.ts.map +1 -1
- package/dest/crypto/random/randomness_singleton.d.ts +1 -1
- package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
- package/dest/crypto/schnorr/index.d.ts +3 -2
- package/dest/crypto/schnorr/index.d.ts.map +1 -1
- package/dest/crypto/schnorr/index.js +30 -38
- package/dest/crypto/schnorr/signature.d.ts +2 -2
- package/dest/crypto/schnorr/signature.d.ts.map +1 -1
- package/dest/crypto/schnorr/signature.js +2 -2
- package/dest/crypto/secp256k1/index.d.ts +1 -1
- package/dest/crypto/secp256k1/index.d.ts.map +1 -1
- package/dest/crypto/secp256k1/index.js +23 -18
- package/dest/crypto/secp256k1-signer/index.d.ts +1 -1
- package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts +1 -1
- package/dest/crypto/secp256k1-signer/secp256k1_signer.d.ts.map +1 -1
- package/dest/crypto/secp256k1-signer/utils.d.ts +49 -3
- package/dest/crypto/secp256k1-signer/utils.d.ts.map +1 -1
- package/dest/crypto/secp256k1-signer/utils.js +87 -5
- package/dest/crypto/serialize.d.ts +1 -1
- package/dest/crypto/sha256/index.d.ts +2 -2
- package/dest/crypto/sha256/index.d.ts.map +1 -1
- package/dest/crypto/sha256/index.js +1 -1
- package/dest/crypto/sha512/index.d.ts +3 -3
- package/dest/crypto/sha512/index.d.ts.map +1 -1
- package/dest/crypto/sha512/index.js +1 -1
- package/dest/crypto/signature/index.d.ts +2 -2
- package/dest/crypto/signature/index.d.ts.map +1 -1
- package/dest/crypto/sync/index.d.ts +1 -1
- package/dest/crypto/sync/index.js +1 -1
- package/dest/crypto/sync/pedersen/index.d.ts +2 -2
- package/dest/crypto/sync/pedersen/index.d.ts.map +1 -1
- package/dest/crypto/sync/pedersen/index.js +18 -11
- package/dest/crypto/sync/poseidon/index.d.ts +2 -2
- package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
- package/dest/crypto/sync/poseidon/index.js +28 -13
- package/dest/{fields/bls12_fields.d.ts → curves/bls12/field.d.ts} +3 -3
- package/dest/curves/bls12/field.d.ts.map +1 -0
- package/dest/{fields/bls12_fields.js → curves/bls12/field.js} +12 -9
- package/dest/curves/bls12/index.d.ts +3 -0
- package/dest/curves/bls12/index.d.ts.map +1 -0
- package/dest/curves/bls12/index.js +2 -0
- package/dest/{fields/bls12_point.d.ts → curves/bls12/point.d.ts} +11 -20
- package/dest/curves/bls12/point.d.ts.map +1 -0
- package/dest/{fields/bls12_point.js → curves/bls12/point.js} +17 -15
- package/dest/curves/bn254/field.d.ts +180 -0
- package/dest/curves/bn254/field.d.ts.map +1 -0
- package/dest/{fields/fields.js → curves/bn254/field.js} +71 -59
- package/dest/curves/bn254/index.d.ts +3 -0
- package/dest/curves/bn254/index.d.ts.map +1 -0
- package/dest/curves/bn254/index.js +2 -0
- package/dest/curves/bn254/point.d.ts +54 -0
- package/dest/curves/bn254/point.d.ts.map +1 -0
- package/dest/curves/bn254/point.js +143 -0
- package/dest/curves/grumpkin/index.d.ts +10 -0
- package/dest/curves/grumpkin/index.d.ts.map +1 -0
- package/dest/curves/grumpkin/index.js +3 -0
- package/dest/{fields → curves/grumpkin}/point.d.ts +13 -13
- package/dest/curves/grumpkin/point.d.ts.map +1 -0
- package/dest/{fields → curves/grumpkin}/point.js +24 -7
- package/dest/decorators/index.d.ts +1 -1
- package/dest/decorators/memoize.d.ts +1 -1
- package/dest/decorators/memoize.d.ts.map +1 -1
- package/dest/error/index.d.ts +4 -4
- package/dest/error/index.d.ts.map +1 -1
- package/dest/eth-address/index.d.ts +14 -4
- package/dest/eth-address/index.d.ts.map +1 -1
- package/dest/eth-address/index.js +26 -2
- package/dest/eth-signature/eth_signature.d.ts +1 -4
- package/dest/eth-signature/eth_signature.d.ts.map +1 -1
- package/dest/eth-signature/eth_signature.js +2 -4
- package/dest/eth-signature/index.d.ts +1 -1
- package/dest/fs/index.d.ts +1 -1
- package/dest/fs/run_in_dir.d.ts +1 -1
- package/dest/fs/try_rm_dir.d.ts +1 -1
- package/dest/iterable/all.d.ts +1 -1
- package/dest/iterable/filter.d.ts +1 -1
- package/dest/iterable/index.d.ts +1 -1
- package/dest/iterable/isAsyncIt.d.ts +1 -1
- package/dest/iterable/map.d.ts +1 -1
- package/dest/iterable/peek.d.ts +1 -1
- package/dest/iterable/sort.d.ts +1 -1
- package/dest/iterable/take.d.ts +1 -1
- package/dest/iterable/toArray.d.ts +1 -1
- package/dest/iterator/filter.d.ts +3 -0
- package/dest/iterator/filter.d.ts.map +1 -0
- package/dest/iterator/filter.js +7 -0
- package/dest/iterator/index.d.ts +2 -0
- package/dest/iterator/index.d.ts.map +1 -0
- package/dest/iterator/index.js +1 -0
- package/dest/json-rpc/client/fetch.d.ts +1 -1
- package/dest/json-rpc/client/index.d.ts +1 -1
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts +1 -1
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
- package/dest/json-rpc/client/safe_json_rpc_client.js +9 -0
- package/dest/json-rpc/client/undici.d.ts +1 -1
- package/dest/json-rpc/convert.d.ts +1 -1
- package/dest/json-rpc/errors.d.ts +1 -1
- package/dest/json-rpc/errors.d.ts.map +1 -1
- package/dest/json-rpc/fixtures/class_a.d.ts +3 -3
- package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
- package/dest/json-rpc/fixtures/class_b.d.ts +3 -3
- package/dest/json-rpc/fixtures/class_b.d.ts.map +1 -1
- package/dest/json-rpc/fixtures/test_state.d.ts +1 -1
- package/dest/json-rpc/fixtures/test_state.d.ts.map +1 -1
- package/dest/json-rpc/index.d.ts +1 -1
- package/dest/json-rpc/js_utils.d.ts +1 -1
- package/dest/json-rpc/js_utils.d.ts.map +1 -1
- package/dest/json-rpc/server/index.d.ts +1 -1
- package/dest/json-rpc/server/safe_json_rpc_server.d.ts +1 -1
- package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +1 -1
- package/dest/json-rpc/test/index.d.ts +1 -1
- package/dest/json-rpc/test/integration.d.ts +1 -1
- package/dest/log/console.d.ts +1 -1
- package/dest/log/gcloud-logger-config.d.ts +1 -1
- package/dest/log/gcloud-logger-config.d.ts.map +1 -1
- package/dest/log/index.d.ts +1 -1
- package/dest/log/libp2p_logger.d.ts +1 -1
- package/dest/log/log-filters.d.ts +1 -1
- package/dest/log/log-levels.d.ts +1 -1
- package/dest/log/log_fn.d.ts +2 -2
- package/dest/log/log_fn.d.ts.map +1 -1
- package/dest/log/noir_debug_log_util.d.ts +1 -1
- package/dest/log/pino-logger.d.ts +2 -2
- package/dest/log/pino-logger.d.ts.map +1 -1
- package/dest/log/pino-logger.js +0 -1
- package/dest/message/index.d.ts +1 -1
- package/dest/message/index.d.ts.map +1 -1
- package/dest/mutex/index.d.ts +1 -1
- package/dest/mutex/index.d.ts.map +1 -1
- package/dest/mutex/mutex_database.d.ts +1 -1
- package/dest/noir/index.d.ts +1 -1
- package/dest/noir/noir_package_config.d.ts +9 -9
- package/dest/number/index.d.ts +1 -1
- package/dest/profiler/index.d.ts +2 -0
- package/dest/profiler/index.d.ts.map +1 -0
- package/dest/profiler/index.js +1 -0
- package/dest/profiler/profiler.d.ts +8 -0
- package/dest/profiler/profiler.d.ts.map +1 -0
- package/dest/profiler/profiler.js +97 -0
- package/dest/promise/index.d.ts +1 -1
- package/dest/promise/running-promise.d.ts +1 -1
- package/dest/promise/running-promise.d.ts.map +1 -1
- package/dest/promise/utils.d.ts +1 -1
- package/dest/queue/base_memory_queue.d.ts +1 -1
- package/dest/queue/base_memory_queue.d.ts.map +1 -1
- package/dest/queue/batch_queue.d.ts +1 -1
- package/dest/queue/batch_queue.d.ts.map +1 -1
- package/dest/queue/bounded_serial_queue.d.ts +1 -1
- package/dest/queue/bounded_serial_queue.d.ts.map +1 -1
- package/dest/queue/fifo_memory_queue.d.ts +1 -1
- package/dest/queue/fifo_memory_queue.d.ts.map +1 -1
- package/dest/queue/index.d.ts +1 -1
- package/dest/queue/priority_memory_queue.d.ts +1 -1
- package/dest/queue/priority_memory_queue.d.ts.map +1 -1
- package/dest/queue/priority_queue.d.ts +1 -1
- package/dest/queue/priority_queue.d.ts.map +1 -1
- package/dest/queue/semaphore.d.ts +1 -1
- package/dest/queue/semaphore.d.ts.map +1 -1
- package/dest/queue/serial_queue.d.ts +1 -1
- package/dest/queue/serial_queue.d.ts.map +1 -1
- package/dest/retry/index.d.ts +1 -1
- package/dest/running-promise/index.d.ts +1 -1
- package/dest/schemas/api.d.ts +1 -1
- package/dest/schemas/index.d.ts +1 -1
- package/dest/schemas/parse.d.ts +1 -1
- package/dest/schemas/schemas.d.ts +15 -17
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +14 -10
- package/dest/schemas/types.d.ts +31 -1
- package/dest/schemas/types.d.ts.map +1 -1
- package/dest/schemas/types.js +25 -1
- package/dest/schemas/utils.d.ts +4 -4
- package/dest/schemas/utils.d.ts.map +1 -1
- package/dest/schemas/utils.js +15 -5
- package/dest/serialize/buffer_reader.d.ts +3 -1
- package/dest/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/serialize/buffer_reader.js +3 -0
- package/dest/serialize/field_reader.d.ts +2 -2
- package/dest/serialize/field_reader.d.ts.map +1 -1
- package/dest/serialize/field_reader.js +1 -1
- package/dest/serialize/free_funcs.d.ts +2 -2
- package/dest/serialize/free_funcs.d.ts.map +1 -1
- package/dest/serialize/free_funcs.js +1 -1
- package/dest/serialize/index.d.ts +1 -1
- package/dest/serialize/serialize.d.ts +2 -2
- package/dest/serialize/serialize.d.ts.map +1 -1
- package/dest/serialize/serialize.js +1 -1
- package/dest/serialize/type_registry.d.ts +1 -1
- package/dest/serialize/type_registry.d.ts.map +1 -1
- package/dest/serialize/types.d.ts +1 -1
- package/dest/sleep/index.d.ts +3 -1
- package/dest/sleep/index.d.ts.map +1 -1
- package/dest/sleep/index.js +4 -0
- package/dest/string/index.d.ts +5 -1
- package/dest/string/index.d.ts.map +1 -1
- package/dest/string/index.js +19 -2
- package/dest/testing/files/index.d.ts +2 -1
- package/dest/testing/files/index.d.ts.map +1 -1
- package/dest/testing/files/index.js +1 -1
- package/dest/testing/formatting.d.ts +4 -0
- package/dest/testing/formatting.d.ts.map +1 -0
- package/dest/testing/formatting.js +3 -0
- package/dest/testing/index.d.ts +2 -1
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -0
- package/dest/testing/port_allocator.d.ts +1 -1
- package/dest/testing/snapshot_serializer.d.ts +1 -1
- package/dest/testing/test_data.d.ts +1 -1
- package/dest/timer/date.d.ts +2 -1
- package/dest/timer/date.d.ts.map +1 -1
- package/dest/timer/date.js +3 -0
- package/dest/timer/elapsed.d.ts +1 -1
- package/dest/timer/index.d.ts +1 -1
- package/dest/timer/timeout.d.ts +1 -1
- package/dest/timer/timeout.d.ts.map +1 -1
- package/dest/timer/timer.d.ts +1 -1
- package/dest/timer/timer.d.ts.map +1 -1
- package/dest/transport/dispatch/create_dispatch_fn.d.ts +1 -1
- package/dest/transport/dispatch/create_dispatch_fn.d.ts.map +1 -1
- package/dest/transport/dispatch/create_dispatch_proxy.d.ts +1 -1
- package/dest/transport/dispatch/messages.d.ts +1 -1
- package/dest/transport/index.d.ts +1 -1
- package/dest/transport/interface/connector.d.ts +1 -1
- package/dest/transport/interface/listener.d.ts +1 -1
- package/dest/transport/interface/socket.d.ts +1 -1
- package/dest/transport/interface/transferable.d.ts +1 -1
- package/dest/transport/node/index.d.ts +1 -1
- package/dest/transport/node/node_connector.d.ts +1 -1
- package/dest/transport/node/node_connector.d.ts.map +1 -1
- package/dest/transport/node/node_connector_socket.d.ts +1 -1
- package/dest/transport/node/node_connector_socket.d.ts.map +1 -1
- package/dest/transport/node/node_listener.d.ts +1 -1
- package/dest/transport/node/node_listener.d.ts.map +1 -1
- package/dest/transport/node/node_listener_socket.d.ts +1 -1
- package/dest/transport/node/node_listener_socket.d.ts.map +1 -1
- package/dest/transport/transport_client.d.ts +1 -1
- package/dest/transport/transport_client.d.ts.map +1 -1
- package/dest/transport/transport_server.d.ts +1 -10
- package/dest/transport/transport_server.d.ts.map +1 -1
- package/dest/trees/balanced_merkle_tree.d.ts +22 -0
- package/dest/trees/balanced_merkle_tree.d.ts.map +1 -0
- package/dest/trees/balanced_merkle_tree.js +66 -0
- package/dest/trees/hasher.d.ts +1 -1
- package/dest/trees/index.d.ts +2 -1
- package/dest/trees/index.d.ts.map +1 -1
- package/dest/trees/index.js +1 -0
- package/dest/trees/indexed_merkle_tree.d.ts +1 -1
- package/dest/trees/indexed_merkle_tree.d.ts.map +1 -1
- package/dest/trees/indexed_merkle_tree.js +1 -1
- package/dest/trees/indexed_merkle_tree_calculator.d.ts +1 -1
- package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/indexed_tree_leaf.d.ts +1 -1
- package/dest/trees/membership_witness.d.ts +3 -24
- package/dest/trees/membership_witness.d.ts.map +1 -1
- package/dest/trees/membership_witness.js +1 -1
- package/dest/trees/merkle_tree.d.ts +1 -1
- package/dest/trees/merkle_tree.d.ts.map +1 -1
- package/dest/trees/merkle_tree_calculator.d.ts +2 -12
- package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/merkle_tree_calculator.js +1 -31
- package/dest/trees/sibling_path.d.ts +5 -39
- package/dest/trees/sibling_path.d.ts.map +1 -1
- package/dest/trees/sibling_path.js +2 -2
- package/dest/trees/unbalanced_merkle_tree.d.ts +5 -4
- package/dest/trees/unbalanced_merkle_tree.d.ts.map +1 -1
- package/dest/trees/unbalanced_merkle_tree.js +33 -10
- package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +27 -23
- package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/unbalanced_merkle_tree_calculator.js +123 -97
- package/dest/trees/unbalanced_tree_store.d.ts +2 -1
- package/dest/trees/unbalanced_tree_store.d.ts.map +1 -1
- package/dest/trees/unbalanced_tree_store.js +6 -0
- package/dest/types/index.d.ts +3 -1
- package/dest/types/index.d.ts.map +1 -1
- package/dest/types/index.js +3 -0
- package/dest/url/index.d.ts +1 -1
- package/dest/validation/index.d.ts +1 -1
- package/package.json +32 -8
- package/src/array/array.ts +0 -16
- package/src/array/index.ts +1 -0
- package/src/array/sorted_array.ts +133 -0
- package/src/branded-types/block_number.ts +112 -0
- package/src/branded-types/checkpoint_number.ts +100 -0
- package/src/branded-types/epoch.ts +88 -0
- package/src/branded-types/index.ts +6 -0
- package/src/branded-types/slot.ts +88 -0
- package/src/branded-types/types.ts +2 -0
- package/src/buffer/buffer16.ts +2 -2
- package/src/buffer/buffer32.ts +2 -2
- package/src/collection/array.ts +15 -3
- package/src/collection/object.ts +8 -0
- package/src/config/env_var.ts +44 -10
- package/src/config/index.ts +22 -2
- package/src/config/network_config.ts +18 -0
- package/src/config/network_name.ts +18 -3
- package/src/crypto/aes128/index.ts +19 -10
- package/src/crypto/bls/bn254_keystore.ts +287 -0
- package/src/crypto/bls/index.ts +77 -0
- package/src/crypto/bn254/index.ts +64 -0
- package/src/crypto/ecdsa/index.ts +40 -37
- package/src/crypto/ecdsa/signature.ts +2 -2
- package/src/crypto/grumpkin/index.ts +38 -46
- package/src/crypto/keys/index.ts +6 -6
- package/src/crypto/pedersen/pedersen.wasm.ts +23 -19
- package/src/crypto/poseidon/index.ts +33 -25
- package/src/crypto/schnorr/index.ts +22 -18
- package/src/crypto/schnorr/signature.ts +2 -2
- package/src/crypto/secp256k1/index.ts +15 -11
- package/src/crypto/secp256k1-signer/utils.ts +115 -7
- package/src/crypto/sha256/index.ts +1 -1
- package/src/crypto/sha512/index.ts +1 -1
- package/src/crypto/signature/index.ts +1 -1
- package/src/crypto/sync/index.ts +1 -1
- package/src/crypto/sync/pedersen/index.ts +17 -16
- package/src/crypto/sync/poseidon/index.ts +28 -23
- package/src/{fields/bls12_fields.ts → curves/bls12/field.ts} +6 -6
- package/src/curves/bls12/index.ts +2 -0
- package/src/{fields/bls12_point.ts → curves/bls12/point.ts} +14 -14
- package/src/{fields/fields.ts → curves/bn254/field.ts} +69 -62
- package/src/curves/bn254/index.ts +2 -0
- package/src/curves/bn254/point.ts +170 -0
- package/src/curves/grumpkin/index.ts +11 -0
- package/src/{fields → curves/grumpkin}/point.ts +26 -7
- package/src/eth-address/index.ts +28 -3
- package/src/eth-signature/eth_signature.ts +2 -4
- package/src/iterator/filter.ts +11 -0
- package/src/iterator/index.ts +1 -0
- package/src/json-rpc/client/safe_json_rpc_client.ts +9 -0
- package/src/log/log_fn.ts +1 -1
- package/src/log/pino-logger.ts +0 -1
- package/src/profiler/index.ts +1 -0
- package/src/profiler/profiler.ts +125 -0
- package/src/schemas/schemas.ts +24 -13
- package/src/schemas/types.ts +33 -0
- package/src/schemas/utils.ts +21 -8
- package/src/serialize/buffer_reader.ts +5 -0
- package/src/serialize/field_reader.ts +1 -1
- package/src/serialize/free_funcs.ts +1 -1
- package/src/serialize/serialize.ts +1 -1
- package/src/sleep/index.ts +6 -0
- package/src/string/index.ts +24 -1
- package/src/testing/files/index.ts +1 -1
- package/src/testing/formatting.ts +3 -0
- package/src/testing/index.ts +1 -0
- package/src/timer/date.ts +4 -0
- package/src/trees/balanced_merkle_tree.ts +84 -0
- package/src/trees/index.ts +1 -0
- package/src/trees/indexed_merkle_tree.ts +1 -1
- package/src/trees/membership_witness.ts +1 -1
- package/src/trees/merkle_tree_calculator.ts +1 -34
- package/src/trees/sibling_path.ts +2 -2
- package/src/trees/unbalanced_merkle_tree.ts +55 -7
- package/src/trees/unbalanced_merkle_tree_calculator.ts +134 -93
- package/src/trees/unbalanced_tree_store.ts +5 -1
- package/src/types/index.ts +5 -0
- package/dest/crypto/index.d.ts +0 -15
- package/dest/crypto/index.d.ts.map +0 -1
- package/dest/crypto/index.js +0 -14
- package/dest/fields/bls12_fields.d.ts.map +0 -1
- package/dest/fields/bls12_point.d.ts.map +0 -1
- package/dest/fields/coordinate.d.ts +0 -66
- package/dest/fields/coordinate.d.ts.map +0 -1
- package/dest/fields/coordinate.js +0 -96
- package/dest/fields/fields.d.ts +0 -174
- package/dest/fields/fields.d.ts.map +0 -1
- package/dest/fields/index.d.ts +0 -6
- package/dest/fields/index.d.ts.map +0 -1
- package/dest/fields/index.js +0 -5
- package/dest/fields/point.d.ts.map +0 -1
- package/dest/index.d.ts +0 -29
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -29
- package/dest/json-rpc/server/telemetry.d.ts +0 -2
- package/dest/json-rpc/server/telemetry.d.ts.map +0 -1
- package/dest/json-rpc/server/telemetry.js +0 -0
- package/src/crypto/index.ts +0 -14
- package/src/fields/coordinate.ts +0 -104
- package/src/fields/index.ts +0 -5
- package/src/index.ts +0 -29
- package/src/json-rpc/server/telemetry.ts +0 -0
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '../bigint-buffer/index.js';
|
|
2
|
-
import { Fr } from './fields.js';
|
|
3
|
-
/**
|
|
4
|
-
* Class to wrap a single point coordinate.
|
|
5
|
-
* This class handles the complexities of representing point coordinates as 32 byte buffers as well as fields.
|
|
6
|
-
* The coordinate value is split across 2 fields to ensure that the max size of a field is not breached.
|
|
7
|
-
* This is achieved by placing the most significant byte of the lower field into the least significant byte of the higher field.
|
|
8
|
-
* Calls to 'toBuffer' or 'toBigInt' undo this change and simply return the original 32 byte value.
|
|
9
|
-
* Calls to 'toFieldsBuffer' will return a 64 bytes buffer containing the serialized fields.
|
|
10
|
-
*/ export class Coordinate {
|
|
11
|
-
fields;
|
|
12
|
-
static ZERO = new Coordinate([
|
|
13
|
-
Fr.ZERO,
|
|
14
|
-
Fr.ZERO
|
|
15
|
-
]);
|
|
16
|
-
constructor(/**
|
|
17
|
-
* The fields of the coordinate value. Least significant limb at index 0.
|
|
18
|
-
*/ fields){
|
|
19
|
-
this.fields = fields;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Converts the coordinate data into a tuple of fields
|
|
23
|
-
* @returns A tuple of the coordinate fields
|
|
24
|
-
*/ toFields() {
|
|
25
|
-
return this.fields;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Generates a random coordinate value
|
|
29
|
-
* @returns The random coordinate
|
|
30
|
-
*/ static random() {
|
|
31
|
-
return this.fromField(Fr.random());
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* serializes the object to buffer of 2 fields.
|
|
35
|
-
* @returns A buffer serialization of the object.
|
|
36
|
-
*/ toFieldsBuffer() {
|
|
37
|
-
return Buffer.concat([
|
|
38
|
-
this.fields[0].toBuffer(),
|
|
39
|
-
this.fields[1].toBuffer()
|
|
40
|
-
]);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* serializes the coordinate to a single 32 byte buffer.
|
|
44
|
-
* @returns A buffer serialization of the object.
|
|
45
|
-
*/ toBuffer() {
|
|
46
|
-
const buf0 = this.fields[0].toBuffer();
|
|
47
|
-
const buf1 = this.fields[1].toBuffer();
|
|
48
|
-
buf0[0] = buf1[31];
|
|
49
|
-
return buf0;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Returns true if this coordinate is equal to the one provided
|
|
53
|
-
* @param other - The coordinate against which to compare
|
|
54
|
-
* @returns True if the coordinates are the same, false otherwise
|
|
55
|
-
*/ equals(other) {
|
|
56
|
-
return this.toBigInt() === other.toBigInt();
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns the coordinate's value as a bigint
|
|
60
|
-
* @returns The coordinate value as a bigint
|
|
61
|
-
*/ toBigInt() {
|
|
62
|
-
return toBigIntBE(this.toBuffer());
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Creates a coordinate object from a 32 byte coordinate value
|
|
66
|
-
* @param coordinate - A buffer containing the 32 byte coordinate value
|
|
67
|
-
* @returns The new coordinate object
|
|
68
|
-
*/ static fromBuffer(coordinate) {
|
|
69
|
-
if (coordinate.length != 32) {
|
|
70
|
-
throw new Error(`Invalid size of coordinate buffer`);
|
|
71
|
-
}
|
|
72
|
-
const buf0 = Buffer.alloc(32);
|
|
73
|
-
coordinate.copy(buf0, 0, 0, 32);
|
|
74
|
-
const buf1 = Buffer.alloc(32);
|
|
75
|
-
buf1[31] = buf0[0];
|
|
76
|
-
buf0[0] = 0;
|
|
77
|
-
return new Coordinate([
|
|
78
|
-
Fr.fromBuffer(buf0),
|
|
79
|
-
Fr.fromBuffer(buf1)
|
|
80
|
-
]);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Creates a coordinate object from a field
|
|
84
|
-
* @param coordinate - The field containing the coordinate
|
|
85
|
-
* @returns The new coordinate object
|
|
86
|
-
*/ static fromField(coordinate) {
|
|
87
|
-
const buf0 = coordinate.toBuffer();
|
|
88
|
-
const buf1 = Buffer.alloc(32);
|
|
89
|
-
buf1[31] = buf0[0];
|
|
90
|
-
buf0[0] = 0;
|
|
91
|
-
return new Coordinate([
|
|
92
|
-
Fr.fromBuffer(buf0),
|
|
93
|
-
Fr.fromBuffer(buf1)
|
|
94
|
-
]);
|
|
95
|
-
}
|
|
96
|
-
}
|
package/dest/fields/fields.d.ts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { inspect } from 'util';
|
|
2
|
-
import { BufferReader } from '../serialize/buffer_reader.js';
|
|
3
|
-
/**
|
|
4
|
-
* Represents a field derived from BaseField.
|
|
5
|
-
*/
|
|
6
|
-
type DerivedField<T extends BaseField> = {
|
|
7
|
-
new (value: any): T;
|
|
8
|
-
/**
|
|
9
|
-
* All derived fields will specify a MODULUS.
|
|
10
|
-
*/
|
|
11
|
-
MODULUS: bigint;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Base field class.
|
|
15
|
-
* Conversions from Buffer to BigInt and vice-versa are not cheap.
|
|
16
|
-
* We allow construction with either form and lazily convert to other as needed.
|
|
17
|
-
* We only check we are within the field modulus when initializing with bigint.
|
|
18
|
-
*/
|
|
19
|
-
declare abstract class BaseField {
|
|
20
|
-
static SIZE_IN_BYTES: number;
|
|
21
|
-
private asBuffer?;
|
|
22
|
-
private asBigInt?;
|
|
23
|
-
/**
|
|
24
|
-
* Return bigint representation.
|
|
25
|
-
* @deprecated Just to get things compiling. Use toBigInt().
|
|
26
|
-
* */
|
|
27
|
-
get value(): bigint;
|
|
28
|
-
/** Returns the size in bytes. */
|
|
29
|
-
get size(): number;
|
|
30
|
-
protected constructor(value: number | bigint | boolean | BaseField | Buffer);
|
|
31
|
-
protected abstract modulus(): bigint;
|
|
32
|
-
/**
|
|
33
|
-
* We return a copy of the Buffer to ensure this remains immutable.
|
|
34
|
-
*/
|
|
35
|
-
toBuffer(): Buffer;
|
|
36
|
-
toString(): `0x${string}`;
|
|
37
|
-
toBigInt(): bigint;
|
|
38
|
-
toBool(): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Converts this field to a number.
|
|
41
|
-
* Throws if the underlying value is greater than MAX_SAFE_INTEGER.
|
|
42
|
-
*/
|
|
43
|
-
toNumber(): number;
|
|
44
|
-
/**
|
|
45
|
-
* Converts this field to a number.
|
|
46
|
-
* May cause loss of precision if the underlying value is greater than MAX_SAFE_INTEGER.
|
|
47
|
-
*/
|
|
48
|
-
toNumberUnsafe(): number;
|
|
49
|
-
toShortString(): string;
|
|
50
|
-
equals(rhs: BaseField): boolean;
|
|
51
|
-
lt(rhs: BaseField): boolean;
|
|
52
|
-
cmp(rhs: BaseField): -1 | 0 | 1;
|
|
53
|
-
isZero(): boolean;
|
|
54
|
-
isEmpty(): boolean;
|
|
55
|
-
toFriendlyJSON(): string;
|
|
56
|
-
toField(): this;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Constructs a field from a Buffer of BufferReader.
|
|
60
|
-
* It maybe not read the full 32 bytes if the Buffer is shorter, but it will padded in BaseField constructor.
|
|
61
|
-
*/
|
|
62
|
-
export declare function fromBuffer<T extends BaseField>(buffer: Buffer | BufferReader, f: DerivedField<T>): T;
|
|
63
|
-
/** Branding to ensure fields are not interchangeable types. */
|
|
64
|
-
export interface Fr {
|
|
65
|
-
/** Brand. */
|
|
66
|
-
_branding: 'Fr';
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Fr field class.
|
|
70
|
-
* @dev This class is used to represent elements of BN254 scalar field or elements in the base field of Grumpkin.
|
|
71
|
-
* (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)
|
|
72
|
-
*/
|
|
73
|
-
export declare class Fr extends BaseField {
|
|
74
|
-
static ZERO: Fr;
|
|
75
|
-
static ONE: Fr;
|
|
76
|
-
static MODULUS: bigint;
|
|
77
|
-
static MAX_FIELD_VALUE: Fr;
|
|
78
|
-
constructor(value: number | bigint | boolean | Fr | Buffer);
|
|
79
|
-
[inspect.custom](): string;
|
|
80
|
-
protected modulus(): bigint;
|
|
81
|
-
static random(): Fr;
|
|
82
|
-
static zero(): Fr;
|
|
83
|
-
static isZero(value: Fr): boolean;
|
|
84
|
-
static fromBuffer(buffer: Buffer | BufferReader): Fr;
|
|
85
|
-
static fromBufferReduce(buffer: Buffer): Fr;
|
|
86
|
-
/**
|
|
87
|
-
* Creates a Fr instance from a string.
|
|
88
|
-
* @param buf - the string to create a Fr from.
|
|
89
|
-
* @returns the Fr instance
|
|
90
|
-
* @remarks if the string only consists of numbers, we assume we are parsing a bigint,
|
|
91
|
-
* otherwise we require the hex string to be prepended with "0x", to ensure there is no misunderstanding
|
|
92
|
-
* as to what is being parsed.
|
|
93
|
-
*/
|
|
94
|
-
static fromString(buf: string): Fr;
|
|
95
|
-
/**
|
|
96
|
-
* Creates a Fr instance from a hex string.
|
|
97
|
-
* @param buf - a hex encoded string.
|
|
98
|
-
* @returns the Fr instance
|
|
99
|
-
*/
|
|
100
|
-
static fromHexString(buf: string): Fr;
|
|
101
|
-
/** Arithmetic */
|
|
102
|
-
add(rhs: Fr): Fr;
|
|
103
|
-
square(): Fr;
|
|
104
|
-
negate(): Fr;
|
|
105
|
-
sub(rhs: Fr): Fr;
|
|
106
|
-
mul(rhs: Fr): Fr;
|
|
107
|
-
div(rhs: Fr): Fr;
|
|
108
|
-
ediv(rhs: Fr): Fr;
|
|
109
|
-
/**
|
|
110
|
-
* Computes a square root of the field element.
|
|
111
|
-
* @returns A square root of the field element (null if it does not exist).
|
|
112
|
-
*/
|
|
113
|
-
sqrt(): Promise<Fr | null>;
|
|
114
|
-
toJSON(): `0x${string}`;
|
|
115
|
-
static get schema(): import("zod").ZodType<Fr, any, string>;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Branding to ensure fields are not interchangeable types.
|
|
119
|
-
*/
|
|
120
|
-
export interface Fq {
|
|
121
|
-
/** Brand. */
|
|
122
|
-
_branding: 'Fq';
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Fq field class.
|
|
126
|
-
* @dev This class is used to represent elements of BN254 base field or elements in the scalar field of Grumpkin.
|
|
127
|
-
* (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)
|
|
128
|
-
*/
|
|
129
|
-
export declare class Fq extends BaseField {
|
|
130
|
-
static ZERO: Fq;
|
|
131
|
-
static MODULUS: bigint;
|
|
132
|
-
private static HIGH_SHIFT;
|
|
133
|
-
private static LOW_MASK;
|
|
134
|
-
[inspect.custom](): string;
|
|
135
|
-
get lo(): Fr;
|
|
136
|
-
get hi(): Fr;
|
|
137
|
-
constructor(value: number | bigint | boolean | Fq | Buffer);
|
|
138
|
-
protected modulus(): bigint;
|
|
139
|
-
static random(): Fq;
|
|
140
|
-
static zero(): Fq;
|
|
141
|
-
static fromBuffer(buffer: Buffer | BufferReader): Fq;
|
|
142
|
-
static fromBufferReduce(buffer: Buffer): Fq;
|
|
143
|
-
/**
|
|
144
|
-
* Creates a Fq instance from a string.
|
|
145
|
-
* @param buf - the string to create a Fq from.
|
|
146
|
-
* @returns the Fq instance
|
|
147
|
-
* @remarks if the string only consists of numbers, we assume we are parsing a bigint,
|
|
148
|
-
* otherwise we require the hex string to be prepended with "0x", to ensure there is no misunderstanding
|
|
149
|
-
* as to what is being parsed.
|
|
150
|
-
*/
|
|
151
|
-
static fromString(buf: string): Fq;
|
|
152
|
-
/**
|
|
153
|
-
* Creates a Fq instance from a hex string.
|
|
154
|
-
* @param buf - a hex encoded string.
|
|
155
|
-
* @returns the Fq instance
|
|
156
|
-
*/
|
|
157
|
-
static fromHexString(buf: string): Fq;
|
|
158
|
-
static fromHighLow(high: Fr, low: Fr): Fq;
|
|
159
|
-
add(rhs: Fq): Fq;
|
|
160
|
-
toJSON(): `0x${string}`;
|
|
161
|
-
toFields(): Fr[];
|
|
162
|
-
static get schema(): import("zod").ZodType<Fq, any, string>;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* GrumpkinScalar is an Fq.
|
|
166
|
-
* @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in
|
|
167
|
-
* the Aztec Protocol Specs.
|
|
168
|
-
*/
|
|
169
|
-
export type GrumpkinScalar = Fq;
|
|
170
|
-
export declare const GrumpkinScalar: typeof Fq;
|
|
171
|
-
/** Wraps a function that returns a buffer so that all results are reduced into a field of the given type. */
|
|
172
|
-
export declare function reduceFn<TInput, TField extends BaseField>(fn: (input: TInput) => Buffer, field: DerivedField<TField>): (input: TInput) => TField;
|
|
173
|
-
export {};
|
|
174
|
-
//# sourceMappingURL=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AAM,CAAC,IAC3G,OAAO,MAAM,YACtB"}
|
package/dest/fields/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
package/dest/fields/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/fields/point.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC;;;;;GAKG;AACH,qBAAa,KAAK;IASd;;OAEG;aACa,CAAC,EAAE,EAAE;IACrB;;OAEG;aACa,CAAC,EAAE,EAAE;IACrB;;OAEG;aACa,UAAU,EAAE,OAAO;IAnBrC,MAAM,CAAC,IAAI,QAAsC;IACjD,MAAM,CAAC,aAAa,SAAwB;IAC5C,MAAM,CAAC,wBAAwB,SAAoB;IAEnD,yDAAyD;IACzD,SAAgB,IAAI,WAAW;;IAG7B;;OAEG;IACa,CAAC,EAAE,EAAE;IACrB;;OAEG;IACa,CAAC,EAAE,EAAE;IACrB;;OAEG;IACa,UAAU,EAAE,OAAO;IAKrC,MAAM;IAIN,MAAM,KAAK,MAAM,8CAEhB;IAED;;;;OAIG;WACU,MAAM;IAcnB;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;IAU1E;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B;;;OAGG;IACH,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAK5C;;;;;;;;OAQG;WACU,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO;IAgB9C;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IASxC;;;;OAIG;IACH,UAAU,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC;IAI3B;;;OAGG;IACH,SAAS;;;;;IAQT;;;;;;;;;OASG;IACH,QAAQ;IAWR;;;OAGG;IACH,kBAAkB;IAalB;;;;;;OAMG;IACH,QAAQ;IAIR;;;;;;;OAOG;IACH,aAAa;IAKb,YAAY;;;;;IAOZ,mBAAmB;;;;;;;IAInB;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,KAAK;IAIjB,MAAM;IAIN,IAAI;IAIJ;;;OAGG;IACH,IAAW,GAAG,YAEb;IAED,YAAY;CAYb;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,CAAC,EAAE,EAAE;CAIlB"}
|
package/dest/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export * as asyncMap from './async-map/index.js';
|
|
2
|
-
export * as bigintBuffer from './bigint-buffer/index.js';
|
|
3
|
-
export * as collection from './collection/index.js';
|
|
4
|
-
export * as committable from './committable/index.js';
|
|
5
|
-
export * as crypto from './crypto/index.js';
|
|
6
|
-
export * as errors from './error/index.js';
|
|
7
|
-
export * as ethAddress from './eth-address/index.js';
|
|
8
|
-
export * as fields from './fields/index.js';
|
|
9
|
-
export * as fifo from './queue/index.js';
|
|
10
|
-
export * as fs from './fs/index.js';
|
|
11
|
-
export * as jsonRpc from './json-rpc/index.js';
|
|
12
|
-
export * as jsonRpcClient from './json-rpc/client/index.js';
|
|
13
|
-
export * as jsonRpcServer from './json-rpc/server/index.js';
|
|
14
|
-
export * as log from './log/index.js';
|
|
15
|
-
export * as mutex from './mutex/index.js';
|
|
16
|
-
export * as retry from './retry/index.js';
|
|
17
|
-
export * as runningPromise from './running-promise/index.js';
|
|
18
|
-
export * as serialize from './serialize/index.js';
|
|
19
|
-
export * as sleep from './sleep/index.js';
|
|
20
|
-
export * as timer from './timer/index.js';
|
|
21
|
-
export * as transport from './transport/index.js';
|
|
22
|
-
export * as trees from './trees/index.js';
|
|
23
|
-
export * as types from './types/index.js';
|
|
24
|
-
export * as url from './url/index.js';
|
|
25
|
-
export * as testing from './testing/index.js';
|
|
26
|
-
export * as config from './config/index.js';
|
|
27
|
-
export * as buffer from './buffer/index.js';
|
|
28
|
-
export * as ethSignature from './eth-signature/index.js';
|
|
29
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dest/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC"}
|
package/dest/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Reexport all folders at the root for packages targeting CommonJS
|
|
2
|
-
export * as asyncMap from './async-map/index.js';
|
|
3
|
-
export * as bigintBuffer from './bigint-buffer/index.js';
|
|
4
|
-
export * as collection from './collection/index.js';
|
|
5
|
-
export * as committable from './committable/index.js';
|
|
6
|
-
export * as crypto from './crypto/index.js';
|
|
7
|
-
export * as errors from './error/index.js';
|
|
8
|
-
export * as ethAddress from './eth-address/index.js';
|
|
9
|
-
export * as fields from './fields/index.js';
|
|
10
|
-
export * as fifo from './queue/index.js';
|
|
11
|
-
export * as fs from './fs/index.js';
|
|
12
|
-
export * as jsonRpc from './json-rpc/index.js';
|
|
13
|
-
export * as jsonRpcClient from './json-rpc/client/index.js';
|
|
14
|
-
export * as jsonRpcServer from './json-rpc/server/index.js';
|
|
15
|
-
export * as log from './log/index.js';
|
|
16
|
-
export * as mutex from './mutex/index.js';
|
|
17
|
-
export * as retry from './retry/index.js';
|
|
18
|
-
export * as runningPromise from './running-promise/index.js';
|
|
19
|
-
export * as serialize from './serialize/index.js';
|
|
20
|
-
export * as sleep from './sleep/index.js';
|
|
21
|
-
export * as timer from './timer/index.js';
|
|
22
|
-
export * as transport from './transport/index.js';
|
|
23
|
-
export * as trees from './trees/index.js';
|
|
24
|
-
export * as types from './types/index.js';
|
|
25
|
-
export * as url from './url/index.js';
|
|
26
|
-
export * as testing from './testing/index.js';
|
|
27
|
-
export * as config from './config/index.js';
|
|
28
|
-
export * as buffer from './buffer/index.js';
|
|
29
|
-
export * as ethSignature from './eth-signature/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../src/json-rpc/server/telemetry.ts"],"names":[],"mappings":""}
|
|
File without changes
|
package/src/crypto/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './keccak/index.js';
|
|
2
|
-
export * from './random/index.js';
|
|
3
|
-
export * from './sha256/index.js';
|
|
4
|
-
export * from './sha512/index.js';
|
|
5
|
-
export * from './pedersen/index.js';
|
|
6
|
-
export * from './poseidon/index.js';
|
|
7
|
-
export * from './secp256k1-signer/index.js';
|
|
8
|
-
export * from './keys/index.js';
|
|
9
|
-
export * from './aes128/index.js';
|
|
10
|
-
export * from './grumpkin/index.js';
|
|
11
|
-
export * from './ecdsa/index.js';
|
|
12
|
-
export * from './secp256k1/index.js';
|
|
13
|
-
export * from './schnorr/index.js';
|
|
14
|
-
export * from './signature/index.js';
|
package/src/fields/coordinate.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '../bigint-buffer/index.js';
|
|
2
|
-
import type { Tuple } from '../serialize/types.js';
|
|
3
|
-
import { Fr } from './fields.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Class to wrap a single point coordinate.
|
|
7
|
-
* This class handles the complexities of representing point coordinates as 32 byte buffers as well as fields.
|
|
8
|
-
* The coordinate value is split across 2 fields to ensure that the max size of a field is not breached.
|
|
9
|
-
* This is achieved by placing the most significant byte of the lower field into the least significant byte of the higher field.
|
|
10
|
-
* Calls to 'toBuffer' or 'toBigInt' undo this change and simply return the original 32 byte value.
|
|
11
|
-
* Calls to 'toFieldsBuffer' will return a 64 bytes buffer containing the serialized fields.
|
|
12
|
-
*/
|
|
13
|
-
export class Coordinate {
|
|
14
|
-
static ZERO = new Coordinate([Fr.ZERO, Fr.ZERO]);
|
|
15
|
-
|
|
16
|
-
constructor(
|
|
17
|
-
/**
|
|
18
|
-
* The fields of the coordinate value. Least significant limb at index 0.
|
|
19
|
-
*/
|
|
20
|
-
public fields: Tuple<Fr, 2>,
|
|
21
|
-
) {}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Converts the coordinate data into a tuple of fields
|
|
25
|
-
* @returns A tuple of the coordinate fields
|
|
26
|
-
*/
|
|
27
|
-
toFields(): Tuple<Fr, 2> {
|
|
28
|
-
return this.fields;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Generates a random coordinate value
|
|
33
|
-
* @returns The random coordinate
|
|
34
|
-
*/
|
|
35
|
-
static random(): Coordinate {
|
|
36
|
-
return this.fromField(Fr.random());
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* serializes the object to buffer of 2 fields.
|
|
41
|
-
* @returns A buffer serialization of the object.
|
|
42
|
-
*/
|
|
43
|
-
toFieldsBuffer(): Buffer {
|
|
44
|
-
return Buffer.concat([this.fields[0].toBuffer(), this.fields[1].toBuffer()]);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* serializes the coordinate to a single 32 byte buffer.
|
|
49
|
-
* @returns A buffer serialization of the object.
|
|
50
|
-
*/
|
|
51
|
-
toBuffer(): Buffer {
|
|
52
|
-
const buf0 = this.fields[0].toBuffer();
|
|
53
|
-
const buf1 = this.fields[1].toBuffer();
|
|
54
|
-
buf0[0] = buf1[31];
|
|
55
|
-
return buf0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Returns true if this coordinate is equal to the one provided
|
|
60
|
-
* @param other - The coordinate against which to compare
|
|
61
|
-
* @returns True if the coordinates are the same, false otherwise
|
|
62
|
-
*/
|
|
63
|
-
equals(other: Coordinate): boolean {
|
|
64
|
-
return this.toBigInt() === other.toBigInt();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Returns the coordinate's value as a bigint
|
|
69
|
-
* @returns The coordinate value as a bigint
|
|
70
|
-
*/
|
|
71
|
-
toBigInt(): bigint {
|
|
72
|
-
return toBigIntBE(this.toBuffer());
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Creates a coordinate object from a 32 byte coordinate value
|
|
77
|
-
* @param coordinate - A buffer containing the 32 byte coordinate value
|
|
78
|
-
* @returns The new coordinate object
|
|
79
|
-
*/
|
|
80
|
-
static fromBuffer(coordinate: Buffer) {
|
|
81
|
-
if (coordinate.length != 32) {
|
|
82
|
-
throw new Error(`Invalid size of coordinate buffer`);
|
|
83
|
-
}
|
|
84
|
-
const buf0 = Buffer.alloc(32);
|
|
85
|
-
coordinate.copy(buf0, 0, 0, 32);
|
|
86
|
-
const buf1 = Buffer.alloc(32);
|
|
87
|
-
buf1[31] = buf0[0];
|
|
88
|
-
buf0[0] = 0;
|
|
89
|
-
return new Coordinate([Fr.fromBuffer(buf0), Fr.fromBuffer(buf1)]);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Creates a coordinate object from a field
|
|
94
|
-
* @param coordinate - The field containing the coordinate
|
|
95
|
-
* @returns The new coordinate object
|
|
96
|
-
*/
|
|
97
|
-
static fromField(coordinate: Fr) {
|
|
98
|
-
const buf0 = coordinate.toBuffer();
|
|
99
|
-
const buf1 = Buffer.alloc(32);
|
|
100
|
-
buf1[31] = buf0[0];
|
|
101
|
-
buf0[0] = 0;
|
|
102
|
-
return new Coordinate([Fr.fromBuffer(buf0), Fr.fromBuffer(buf1)]);
|
|
103
|
-
}
|
|
104
|
-
}
|
package/src/fields/index.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Reexport all folders at the root for packages targeting CommonJS
|
|
2
|
-
export * as asyncMap from './async-map/index.js';
|
|
3
|
-
export * as bigintBuffer from './bigint-buffer/index.js';
|
|
4
|
-
export * as collection from './collection/index.js';
|
|
5
|
-
export * as committable from './committable/index.js';
|
|
6
|
-
export * as crypto from './crypto/index.js';
|
|
7
|
-
export * as errors from './error/index.js';
|
|
8
|
-
export * as ethAddress from './eth-address/index.js';
|
|
9
|
-
export * as fields from './fields/index.js';
|
|
10
|
-
export * as fifo from './queue/index.js';
|
|
11
|
-
export * as fs from './fs/index.js';
|
|
12
|
-
export * as jsonRpc from './json-rpc/index.js';
|
|
13
|
-
export * as jsonRpcClient from './json-rpc/client/index.js';
|
|
14
|
-
export * as jsonRpcServer from './json-rpc/server/index.js';
|
|
15
|
-
export * as log from './log/index.js';
|
|
16
|
-
export * as mutex from './mutex/index.js';
|
|
17
|
-
export * as retry from './retry/index.js';
|
|
18
|
-
export * as runningPromise from './running-promise/index.js';
|
|
19
|
-
export * as serialize from './serialize/index.js';
|
|
20
|
-
export * as sleep from './sleep/index.js';
|
|
21
|
-
export * as timer from './timer/index.js';
|
|
22
|
-
export * as transport from './transport/index.js';
|
|
23
|
-
export * as trees from './trees/index.js';
|
|
24
|
-
export * as types from './types/index.js';
|
|
25
|
-
export * as url from './url/index.js';
|
|
26
|
-
export * as testing from './testing/index.js';
|
|
27
|
-
export * as config from './config/index.js';
|
|
28
|
-
export * as buffer from './buffer/index.js';
|
|
29
|
-
export * as ethSignature from './eth-signature/index.js';
|
|
File without changes
|