@ozdao/prometheus-framework 0.1.66 → 0.1.67
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/_virtual/_commonjsHelpers.cjs +1 -1
- package/dist/_virtual/_commonjsHelpers.js +5 -3
- package/dist/_virtual/browser-ponyfill.cjs +1 -0
- package/dist/_virtual/browser-ponyfill.js +4 -0
- package/dist/_virtual/crc32.cjs +1 -0
- package/dist/_virtual/crc32.js +4 -0
- package/dist/_virtual/events.cjs +1 -0
- package/dist/_virtual/events.js +4 -0
- package/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/node_modules/@adraffy/ens-normalize/dist/index.cjs +1 -0
- package/dist/node_modules/@adraffy/ens-normalize/dist/index.js +557 -0
- package/dist/node_modules/@ethereumjs/rlp/dist/index.cjs +1 -0
- package/dist/node_modules/@ethereumjs/rlp/dist/index.js +164 -0
- package/dist/node_modules/@noble/curves/esm/_shortw_utils.cjs +1 -0
- package/dist/node_modules/@noble/curves/esm/_shortw_utils.js +19 -0
- package/dist/node_modules/@noble/curves/esm/abstract/curve.cjs +1 -0
- package/dist/node_modules/@noble/curves/esm/abstract/curve.js +88 -0
- package/dist/node_modules/@noble/curves/esm/abstract/modular.cjs +1 -0
- package/dist/node_modules/@noble/curves/esm/abstract/modular.js +210 -0
- package/dist/node_modules/@noble/curves/esm/abstract/utils.cjs +1 -0
- package/dist/node_modules/@noble/curves/esm/abstract/utils.js +178 -0
- package/dist/node_modules/@noble/curves/esm/abstract/weierstrass.cjs +1 -0
- package/dist/node_modules/@noble/curves/esm/abstract/weierstrass.js +581 -0
- package/dist/node_modules/@noble/curves/esm/secp256k1.cjs +1 -0
- package/dist/node_modules/@noble/curves/esm/secp256k1.js +47 -0
- package/dist/node_modules/@noble/hashes/esm/_assert.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/_assert.js +48 -0
- package/dist/node_modules/@noble/hashes/esm/_sha2.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/_sha2.js +61 -0
- package/dist/node_modules/@noble/hashes/esm/_u64.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/_u64.js +48 -0
- package/dist/node_modules/@noble/hashes/esm/crypto.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/crypto.js +4 -0
- package/dist/node_modules/@noble/hashes/esm/hmac.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/hmac.js +43 -0
- package/dist/node_modules/@noble/hashes/esm/pbkdf2.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/pbkdf2.js +32 -0
- package/dist/node_modules/@noble/hashes/esm/scrypt.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/scrypt.js +73 -0
- package/dist/node_modules/@noble/hashes/esm/sha256.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/sha256.js +120 -0
- package/dist/node_modules/@noble/hashes/esm/sha3.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/sha3.js +118 -0
- package/dist/node_modules/@noble/hashes/esm/sha512.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/sha512.js +144 -0
- package/dist/node_modules/@noble/hashes/esm/utils.cjs +1 -0
- package/dist/node_modules/@noble/hashes/esm/utils.js +64 -0
- package/dist/node_modules/abitype/dist/chunk-NHABU752.cjs +1 -0
- package/dist/node_modules/abitype/dist/chunk-NHABU752.js +4 -0
- package/dist/node_modules/abitype/dist/chunk-WP7KDV47.cjs +1 -0
- package/dist/node_modules/abitype/dist/chunk-WP7KDV47.js +11 -0
- package/dist/node_modules/abitype/dist/index.cjs +2 -0
- package/dist/node_modules/abitype/dist/index.js +299 -0
- package/dist/node_modules/crc-32/crc32.cjs +1 -0
- package/dist/node_modules/crc-32/crc32.js +51 -0
- package/dist/node_modules/cross-fetch/dist/browser-ponyfill.cjs +2 -0
- package/dist/node_modules/cross-fetch/dist/browser-ponyfill.js +320 -0
- package/dist/node_modules/ethereum-cryptography/esm/aes.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/aes.js +61 -0
- package/dist/node_modules/ethereum-cryptography/esm/keccak.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/keccak.js +9 -0
- package/dist/node_modules/ethereum-cryptography/esm/pbkdf2.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/pbkdf2.js +15 -0
- package/dist/node_modules/ethereum-cryptography/esm/random.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/random.js +7 -0
- package/dist/node_modules/ethereum-cryptography/esm/scrypt.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/scrypt.js +8 -0
- package/dist/node_modules/ethereum-cryptography/esm/secp256k1.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/secp256k1.js +4 -0
- package/dist/node_modules/ethereum-cryptography/esm/utils.cjs +1 -0
- package/dist/node_modules/ethereum-cryptography/esm/utils.js +35 -0
- package/dist/node_modules/events/events.cjs +1 -0
- package/dist/node_modules/events/events.js +229 -0
- package/dist/node_modules/isomorphic-ws/browser.cjs +1 -0
- package/dist/node_modules/isomorphic-ws/browser.js +6 -0
- package/dist/node_modules/setimmediate/setImmediate.cjs +1 -0
- package/dist/node_modules/setimmediate/setImmediate.js +99 -0
- package/dist/node_modules/web3/lib/esm/abi.cjs +1 -0
- package/dist/node_modules/web3/lib/esm/abi.js +24 -0
- package/dist/node_modules/web3/lib/esm/accounts.cjs +1 -0
- package/dist/node_modules/web3/lib/esm/accounts.js +101 -0
- package/dist/node_modules/web3/lib/esm/index.cjs +1 -0
- package/dist/node_modules/web3/lib/esm/index.js +76 -0
- package/dist/node_modules/web3/lib/esm/version.cjs +1 -0
- package/dist/node_modules/web3/lib/esm/version.js +4 -0
- package/dist/node_modules/web3/lib/esm/web3.cjs +1 -0
- package/dist/node_modules/web3/lib/esm/web3.js +89 -0
- package/dist/node_modules/web3-core/lib/esm/utils.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/utils.js +14 -0
- package/dist/node_modules/web3-core/lib/esm/web3_batch_request.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_batch_request.js +83 -0
- package/dist/node_modules/web3-core/lib/esm/web3_config.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_config.js +343 -0
- package/dist/node_modules/web3-core/lib/esm/web3_context.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_context.js +227 -0
- package/dist/node_modules/web3-core/lib/esm/web3_event_emitter.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_event_emitter.js +39 -0
- package/dist/node_modules/web3-core/lib/esm/web3_promi_event.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_promi_event.js +58 -0
- package/dist/node_modules/web3-core/lib/esm/web3_request_manager.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_request_manager.js +240 -0
- package/dist/node_modules/web3-core/lib/esm/web3_subscription_manager.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_subscription_manager.js +155 -0
- package/dist/node_modules/web3-core/lib/esm/web3_subscriptions.cjs +1 -0
- package/dist/node_modules/web3-core/lib/esm/web3_subscriptions.js +111 -0
- package/dist/node_modules/web3-errors/lib/esm/error_codes.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/error_codes.js +106 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/account_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/account_errors.js +58 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/connection_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/connection_errors.js +37 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/contract_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/contract_errors.js +49 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/core_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/core_errors.js +16 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/ens_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/ens_errors.js +16 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/generic_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/generic_errors.js +49 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/provider_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/provider_errors.js +28 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/response_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/response_errors.js +30 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/rpc_error_messages.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/rpc_error_messages.js +161 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/rpc_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/rpc_errors.js +129 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/schema_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/schema_errors.js +13 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/signature_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/signature_errors.js +10 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/transaction_errors.cjs +5 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/transaction_errors.js +256 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/utils_errors.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/errors/utils_errors.js +76 -0
- package/dist/node_modules/web3-errors/lib/esm/web3_error_base.cjs +1 -0
- package/dist/node_modules/web3-errors/lib/esm/web3_error_base.js +28 -0
- package/dist/node_modules/web3-eth/lib/esm/constants.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/constants.js +14 -0
- package/dist/node_modules/web3-eth/lib/esm/rpc_method_wrappers.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/rpc_method_wrappers.js +413 -0
- package/dist/node_modules/web3-eth/lib/esm/schemas.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/schemas.js +570 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/decode_signed_transaction.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/decode_signed_transaction.js +31 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/decoding.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/decoding.js +34 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/detect_transaction_type.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/detect_transaction_type.js +90 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/format_transaction.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/format_transaction.js +30 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/get_revert_reason.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/get_revert_reason.js +77 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_error.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_error.js +50 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_gas_pricing.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_gas_pricing.js +79 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/prepare_transaction_for_signing.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/prepare_transaction_for_signing.js +102 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/reject_if_block_timeout.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/reject_if_block_timeout.js +109 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/send_tx_helper.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/send_tx_helper.js +143 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/transaction_builder.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/transaction_builder.js +131 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/try_send_transaction.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/try_send_transaction.js +52 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/wait_for_transaction_receipt.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/wait_for_transaction_receipt.js +61 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_pooling.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_pooling.js +51 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_subscription.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_subscription.js +77 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_for_confirmations.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_for_confirmations.js +42 -0
- package/dist/node_modules/web3-eth/lib/esm/validation.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/validation.js +111 -0
- package/dist/node_modules/web3-eth/lib/esm/web3_eth.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/web3_eth.js +1512 -0
- package/dist/node_modules/web3-eth/lib/esm/web3_subscriptions.cjs +1 -0
- package/dist/node_modules/web3-eth/lib/esm/web3_subscriptions.js +65 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/errors_api.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/errors_api.js +13 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/events_api.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/events_api.js +13 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/functions_api.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/functions_api.js +20 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/logs_api.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/logs_api.js +14 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/parameters_api.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/api/parameters_api.js +22 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/address.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/address.js +47 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/array.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/array.js +72 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/bool.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/bool.js +37 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/bytes.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/bytes.js +66 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/index.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/index.js +59 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/number.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/number.js +85 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/numbersLimits.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/numbersLimits.js +15 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/string.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/string.js +22 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/tuple.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/tuple.js +77 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/base/utils.js +15 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/decode.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/decode.js +16 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/encode.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/encode.js +23 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/coders/utils.js +58 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/decode_contract_error_data.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/decode_contract_error_data.js +18 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-abi/lib/esm/utils.js +39 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/account.cjs +2 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/account.js +219 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/chains/goerli.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/chains/goerli.js +99 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/chains/mainnet.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/chains/mainnet.js +115 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/chains/sepolia.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/chains/sepolia.js +102 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/common.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/common.js +741 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/1153.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/1153.js +25 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/1559.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/1559.js +29 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2315.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2315.js +28 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2537.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2537.js +181 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2565.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2565.js +20 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2718.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2718.js +14 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2929.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2929.js +87 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2930.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/2930.js +24 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3198.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3198.js +20 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3529.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3529.js +29 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3540.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3540.js +16 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3541.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3541.js +15 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3554.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3554.js +20 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3607.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3607.js +16 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3651.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3651.js +16 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3670.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3670.js +16 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3675.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3675.js +16 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3855.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3855.js +21 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3860.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/3860.js +26 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/4345.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/4345.js +20 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/4399.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/4399.js +16 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/5133.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/5133.js +20 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/index.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/eips/index.js +49 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/enums.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/enums.js +27 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/arrowGlacier.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/arrowGlacier.js +14 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/berlin.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/berlin.js +10 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/byzantium.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/byzantium.js +59 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/chainstart.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/chainstart.js +441 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/constantinople.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/constantinople.js +71 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/dao.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/dao.js +13 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/grayGlacier.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/grayGlacier.js +14 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/homestead.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/homestead.js +18 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/index.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/index.js +39 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/istanbul.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/istanbul.js +90 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/london.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/london.js +10 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/merge.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/merge.js +15 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/mergeForkIdTransition.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/mergeForkIdTransition.js +10 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/muirGlacier.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/muirGlacier.js +18 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/petersburg.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/petersburg.js +42 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/shanghai.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/shanghai.js +10 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/spuriousDragon.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/spuriousDragon.js +23 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/tangerineWhistle.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/hardforks/tangerineWhistle.js +46 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/types.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/types.js +7 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/common/utils.js +277 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/schemas.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/schemas.js +25 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/address.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/address.js +57 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/baseTransaction.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/baseTransaction.js +272 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/constants.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/constants.js +11 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/eip1559Transaction.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/eip1559Transaction.js +285 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/eip2930Transaction.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/eip2930Transaction.js +268 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/legacyTransaction.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/legacyTransaction.js +256 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/transactionFactory.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/transactionFactory.js +89 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/types.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/types.js +18 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/tx/utils.js +80 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/wallet.cjs +1 -0
- package/dist/node_modules/web3-eth-accounts/lib/esm/wallet.js +361 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.cjs +1 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.js +510 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.cjs +1 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.js +80 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/index.cjs +1 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/index.js +27 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/log_subscription.cjs +1 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/log_subscription.js +36 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-contract/lib/esm/utils.js +90 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/abi/ens/ENSRegistry.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/abi/ens/ENSRegistry.js +168 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/abi/ens/PublicResolver.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/abi/ens/PublicResolver.js +578 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/config.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/config.js +27 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.js +241 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/registry.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/registry.js +105 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.js +95 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/utils.cjs +1 -0
- package/dist/node_modules/web3-eth-ens/lib/esm/utils.js +19 -0
- package/dist/node_modules/web3-eth-iban/lib/esm/iban.cjs +1 -0
- package/dist/node_modules/web3-eth-iban/lib/esm/iban.js +283 -0
- package/dist/node_modules/web3-eth-personal/lib/esm/personal.cjs +1 -0
- package/dist/node_modules/web3-eth-personal/lib/esm/personal.js +265 -0
- package/dist/node_modules/web3-eth-personal/lib/esm/rpc_method_wrappers.cjs +1 -0
- package/dist/node_modules/web3-eth-personal/lib/esm/rpc_method_wrappers.js +93 -0
- package/dist/node_modules/web3-net/lib/esm/net.cjs +1 -0
- package/dist/node_modules/web3-net/lib/esm/net.js +97 -0
- package/dist/node_modules/web3-net/lib/esm/rpc_method_wrappers.cjs +1 -0
- package/dist/node_modules/web3-net/lib/esm/rpc_method_wrappers.js +51 -0
- package/dist/node_modules/web3-providers-http/lib/esm/index.cjs +1 -0
- package/dist/node_modules/web3-providers-http/lib/esm/index.js +98 -0
- package/dist/node_modules/web3-providers-ws/lib/esm/index.cjs +1 -0
- package/dist/node_modules/web3-providers-ws/lib/esm/index.js +70 -0
- package/dist/node_modules/web3-rpc-methods/lib/esm/eth_rpc_methods.cjs +1 -0
- package/dist/node_modules/web3-rpc-methods/lib/esm/eth_rpc_methods.js +407 -0
- package/dist/node_modules/web3-rpc-methods/lib/esm/net_rpc_methods.cjs +1 -0
- package/dist/node_modules/web3-rpc-methods/lib/esm/net_rpc_methods.js +56 -0
- package/dist/node_modules/web3-rpc-methods/lib/esm/personal_rpc_methods.cjs +1 -0
- package/dist/node_modules/web3-rpc-methods/lib/esm/personal_rpc_methods.js +84 -0
- package/dist/node_modules/web3-types/lib/esm/data_format_types.cjs +1 -0
- package/dist/node_modules/web3-types/lib/esm/data_format_types.js +15 -0
- package/dist/node_modules/web3-types/lib/esm/eth_types.cjs +1 -0
- package/dist/node_modules/web3-types/lib/esm/eth_types.js +12 -0
- package/dist/node_modules/web3-types/lib/esm/primitives_types.cjs +1 -0
- package/dist/node_modules/web3-types/lib/esm/primitives_types.js +4 -0
- package/dist/node_modules/web3-types/lib/esm/web3_base_provider.cjs +1 -0
- package/dist/node_modules/web3-types/lib/esm/web3_base_provider.js +89 -0
- package/dist/node_modules/web3-types/lib/esm/web3_base_wallet.cjs +1 -0
- package/dist/node_modules/web3-types/lib/esm/web3_base_wallet.js +8 -0
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.js +37 -0
- package/dist/node_modules/web3-utils/lib/esm/converters.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/converters.js +177 -0
- package/dist/node_modules/web3-utils/lib/esm/event_emitter.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/event_emitter.js +91 -0
- package/dist/node_modules/web3-utils/lib/esm/formatter.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/formatter.js +134 -0
- package/dist/node_modules/web3-utils/lib/esm/hash.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/hash.js +107 -0
- package/dist/node_modules/web3-utils/lib/esm/index.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/index.js +107 -0
- package/dist/node_modules/web3-utils/lib/esm/json_rpc.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/json_rpc.js +41 -0
- package/dist/node_modules/web3-utils/lib/esm/objects.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/objects.js +20 -0
- package/dist/node_modules/web3-utils/lib/esm/promise_helpers.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/promise_helpers.js +104 -0
- package/dist/node_modules/web3-utils/lib/esm/random.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/random.js +7 -0
- package/dist/node_modules/web3-utils/lib/esm/socket_provider.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/socket_provider.js +195 -0
- package/dist/node_modules/web3-utils/lib/esm/string_manipulation.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/string_manipulation.js +48 -0
- package/dist/node_modules/web3-utils/lib/esm/uint8array.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/uint8array.js +21 -0
- package/dist/node_modules/web3-utils/lib/esm/uuid.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/uuid.js +17 -0
- package/dist/node_modules/web3-utils/lib/esm/validation.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/validation.js +50 -0
- package/dist/node_modules/web3-utils/lib/esm/web3_deferred_promise.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/web3_deferred_promise.js +114 -0
- package/dist/node_modules/web3-utils/lib/esm/web3_eip1193_provider.cjs +1 -0
- package/dist/node_modules/web3-utils/lib/esm/web3_eip1193_provider.js +86 -0
- package/dist/node_modules/web3-validator/lib/esm/constants.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/constants.js +4 -0
- package/dist/node_modules/web3-validator/lib/esm/default_validator.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/default_validator.js +5 -0
- package/dist/node_modules/web3-validator/lib/esm/errors.cjs +3 -0
- package/dist/node_modules/web3-validator/lib/esm/errors.js +17 -0
- package/dist/node_modules/web3-validator/lib/esm/formats.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/formats.js +31 -0
- package/dist/node_modules/web3-validator/lib/esm/utils.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/utils.js +178 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/abi.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/abi.js +4 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/address.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/address.js +22 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/block.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/block.js +10 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/bloom.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/bloom.js +29 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/boolean.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/boolean.js +5 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/bytes.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/bytes.js +27 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/filter.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/filter.js +26 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/numbers.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/numbers.js +52 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/object.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/object.js +13 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/string.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/string.js +23 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/topic.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validation/topic.js +6 -0
- package/dist/node_modules/web3-validator/lib/esm/validator.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/validator.js +84 -0
- package/dist/node_modules/web3-validator/lib/esm/web3_validator.cjs +1 -0
- package/dist/node_modules/web3-validator/lib/esm/web3_validator.js +31 -0
- package/dist/node_modules/zod/lib/index.cjs +1 -0
- package/dist/node_modules/zod/lib/index.js +2854 -0
- package/dist/prometheus-framework/node_modules/axios/lib/adapters/adapters.cjs +3 -0
- package/dist/prometheus-framework/node_modules/axios/lib/adapters/adapters.js +51 -0
- package/dist/prometheus-framework/node_modules/axios/lib/adapters/xhr.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/adapters/xhr.js +105 -79
- package/dist/prometheus-framework/node_modules/axios/lib/axios.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/axios.js +41 -35
- package/dist/prometheus-framework/node_modules/axios/lib/cancel/CancelToken.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/cancel/CancelToken.js +57 -44
- package/dist/prometheus-framework/node_modules/axios/lib/cancel/CanceledError.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/cancel/CanceledError.js +8 -15
- package/dist/prometheus-framework/node_modules/axios/lib/cancel/isCancel.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/cancel/isCancel.js +3 -6
- package/dist/prometheus-framework/node_modules/axios/lib/core/Axios.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/Axios.js +101 -72
- package/dist/prometheus-framework/node_modules/axios/lib/core/AxiosError.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/AxiosError.js +19 -19
- package/dist/prometheus-framework/node_modules/axios/lib/core/AxiosHeaders.cjs +2 -0
- package/dist/prometheus-framework/node_modules/axios/lib/core/AxiosHeaders.js +165 -0
- package/dist/prometheus-framework/node_modules/axios/lib/core/InterceptorManager.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/InterceptorManager.js +56 -22
- package/dist/prometheus-framework/node_modules/axios/lib/core/buildFullPath.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/buildFullPath.js +6 -6
- package/dist/prometheus-framework/node_modules/axios/lib/core/dispatchRequest.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/dispatchRequest.js +23 -38
- package/dist/prometheus-framework/node_modules/axios/lib/core/mergeConfig.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/mergeConfig.js +62 -58
- package/dist/prometheus-framework/node_modules/axios/lib/core/settle.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/settle.js +11 -18
- package/dist/prometheus-framework/node_modules/axios/lib/core/transformData.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/core/transformData.js +11 -9
- package/dist/prometheus-framework/node_modules/axios/lib/defaults/index.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/defaults/index.js +49 -48
- package/dist/prometheus-framework/node_modules/axios/lib/defaults/transitional.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/defaults/transitional.js +2 -2
- package/dist/prometheus-framework/node_modules/axios/lib/env/data.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/env/data.js +2 -7
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/AxiosURLSearchParams.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +33 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/HttpStatusCode.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/HttpStatusCode.js +72 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/bind.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/bind.js +4 -6
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/buildURL.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/buildURL.js +13 -24
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/combineURLs.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/combineURLs.js +4 -4
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/cookies.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/cookies.js +30 -40
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/formDataToJSON.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/formDataToJSON.js +30 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/isAbsoluteURL.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/isAbsoluteURL.js +3 -3
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/isAxiosError.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/isAxiosError.js +4 -11
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/isURLSameOrigin.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/isURLSameOrigin.js +34 -39
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/null.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/null.js +2 -5
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/parseHeaders.cjs +2 -2
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/parseHeaders.js +28 -38
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/parseProtocol.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/parseProtocol.js +4 -7
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/speedometer.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/speedometer.js +19 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/spread.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/spread.js +5 -8
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/toFormData.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/toFormData.js +79 -32
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/toURLEncodedForm.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/toURLEncodedForm.js +13 -0
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/validator.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/helpers/validator.js +33 -31
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/classes/Blob.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/classes/Blob.js +4 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/classes/FormData.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/classes/FormData.js +4 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/classes/URLSearchParams.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/index.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/browser/index.js +15 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/common/utils.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/common/utils.js +7 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/index.cjs +1 -0
- package/dist/prometheus-framework/node_modules/axios/lib/platform/index.js +9 -0
- package/dist/prometheus-framework/node_modules/axios/lib/utils.cjs +1 -1
- package/dist/prometheus-framework/node_modules/axios/lib/utils.js +212 -140
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +2 -72
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +72 -2
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +1 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.js +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/invites.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/store/blogposts.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/store/blogposts.js +1 -1
- package/dist/prometheus-framework/src/modules/community/store/reactions.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/store/reactions.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Image.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Image.vue.js +6 -7
- package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.js +1 -1
- package/dist/prometheus-framework/src/modules/events/store/tickets.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/tickets.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/store/gallery.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/store/gallery.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/invites.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.js +1 -1
- package/dist/prometheus-framework/src/modules/payments/components/pages/Payments.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/payments/components/pages/Payments.vue.js +30 -61
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.js +20 -21
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +28 -33
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +6 -41
- package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/categories.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/store/reports.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/store/reports.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/store/spots.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/store/spots.js +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +75 -33
- package/dist/prometheus-framework.cjs.js +29 -30
- package/dist/prometheus-framework.es.js +3953 -3225
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/src/modules/payments/components/pages/Payments.vue +32 -34
- package/src/modules/products/components/blocks/CardLeftover.vue +1 -2
- package/src/modules/products/components/blocks/CardProduct.vue +1 -17
- package/src/modules/products/components/sections/EditProductInfo.vue +3 -5
@@ -0,0 +1,227 @@
|
|
1
|
+
import { ExistingPluginNamespaceError as f } from "../../../web3-errors/lib/esm/errors/generic_errors.js";
|
2
|
+
import "../../../web3-errors/lib/esm/errors/rpc_errors.js";
|
3
|
+
import { isSupportedProvider as m } from "./utils.js";
|
4
|
+
import { Web3Config as M, Web3ConfigEvent as p } from "./web3_config.js";
|
5
|
+
import { Web3RequestManager as h } from "./web3_request_manager.js";
|
6
|
+
import { Web3SubscriptionManager as l } from "./web3_subscription_manager.js";
|
7
|
+
import { Web3BatchRequest as _ } from "./web3_batch_request.js";
|
8
|
+
import { isNullish as b } from "../../../web3-utils/lib/esm/validation.js";
|
9
|
+
var w = globalThis && globalThis.__awaiter || function(v, e, r, i) {
|
10
|
+
function s(t) {
|
11
|
+
return t instanceof r ? t : new r(function(n) {
|
12
|
+
n(t);
|
13
|
+
});
|
14
|
+
}
|
15
|
+
return new (r || (r = Promise))(function(t, n) {
|
16
|
+
function u(o) {
|
17
|
+
try {
|
18
|
+
a(i.next(o));
|
19
|
+
} catch (g) {
|
20
|
+
n(g);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
function c(o) {
|
24
|
+
try {
|
25
|
+
a(i.throw(o));
|
26
|
+
} catch (g) {
|
27
|
+
n(g);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
function a(o) {
|
31
|
+
o.done ? t(o.value) : s(o.value).then(u, c);
|
32
|
+
}
|
33
|
+
a((i = i.apply(v, e || [])).next());
|
34
|
+
});
|
35
|
+
};
|
36
|
+
class d extends M {
|
37
|
+
constructor(e) {
|
38
|
+
var r;
|
39
|
+
if (super(), this.providers = h.providers, b(e) || typeof e == "string" && e.trim() !== "" || m(e)) {
|
40
|
+
this._requestManager = new h(e), this._subscriptionManager = new l(this._requestManager, {});
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
const { config: i, provider: s, requestManager: t, subscriptionManager: n, registeredSubscriptions: u, accountProvider: c, wallet: a } = e;
|
44
|
+
this.setConfig(i ?? {}), this._requestManager = t ?? new h(s, (r = i == null ? void 0 : i.enableExperimentalFeatures) === null || r === void 0 ? void 0 : r.useSubscriptionWhenCheckingBlockTimeout), n ? this._subscriptionManager = n : this._subscriptionManager = new l(this.requestManager, u ?? {}), c && (this._accountProvider = c), a && (this._wallet = a);
|
45
|
+
}
|
46
|
+
get requestManager() {
|
47
|
+
return this._requestManager;
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Will return the current subscriptionManager ({@link Web3SubscriptionManager})
|
51
|
+
*/
|
52
|
+
get subscriptionManager() {
|
53
|
+
return this._subscriptionManager;
|
54
|
+
}
|
55
|
+
get wallet() {
|
56
|
+
return this._wallet;
|
57
|
+
}
|
58
|
+
get accountProvider() {
|
59
|
+
return this._accountProvider;
|
60
|
+
}
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
62
|
+
static fromContextObject(...e) {
|
63
|
+
return new this(...e.reverse());
|
64
|
+
}
|
65
|
+
getContextObject() {
|
66
|
+
var e;
|
67
|
+
return {
|
68
|
+
config: this.config,
|
69
|
+
provider: this.provider,
|
70
|
+
requestManager: this.requestManager,
|
71
|
+
subscriptionManager: this.subscriptionManager,
|
72
|
+
registeredSubscriptions: (e = this.subscriptionManager) === null || e === void 0 ? void 0 : e.registeredSubscriptions,
|
73
|
+
providers: this.providers,
|
74
|
+
wallet: this.wallet,
|
75
|
+
accountProvider: this.accountProvider
|
76
|
+
};
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* Use to create new object of any type extended by `Web3Context`
|
80
|
+
* and link it to current context. This can be used to initiate a global context object
|
81
|
+
* and then use it to create new objects of any type extended by `Web3Context`.
|
82
|
+
*/
|
83
|
+
use(e, ...r) {
|
84
|
+
const i = new e(...r, this.getContextObject());
|
85
|
+
return this.on(p.CONFIG_CHANGE, (s) => {
|
86
|
+
i.setConfig({ [s.name]: s.newValue });
|
87
|
+
}), i;
|
88
|
+
}
|
89
|
+
/**
|
90
|
+
* Link current context to another context.
|
91
|
+
*/
|
92
|
+
link(e) {
|
93
|
+
this.setConfig(e.config), this._requestManager = e.requestManager, this.provider = e.provider, this._subscriptionManager = e.subscriptionManager, this._wallet = e.wallet, this._accountProvider = e._accountProvider, e.on(p.CONFIG_CHANGE, (r) => {
|
94
|
+
this.setConfig({ [r.name]: r.newValue });
|
95
|
+
});
|
96
|
+
}
|
97
|
+
// eslint-disable-next-line no-use-before-define
|
98
|
+
registerPlugin(e) {
|
99
|
+
if (this[e.pluginNamespace] !== void 0)
|
100
|
+
throw new f(e.pluginNamespace);
|
101
|
+
const r = {
|
102
|
+
[e.pluginNamespace]: e
|
103
|
+
};
|
104
|
+
r[e.pluginNamespace].link(this), Object.assign(this, r);
|
105
|
+
}
|
106
|
+
/**
|
107
|
+
* Will return the current provider.
|
108
|
+
*
|
109
|
+
* @returns Returns the current provider
|
110
|
+
* @example
|
111
|
+
* ```ts
|
112
|
+
* const web3 = new Web3Context("http://localhost:8545");
|
113
|
+
* console.log(web3.provider);
|
114
|
+
* > HttpProvider {
|
115
|
+
* clientUrl: 'http://localhost:8545',
|
116
|
+
* httpProviderOptions: undefined
|
117
|
+
* }
|
118
|
+
* ```
|
119
|
+
*/
|
120
|
+
get provider() {
|
121
|
+
return this.currentProvider;
|
122
|
+
}
|
123
|
+
/**
|
124
|
+
* Will set the current provider.
|
125
|
+
*
|
126
|
+
* @param provider - The provider to set
|
127
|
+
*
|
128
|
+
* Accepted providers are of type {@link SupportedProviders}
|
129
|
+
* @example
|
130
|
+
* ```ts
|
131
|
+
* const web3Context = new web3ContextContext("http://localhost:8545");
|
132
|
+
* web3Context.provider = "ws://localhost:8545";
|
133
|
+
* console.log(web3Context.provider);
|
134
|
+
* > WebSocketProvider {
|
135
|
+
* _eventEmitter: EventEmitter {
|
136
|
+
* _events: [Object: null prototype] {},
|
137
|
+
* _eventsCount: 0,
|
138
|
+
* ...
|
139
|
+
* }
|
140
|
+
* ```
|
141
|
+
*/
|
142
|
+
set provider(e) {
|
143
|
+
this.requestManager.setProvider(e);
|
144
|
+
}
|
145
|
+
/**
|
146
|
+
* Will return the current provider. (The same as `provider`)
|
147
|
+
*
|
148
|
+
* @returns Returns the current provider
|
149
|
+
* @example
|
150
|
+
* ```ts
|
151
|
+
* const web3Context = new Web3Context("http://localhost:8545");
|
152
|
+
* console.log(web3Context.provider);
|
153
|
+
* > HttpProvider {
|
154
|
+
* clientUrl: 'http://localhost:8545',
|
155
|
+
* httpProviderOptions: undefined
|
156
|
+
* }
|
157
|
+
* ```
|
158
|
+
*/
|
159
|
+
get currentProvider() {
|
160
|
+
return this.requestManager.provider;
|
161
|
+
}
|
162
|
+
/**
|
163
|
+
* Will set the current provider. (The same as `provider`)
|
164
|
+
*
|
165
|
+
* @param provider - {@link SupportedProviders} The provider to set
|
166
|
+
*
|
167
|
+
* @example
|
168
|
+
* ```ts
|
169
|
+
* const web3Context = new Web3Context("http://localhost:8545");
|
170
|
+
* web3Context.currentProvider = "ws://localhost:8545";
|
171
|
+
* console.log(web3Context.provider);
|
172
|
+
* > WebSocketProvider {
|
173
|
+
* _eventEmitter: EventEmitter {
|
174
|
+
* _events: [Object: null prototype] {},
|
175
|
+
* _eventsCount: 0,
|
176
|
+
* ...
|
177
|
+
* }
|
178
|
+
* ```
|
179
|
+
*/
|
180
|
+
set currentProvider(e) {
|
181
|
+
this.requestManager.setProvider(e);
|
182
|
+
}
|
183
|
+
/**
|
184
|
+
* Will return the givenProvider if available.
|
185
|
+
*
|
186
|
+
* When using web3.js in an Ethereum compatible browser, it will set with the current native provider by that browser. Will return the given provider by the (browser) environment, otherwise `undefined`.
|
187
|
+
*/
|
188
|
+
// eslint-disable-next-line class-methods-use-this
|
189
|
+
get givenProvider() {
|
190
|
+
return d.givenProvider;
|
191
|
+
}
|
192
|
+
/**
|
193
|
+
* Will set the provider.
|
194
|
+
*
|
195
|
+
* @param provider - {@link SupportedProviders} The provider to set
|
196
|
+
* @returns Returns true if the provider was set
|
197
|
+
*/
|
198
|
+
setProvider(e) {
|
199
|
+
return this.provider = e, !0;
|
200
|
+
}
|
201
|
+
/**
|
202
|
+
* Will return the {@link Web3BatchRequest} constructor.
|
203
|
+
*/
|
204
|
+
get BatchRequest() {
|
205
|
+
return _.bind(void 0, this._requestManager);
|
206
|
+
}
|
207
|
+
/**
|
208
|
+
* This method allows extending the web3 modules.
|
209
|
+
* Note: This method is only for backward compatibility, and It is recommended to use Web3 v4 Plugin feature for extending web3.js functionality if you are developing some thing new.
|
210
|
+
*/
|
211
|
+
extend(e) {
|
212
|
+
var r;
|
213
|
+
return e.property && !this[e.property] && (this[e.property] = {}), (r = e.methods) === null || r === void 0 || r.forEach((i) => {
|
214
|
+
const s = (...t) => w(this, void 0, void 0, function* () {
|
215
|
+
return this.requestManager.send({
|
216
|
+
method: i.call,
|
217
|
+
params: t
|
218
|
+
});
|
219
|
+
});
|
220
|
+
e.property ? this[e.property][i.name] = s : this[i.name] = s;
|
221
|
+
}), this;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
d.providers = h.providers;
|
225
|
+
export {
|
226
|
+
d as Web3Context
|
227
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../web3-utils/lib/esm/event_emitter.cjs");class i{constructor(){this._emitter=new r.EventEmitter}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,t){this._emitter.emit(e,t)}listenerCount(e){return this._emitter.listenerCount(e)}listeners(e){return this._emitter.listeners(e)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(e){this._emitter.setMaxListeners(e)}getMaxListeners(){return this._emitter.getMaxListeners()}}exports.Web3EventEmitter=i;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { EventEmitter as r } from "../../../web3-utils/lib/esm/event_emitter.js";
|
2
|
+
class n {
|
3
|
+
constructor() {
|
4
|
+
this._emitter = new r();
|
5
|
+
}
|
6
|
+
on(e, t) {
|
7
|
+
this._emitter.on(e, t);
|
8
|
+
}
|
9
|
+
once(e, t) {
|
10
|
+
this._emitter.once(e, t);
|
11
|
+
}
|
12
|
+
off(e, t) {
|
13
|
+
this._emitter.off(e, t);
|
14
|
+
}
|
15
|
+
emit(e, t) {
|
16
|
+
this._emitter.emit(e, t);
|
17
|
+
}
|
18
|
+
listenerCount(e) {
|
19
|
+
return this._emitter.listenerCount(e);
|
20
|
+
}
|
21
|
+
listeners(e) {
|
22
|
+
return this._emitter.listeners(e);
|
23
|
+
}
|
24
|
+
eventNames() {
|
25
|
+
return this._emitter.eventNames();
|
26
|
+
}
|
27
|
+
removeAllListeners() {
|
28
|
+
return this._emitter.removeAllListeners();
|
29
|
+
}
|
30
|
+
setMaxListenerWarningThreshold(e) {
|
31
|
+
this._emitter.setMaxListeners(e);
|
32
|
+
}
|
33
|
+
getMaxListeners() {
|
34
|
+
return this._emitter.getMaxListeners();
|
35
|
+
}
|
36
|
+
}
|
37
|
+
export {
|
38
|
+
n as Web3EventEmitter
|
39
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./web3_event_emitter.cjs");var u=globalThis&&globalThis.__awaiter||function(h,t,e,r){function f(i){return i instanceof e?i:new e(function(o){o(i)})}return new(e||(e=Promise))(function(i,o){function l(n){try{s(r.next(n))}catch(c){o(c)}}function d(n){try{s(r.throw(n))}catch(c){o(c)}}function s(n){n.done?i(n.value):f(n.value).then(l,d)}s((r=r.apply(h,t||[])).next())})},a;class v extends m.Web3EventEmitter{constructor(t){super(),this[a]="Promise",this._promise=new Promise(t)}then(t,e){return u(this,void 0,void 0,function*(){return this._promise.then(t,e)})}catch(t){return u(this,void 0,void 0,function*(){return this._promise.catch(t)})}finally(t){return u(this,void 0,void 0,function*(){return this._promise.finally(t)})}on(t,e){return super.on(t,e),this}once(t,e){return super.once(t,e),this}}a=Symbol.toStringTag;exports.Web3PromiEvent=v;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { Web3EventEmitter as m } from "./web3_event_emitter.js";
|
2
|
+
var u = globalThis && globalThis.__awaiter || function(h, t, n, o) {
|
3
|
+
function f(e) {
|
4
|
+
return e instanceof n ? e : new n(function(r) {
|
5
|
+
r(e);
|
6
|
+
});
|
7
|
+
}
|
8
|
+
return new (n || (n = Promise))(function(e, r) {
|
9
|
+
function p(i) {
|
10
|
+
try {
|
11
|
+
s(o.next(i));
|
12
|
+
} catch (c) {
|
13
|
+
r(c);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
function l(i) {
|
17
|
+
try {
|
18
|
+
s(o.throw(i));
|
19
|
+
} catch (c) {
|
20
|
+
r(c);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
function s(i) {
|
24
|
+
i.done ? e(i.value) : f(i.value).then(p, l);
|
25
|
+
}
|
26
|
+
s((o = o.apply(h, t || [])).next());
|
27
|
+
});
|
28
|
+
}, a;
|
29
|
+
class v extends m {
|
30
|
+
constructor(t) {
|
31
|
+
super(), this[a] = "Promise", this._promise = new Promise(t);
|
32
|
+
}
|
33
|
+
then(t, n) {
|
34
|
+
return u(this, void 0, void 0, function* () {
|
35
|
+
return this._promise.then(t, n);
|
36
|
+
});
|
37
|
+
}
|
38
|
+
catch(t) {
|
39
|
+
return u(this, void 0, void 0, function* () {
|
40
|
+
return this._promise.catch(t);
|
41
|
+
});
|
42
|
+
}
|
43
|
+
finally(t) {
|
44
|
+
return u(this, void 0, void 0, function* () {
|
45
|
+
return this._promise.finally(t);
|
46
|
+
});
|
47
|
+
}
|
48
|
+
on(t, n) {
|
49
|
+
return super.on(t, n), this;
|
50
|
+
}
|
51
|
+
once(t, n) {
|
52
|
+
return super.once(t, n), this;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
a = Symbol.toStringTag;
|
56
|
+
export {
|
57
|
+
v as Web3PromiEvent
|
58
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../../web3-errors/lib/esm/errors/contract_errors.cjs"),E=require("../../../web3-errors/lib/esm/errors/provider_errors.cjs"),R=require("../../../web3-errors/lib/esm/errors/response_errors.cjs"),_=require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs"),b=require("../../../web3-providers-http/lib/esm/index.cjs"),m=require("../../../web3-providers-ws/lib/esm/index.cjs"),d=require("./utils.cjs"),O=require("./web3_event_emitter.cjs"),W=require("../../../web3-utils/lib/esm/promise_helpers.cjs"),i=require("../../../web3-utils/lib/esm/json_rpc.cjs"),l=require("../../../web3-utils/lib/esm/validation.cjs");var w=globalThis&&globalThis.__awaiter||function(u,r,e,t){function s(o){return o instanceof e?o:new e(function(n){n(o)})}return new(e||(e=Promise))(function(o,n){function h(a){try{c(t.next(a))}catch(p){n(p)}}function f(a){try{c(t.throw(a))}catch(p){n(p)}}function c(a){a.done?o(a.value):s(a.value).then(h,f)}c((t=t.apply(u,r||[])).next())})};exports.Web3RequestManagerEvent=void 0;(function(u){u.PROVIDER_CHANGED="PROVIDER_CHANGED",u.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE"})(exports.Web3RequestManagerEvent||(exports.Web3RequestManagerEvent={}));const P={HttpProvider:b.default,WebsocketProvider:m.default},q=u=>{var r;if(Array.isArray(u.params)){const e=u.params[0];if(e.input&&!e.data)return Object.assign(Object.assign({},u),{params:[Object.assign(Object.assign({},e),{data:(r=e.data)!==null&&r!==void 0?r:e.input})]})}return u};class v extends O.Web3EventEmitter{constructor(r,e){super(),l.isNullish(r)||this.setProvider(r),this.useRpcCallSpecification=e}static get providers(){return P}get provider(){return this._provider}get providers(){return P}setProvider(r){let e;if(r&&typeof r=="string"&&this.providers)if(/^http(s)?:\/\//i.test(r))e=new this.providers.HttpProvider(r);else if(/^ws(s)?:\/\//i.test(r))e=new this.providers.WebsocketProvider(r);else throw new E.ProviderError(`Can't autodetect provider for "${r}"`);else l.isNullish(r)?e=void 0:e=r;return this.emit(exports.Web3RequestManagerEvent.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=e,this.emit(exports.Web3RequestManagerEvent.PROVIDER_CHANGED,this._provider),!0}send(r){return w(this,void 0,void 0,function*(){const e=yield this._sendRequest(r);if(i.isResponseWithResult(e))return e.result;throw new R.ResponseError(e)})}sendBatch(r){return w(this,void 0,void 0,function*(){return yield this._sendRequest(r)})}_sendRequest(r){return w(this,void 0,void 0,function*(){const{provider:e}=this;if(l.isNullish(e))throw new E.ProviderError("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let t=i.isBatchRequest(r)?i.toBatchPayload(r):i.toPayload(r);if(d.isMetaMaskProvider(e)&&t.method==="eth_sendTransaction"&&(i.isBatchRequest(t)?t=t.map(s=>q(s)):t=q(t)),d.isWeb3Provider(e)){let s;try{s=yield e.request(t)}catch(o){s=o}return this._processJsonRpcResponse(t,s,{legacy:!1,error:!1})}if(d.isEIP1193Provider(e))return e.request(t).then(s=>this._processJsonRpcResponse(t,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(t,s,{legacy:!0,error:!0}));if(d.isLegacyRequestProvider(e))return new Promise((s,o)=>{const n=c=>o(this._processJsonRpcResponse(t,c,{legacy:!0,error:!0})),h=c=>s(this._processJsonRpcResponse(t,c,{legacy:!0,error:!1})),f=e.request(t,(c,a)=>c?n(c):h(a));W.isPromise(f)&&f.then(h).catch(n)});if(d.isLegacySendProvider(e))return new Promise((s,o)=>{e.send(t,(n,h)=>{if(n)return o(this._processJsonRpcResponse(t,n,{legacy:!0,error:!0}));if(l.isNullish(h))throw new R.ResponseError("",'Got a "nullish" response from provider.');return s(this._processJsonRpcResponse(t,h,{legacy:!0,error:!1}))})});if(d.isLegacySendAsyncProvider(e))return e.sendAsync(t).then(s=>this._processJsonRpcResponse(t,s,{legacy:!0,error:!1})).catch(s=>this._processJsonRpcResponse(t,s,{legacy:!0,error:!0}));throw new E.ProviderError("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(r,e,{legacy:t,error:s}){if(l.isNullish(e))return this._buildResponse(r,null,s);if(i.isResponseWithError(e)){if(this.useRpcCallSpecification&&i.isResponseRpcError(e)){const o=e;if(_.rpcErrorsMap.get(o.error.code)){const n=_.rpcErrorsMap.get(o.error.code).error;throw new n(o)}else throw new _.RpcError(o)}else if(!v._isReverted(e))throw new R.InvalidResponseError(e,r)}if(i.isResponseWithResult(e))return e;if(e instanceof Error)throw v._isReverted(e),e;if(!t&&i.isBatchRequest(r)&&i.isBatchResponse(e)||t&&!s&&i.isBatchRequest(r))return e;if(t&&s&&i.isBatchRequest(r))throw e;if(t&&!i.isResponseWithError(e)&&!i.isResponseWithResult(e))return this._buildResponse(r,e,s);throw i.isBatchRequest(r)&&!Array.isArray(e)?new R.ResponseError(e,"Got normal response for a batch request."):!i.isBatchRequest(r)&&Array.isArray(e)?new R.ResponseError(e,"Got batch response for a normal request."):(i.isResponseWithError(e)||i.isResponseWithResult(e))&&!i.isBatchRequest(r)&&e.id&&r.id!==e.id?new R.InvalidResponseError(e):new R.ResponseError(e,"Invalid response")}static _isReverted(r){let e;if(i.isResponseWithError(r)?e=r.error:r instanceof Error&&(e=r),e!=null&&e.message.includes("revert"))throw new g.ContractExecutionError(e);return!1}_buildResponse(r,e,t){const s={jsonrpc:"2.0",id:i.isBatchRequest(r)?r[0].id:"id"in r?r.id:null};return t?Object.assign(Object.assign({},s),{error:e}):Object.assign(Object.assign({},s),{result:e})}}exports.Web3RequestManager=v;
|
@@ -0,0 +1,240 @@
|
|
1
|
+
import { ContractExecutionError as y } from "../../../web3-errors/lib/esm/errors/contract_errors.js";
|
2
|
+
import { ProviderError as w } from "../../../web3-errors/lib/esm/errors/provider_errors.js";
|
3
|
+
import { ResponseError as h, InvalidResponseError as P } from "../../../web3-errors/lib/esm/errors/response_errors.js";
|
4
|
+
import { rpcErrorsMap as g, RpcError as A } from "../../../web3-errors/lib/esm/errors/rpc_errors.js";
|
5
|
+
import j from "../../../web3-providers-http/lib/esm/index.js";
|
6
|
+
import C from "../../../web3-providers-ws/lib/esm/index.js";
|
7
|
+
import { isMetaMaskProvider as J, isWeb3Provider as D, isEIP1193Provider as G, isLegacyRequestProvider as H, isLegacySendProvider as I, isLegacySendAsyncProvider as q } from "./utils.js";
|
8
|
+
import { Web3EventEmitter as W } from "./web3_event_emitter.js";
|
9
|
+
import { isPromise as B } from "../../../web3-utils/lib/esm/promise_helpers.js";
|
10
|
+
import { isResponseWithResult as R, isBatchRequest as f, toBatchPayload as N, toPayload as V, isResponseWithError as p, isResponseRpcError as k, isBatchResponse as x } from "../../../web3-utils/lib/esm/json_rpc.js";
|
11
|
+
import { isNullish as d } from "../../../web3-utils/lib/esm/validation.js";
|
12
|
+
var _ = globalThis && globalThis.__awaiter || function(c, e, r, t) {
|
13
|
+
function i(s) {
|
14
|
+
return s instanceof r ? s : new r(function(o) {
|
15
|
+
o(s);
|
16
|
+
});
|
17
|
+
}
|
18
|
+
return new (r || (r = Promise))(function(s, o) {
|
19
|
+
function a(u) {
|
20
|
+
try {
|
21
|
+
n(t.next(u));
|
22
|
+
} catch (m) {
|
23
|
+
o(m);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
function l(u) {
|
27
|
+
try {
|
28
|
+
n(t.throw(u));
|
29
|
+
} catch (m) {
|
30
|
+
o(m);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
function n(u) {
|
34
|
+
u.done ? s(u.value) : i(u.value).then(a, l);
|
35
|
+
}
|
36
|
+
n((t = t.apply(c, e || [])).next());
|
37
|
+
});
|
38
|
+
}, v;
|
39
|
+
(function(c) {
|
40
|
+
c.PROVIDER_CHANGED = "PROVIDER_CHANGED", c.BEFORE_PROVIDER_CHANGE = "BEFORE_PROVIDER_CHANGE";
|
41
|
+
})(v || (v = {}));
|
42
|
+
const b = {
|
43
|
+
HttpProvider: j,
|
44
|
+
WebsocketProvider: C
|
45
|
+
}, O = (c) => {
|
46
|
+
var e;
|
47
|
+
if (Array.isArray(c.params)) {
|
48
|
+
const r = c.params[0];
|
49
|
+
if (r.input && !r.data)
|
50
|
+
return Object.assign(Object.assign({}, c), { params: [Object.assign(Object.assign({}, r), { data: (e = r.data) !== null && e !== void 0 ? e : r.input })] });
|
51
|
+
}
|
52
|
+
return c;
|
53
|
+
};
|
54
|
+
class E extends W {
|
55
|
+
constructor(e, r) {
|
56
|
+
super(), d(e) || this.setProvider(e), this.useRpcCallSpecification = r;
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* Will return all available providers
|
60
|
+
*/
|
61
|
+
static get providers() {
|
62
|
+
return b;
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* Will return the current provider.
|
66
|
+
*
|
67
|
+
* @returns Returns the current provider
|
68
|
+
*/
|
69
|
+
get provider() {
|
70
|
+
return this._provider;
|
71
|
+
}
|
72
|
+
/**
|
73
|
+
* Will return all available providers
|
74
|
+
*/
|
75
|
+
// eslint-disable-next-line class-methods-use-this
|
76
|
+
get providers() {
|
77
|
+
return b;
|
78
|
+
}
|
79
|
+
/**
|
80
|
+
* Use to set provider. Provider can be a provider instance or a string.
|
81
|
+
*
|
82
|
+
* @param provider - The provider to set
|
83
|
+
*/
|
84
|
+
setProvider(e) {
|
85
|
+
let r;
|
86
|
+
if (e && typeof e == "string" && this.providers)
|
87
|
+
if (/^http(s)?:\/\//i.test(e))
|
88
|
+
r = new this.providers.HttpProvider(e);
|
89
|
+
else if (/^ws(s)?:\/\//i.test(e))
|
90
|
+
r = new this.providers.WebsocketProvider(e);
|
91
|
+
else
|
92
|
+
throw new w(`Can't autodetect provider for "${e}"`);
|
93
|
+
else
|
94
|
+
d(e) ? r = void 0 : r = e;
|
95
|
+
return this.emit(v.BEFORE_PROVIDER_CHANGE, this._provider), this._provider = r, this.emit(v.PROVIDER_CHANGED, this._provider), !0;
|
96
|
+
}
|
97
|
+
/**
|
98
|
+
*
|
99
|
+
* Will execute a request
|
100
|
+
*
|
101
|
+
* @param request - {@link Web3APIRequest} The request to send
|
102
|
+
*
|
103
|
+
* @returns The response of the request {@link ResponseType}. If there is error
|
104
|
+
* in the response, will throw an error
|
105
|
+
*/
|
106
|
+
send(e) {
|
107
|
+
return _(this, void 0, void 0, function* () {
|
108
|
+
const r = yield this._sendRequest(e);
|
109
|
+
if (R(r))
|
110
|
+
return r.result;
|
111
|
+
throw new h(r);
|
112
|
+
});
|
113
|
+
}
|
114
|
+
/**
|
115
|
+
* Same as send, but, will execute a batch of requests
|
116
|
+
*
|
117
|
+
* @param request {@link JsonRpcBatchRequest} The batch request to send
|
118
|
+
*/
|
119
|
+
sendBatch(e) {
|
120
|
+
return _(this, void 0, void 0, function* () {
|
121
|
+
return yield this._sendRequest(e);
|
122
|
+
});
|
123
|
+
}
|
124
|
+
_sendRequest(e) {
|
125
|
+
return _(this, void 0, void 0, function* () {
|
126
|
+
const { provider: r } = this;
|
127
|
+
if (d(r))
|
128
|
+
throw new w("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");
|
129
|
+
let t = f(e) ? N(e) : V(e);
|
130
|
+
if (J(r) && t.method === "eth_sendTransaction" && (f(t) ? t = t.map((i) => O(i)) : t = O(t)), D(r)) {
|
131
|
+
let i;
|
132
|
+
try {
|
133
|
+
i = yield r.request(t);
|
134
|
+
} catch (s) {
|
135
|
+
i = s;
|
136
|
+
}
|
137
|
+
return this._processJsonRpcResponse(t, i, { legacy: !1, error: !1 });
|
138
|
+
}
|
139
|
+
if (G(r))
|
140
|
+
return r.request(t).then((i) => this._processJsonRpcResponse(t, i, {
|
141
|
+
legacy: !0,
|
142
|
+
error: !1
|
143
|
+
})).catch((i) => this._processJsonRpcResponse(t, i, { legacy: !0, error: !0 }));
|
144
|
+
if (H(r))
|
145
|
+
return new Promise((i, s) => {
|
146
|
+
const o = (n) => s(this._processJsonRpcResponse(t, n, {
|
147
|
+
legacy: !0,
|
148
|
+
error: !0
|
149
|
+
})), a = (n) => i(this._processJsonRpcResponse(t, n, {
|
150
|
+
legacy: !0,
|
151
|
+
error: !1
|
152
|
+
})), l = r.request(
|
153
|
+
t,
|
154
|
+
// a callback that is expected to be called after getting the response:
|
155
|
+
(n, u) => n ? o(n) : a(u)
|
156
|
+
);
|
157
|
+
B(l) && l.then(a).catch(o);
|
158
|
+
});
|
159
|
+
if (I(r))
|
160
|
+
return new Promise((i, s) => {
|
161
|
+
r.send(t, (o, a) => {
|
162
|
+
if (o)
|
163
|
+
return s(this._processJsonRpcResponse(t, o, {
|
164
|
+
legacy: !0,
|
165
|
+
error: !0
|
166
|
+
}));
|
167
|
+
if (d(a))
|
168
|
+
throw new h("", 'Got a "nullish" response from provider.');
|
169
|
+
return i(this._processJsonRpcResponse(t, a, {
|
170
|
+
legacy: !0,
|
171
|
+
error: !1
|
172
|
+
}));
|
173
|
+
});
|
174
|
+
});
|
175
|
+
if (q(r))
|
176
|
+
return r.sendAsync(t).then((i) => this._processJsonRpcResponse(t, i, { legacy: !0, error: !1 })).catch((i) => this._processJsonRpcResponse(t, i, {
|
177
|
+
legacy: !0,
|
178
|
+
error: !0
|
179
|
+
}));
|
180
|
+
throw new w("Provider does not have a request or send method to use.");
|
181
|
+
});
|
182
|
+
}
|
183
|
+
// eslint-disable-next-line class-methods-use-this
|
184
|
+
_processJsonRpcResponse(e, r, { legacy: t, error: i }) {
|
185
|
+
if (d(r))
|
186
|
+
return this._buildResponse(
|
187
|
+
e,
|
188
|
+
// Some providers uses "null" as valid empty response
|
189
|
+
// eslint-disable-next-line no-null/no-null
|
190
|
+
null,
|
191
|
+
i
|
192
|
+
);
|
193
|
+
if (p(r)) {
|
194
|
+
if (this.useRpcCallSpecification && k(r)) {
|
195
|
+
const s = r;
|
196
|
+
if (g.get(s.error.code)) {
|
197
|
+
const o = g.get(s.error.code).error;
|
198
|
+
throw new o(s);
|
199
|
+
} else
|
200
|
+
throw new A(s);
|
201
|
+
} else if (!E._isReverted(r))
|
202
|
+
throw new P(r, e);
|
203
|
+
}
|
204
|
+
if (R(r))
|
205
|
+
return r;
|
206
|
+
if (r instanceof Error)
|
207
|
+
throw E._isReverted(r), r;
|
208
|
+
if (!t && f(e) && x(r) || t && !i && f(e))
|
209
|
+
return r;
|
210
|
+
if (t && i && f(e))
|
211
|
+
throw r;
|
212
|
+
if (t && !p(r) && !R(r))
|
213
|
+
return this._buildResponse(e, r, i);
|
214
|
+
throw f(e) && !Array.isArray(r) ? new h(r, "Got normal response for a batch request.") : !f(e) && Array.isArray(r) ? new h(r, "Got batch response for a normal request.") : (p(r) || R(r)) && !f(e) && r.id && e.id !== r.id ? new P(r) : new h(r, "Invalid response");
|
215
|
+
}
|
216
|
+
static _isReverted(e) {
|
217
|
+
let r;
|
218
|
+
if (p(e) ? r = e.error : e instanceof Error && (r = e), r != null && r.message.includes("revert"))
|
219
|
+
throw new y(r);
|
220
|
+
return !1;
|
221
|
+
}
|
222
|
+
// Need to use same types as _processJsonRpcResponse so have to declare as instance method
|
223
|
+
// eslint-disable-next-line class-methods-use-this
|
224
|
+
_buildResponse(e, r, t) {
|
225
|
+
const i = {
|
226
|
+
jsonrpc: "2.0",
|
227
|
+
// eslint-disable-next-line no-nested-ternary
|
228
|
+
id: f(e) ? e[0].id : "id" in e ? e.id : (
|
229
|
+
// Have to use the null here explicitly
|
230
|
+
// eslint-disable-next-line no-null/no-null
|
231
|
+
null
|
232
|
+
)
|
233
|
+
};
|
234
|
+
return t ? Object.assign(Object.assign({}, i), { error: r }) : Object.assign(Object.assign({}, i), { result: r });
|
235
|
+
}
|
236
|
+
}
|
237
|
+
export {
|
238
|
+
E as Web3RequestManager,
|
239
|
+
v as Web3RequestManagerEvent
|
240
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../web3-types/lib/esm/data_format_types.cjs");require("../../../web3-types/lib/esm/eth_types.cjs");require("../../../web3-types/lib/esm/web3_base_provider.cjs");const o=require("../../../web3-errors/lib/esm/errors/provider_errors.cjs");require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");const S=require("./utils.cjs"),h=require("./web3_request_manager.cjs"),d=require("../../../web3-utils/lib/esm/validation.cjs");var c=globalThis&&globalThis.__awaiter||function(b,i,r,s){function t(e){return e instanceof r?e:new r(function(n){n(e)})}return new(r||(r=Promise))(function(e,n){function l(u){try{a(s.next(u))}catch(p){n(p)}}function v(u){try{a(s.throw(u))}catch(p){n(p)}}function a(u){u.done?e(u.value):t(u.value).then(l,v)}a((s=s.apply(b,i||[])).next())})};class g{constructor(i,r,s=!1){this.requestManager=i,this.registeredSubscriptions=r,this.tolerateUnlinkedSubscription=s,this._subscriptions=new Map,this.requestManager.on(h.Web3RequestManagerEvent.BEFORE_PROVIDER_CHANGE,()=>c(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(h.Web3RequestManagerEvent.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){const i=this.requestManager.provider;!this.requestManager.provider||typeof(i==null?void 0:i.supportsSubscriptions)=="function"&&!(i!=null&&i.supportsSubscriptions())||typeof this.requestManager.provider.on=="function"&&(typeof this.requestManager.provider.request=="function"?this.requestManager.provider.on("message",r=>this.messageListener(r)):i.on("data",r=>this.messageListener(r)))}messageListener(i){var r,s,t;if(!i)throw new o.SubscriptionError("Should not call messageListener with no data. Type was");const e=((r=i.params)===null||r===void 0?void 0:r.subscription)||((s=i.data)===null||s===void 0?void 0:s.subscription)||((t=i.id)===null||t===void 0?void 0:t.toString(16));if(e){const n=this._subscriptions.get(e);n==null||n.processSubscriptionData(i)}}subscribe(i,r,s=f.DEFAULT_RETURN_FORMAT){return c(this,void 0,void 0,function*(){const t=this.registeredSubscriptions[i];if(!t)throw new o.SubscriptionError("Invalid subscription type");const e=new t(r??void 0,{subscriptionManager:this,returnFormat:s});return yield this.addSubscription(e),e})}get subscriptions(){return this._subscriptions}addSubscription(i){return c(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new o.ProviderError("Provider not available");if(!this.supportsSubscriptions())throw new o.SubscriptionError("The current provider does not support subscriptions");if(i.id&&this._subscriptions.has(i.id))throw new o.SubscriptionError(`Subscription with id "${i.id}" already exists`);if(yield i.sendSubscriptionRequest(),d.isNullish(i.id))throw new o.SubscriptionError("Subscription is not subscribed yet.");return this._subscriptions.set(i.id,i),i.id})}removeSubscription(i){return c(this,void 0,void 0,function*(){const{id:r}=i;if(d.isNullish(r))throw new o.SubscriptionError("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(r)&&!this.tolerateUnlinkedSubscription)throw new o.SubscriptionError(`Subscription with id "${r.toString()}" does not exists`);return yield i.sendUnsubscribeRequest(),this._subscriptions.delete(r),r})}unsubscribe(i){return c(this,void 0,void 0,function*(){const r=[];for(const[s,t]of this.subscriptions.entries())(!i||typeof i=="function"&&i({id:s,sub:t}))&&r.push(this.removeSubscription(t));return Promise.all(r)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return d.isNullish(this.requestManager.provider)?!1:S.isSupportSubscriptions(this.requestManager.provider)}}exports.Web3SubscriptionManager=g;
|