@aztec/foundation 0.0.0-test.1 → 0.0.1-commit.1142ef1
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 +6 -9
- package/dest/array/array.d.ts.map +1 -1
- package/dest/array/array.js +11 -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/async-pool/index.d.ts.map +1 -1
- package/dest/async-pool/index.js +1 -0
- package/dest/bigint/index.d.ts +7 -0
- package/dest/bigint/index.d.ts.map +1 -0
- package/dest/bigint/index.js +15 -0
- package/dest/bigint-buffer/index.d.ts +1 -3
- package/dest/bigint-buffer/index.d.ts.map +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 +54 -0
- package/dest/branded-types/checkpoint_number.d.ts.map +1 -0
- package/dest/branded-types/checkpoint_number.js +77 -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 +77 -0
- package/dest/buffer/buffer16.d.ts.map +1 -0
- package/dest/buffer/buffer16.js +102 -0
- package/dest/buffer/buffer32.d.ts +5 -12
- package/dest/buffer/buffer32.d.ts.map +1 -1
- package/dest/buffer/buffer32.js +9 -7
- package/dest/buffer/index.d.ts +2 -1
- package/dest/buffer/index.d.ts.map +1 -1
- package/dest/buffer/index.js +1 -0
- package/dest/collection/array.d.ts +17 -4
- package/dest/collection/array.d.ts.map +1 -1
- package/dest/collection/array.js +57 -3
- package/dest/collection/index.d.ts +1 -1
- package/dest/collection/object.d.ts +17 -1
- package/dest/collection/object.d.ts.map +1 -1
- package/dest/collection/object.js +25 -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 +58 -4
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +129 -12
- 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 +3 -0
- package/dest/config/network_name.d.ts.map +1 -0
- package/dest/config/network_name.js +19 -0
- package/dest/config/parse-env.d.ts +3 -0
- package/dest/config/parse-env.d.ts.map +1 -0
- package/dest/config/parse-env.js +7 -0
- package/dest/config/secret_value.d.ts +28 -0
- package/dest/config/secret_value.d.ts.map +1 -0
- package/dest/config/secret_value.js +36 -0
- package/dest/crypto/aes128/index.d.ts +3 -5
- 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 +3 -3
- package/dest/crypto/ecdsa/index.d.ts.map +1 -1
- package/dest/crypto/ecdsa/index.js +62 -48
- package/dest/crypto/ecdsa/signature.d.ts +3 -14
- 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 -15
- 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 +3 -5
- package/dest/crypto/keccak/index.d.ts.map +1 -1
- package/dest/crypto/keys/index.d.ts +2 -4
- 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 +3 -5
- package/dest/crypto/pedersen/pedersen.noble.d.ts.map +1 -1
- package/dest/crypto/pedersen/pedersen.wasm.d.ts +4 -6
- 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 -4
- 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 +2 -4
- package/dest/crypto/random/index.d.ts.map +1 -1
- package/dest/crypto/random/index.js +2 -34
- package/dest/crypto/random/randomness_singleton.d.ts +2 -4
- package/dest/crypto/random/randomness_singleton.d.ts.map +1 -1
- package/dest/crypto/random/randomness_singleton.js +3 -3
- 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 +5 -7
- 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 +5 -7
- 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 +56 -5
- package/dest/crypto/secp256k1-signer/utils.d.ts.map +1 -1
- package/dest/crypto/secp256k1-signer/utils.js +92 -6
- package/dest/crypto/serialize.d.ts +5 -7
- package/dest/crypto/serialize.d.ts.map +1 -1
- package/dest/crypto/sha256/index.d.ts +23 -6
- package/dest/crypto/sha256/index.d.ts.map +1 -1
- package/dest/crypto/sha256/index.js +43 -1
- package/dest/crypto/sha512/index.d.ts +3 -5
- 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 -4
- 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 +4 -6
- 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 -4
- package/dest/crypto/sync/poseidon/index.d.ts.map +1 -1
- package/dest/crypto/sync/poseidon/index.js +28 -13
- package/dest/curves/bls12/field.d.ts +148 -0
- package/dest/curves/bls12/field.d.ts.map +1 -0
- package/dest/curves/bls12/field.js +362 -0
- 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/curves/bls12/point.d.ts +220 -0
- package/dest/curves/bls12/point.d.ts.map +1 -0
- package/dest/curves/bls12/point.js +400 -0
- 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} +90 -62
- 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 +15 -17
- package/dest/curves/grumpkin/point.d.ts.map +1 -0
- package/dest/{fields → curves/grumpkin}/point.js +27 -10
- 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 +18 -9
- package/dest/eth-address/index.d.ts.map +1 -1
- package/dest/eth-address/index.js +31 -2
- package/dest/eth-signature/eth_signature.d.ts +17 -18
- package/dest/eth-signature/eth_signature.d.ts.map +1 -1
- package/dest/eth-signature/eth_signature.js +31 -17
- package/dest/eth-signature/index.d.ts +1 -1
- package/dest/fs/index.d.ts +2 -1
- package/dest/fs/index.d.ts.map +1 -1
- package/dest/fs/index.js +1 -0
- package/dest/fs/run_in_dir.d.ts +1 -1
- package/dest/fs/try_rm_dir.d.ts +3 -0
- package/dest/fs/try_rm_dir.d.ts.map +1 -0
- package/dest/fs/try_rm_dir.js +16 -0
- package/dest/iterable/all.d.ts +1 -1
- package/dest/iterable/filter.d.ts +1 -1
- package/dest/iterable/filter.js +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/map.js +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/jest/env.js +48 -0
- package/dest/jest/setupAfterEnv.js +3 -0
- package/dest/json-rpc/client/fetch.d.ts +3 -3
- package/dest/json-rpc/client/fetch.d.ts.map +1 -1
- package/dest/json-rpc/client/fetch.js +16 -30
- package/dest/json-rpc/client/index.d.ts +1 -1
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts +10 -4
- package/dest/json-rpc/client/safe_json_rpc_client.d.ts.map +1 -1
- package/dest/json-rpc/client/safe_json_rpc_client.js +173 -13
- package/dest/json-rpc/client/undici.d.ts +1 -1
- package/dest/json-rpc/client/undici.d.ts.map +1 -1
- package/dest/json-rpc/client/undici.js +6 -7
- package/dest/json-rpc/convert.d.ts +3 -10
- package/dest/json-rpc/convert.d.ts.map +1 -1
- package/dest/json-rpc/convert.js +1 -9
- package/dest/json-rpc/errors.d.ts +4 -0
- package/dest/json-rpc/errors.d.ts.map +1 -0
- package/dest/json-rpc/errors.js +6 -0
- package/dest/json-rpc/fixtures/class_a.d.ts +4 -2
- package/dest/json-rpc/fixtures/class_a.d.ts.map +1 -1
- package/dest/json-rpc/fixtures/class_b.d.ts +4 -2
- 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 +3 -2
- package/dest/json-rpc/index.d.ts.map +1 -1
- package/dest/json-rpc/index.js +2 -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 +22 -23
- package/dest/json-rpc/server/safe_json_rpc_server.d.ts.map +1 -1
- package/dest/json-rpc/server/safe_json_rpc_server.js +161 -56
- package/dest/json-rpc/test/index.d.ts +1 -1
- package/dest/json-rpc/test/integration.d.ts +2 -3
- package/dest/json-rpc/test/integration.d.ts.map +1 -1
- package/dest/log/console.d.ts +1 -1
- package/dest/log/console.d.ts.map +1 -1
- package/dest/log/gcloud-logger-config.d.ts +1 -2
- package/dest/log/gcloud-logger-config.d.ts.map +1 -1
- package/dest/log/gcloud-logger-config.js +1 -9
- package/dest/log/index.d.ts +5 -5
- package/dest/log/index.d.ts.map +1 -1
- package/dest/log/index.js +4 -4
- package/dest/log/libp2p_logger.d.ts +1 -1
- package/dest/log/libp2p_logger.js +13 -2
- 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 +14 -0
- package/dest/log/noir_debug_log_util.d.ts.map +1 -0
- package/dest/log/noir_debug_log_util.js +14 -0
- package/dest/log/pino-logger.d.ts +4 -4
- package/dest/log/pino-logger.d.ts.map +1 -1
- package/dest/log/pino-logger.js +29 -3
- 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/mutex/mutex_database.d.ts.map +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 +3 -0
- package/dest/number/index.d.ts.map +1 -0
- package/dest/number/index.js +12 -0
- 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 +2 -2
- package/dest/promise/running-promise.d.ts.map +1 -1
- package/dest/promise/running-promise.js +2 -2
- 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 +2 -2
- package/dest/queue/batch_queue.d.ts.map +1 -1
- package/dest/queue/batch_queue.js +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 +3 -3
- package/dest/queue/serial_queue.d.ts.map +1 -1
- package/dest/queue/serial_queue.js +7 -5
- package/dest/retry/index.d.ts +4 -3
- package/dest/retry/index.d.ts.map +1 -1
- package/dest/retry/index.js +2 -2
- package/dest/running-promise/index.d.ts +1 -1
- package/dest/schemas/api.d.ts +1 -1
- package/dest/schemas/api.d.ts.map +1 -1
- package/dest/schemas/index.d.ts +1 -1
- package/dest/schemas/parse.d.ts +1 -1
- package/dest/schemas/parse.js +1 -1
- package/dest/schemas/schemas.d.ts +21 -20
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +29 -11
- 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 -6
- package/dest/schemas/utils.d.ts.map +1 -1
- package/dest/schemas/utils.js +15 -5
- package/dest/serialize/buffer_reader.d.ts +28 -3
- package/dest/serialize/buffer_reader.d.ts.map +1 -1
- package/dest/serialize/buffer_reader.js +44 -2
- package/dest/serialize/field_reader.d.ts +12 -3
- package/dest/serialize/field_reader.d.ts.map +1 -1
- package/dest/serialize/field_reader.js +19 -2
- package/dest/serialize/free_funcs.d.ts +25 -23
- package/dest/serialize/free_funcs.d.ts.map +1 -1
- package/dest/serialize/free_funcs.js +22 -28
- package/dest/serialize/index.d.ts +1 -1
- package/dest/serialize/serialize.d.ts +6 -7
- 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 +8 -3
- package/dest/string/index.d.ts.map +1 -1
- package/dest/string/index.js +27 -1
- package/dest/testing/files/index.d.ts +2 -3
- package/dest/testing/files/index.d.ts.map +1 -1
- package/dest/testing/files/index.js +3 -3
- 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 +4 -2
- package/dest/timer/date.d.ts.map +1 -1
- package/dest/timer/date.js +8 -3
- package/dest/timer/elapsed.d.ts +1 -1
- package/dest/timer/index.d.ts +2 -2
- package/dest/timer/index.d.ts.map +1 -1
- package/dest/timer/index.js +1 -1
- package/dest/timer/timeout.d.ts +19 -6
- package/dest/timer/timeout.d.ts.map +1 -1
- package/dest/timer/timeout.js +43 -22
- 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 -2
- package/dest/transport/index.d.ts.map +1 -1
- package/dest/transport/index.js +0 -1
- package/dest/transport/interface/connector.d.ts +1 -1
- package/dest/transport/interface/connector.d.ts.map +1 -1
- package/dest/transport/interface/listener.d.ts +1 -2
- package/dest/transport/interface/listener.d.ts.map +1 -1
- package/dest/transport/interface/socket.d.ts +1 -1
- package/dest/transport/interface/socket.d.ts.map +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 -2
- package/dest/transport/node/node_connector.d.ts.map +1 -1
- package/dest/transport/node/node_connector_socket.d.ts +1 -2
- package/dest/transport/node/node_connector_socket.d.ts.map +1 -1
- package/dest/transport/node/node_listener.d.ts +1 -2
- package/dest/transport/node/node_listener.d.ts.map +1 -1
- package/dest/transport/node/node_listener_socket.d.ts +1 -2
- package/dest/transport/node/node_listener_socket.d.ts.map +1 -1
- package/dest/transport/transport_client.d.ts +1 -2
- 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 +5 -7
- package/dest/trees/hasher.d.ts.map +1 -1
- package/dest/trees/index.d.ts +3 -1
- package/dest/trees/index.d.ts.map +1 -1
- package/dest/trees/index.js +2 -0
- package/dest/trees/indexed_merkle_tree.d.ts +1 -3
- 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 +2 -4
- package/dest/trees/indexed_merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/indexed_tree_leaf.d.ts +1 -3
- package/dest/trees/indexed_tree_leaf.d.ts.map +1 -1
- package/dest/trees/membership_witness.d.ts +6 -11
- package/dest/trees/membership_witness.d.ts.map +1 -1
- package/dest/trees/membership_witness.js +14 -1
- package/dest/trees/merkle_tree.d.ts +1 -3
- package/dest/trees/merkle_tree.d.ts.map +1 -1
- package/dest/trees/merkle_tree_calculator.d.ts +2 -4
- package/dest/trees/merkle_tree_calculator.d.ts.map +1 -1
- package/dest/trees/merkle_tree_calculator.js +1 -1
- package/dest/trees/sibling_path.d.ts +6 -42
- 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 +25 -10
- package/dest/trees/unbalanced_merkle_tree.d.ts.map +1 -1
- package/dest/trees/unbalanced_merkle_tree.js +78 -50
- package/dest/trees/unbalanced_merkle_tree_calculator.d.ts +48 -0
- package/dest/trees/unbalanced_merkle_tree_calculator.d.ts.map +1 -0
- package/dest/trees/unbalanced_merkle_tree_calculator.js +154 -0
- 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 +28 -3
- 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/url/index.d.ts.map +1 -1
- package/dest/url/index.js +1 -1
- package/dest/validation/index.d.ts +1 -1
- package/package.json +59 -45
- package/src/array/array.ts +13 -16
- package/src/array/index.ts +1 -0
- package/src/array/sorted_array.ts +133 -0
- package/src/async-pool/index.ts +1 -0
- package/src/bigint/index.ts +20 -0
- package/src/branded-types/block_number.ts +112 -0
- package/src/branded-types/checkpoint_number.ts +115 -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 +133 -0
- package/src/buffer/buffer32.ts +10 -8
- package/src/buffer/index.ts +1 -0
- package/src/collection/array.ts +66 -4
- package/src/collection/object.ts +37 -0
- package/src/config/env_var.ts +177 -58
- package/src/config/index.ts +209 -10
- package/src/config/network_config.ts +18 -0
- package/src/config/network_name.ts +28 -0
- package/src/config/parse-env.ts +4 -0
- package/src/config/secret_value.ts +49 -0
- 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 +41 -23
- 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/random/index.ts +2 -40
- package/src/crypto/random/randomness_singleton.ts +2 -4
- 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 +120 -7
- package/src/crypto/sha256/index.ts +48 -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/curves/bls12/field.ts +463 -0
- package/src/curves/bls12/index.ts +2 -0
- package/src/curves/bls12/point.ts +450 -0
- package/src/{fields/fields.ts → curves/bn254/field.ts} +84 -63
- 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 +27 -10
- package/src/eth-address/index.ts +35 -3
- package/src/eth-signature/eth_signature.ts +44 -22
- package/src/fs/index.ts +1 -0
- package/src/fs/try_rm_dir.ts +15 -0
- package/src/iterable/filter.ts +1 -1
- package/src/iterable/map.ts +1 -1
- package/src/iterator/filter.ts +11 -0
- package/src/iterator/index.ts +1 -0
- package/src/jest/env.mjs +52 -0
- package/src/jest/setupAfterEnv.mjs +3 -0
- package/src/json-rpc/client/fetch.ts +14 -33
- package/src/json-rpc/client/safe_json_rpc_client.ts +226 -13
- package/src/json-rpc/client/undici.ts +8 -15
- package/src/json-rpc/convert.ts +3 -12
- package/src/json-rpc/errors.ts +6 -0
- package/src/json-rpc/fixtures/class_a.ts +4 -1
- package/src/json-rpc/fixtures/class_b.ts +4 -1
- package/src/json-rpc/index.ts +2 -1
- package/src/json-rpc/server/safe_json_rpc_server.ts +141 -48
- package/src/json-rpc/test/integration.ts +1 -1
- package/src/log/console.ts +4 -1
- package/src/log/gcloud-logger-config.ts +3 -7
- package/src/log/index.ts +4 -4
- package/src/log/libp2p_logger.ts +21 -2
- package/src/log/log_fn.ts +1 -1
- package/src/log/noir_debug_log_util.ts +21 -0
- package/src/log/pino-logger.ts +35 -3
- package/src/message/index.ts +5 -1
- package/src/mutex/mutex_database.ts +2 -3
- package/src/number/index.ts +14 -0
- package/src/profiler/index.ts +1 -0
- package/src/profiler/profiler.ts +125 -0
- package/src/promise/running-promise.ts +2 -2
- package/src/queue/batch_queue.ts +1 -1
- package/src/queue/bounded_serial_queue.ts +4 -1
- package/src/queue/serial_queue.ts +5 -5
- package/src/retry/index.ts +10 -5
- package/src/schemas/api.ts +4 -4
- package/src/schemas/parse.ts +1 -1
- package/src/schemas/schemas.ts +42 -13
- package/src/schemas/types.ts +33 -0
- package/src/schemas/utils.ts +21 -8
- package/src/serialize/buffer_reader.ts +60 -3
- package/src/serialize/field_reader.ts +28 -4
- package/src/serialize/free_funcs.ts +26 -32
- package/src/serialize/serialize.ts +3 -1
- package/src/sleep/index.ts +6 -0
- package/src/string/index.ts +36 -1
- package/src/testing/files/index.ts +7 -3
- package/src/testing/formatting.ts +3 -0
- package/src/testing/index.ts +1 -0
- package/src/timer/date.ts +13 -3
- package/src/timer/index.ts +1 -1
- package/src/timer/timeout.ts +54 -19
- package/src/transport/index.ts +0 -1
- package/src/transport/interface/connector.ts +0 -1
- package/src/transport/interface/listener.ts +2 -3
- package/src/transport/interface/socket.ts +2 -3
- package/src/transport/transport_client.ts +3 -4
- package/src/transport/transport_server.ts +4 -1
- package/src/trees/balanced_merkle_tree.ts +84 -0
- package/src/trees/hasher.ts +4 -4
- package/src/trees/index.ts +2 -0
- package/src/trees/indexed_merkle_tree.ts +6 -2
- package/src/trees/indexed_merkle_tree_calculator.ts +2 -2
- package/src/trees/membership_witness.ts +14 -1
- package/src/trees/merkle_tree.ts +4 -1
- package/src/trees/merkle_tree_calculator.ts +10 -5
- package/src/trees/sibling_path.ts +2 -2
- package/src/trees/unbalanced_merkle_tree.ts +112 -42
- package/src/trees/unbalanced_merkle_tree_calculator.ts +177 -0
- package/src/trees/unbalanced_tree_store.ts +5 -1
- package/src/types/index.ts +30 -4
- package/src/url/index.ts +0 -1
- 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/crypto/pedersen/pedersen.elliptic.d.ts +0 -13
- package/dest/crypto/pedersen/pedersen.elliptic.d.ts.map +0 -1
- package/dest/crypto/pedersen/pedersen.elliptic.js +0 -582
- package/dest/fields/coordinate.d.ts +0 -68
- package/dest/fields/coordinate.d.ts.map +0 -1
- package/dest/fields/coordinate.js +0 -96
- package/dest/fields/fields.d.ts +0 -176
- package/dest/fields/fields.d.ts.map +0 -1
- package/dest/fields/index.d.ts +0 -4
- package/dest/fields/index.d.ts.map +0 -1
- package/dest/fields/index.js +0 -3
- package/dest/fields/point.d.ts.map +0 -1
- package/dest/index.d.ts +0 -31
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -31
- 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/dest/log/debug.d.ts +0 -56
- package/dest/log/debug.d.ts.map +0 -1
- package/dest/log/debug.js +0 -75
- package/dest/log/log_history.d.ts +0 -31
- package/dest/log/log_history.d.ts.map +0 -1
- package/dest/log/log_history.js +0 -38
- package/dest/transport/browser/index.d.ts +0 -5
- package/dest/transport/browser/index.d.ts.map +0 -1
- package/dest/transport/browser/index.js +0 -4
- package/dest/transport/browser/message_port_socket.d.ts +0 -37
- package/dest/transport/browser/message_port_socket.d.ts.map +0 -1
- package/dest/transport/browser/message_port_socket.js +0 -42
- package/dest/transport/browser/shared_worker_connector.d.ts +0 -19
- package/dest/transport/browser/shared_worker_connector.d.ts.map +0 -1
- package/dest/transport/browser/shared_worker_connector.js +0 -19
- package/dest/transport/browser/shared_worker_listener.d.ts +0 -38
- package/dest/transport/browser/shared_worker_listener.d.ts.map +0 -1
- package/dest/transport/browser/shared_worker_listener.js +0 -33
- package/dest/transport/browser/worker_connector.d.ts +0 -26
- package/dest/transport/browser/worker_connector.d.ts.map +0 -1
- package/dest/transport/browser/worker_connector.js +0 -30
- package/dest/transport/browser/worker_listener.d.ts +0 -39
- package/dest/transport/browser/worker_listener.d.ts.map +0 -1
- package/dest/transport/browser/worker_listener.js +0 -35
- package/dest/wasm/empty_wasi_sdk.d.ts +0 -130
- package/dest/wasm/empty_wasi_sdk.d.ts.map +0 -1
- package/dest/wasm/empty_wasi_sdk.js +0 -148
- package/dest/wasm/index.d.ts +0 -2
- package/dest/wasm/index.d.ts.map +0 -1
- package/dest/wasm/index.js +0 -1
- package/dest/wasm/wasm_module.d.ts +0 -136
- package/dest/wasm/wasm_module.d.ts.map +0 -1
- package/dest/wasm/wasm_module.js +0 -196
- package/dest/worker/browser/index.d.ts +0 -3
- package/dest/worker/browser/index.d.ts.map +0 -1
- package/dest/worker/browser/index.js +0 -2
- package/dest/worker/browser/start_web_module.d.ts +0 -7
- package/dest/worker/browser/start_web_module.d.ts.map +0 -1
- package/dest/worker/browser/start_web_module.js +0 -27
- package/dest/worker/browser/web_data_store.d.ts +0 -24
- package/dest/worker/browser/web_data_store.d.ts.map +0 -1
- package/dest/worker/browser/web_data_store.js +0 -29
- package/dest/worker/browser/web_worker.d.ts +0 -10
- package/dest/worker/browser/web_worker.d.ts.map +0 -1
- package/dest/worker/browser/web_worker.js +0 -25
- package/dest/worker/data_store.d.ts +0 -21
- package/dest/worker/data_store.d.ts.map +0 -1
- package/dest/worker/data_store.js +0 -3
- package/dest/worker/index.d.ts +0 -3
- package/dest/worker/index.d.ts.map +0 -1
- package/dest/worker/index.js +0 -1
- package/dest/worker/node/index.d.ts +0 -3
- package/dest/worker/node/index.d.ts.map +0 -1
- package/dest/worker/node/index.js +0 -2
- package/dest/worker/node/node_data_store.d.ts +0 -13
- package/dest/worker/node/node_data_store.d.ts.map +0 -1
- package/dest/worker/node/node_data_store.js +0 -20
- package/dest/worker/node/node_worker.d.ts +0 -6
- package/dest/worker/node/node_worker.d.ts.map +0 -1
- package/dest/worker/node/node_worker.js +0 -22
- package/dest/worker/node/start_node_module.d.ts +0 -7
- package/dest/worker/node/start_node_module.d.ts.map +0 -1
- package/dest/worker/node/start_node_module.js +0 -31
- package/dest/worker/wasm_worker.d.ts +0 -9
- package/dest/worker/wasm_worker.d.ts.map +0 -1
- package/dest/worker/wasm_worker.js +0 -3
- package/dest/worker/worker_pool.d.ts +0 -40
- package/dest/worker/worker_pool.d.ts.map +0 -1
- package/dest/worker/worker_pool.js +0 -51
- package/src/crypto/index.ts +0 -14
- package/src/crypto/pedersen/pedersen.elliptic.ts +0 -584
- package/src/fields/coordinate.ts +0 -104
- package/src/fields/index.ts +0 -3
- package/src/index.ts +0 -31
- package/src/json-rpc/server/telemetry.ts +0 -0
- package/src/log/debug.ts +0 -104
- package/src/log/log_history.ts +0 -44
- package/src/transport/browser/index.ts +0 -4
- package/src/transport/browser/message_port_socket.ts +0 -48
- package/src/transport/browser/shared_worker_connector.ts +0 -21
- package/src/transport/browser/shared_worker_listener.ts +0 -53
- package/src/transport/browser/worker_connector.ts +0 -30
- package/src/transport/browser/worker_listener.ts +0 -54
- package/src/wasm/README.md +0 -6
- package/src/wasm/empty_wasi_sdk.ts +0 -166
- package/src/wasm/fixtures/gcd.wasm +0 -0
- package/src/wasm/fixtures/gcd.wat +0 -27
- package/src/wasm/index.ts +0 -1
- package/src/wasm/wasm_module.ts +0 -260
- package/src/worker/browser/index.ts +0 -2
- package/src/worker/browser/start_web_module.ts +0 -24
- package/src/worker/browser/web_data_store.ts +0 -38
- package/src/worker/browser/web_worker.ts +0 -25
- package/src/worker/data_store.ts +0 -19
- package/src/worker/index.ts +0 -2
- package/src/worker/node/index.ts +0 -2
- package/src/worker/node/node_data_store.ts +0 -27
- package/src/worker/node/node_worker.ts +0 -23
- package/src/worker/node/start_node_module.ts +0 -30
- package/src/worker/wasm_worker.ts +0 -7
- package/src/worker/worker_pool.ts +0 -73
|
@@ -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,176 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
-
import { inspect } from 'util';
|
|
5
|
-
import { BufferReader } from '../serialize/buffer_reader.js';
|
|
6
|
-
/**
|
|
7
|
-
* Represents a field derived from BaseField.
|
|
8
|
-
*/
|
|
9
|
-
type DerivedField<T extends BaseField> = {
|
|
10
|
-
new (value: any): T;
|
|
11
|
-
/**
|
|
12
|
-
* All derived fields will specify a MODULUS.
|
|
13
|
-
*/
|
|
14
|
-
MODULUS: bigint;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Base field class.
|
|
18
|
-
* Conversions from Buffer to BigInt and vice-versa are not cheap.
|
|
19
|
-
* We allow construction with either form and lazily convert to other as needed.
|
|
20
|
-
* We only check we are within the field modulus when initializing with bigint.
|
|
21
|
-
*/
|
|
22
|
-
declare abstract class BaseField {
|
|
23
|
-
static SIZE_IN_BYTES: number;
|
|
24
|
-
private asBuffer?;
|
|
25
|
-
private asBigInt?;
|
|
26
|
-
/**
|
|
27
|
-
* Return bigint representation.
|
|
28
|
-
* @deprecated Just to get things compiling. Use toBigInt().
|
|
29
|
-
* */
|
|
30
|
-
get value(): bigint;
|
|
31
|
-
/** Returns the size in bytes. */
|
|
32
|
-
get size(): number;
|
|
33
|
-
protected constructor(value: number | bigint | boolean | BaseField | Buffer);
|
|
34
|
-
protected abstract modulus(): bigint;
|
|
35
|
-
/**
|
|
36
|
-
* We return a copy of the Buffer to ensure this remains immutable.
|
|
37
|
-
*/
|
|
38
|
-
toBuffer(): Buffer;
|
|
39
|
-
toString(): `0x${string}`;
|
|
40
|
-
toBigInt(): bigint;
|
|
41
|
-
toBool(): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Converts this field to a number.
|
|
44
|
-
* Throws if the underlying value is greater than MAX_SAFE_INTEGER.
|
|
45
|
-
*/
|
|
46
|
-
toNumber(): number;
|
|
47
|
-
/**
|
|
48
|
-
* Converts this field to a number.
|
|
49
|
-
* May cause loss of precision if the underlying value is greater than MAX_SAFE_INTEGER.
|
|
50
|
-
*/
|
|
51
|
-
toNumberUnsafe(): number;
|
|
52
|
-
toShortString(): string;
|
|
53
|
-
equals(rhs: BaseField): boolean;
|
|
54
|
-
lt(rhs: BaseField): boolean;
|
|
55
|
-
cmp(rhs: BaseField): -1 | 0 | 1;
|
|
56
|
-
isZero(): boolean;
|
|
57
|
-
isEmpty(): boolean;
|
|
58
|
-
toFriendlyJSON(): string;
|
|
59
|
-
toField(): this;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Constructs a field from a Buffer of BufferReader.
|
|
63
|
-
* It maybe not read the full 32 bytes if the Buffer is shorter, but it will padded in BaseField constructor.
|
|
64
|
-
*/
|
|
65
|
-
export declare function fromBuffer<T extends BaseField>(buffer: Buffer | BufferReader, f: DerivedField<T>): T;
|
|
66
|
-
/** Branding to ensure fields are not interchangeable types. */
|
|
67
|
-
export interface Fr {
|
|
68
|
-
/** Brand. */
|
|
69
|
-
_branding: 'Fr';
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Fr field class.
|
|
73
|
-
* @dev This class is used to represent elements of BN254 scalar field or elements in the base field of Grumpkin.
|
|
74
|
-
* (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)
|
|
75
|
-
*/
|
|
76
|
-
export declare class Fr extends BaseField {
|
|
77
|
-
static ZERO: Fr;
|
|
78
|
-
static ONE: Fr;
|
|
79
|
-
static MODULUS: bigint;
|
|
80
|
-
static MAX_FIELD_VALUE: Fr;
|
|
81
|
-
constructor(value: number | bigint | boolean | Fr | Buffer);
|
|
82
|
-
[inspect.custom](): string;
|
|
83
|
-
protected modulus(): bigint;
|
|
84
|
-
static random(): Fr;
|
|
85
|
-
static zero(): Fr;
|
|
86
|
-
static isZero(value: Fr): boolean;
|
|
87
|
-
static fromBuffer(buffer: Buffer | BufferReader): Fr;
|
|
88
|
-
static fromBufferReduce(buffer: Buffer): Fr;
|
|
89
|
-
/**
|
|
90
|
-
* Creates a Fr instance from a string.
|
|
91
|
-
* @param buf - the string to create a Fr from.
|
|
92
|
-
* @returns the Fr instance
|
|
93
|
-
* @remarks if the string only consists of numbers, we assume we are parsing a bigint,
|
|
94
|
-
* otherwise we require the hex string to be prepended with "0x", to ensure there is no misunderstanding
|
|
95
|
-
* as to what is being parsed.
|
|
96
|
-
*/
|
|
97
|
-
static fromString(buf: string): Fr;
|
|
98
|
-
/**
|
|
99
|
-
* Creates a Fr instance from a hex string.
|
|
100
|
-
* @param buf - a hex encoded string.
|
|
101
|
-
* @returns the Fr instance
|
|
102
|
-
*/
|
|
103
|
-
static fromHexString(buf: string): Fr;
|
|
104
|
-
/** Arithmetic */
|
|
105
|
-
add(rhs: Fr): Fr;
|
|
106
|
-
square(): Fr;
|
|
107
|
-
negate(): Fr;
|
|
108
|
-
sub(rhs: Fr): Fr;
|
|
109
|
-
mul(rhs: Fr): Fr;
|
|
110
|
-
div(rhs: Fr): Fr;
|
|
111
|
-
ediv(rhs: Fr): Fr;
|
|
112
|
-
/**
|
|
113
|
-
* Computes a square root of the field element.
|
|
114
|
-
* @returns A square root of the field element (null if it does not exist).
|
|
115
|
-
*/
|
|
116
|
-
sqrt(): Promise<Fr | null>;
|
|
117
|
-
toJSON(): `0x${string}`;
|
|
118
|
-
static get schema(): import("zod").ZodType<Fr, any, string>;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Branding to ensure fields are not interchangeable types.
|
|
122
|
-
*/
|
|
123
|
-
export interface Fq {
|
|
124
|
-
/** Brand. */
|
|
125
|
-
_branding: 'Fq';
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Fq field class.
|
|
129
|
-
* @dev This class is used to represent elements of BN254 base field or elements in the scalar field of Grumpkin.
|
|
130
|
-
* (Grumpkin's scalar field corresponds to BN254's base field and vice versa.)
|
|
131
|
-
*/
|
|
132
|
-
export declare class Fq extends BaseField {
|
|
133
|
-
static ZERO: Fq;
|
|
134
|
-
static MODULUS: bigint;
|
|
135
|
-
private static HIGH_SHIFT;
|
|
136
|
-
private static LOW_MASK;
|
|
137
|
-
[inspect.custom](): string;
|
|
138
|
-
get lo(): Fr;
|
|
139
|
-
get hi(): Fr;
|
|
140
|
-
constructor(value: number | bigint | boolean | Fq | Buffer);
|
|
141
|
-
protected modulus(): bigint;
|
|
142
|
-
static random(): Fq;
|
|
143
|
-
static zero(): Fq;
|
|
144
|
-
static fromBuffer(buffer: Buffer | BufferReader): Fq;
|
|
145
|
-
static fromBufferReduce(buffer: Buffer): Fq;
|
|
146
|
-
/**
|
|
147
|
-
* Creates a Fq instance from a string.
|
|
148
|
-
* @param buf - the string to create a Fq from.
|
|
149
|
-
* @returns the Fq instance
|
|
150
|
-
* @remarks if the string only consists of numbers, we assume we are parsing a bigint,
|
|
151
|
-
* otherwise we require the hex string to be prepended with "0x", to ensure there is no misunderstanding
|
|
152
|
-
* as to what is being parsed.
|
|
153
|
-
*/
|
|
154
|
-
static fromString(buf: string): Fq;
|
|
155
|
-
/**
|
|
156
|
-
* Creates a Fq instance from a hex string.
|
|
157
|
-
* @param buf - a hex encoded string.
|
|
158
|
-
* @returns the Fq instance
|
|
159
|
-
*/
|
|
160
|
-
static fromHexString(buf: string): Fq;
|
|
161
|
-
static fromHighLow(high: Fr, low: Fr): Fq;
|
|
162
|
-
add(rhs: Fq): Fq;
|
|
163
|
-
toJSON(): `0x${string}`;
|
|
164
|
-
static get schema(): import("zod").ZodType<Fq, any, string>;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* GrumpkinScalar is an Fq.
|
|
168
|
-
* @remarks Called GrumpkinScalar because it is used to represent elements in Grumpkin's scalar field as defined in
|
|
169
|
-
* the Aztec Protocol Specs.
|
|
170
|
-
*/
|
|
171
|
-
export type GrumpkinScalar = Fq;
|
|
172
|
-
export declare const GrumpkinScalar: typeof Fq;
|
|
173
|
-
/** Wraps a function that returns a buffer so that all results are reduced into a field of the given type. */
|
|
174
|
-
export declare function reduceFn<TInput, TField extends BaseField>(fn: (input: TInput) => Buffer, field: DerivedField<TField>): (input: TInput) => TField;
|
|
175
|
-
export {};
|
|
176
|
-
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/fields/fields.ts"],"names":[],"mappings":";;;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAA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AAC,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;;;;;;;IAMnB;;;;;;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,31 +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 wasm from './wasm/index.js';
|
|
26
|
-
export * as worker from './worker/index.js';
|
|
27
|
-
export * as testing from './testing/index.js';
|
|
28
|
-
export * as config from './config/index.js';
|
|
29
|
-
export * as buffer from './buffer/index.js';
|
|
30
|
-
export * as ethSignature from './eth-signature/index.js';
|
|
31
|
-
//# 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,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,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,31 +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 wasm from './wasm/index.js';
|
|
27
|
-
export * as worker from './worker/index.js';
|
|
28
|
-
export * as testing from './testing/index.js';
|
|
29
|
-
export * as config from './config/index.js';
|
|
30
|
-
export * as buffer from './buffer/index.js';
|
|
31
|
-
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/dest/log/debug.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { LogFn } from './log_fn.js';
|
|
2
|
-
/**
|
|
3
|
-
* Return a logger, meant to be silent by default and verbose during debugging.
|
|
4
|
-
* @param name - The module name of the logger.
|
|
5
|
-
* @returns A callable log function.
|
|
6
|
-
*/
|
|
7
|
-
export declare function createDebugOnlyLogger(name: string): LogFn;
|
|
8
|
-
/**
|
|
9
|
-
* Set a function to be called before each log message is handled by the debug logger.
|
|
10
|
-
* The hook function will receive the logger namespace and any arguments passed to the logger.
|
|
11
|
-
* This can be useful for adding additional context, filtering logs, or performing side-effects
|
|
12
|
-
* based on logged messages.
|
|
13
|
-
*
|
|
14
|
-
* @param fn - The function to be called before each log message.
|
|
15
|
-
*/
|
|
16
|
-
export declare function setPreDebugLogHook(fn: (...args: any[]) => void): void;
|
|
17
|
-
/**
|
|
18
|
-
* Set a callback function to be executed after each log is written by the debug logger.
|
|
19
|
-
* This allows additional behavior or side effects to occur after a log has been written,
|
|
20
|
-
* such as sending logs to external services, formatting output, or triggering events.
|
|
21
|
-
*
|
|
22
|
-
* @param fn - The callback function to be executed after each log. It receives the same arguments as the original log function call.
|
|
23
|
-
*/
|
|
24
|
-
export declare function setPostDebugLogHook(fn: (...args: any[]) => void): void;
|
|
25
|
-
/**
|
|
26
|
-
* Enable logs for the specified namespace(s) or wildcard pattern(s).
|
|
27
|
-
* This function activates the logging functionality for the given
|
|
28
|
-
* namespace(s) or pattern(s), allowing developers to selectively display
|
|
29
|
-
* debug logs that match the provided string(s).
|
|
30
|
-
*
|
|
31
|
-
* @param str - The namespace(s) or wildcard pattern(s) for which logs should be enabled.
|
|
32
|
-
*/
|
|
33
|
-
export declare function enableLogs(str: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Check if the logging is enabled for a given namespace.
|
|
36
|
-
* The input 'str' represents the namespace for which the log status is being checked.
|
|
37
|
-
* Returns true if the logging is enabled, otherwise false.
|
|
38
|
-
*
|
|
39
|
-
* @param str - The namespace string used to determine if logging is enabled.
|
|
40
|
-
* @returns A boolean indicating whether logging is enabled for the given namespace.
|
|
41
|
-
*/
|
|
42
|
-
export declare function isLogEnabled(str: string): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Format a debug string filling in `'{0}'` entries with their
|
|
45
|
-
* corresponding values from the args array, amd `'{}'` with the whole array.
|
|
46
|
-
*
|
|
47
|
-
* @param formatStr - str of form `'this is a string with some entries like {0} and {1}'`
|
|
48
|
-
* @param args - array of fields to fill in the string format entries with
|
|
49
|
-
* @returns formatted string
|
|
50
|
-
*/
|
|
51
|
-
interface Printable {
|
|
52
|
-
toString(): string;
|
|
53
|
-
}
|
|
54
|
-
export declare function applyStringFormatting(formatStr: string, args: Printable[]): string;
|
|
55
|
-
export {};
|
|
56
|
-
//# sourceMappingURL=debug.d.ts.map
|
package/dest/log/debug.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/log/debug.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAyBzC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAGzD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,QAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,QAE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,QAErC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,WAEvC;AAED;;;;;;;GAOG;AACH,UAAU,SAAS;IACjB,QAAQ,IAAI,MAAM,CAAC;CACpB;AACD,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAQlF"}
|
package/dest/log/debug.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import debug from 'debug';
|
|
2
|
-
let preLogHook;
|
|
3
|
-
let postLogHook;
|
|
4
|
-
/**
|
|
5
|
-
* Process and handle the logging of messages through custom hooks and the given logger.
|
|
6
|
-
* This function checks if the logger's namespace is enabled, executes any preLogHook functions, logs the message using the provided logger, and then executes any postLogHook functions.
|
|
7
|
-
*
|
|
8
|
-
* @param logger - The debug logger instance to be used for logging.
|
|
9
|
-
* @param args - The arguments to be passed to the logger and any hook functions.
|
|
10
|
-
*/ function theFunctionThroughWhichAllLogsPass(logger, ...args) {
|
|
11
|
-
if (!debug.enabled(logger.namespace)) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
if (preLogHook) {
|
|
15
|
-
preLogHook(logger.namespace, ...args);
|
|
16
|
-
}
|
|
17
|
-
logger(...args);
|
|
18
|
-
if (postLogHook) {
|
|
19
|
-
postLogHook(logger.namespace, ...args);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Return a logger, meant to be silent by default and verbose during debugging.
|
|
24
|
-
* @param name - The module name of the logger.
|
|
25
|
-
* @returns A callable log function.
|
|
26
|
-
*/ export function createDebugOnlyLogger(name) {
|
|
27
|
-
const logger = debug(name);
|
|
28
|
-
return (...args)=>theFunctionThroughWhichAllLogsPass(logger, ...args);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Set a function to be called before each log message is handled by the debug logger.
|
|
32
|
-
* The hook function will receive the logger namespace and any arguments passed to the logger.
|
|
33
|
-
* This can be useful for adding additional context, filtering logs, or performing side-effects
|
|
34
|
-
* based on logged messages.
|
|
35
|
-
*
|
|
36
|
-
* @param fn - The function to be called before each log message.
|
|
37
|
-
*/ export function setPreDebugLogHook(fn) {
|
|
38
|
-
preLogHook = fn;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Set a callback function to be executed after each log is written by the debug logger.
|
|
42
|
-
* This allows additional behavior or side effects to occur after a log has been written,
|
|
43
|
-
* such as sending logs to external services, formatting output, or triggering events.
|
|
44
|
-
*
|
|
45
|
-
* @param fn - The callback function to be executed after each log. It receives the same arguments as the original log function call.
|
|
46
|
-
*/ export function setPostDebugLogHook(fn) {
|
|
47
|
-
postLogHook = fn;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Enable logs for the specified namespace(s) or wildcard pattern(s).
|
|
51
|
-
* This function activates the logging functionality for the given
|
|
52
|
-
* namespace(s) or pattern(s), allowing developers to selectively display
|
|
53
|
-
* debug logs that match the provided string(s).
|
|
54
|
-
*
|
|
55
|
-
* @param str - The namespace(s) or wildcard pattern(s) for which logs should be enabled.
|
|
56
|
-
*/ export function enableLogs(str) {
|
|
57
|
-
debug.enable(str);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Check if the logging is enabled for a given namespace.
|
|
61
|
-
* The input 'str' represents the namespace for which the log status is being checked.
|
|
62
|
-
* Returns true if the logging is enabled, otherwise false.
|
|
63
|
-
*
|
|
64
|
-
* @param str - The namespace string used to determine if logging is enabled.
|
|
65
|
-
* @returns A boolean indicating whether logging is enabled for the given namespace.
|
|
66
|
-
*/ export function isLogEnabled(str) {
|
|
67
|
-
return debug.enabled(str);
|
|
68
|
-
}
|
|
69
|
-
export function applyStringFormatting(formatStr, args) {
|
|
70
|
-
return formatStr.replace(/{(\d+)}/g, (match, index)=>{
|
|
71
|
-
return typeof args[index] === 'undefined' ? match : args[index].toString();
|
|
72
|
-
}).replace(/{}/g, (_match, _index)=>{
|
|
73
|
-
return args.toString();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LogHistory is a utility class that provides the ability to store and manage debug logs.
|
|
3
|
-
* It can be enabled to record logs along with their timestamps, retrieve a specified number
|
|
4
|
-
* of recent logs, or clear stored logs based on a given count. This can be useful for debugging
|
|
5
|
-
* purposes, monitoring application activities, and maintaining log history.
|
|
6
|
-
*/
|
|
7
|
-
export declare class LogHistory {
|
|
8
|
-
private logs;
|
|
9
|
-
/**
|
|
10
|
-
* Enables the logging of debug messages with timestamps.
|
|
11
|
-
* Hooks into the pre-debug log and stores each log entry along with its timestamp in the logs array.
|
|
12
|
-
*/
|
|
13
|
-
enable(): void;
|
|
14
|
-
/**
|
|
15
|
-
* Retrieves a specified number of logs from the end of the log history or all logs if no argument is provided.
|
|
16
|
-
* The logs are ordered chronologically, with the oldest logs at the beginning of the array.
|
|
17
|
-
*
|
|
18
|
-
* @param last - Optional number representing the amount of recent logs to return. Defaults to 0, which returns all logs.
|
|
19
|
-
* @returns An array of log arrays, each containing a timestamp and log arguments.
|
|
20
|
-
*/
|
|
21
|
-
getLogs(last?: number): any[][];
|
|
22
|
-
/**
|
|
23
|
-
* Clear a specified number of logs from the beginning of the logs array.
|
|
24
|
-
* If no count is provided, it will clear all logs.
|
|
25
|
-
*
|
|
26
|
-
* @param count - The number of logs to be removed (default: total logs length).
|
|
27
|
-
*/
|
|
28
|
-
clear(count?: number): void;
|
|
29
|
-
}
|
|
30
|
-
export declare const logHistory: LogHistory;
|
|
31
|
-
//# sourceMappingURL=log_history.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log_history.d.ts","sourceRoot":"","sources":["../../src/log/log_history.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,IAAI,CAAe;IAE3B;;;OAGG;IACI,MAAM;IAMb;;;;;;OAMG;IACI,OAAO,CAAC,IAAI,SAAI;IAIvB;;;;;OAKG;IACI,KAAK,CAAC,KAAK,SAAmB;CAGtC;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
|
package/dest/log/log_history.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { setPreDebugLogHook } from './debug.js';
|
|
2
|
-
/**
|
|
3
|
-
* LogHistory is a utility class that provides the ability to store and manage debug logs.
|
|
4
|
-
* It can be enabled to record logs along with their timestamps, retrieve a specified number
|
|
5
|
-
* of recent logs, or clear stored logs based on a given count. This can be useful for debugging
|
|
6
|
-
* purposes, monitoring application activities, and maintaining log history.
|
|
7
|
-
*/ export class LogHistory {
|
|
8
|
-
logs = [];
|
|
9
|
-
/**
|
|
10
|
-
* Enables the logging of debug messages with timestamps.
|
|
11
|
-
* Hooks into the pre-debug log and stores each log entry along with its timestamp in the logs array.
|
|
12
|
-
*/ enable() {
|
|
13
|
-
setPreDebugLogHook((...args)=>{
|
|
14
|
-
this.logs.push([
|
|
15
|
-
new Date().toISOString(),
|
|
16
|
-
...args
|
|
17
|
-
]);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a specified number of logs from the end of the log history or all logs if no argument is provided.
|
|
22
|
-
* The logs are ordered chronologically, with the oldest logs at the beginning of the array.
|
|
23
|
-
*
|
|
24
|
-
* @param last - Optional number representing the amount of recent logs to return. Defaults to 0, which returns all logs.
|
|
25
|
-
* @returns An array of log arrays, each containing a timestamp and log arguments.
|
|
26
|
-
*/ getLogs(last = 0) {
|
|
27
|
-
return last ? this.logs.slice(-last) : this.logs;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Clear a specified number of logs from the beginning of the logs array.
|
|
31
|
-
* If no count is provided, it will clear all logs.
|
|
32
|
-
*
|
|
33
|
-
* @param count - The number of logs to be removed (default: total logs length).
|
|
34
|
-
*/ clear(count = this.logs.length) {
|
|
35
|
-
this.logs = this.logs.slice(count);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export const logHistory = new LogHistory();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Socket } from '../interface/socket.js';
|
|
2
|
-
/**
|
|
3
|
-
* An implementation of a TransportSocket using MessagePorts.
|
|
4
|
-
*/
|
|
5
|
-
export declare class MessagePortSocket implements Socket {
|
|
6
|
-
private port;
|
|
7
|
-
constructor(port: MessagePort);
|
|
8
|
-
/**
|
|
9
|
-
* Send a message to the connected MessagePort, optionally transferring ownership of certain objects.
|
|
10
|
-
* The 'msg' parameter can be any structured data type and will be sent to the other end of the MessagePort.
|
|
11
|
-
* The optional 'transfer' parameter is an array of Transferable objects whose ownership will be transferred,
|
|
12
|
-
* making them inaccessible on the sending side. This can improve performance for large data transfers.
|
|
13
|
-
*
|
|
14
|
-
* @param msg - The message to be sent through the MessagePort.
|
|
15
|
-
* @param transfer - An optional array of Transferable objects to transfer ownership.
|
|
16
|
-
* @returns A Promise that resolves when the message has been sent.
|
|
17
|
-
*/
|
|
18
|
-
send(msg: any, transfer?: Transferable[]): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Register a callback function to handle incoming messages from the MessagePort.
|
|
21
|
-
* The provided callback will be invoked with the message data whenever a new message arrives.
|
|
22
|
-
* Note that only one callback can be registered at a time. Subsequent calls to this method
|
|
23
|
-
* will overwrite the previously registered callback.
|
|
24
|
-
*
|
|
25
|
-
* @param cb - The callback function to handle incoming messages.
|
|
26
|
-
*/
|
|
27
|
-
registerHandler(cb: (msg: any) => any): void;
|
|
28
|
-
/**
|
|
29
|
-
* Close the MessagePort, unregister the message handler, and send an undefined message.
|
|
30
|
-
* The 'close' function is useful for gracefully shutting down a connection between two
|
|
31
|
-
* endpoints by sending an undefined message as an indication of disconnection before
|
|
32
|
-
* closing the port. After calling this method, the MessagePortSocket instance should not
|
|
33
|
-
* be used again.
|
|
34
|
-
*/
|
|
35
|
-
close(): void;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=message_port_socket.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message_port_socket.d.ts","sourceRoot":"","sources":["../../../src/transport/browser/message_port_socket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,qBAAa,iBAAkB,YAAW,MAAM;IAClC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC;;;;;;;;;OASG;IACH,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,GAAE,YAAY,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAAG,IAAI;IAI5C;;;;;;OAMG;IACH,KAAK;CAKN"}
|