bitmart 0.0.116__py3-none-any.whl
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.
- bitmart/__init__.py +7 -0
- bitmart/ccxt/__init__.py +102 -0
- bitmart/ccxt/abstract/bitmart.py +117 -0
- bitmart/ccxt/async_support/__init__.py +81 -0
- bitmart/ccxt/async_support/base/__init__.py +1 -0
- bitmart/ccxt/async_support/base/exchange.py +2315 -0
- bitmart/ccxt/async_support/base/throttler.py +88 -0
- bitmart/ccxt/async_support/base/ws/__init__.py +38 -0
- bitmart/ccxt/async_support/base/ws/cache.py +219 -0
- bitmart/ccxt/async_support/base/ws/client.py +350 -0
- bitmart/ccxt/async_support/base/ws/functions.py +59 -0
- bitmart/ccxt/async_support/base/ws/future.py +46 -0
- bitmart/ccxt/async_support/base/ws/order_book.py +78 -0
- bitmart/ccxt/async_support/base/ws/order_book_side.py +174 -0
- bitmart/ccxt/async_support/bitmart.py +5361 -0
- bitmart/ccxt/base/__init__.py +27 -0
- bitmart/ccxt/base/decimal_to_precision.py +178 -0
- bitmart/ccxt/base/errors.py +273 -0
- bitmart/ccxt/base/exchange.py +7642 -0
- bitmart/ccxt/base/precise.py +297 -0
- bitmart/ccxt/base/types.py +619 -0
- bitmart/ccxt/bitmart.py +5361 -0
- bitmart/ccxt/pro/__init__.py +66 -0
- bitmart/ccxt/pro/bitmart.py +1917 -0
- bitmart/ccxt/static_dependencies/README.md +1 -0
- bitmart/ccxt/static_dependencies/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/__init__.py +6 -0
- bitmart/ccxt/static_dependencies/bip/addr/P2PKH_addr.py +205 -0
- bitmart/ccxt/static_dependencies/bip/addr/__init__.py +5 -0
- bitmart/ccxt/static_dependencies/bip/addr/addr_dec_utils.py +125 -0
- bitmart/ccxt/static_dependencies/bip/addr/addr_key_validator.py +162 -0
- bitmart/ccxt/static_dependencies/bip/addr/iaddr_decoder.py +48 -0
- bitmart/ccxt/static_dependencies/bip/addr/iaddr_encoder.py +50 -0
- bitmart/ccxt/static_dependencies/bip/base58/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/base58/base58.py +207 -0
- bitmart/ccxt/static_dependencies/bip/base58/base58_ex.py +25 -0
- bitmart/ccxt/static_dependencies/bip/base58/base58_xmr.py +155 -0
- bitmart/ccxt/static_dependencies/bip/bech32/__init__.py +4 -0
- bitmart/ccxt/static_dependencies/bip/bech32/bch_bech32.py +220 -0
- bitmart/ccxt/static_dependencies/bip/bech32/bech32.py +235 -0
- bitmart/ccxt/static_dependencies/bip/bech32/bech32_base.py +246 -0
- bitmart/ccxt/static_dependencies/bip/bech32/bech32_ex.py +25 -0
- bitmart/ccxt/static_dependencies/bip/bech32/segwit_bech32.py +173 -0
- bitmart/ccxt/static_dependencies/bip/bip32/__init__.py +14 -0
- bitmart/ccxt/static_dependencies/bip/bip32/base/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/bip32/base/bip32_base.py +581 -0
- bitmart/ccxt/static_dependencies/bip/bip32/base/ibip32_key_derivator.py +83 -0
- bitmart/ccxt/static_dependencies/bip/bip32/base/ibip32_mst_key_generator.py +47 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_const.py +35 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_ex.py +29 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_key_data.py +500 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_key_net_ver.py +83 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_key_ser.py +294 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_keys.py +457 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_path.py +247 -0
- bitmart/ccxt/static_dependencies/bip/bip32/bip32_utils.py +72 -0
- bitmart/ccxt/static_dependencies/bip/bip32/kholaw/__init__.py +4 -0
- bitmart/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_ed25519.py +82 -0
- bitmart/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_ed25519_key_derivator.py +118 -0
- bitmart/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_key_derivator_base.py +204 -0
- bitmart/ccxt/static_dependencies/bip/bip32/kholaw/bip32_kholaw_mst_key_generator.py +119 -0
- bitmart/ccxt/static_dependencies/bip/bip32/slip10/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/bip32/slip10/bip32_slip10_key_derivator.py +200 -0
- bitmart/ccxt/static_dependencies/bip/bip32/slip10/bip32_slip10_mst_key_generator.py +168 -0
- bitmart/ccxt/static_dependencies/bip/bip32/slip10/bip32_slip10_secp256k1.py +82 -0
- bitmart/ccxt/static_dependencies/bip/bip44/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/bip44/bip44.py +265 -0
- bitmart/ccxt/static_dependencies/bip/bip44_base/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/bip44_base/bip44_base.py +624 -0
- bitmart/ccxt/static_dependencies/bip/bip44_base/bip44_base_ex.py +25 -0
- bitmart/ccxt/static_dependencies/bip/bip44_base/bip44_keys.py +225 -0
- bitmart/ccxt/static_dependencies/bip/coin_conf/__init__.py +2 -0
- bitmart/ccxt/static_dependencies/bip/coin_conf/coin_conf.py +68 -0
- bitmart/ccxt/static_dependencies/bip/coin_conf/coins_conf.py +890 -0
- bitmart/ccxt/static_dependencies/bip/conf/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip44/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip44/bip44_coins.py +126 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip44/bip44_conf.py +1360 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip44/bip44_conf_getter.py +153 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip49/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip49/bip49_coins.py +53 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip49/bip49_conf.py +366 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip49/bip49_conf_getter.py +80 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip84/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip84/bip84_coins.py +39 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip84/bip84_conf.py +113 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip84/bip84_conf_getter.py +66 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip86/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip86/bip86_coins.py +37 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip86/bip86_conf.py +83 -0
- bitmart/ccxt/static_dependencies/bip/conf/bip86/bip86_conf_getter.py +64 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/__init__.py +8 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/atom_addr.py +104 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/bip_bitcoin_cash_conf.py +106 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/bip_coin_conf.py +217 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/bip_coins.py +28 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/bip_conf_const.py +30 -0
- bitmart/ccxt/static_dependencies/bip/conf/common/bip_litecoin_conf.py +121 -0
- bitmart/ccxt/static_dependencies/bip/ecc/__init__.py +42 -0
- bitmart/ccxt/static_dependencies/bip/ecc/common/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/ecc/common/dummy_point.py +219 -0
- bitmart/ccxt/static_dependencies/bip/ecc/common/ikeys.py +263 -0
- bitmart/ccxt/static_dependencies/bip/ecc/common/ipoint.py +190 -0
- bitmart/ccxt/static_dependencies/bip/ecc/conf.py +28 -0
- bitmart/ccxt/static_dependencies/bip/ecc/curve/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/ecc/curve/elliptic_curve.py +121 -0
- bitmart/ccxt/static_dependencies/bip/ecc/curve/elliptic_curve_getter.py +74 -0
- bitmart/ccxt/static_dependencies/bip/ecc/curve/elliptic_curve_types.py +37 -0
- bitmart/ccxt/static_dependencies/bip/ecc/ecdsa/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/ecc/ecdsa/ecdsa_keys.py +36 -0
- bitmart/ccxt/static_dependencies/bip/ecc/secp256k1/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1.py +36 -0
- bitmart/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1_const.py +59 -0
- bitmart/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1_keys_ecdsa.py +248 -0
- bitmart/ccxt/static_dependencies/bip/ecc/secp256k1/secp256k1_point_ecdsa.py +234 -0
- bitmart/ccxt/static_dependencies/bip/slip/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip173/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip173/slip173.py +60 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip32/__init__.py +4 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip32/slip32.py +322 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip32/slip32_key_net_ver.py +62 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip44/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/slip/slip44/slip44.py +81 -0
- bitmart/ccxt/static_dependencies/bip/utils/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/bip/utils/conf/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/utils/conf/coin_names.py +59 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/__init__.py +10 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/aes_ecb.py +152 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/blake2.py +191 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/chacha20_poly1305.py +101 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/hash160.py +57 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/hmac.py +118 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/pbkdf2.py +66 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/ripemd.py +58 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/scrypt.py +66 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/sha2.py +182 -0
- bitmart/ccxt/static_dependencies/bip/utils/crypto/sha3.py +99 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/__init__.py +7 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/algo.py +108 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/base32.py +151 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/bit.py +115 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/bytes.py +200 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/data_bytes.py +181 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/integer.py +97 -0
- bitmart/ccxt/static_dependencies/bip/utils/misc/string.py +54 -0
- bitmart/ccxt/static_dependencies/bip/utils/typing/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/utils/typing/literal.py +27 -0
- bitmart/ccxt/static_dependencies/bip/wif/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/bip/wif/wif.py +144 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/amino/amino_pb2.py +31 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/base/v1beta1/coin_pb2.py +47 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/crypto/multisig/keys_pb2.py +33 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/crypto/multisig/v1beta1/multisig_pb2.py +33 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/crypto/secp256k1/keys_pb2.py +34 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/msg/v1/msg_pb2.py +27 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/tx/signing/v1beta1/signing_pb2.py +38 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos/tx/v1beta1/tx_pb2.py +75 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/cosmos_proto/cosmos_pb2.py +36 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/accountplus_pb2.py +31 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/genesis_pb2.py +40 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/models_pb2.py +26 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/params_pb2.py +29 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/query_pb2.py +57 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/accountplus/tx_pb2.py +51 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/block_rate_limit_config_pb2.py +37 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/clob_pair_pb2.py +41 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/equity_tier_limit_config_pb2.py +35 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/finalize_block_pb2.py +27 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/liquidations_config_pb2.py +39 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/liquidations_pb2.py +38 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/matches_pb2.py +55 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/mev_pb2.py +49 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/operation_pb2.py +32 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/order_pb2.py +86 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/order_removals_pb2.py +32 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/process_proposer_matches_events_pb2.py +42 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/query_pb2.py +124 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/streaming_pb2.py +29 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/clob/tx_pb2.py +117 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/genesis_pb2.py +26 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/query_pb2.py +26 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/transfer_pb2.py +61 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/sending/tx_pb2.py +37 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/asset_position_pb2.py +29 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/genesis_pb2.py +30 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/perpetual_position_pb2.py +33 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/query_pb2.py +63 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/streaming_pb2.py +31 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/dydxprotocol/subaccounts/subaccount_pb2.py +33 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/gogoproto/gogo_pb2.py +102 -0
- bitmart/ccxt/static_dependencies/dydx_v4_client/registry.py +38 -0
- bitmart/ccxt/static_dependencies/ecdsa/__init__.py +14 -0
- bitmart/ccxt/static_dependencies/ecdsa/_version.py +520 -0
- bitmart/ccxt/static_dependencies/ecdsa/curves.py +56 -0
- bitmart/ccxt/static_dependencies/ecdsa/der.py +221 -0
- bitmart/ccxt/static_dependencies/ecdsa/ecdsa.py +310 -0
- bitmart/ccxt/static_dependencies/ecdsa/ellipticcurve.py +1039 -0
- bitmart/ccxt/static_dependencies/ecdsa/keys.py +343 -0
- bitmart/ccxt/static_dependencies/ecdsa/numbertheory.py +531 -0
- bitmart/ccxt/static_dependencies/ecdsa/rfc6979.py +100 -0
- bitmart/ccxt/static_dependencies/ecdsa/util.py +266 -0
- bitmart/ccxt/static_dependencies/ethereum/__init__.py +7 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/__init__.py +16 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/abi.py +19 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/base.py +152 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/codec.py +217 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/constants.py +3 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/decoding.py +565 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/encoding.py +720 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/exceptions.py +139 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/grammar.py +443 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/packed.py +13 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/registry.py +643 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/tools/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/tools/_strategies.py +230 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/utils/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/utils/numeric.py +83 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/utils/padding.py +27 -0
- bitmart/ccxt/static_dependencies/ethereum/abi/utils/string.py +19 -0
- bitmart/ccxt/static_dependencies/ethereum/account/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/ethereum/account/encode_typed_data/__init__.py +4 -0
- bitmart/ccxt/static_dependencies/ethereum/account/encode_typed_data/encoding_and_hashing.py +239 -0
- bitmart/ccxt/static_dependencies/ethereum/account/encode_typed_data/helpers.py +40 -0
- bitmart/ccxt/static_dependencies/ethereum/account/messages.py +263 -0
- bitmart/ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- bitmart/ccxt/static_dependencies/ethereum/hexbytes/__init__.py +5 -0
- bitmart/ccxt/static_dependencies/ethereum/hexbytes/_utils.py +54 -0
- bitmart/ccxt/static_dependencies/ethereum/hexbytes/main.py +65 -0
- bitmart/ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/__init__.py +63 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/abi.py +6 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/bls.py +7 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/discovery.py +5 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/encoding.py +7 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/enums.py +17 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/ethpm.py +9 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/evm.py +20 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/networks.py +1122 -0
- bitmart/ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/__init__.py +115 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/abi.py +72 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/address.py +171 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/applicators.py +151 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/conversions.py +190 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/currency.py +107 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/curried/__init__.py +269 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/debug.py +20 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/decorators.py +132 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/encoding.py +6 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/exceptions.py +4 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/functional.py +75 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/hexadecimal.py +74 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/humanize.py +188 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/logging.py +159 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/module_loading.py +31 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/numeric.py +43 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/toolz.py +76 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/types.py +54 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/typing/__init__.py +18 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/typing/misc.py +14 -0
- bitmart/ccxt/static_dependencies/ethereum/utils/units.py +31 -0
- bitmart/ccxt/static_dependencies/keccak/__init__.py +3 -0
- bitmart/ccxt/static_dependencies/keccak/keccak.py +197 -0
- bitmart/ccxt/static_dependencies/lark/__init__.py +38 -0
- bitmart/ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
- bitmart/ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
- bitmart/ccxt/static_dependencies/lark/ast_utils.py +59 -0
- bitmart/ccxt/static_dependencies/lark/common.py +86 -0
- bitmart/ccxt/static_dependencies/lark/exceptions.py +292 -0
- bitmart/ccxt/static_dependencies/lark/grammar.py +130 -0
- bitmart/ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/lark/grammars/common.lark +59 -0
- bitmart/ccxt/static_dependencies/lark/grammars/lark.lark +62 -0
- bitmart/ccxt/static_dependencies/lark/grammars/python.lark +302 -0
- bitmart/ccxt/static_dependencies/lark/grammars/unicode.lark +7 -0
- bitmart/ccxt/static_dependencies/lark/indenter.py +143 -0
- bitmart/ccxt/static_dependencies/lark/lark.py +658 -0
- bitmart/ccxt/static_dependencies/lark/lexer.py +678 -0
- bitmart/ccxt/static_dependencies/lark/load_grammar.py +1428 -0
- bitmart/ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
- bitmart/ccxt/static_dependencies/lark/parser_frontends.py +257 -0
- bitmart/ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
- bitmart/ccxt/static_dependencies/lark/parsers/earley.py +314 -0
- bitmart/ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
- bitmart/ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
- bitmart/ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
- bitmart/ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
- bitmart/ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
- bitmart/ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
- bitmart/ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
- bitmart/ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
- bitmart/ccxt/static_dependencies/lark/py.typed +0 -0
- bitmart/ccxt/static_dependencies/lark/reconstruct.py +107 -0
- bitmart/ccxt/static_dependencies/lark/tools/__init__.py +70 -0
- bitmart/ccxt/static_dependencies/lark/tools/nearley.py +202 -0
- bitmart/ccxt/static_dependencies/lark/tools/serialize.py +32 -0
- bitmart/ccxt/static_dependencies/lark/tools/standalone.py +196 -0
- bitmart/ccxt/static_dependencies/lark/tree.py +267 -0
- bitmart/ccxt/static_dependencies/lark/tree_matcher.py +186 -0
- bitmart/ccxt/static_dependencies/lark/tree_templates.py +180 -0
- bitmart/ccxt/static_dependencies/lark/utils.py +343 -0
- bitmart/ccxt/static_dependencies/lark/visitors.py +596 -0
- bitmart/ccxt/static_dependencies/marshmallow/__init__.py +81 -0
- bitmart/ccxt/static_dependencies/marshmallow/base.py +65 -0
- bitmart/ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
- bitmart/ccxt/static_dependencies/marshmallow/decorators.py +231 -0
- bitmart/ccxt/static_dependencies/marshmallow/error_store.py +60 -0
- bitmart/ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
- bitmart/ccxt/static_dependencies/marshmallow/fields.py +2114 -0
- bitmart/ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
- bitmart/ccxt/static_dependencies/marshmallow/py.typed +0 -0
- bitmart/ccxt/static_dependencies/marshmallow/schema.py +1228 -0
- bitmart/ccxt/static_dependencies/marshmallow/types.py +12 -0
- bitmart/ccxt/static_dependencies/marshmallow/utils.py +378 -0
- bitmart/ccxt/static_dependencies/marshmallow/validate.py +678 -0
- bitmart/ccxt/static_dependencies/marshmallow/warnings.py +2 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
- bitmart/ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
- bitmart/ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
- bitmart/ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
- bitmart/ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- bitmart/ccxt/static_dependencies/mnemonic/__init__.py +4 -0
- bitmart/ccxt/static_dependencies/mnemonic/mnemonic.py +282 -0
- bitmart/ccxt/static_dependencies/mnemonic/py.typed +1 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/chinese_simplified.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/chinese_traditional.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/czech.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/english.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/french.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/italian.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/japanese.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/korean.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/portuguese.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/russian.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/spanish.txt +2048 -0
- bitmart/ccxt/static_dependencies/mnemonic/wordlist/turkish.txt +2048 -0
- bitmart/ccxt/static_dependencies/msgpack/__init__.py +55 -0
- bitmart/ccxt/static_dependencies/msgpack/_cmsgpack.pyx +11 -0
- bitmart/ccxt/static_dependencies/msgpack/_packer.pyx +374 -0
- bitmart/ccxt/static_dependencies/msgpack/_unpacker.pyx +547 -0
- bitmart/ccxt/static_dependencies/msgpack/buff_converter.h +8 -0
- bitmart/ccxt/static_dependencies/msgpack/exceptions.py +48 -0
- bitmart/ccxt/static_dependencies/msgpack/ext.py +168 -0
- bitmart/ccxt/static_dependencies/msgpack/fallback.py +951 -0
- bitmart/ccxt/static_dependencies/msgpack/pack.h +89 -0
- bitmart/ccxt/static_dependencies/msgpack/pack_template.h +820 -0
- bitmart/ccxt/static_dependencies/msgpack/sysdep.h +194 -0
- bitmart/ccxt/static_dependencies/msgpack/unpack.h +391 -0
- bitmart/ccxt/static_dependencies/msgpack/unpack_define.h +95 -0
- bitmart/ccxt/static_dependencies/msgpack/unpack_template.h +464 -0
- bitmart/ccxt/static_dependencies/parsimonious/__init__.py +10 -0
- bitmart/ccxt/static_dependencies/parsimonious/exceptions.py +105 -0
- bitmart/ccxt/static_dependencies/parsimonious/expressions.py +479 -0
- bitmart/ccxt/static_dependencies/parsimonious/grammar.py +487 -0
- bitmart/ccxt/static_dependencies/parsimonious/nodes.py +325 -0
- bitmart/ccxt/static_dependencies/parsimonious/utils.py +40 -0
- bitmart/ccxt/static_dependencies/starknet/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v0/__init__.py +2 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v0/model.py +44 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v0/parser.py +216 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v0/schemas.py +72 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v0/shape.py +63 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/__init__.py +2 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/core_structures.json +14 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/model.py +39 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/parser.py +220 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/parser_transformer.py +179 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/schemas.py +66 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v1/shape.py +47 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v2/__init__.py +2 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v2/model.py +89 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v2/parser.py +293 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v2/parser_transformer.py +192 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v2/schemas.py +132 -0
- bitmart/ccxt/static_dependencies/starknet/abi/v2/shape.py +107 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
- bitmart/ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
- bitmart/ccxt/static_dependencies/starknet/common.py +15 -0
- bitmart/ccxt/static_dependencies/starknet/constants.py +39 -0
- bitmart/ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/hash/address.py +79 -0
- bitmart/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
- bitmart/ccxt/static_dependencies/starknet/hash/selector.py +16 -0
- bitmart/ccxt/static_dependencies/starknet/hash/storage.py +12 -0
- bitmart/ccxt/static_dependencies/starknet/hash/utils.py +78 -0
- bitmart/ccxt/static_dependencies/starknet/models/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
- bitmart/ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
- bitmart/ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
- bitmart/ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
- bitmart/ccxt/static_dependencies/starknet/utils/schema.py +13 -0
- bitmart/ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
- bitmart/ccxt/static_dependencies/starkware/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
- bitmart/ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
- bitmart/ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
- bitmart/ccxt/static_dependencies/starkware/crypto/utils.py +63 -0
- bitmart/ccxt/static_dependencies/sympy/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/sympy/core/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
- bitmart/ccxt/static_dependencies/sympy/external/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
- bitmart/ccxt/static_dependencies/sympy/external/importtools.py +187 -0
- bitmart/ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
- bitmart/ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
- bitmart/ccxt/static_dependencies/toolz/__init__.py +26 -0
- bitmart/ccxt/static_dependencies/toolz/_signatures.py +784 -0
- bitmart/ccxt/static_dependencies/toolz/_version.py +520 -0
- bitmart/ccxt/static_dependencies/toolz/compatibility.py +30 -0
- bitmart/ccxt/static_dependencies/toolz/curried/__init__.py +101 -0
- bitmart/ccxt/static_dependencies/toolz/curried/exceptions.py +22 -0
- bitmart/ccxt/static_dependencies/toolz/curried/operator.py +22 -0
- bitmart/ccxt/static_dependencies/toolz/dicttoolz.py +339 -0
- bitmart/ccxt/static_dependencies/toolz/functoolz.py +1049 -0
- bitmart/ccxt/static_dependencies/toolz/itertoolz.py +1057 -0
- bitmart/ccxt/static_dependencies/toolz/recipes.py +46 -0
- bitmart/ccxt/static_dependencies/toolz/utils.py +9 -0
- bitmart/ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
- bitmart/ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
- bitmart-0.0.116.dist-info/METADATA +342 -0
- bitmart-0.0.116.dist-info/RECORD +466 -0
- bitmart-0.0.116.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
from typing import (
|
|
2
|
+
Any,
|
|
3
|
+
Iterable,
|
|
4
|
+
Iterator,
|
|
5
|
+
Tuple,
|
|
6
|
+
Union,
|
|
7
|
+
)
|
|
8
|
+
from urllib import (
|
|
9
|
+
parse,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from ..typing import (
|
|
13
|
+
URI,
|
|
14
|
+
Hash32,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from .currency import (
|
|
18
|
+
denoms,
|
|
19
|
+
from_wei,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
from .toolz import (
|
|
23
|
+
sliding_window,
|
|
24
|
+
take,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def humanize_seconds(seconds: Union[float, int]) -> str:
|
|
29
|
+
if int(seconds) == 0:
|
|
30
|
+
return "0s"
|
|
31
|
+
|
|
32
|
+
unit_values = _consume_leading_zero_units(_humanize_seconds(int(seconds)))
|
|
33
|
+
|
|
34
|
+
return "".join((f"{amount}{unit}" for amount, unit in take(3, unit_values)))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
SECOND = 1
|
|
38
|
+
MINUTE = 60
|
|
39
|
+
HOUR = 60 * 60
|
|
40
|
+
DAY = 24 * HOUR
|
|
41
|
+
YEAR = 365 * DAY
|
|
42
|
+
MONTH = YEAR // 12
|
|
43
|
+
WEEK = 7 * DAY
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
UNITS = (
|
|
47
|
+
(YEAR, "y"),
|
|
48
|
+
(MONTH, "m"),
|
|
49
|
+
(WEEK, "w"),
|
|
50
|
+
(DAY, "d"),
|
|
51
|
+
(HOUR, "h"),
|
|
52
|
+
(MINUTE, "m"),
|
|
53
|
+
(SECOND, "s"),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _consume_leading_zero_units(
|
|
58
|
+
units_iter: Iterator[Tuple[int, str]]
|
|
59
|
+
) -> Iterator[Tuple[int, str]]:
|
|
60
|
+
for amount, unit in units_iter:
|
|
61
|
+
if amount == 0:
|
|
62
|
+
continue
|
|
63
|
+
else:
|
|
64
|
+
yield (amount, unit)
|
|
65
|
+
break
|
|
66
|
+
|
|
67
|
+
yield from units_iter
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def _humanize_seconds(seconds: int) -> Iterator[Tuple[int, str]]:
|
|
71
|
+
remainder = seconds
|
|
72
|
+
|
|
73
|
+
for duration, unit in UNITS:
|
|
74
|
+
if not remainder:
|
|
75
|
+
break
|
|
76
|
+
|
|
77
|
+
num = remainder // duration
|
|
78
|
+
yield num, unit
|
|
79
|
+
|
|
80
|
+
remainder %= duration
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
DISPLAY_HASH_CHARS = 4
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def humanize_bytes(value: bytes) -> str:
|
|
87
|
+
if len(value) <= DISPLAY_HASH_CHARS + 1:
|
|
88
|
+
return value.hex()
|
|
89
|
+
value_as_hex = value.hex()
|
|
90
|
+
head = value_as_hex[:DISPLAY_HASH_CHARS]
|
|
91
|
+
tail = value_as_hex[-1 * DISPLAY_HASH_CHARS :]
|
|
92
|
+
return f"{head}..{tail}"
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def humanize_hash(value: Hash32) -> str:
|
|
96
|
+
return humanize_bytes(value)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def humanize_ipfs_uri(uri: URI) -> str:
|
|
100
|
+
if not is_ipfs_uri(uri):
|
|
101
|
+
raise TypeError(
|
|
102
|
+
f"{uri} does not look like a valid IPFS uri. Currently, "
|
|
103
|
+
"only CIDv0 hash schemes are supported."
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
parsed = parse.urlparse(uri)
|
|
107
|
+
ipfs_hash = parsed.netloc
|
|
108
|
+
head = ipfs_hash[:DISPLAY_HASH_CHARS]
|
|
109
|
+
tail = ipfs_hash[-1 * DISPLAY_HASH_CHARS :]
|
|
110
|
+
return f"ipfs://{head}..{tail}"
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def is_ipfs_uri(value: Any) -> bool:
|
|
114
|
+
if not isinstance(value, str):
|
|
115
|
+
return False
|
|
116
|
+
|
|
117
|
+
parsed = parse.urlparse(value)
|
|
118
|
+
if parsed.scheme != "ipfs" or not parsed.netloc:
|
|
119
|
+
return False
|
|
120
|
+
|
|
121
|
+
return _is_CIDv0_ipfs_hash(parsed.netloc)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def _is_CIDv0_ipfs_hash(ipfs_hash: str) -> bool:
|
|
125
|
+
if ipfs_hash.startswith("Qm") and len(ipfs_hash) == 46:
|
|
126
|
+
return True
|
|
127
|
+
return False
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _find_breakpoints(*values: int) -> Iterator[int]:
|
|
131
|
+
yield 0
|
|
132
|
+
for index, (left, right) in enumerate(sliding_window(2, values), 1):
|
|
133
|
+
if left + 1 == right:
|
|
134
|
+
continue
|
|
135
|
+
else:
|
|
136
|
+
yield index
|
|
137
|
+
yield len(values)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _extract_integer_ranges(*values: int) -> Iterator[Tuple[int, int]]:
|
|
141
|
+
"""
|
|
142
|
+
Return a tuple of consecutive ranges of integers.
|
|
143
|
+
|
|
144
|
+
:param values: a sequence of ordered integers
|
|
145
|
+
|
|
146
|
+
- fn(1, 2, 3) -> ((1, 3),)
|
|
147
|
+
- fn(1, 2, 3, 7, 8, 9) -> ((1, 3), (7, 9))
|
|
148
|
+
- fn(1, 7, 8, 9) -> ((1, 1), (7, 9))
|
|
149
|
+
"""
|
|
150
|
+
for left, right in sliding_window(2, _find_breakpoints(*values)):
|
|
151
|
+
chunk = values[left:right]
|
|
152
|
+
yield chunk[0], chunk[-1]
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _humanize_range(bounds: Tuple[int, int]) -> str:
|
|
156
|
+
left, right = bounds
|
|
157
|
+
if left == right:
|
|
158
|
+
return str(left)
|
|
159
|
+
else:
|
|
160
|
+
return f"{left}-{right}"
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def humanize_integer_sequence(values_iter: Iterable[int]) -> str:
|
|
164
|
+
"""
|
|
165
|
+
Return a concise, human-readable string representing a sequence of integers.
|
|
166
|
+
|
|
167
|
+
- fn((1, 2, 3)) -> '1-3'
|
|
168
|
+
- fn((1, 2, 3, 7, 8, 9)) -> '1-3|7-9'
|
|
169
|
+
- fn((1, 2, 3, 5, 7, 8, 9)) -> '1-3|5|7-9'
|
|
170
|
+
- fn((1, 7, 8, 9)) -> '1|7-9'
|
|
171
|
+
"""
|
|
172
|
+
values = tuple(values_iter)
|
|
173
|
+
if not values:
|
|
174
|
+
return "(empty)"
|
|
175
|
+
else:
|
|
176
|
+
return "|".join(map(_humanize_range, _extract_integer_ranges(*values)))
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def humanize_wei(number: int) -> str:
|
|
180
|
+
if number >= denoms.finney:
|
|
181
|
+
unit = "ether"
|
|
182
|
+
elif number >= denoms.mwei:
|
|
183
|
+
unit = "gwei"
|
|
184
|
+
else:
|
|
185
|
+
unit = "wei"
|
|
186
|
+
amount = from_wei(number, unit)
|
|
187
|
+
x = f"{str(amount)} {unit}"
|
|
188
|
+
return x
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import contextlib
|
|
2
|
+
from functools import (
|
|
3
|
+
cached_property,
|
|
4
|
+
)
|
|
5
|
+
import logging
|
|
6
|
+
from typing import (
|
|
7
|
+
Any,
|
|
8
|
+
Dict,
|
|
9
|
+
Iterator,
|
|
10
|
+
Tuple,
|
|
11
|
+
Type,
|
|
12
|
+
TypeVar,
|
|
13
|
+
Union,
|
|
14
|
+
cast,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from .toolz import (
|
|
18
|
+
assoc,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
DEBUG2_LEVEL_NUM = 8
|
|
22
|
+
|
|
23
|
+
TLogger = TypeVar("TLogger", bound=logging.Logger)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ExtendedDebugLogger(logging.Logger):
|
|
27
|
+
"""
|
|
28
|
+
Logging class that can be used for lower level debug logging.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
@cached_property
|
|
32
|
+
def show_debug2(self) -> bool:
|
|
33
|
+
return self.isEnabledFor(DEBUG2_LEVEL_NUM)
|
|
34
|
+
|
|
35
|
+
def debug2(self, message: str, *args: Any, **kwargs: Any) -> None:
|
|
36
|
+
if self.show_debug2:
|
|
37
|
+
self.log(DEBUG2_LEVEL_NUM, message, *args, **kwargs)
|
|
38
|
+
else:
|
|
39
|
+
# When we find that `DEBUG2` isn't enabled we completely replace
|
|
40
|
+
# the `debug2` function in this instance of the logger with a noop
|
|
41
|
+
# lambda to further speed up
|
|
42
|
+
self.__dict__["debug2"] = lambda message, *args, **kwargs: None
|
|
43
|
+
|
|
44
|
+
def __reduce__(self) -> Tuple[Any, ...]:
|
|
45
|
+
# This is needed because our parent's implementation could
|
|
46
|
+
# cause us to become a regular Logger on unpickling.
|
|
47
|
+
return get_extended_debug_logger, (self.name,)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def setup_DEBUG2_logging() -> None:
|
|
51
|
+
"""
|
|
52
|
+
Installs the `DEBUG2` level logging levels to the main logging module.
|
|
53
|
+
"""
|
|
54
|
+
if not hasattr(logging, "DEBUG2"):
|
|
55
|
+
logging.addLevelName(DEBUG2_LEVEL_NUM, "DEBUG2")
|
|
56
|
+
logging.DEBUG2 = DEBUG2_LEVEL_NUM # type: ignore
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@contextlib.contextmanager
|
|
60
|
+
def _use_logger_class(logger_class: Type[logging.Logger]) -> Iterator[None]:
|
|
61
|
+
original_logger_class = logging.getLoggerClass()
|
|
62
|
+
logging.setLoggerClass(logger_class)
|
|
63
|
+
try:
|
|
64
|
+
yield
|
|
65
|
+
finally:
|
|
66
|
+
logging.setLoggerClass(original_logger_class)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def get_logger(name: str, logger_class: Union[Type[TLogger], None] = None) -> TLogger:
|
|
70
|
+
if logger_class is None:
|
|
71
|
+
return cast(TLogger, logging.getLogger(name))
|
|
72
|
+
else:
|
|
73
|
+
with _use_logger_class(logger_class):
|
|
74
|
+
# The logging module caches logger instances. The following code
|
|
75
|
+
# ensures that if there is a cached instance that we don't
|
|
76
|
+
# accidentally return the incorrect logger type because the logging
|
|
77
|
+
# module does not *update* the cached instance in the event that
|
|
78
|
+
# the global logging class changes.
|
|
79
|
+
#
|
|
80
|
+
# types ignored b/c mypy doesn't identify presence of
|
|
81
|
+
# manager on logging.Logger
|
|
82
|
+
manager = logging.Logger.manager
|
|
83
|
+
if name in manager.loggerDict:
|
|
84
|
+
if type(manager.loggerDict[name]) is not logger_class:
|
|
85
|
+
del manager.loggerDict[name]
|
|
86
|
+
return cast(TLogger, logging.getLogger(name))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def get_extended_debug_logger(name: str) -> ExtendedDebugLogger:
|
|
90
|
+
return get_logger(name, ExtendedDebugLogger)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
THasLoggerMeta = TypeVar("THasLoggerMeta", bound="HasLoggerMeta")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class HasLoggerMeta(type):
|
|
97
|
+
"""
|
|
98
|
+
Assigns a logger instance to a class, derived from the import path and name.
|
|
99
|
+
|
|
100
|
+
This metaclass uses `__qualname__` to identify a unique and meaningful name
|
|
101
|
+
to use when creating the associated logger for a given class.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
logger_class = logging.Logger
|
|
105
|
+
|
|
106
|
+
def __new__(
|
|
107
|
+
mcls: Type[THasLoggerMeta],
|
|
108
|
+
name: str,
|
|
109
|
+
bases: Tuple[Type[Any]],
|
|
110
|
+
namespace: Dict[str, Any],
|
|
111
|
+
) -> THasLoggerMeta:
|
|
112
|
+
if "logger" in namespace:
|
|
113
|
+
# If a logger was explicitly declared we shouldn't do anything to
|
|
114
|
+
# replace it.
|
|
115
|
+
return super().__new__(mcls, name, bases, namespace)
|
|
116
|
+
if "__qualname__" not in namespace:
|
|
117
|
+
raise AttributeError("Missing __qualname__")
|
|
118
|
+
|
|
119
|
+
with _use_logger_class(mcls.logger_class):
|
|
120
|
+
logger = logging.getLogger(namespace["__qualname__"])
|
|
121
|
+
|
|
122
|
+
return super().__new__(mcls, name, bases, assoc(namespace, "logger", logger))
|
|
123
|
+
|
|
124
|
+
@classmethod
|
|
125
|
+
def replace_logger_class(
|
|
126
|
+
mcls: Type[THasLoggerMeta], value: Type[logging.Logger]
|
|
127
|
+
) -> Type[THasLoggerMeta]:
|
|
128
|
+
return type(mcls.__name__, (mcls,), {"logger_class": value})
|
|
129
|
+
|
|
130
|
+
@classmethod
|
|
131
|
+
def meta_compat(
|
|
132
|
+
mcls: Type[THasLoggerMeta], other: Type[type]
|
|
133
|
+
) -> Type[THasLoggerMeta]:
|
|
134
|
+
return type(mcls.__name__, (mcls, other), {})
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class _BaseHasLogger(metaclass=HasLoggerMeta):
|
|
138
|
+
# This class exists to a allow us to define the type of the logger. Once
|
|
139
|
+
# python3.5 is deprecated this can be removed in favor of a simple type
|
|
140
|
+
# annotation on the main class.
|
|
141
|
+
logger = logging.Logger("") # type: logging.Logger
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class HasLogger(_BaseHasLogger):
|
|
145
|
+
pass
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
HasExtendedDebugLoggerMeta = HasLoggerMeta.replace_logger_class(ExtendedDebugLogger)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class _BaseHasExtendedDebugLogger(metaclass=HasExtendedDebugLoggerMeta): # type: ignore
|
|
152
|
+
# This class exists to a allow us to define the type of the logger. Once
|
|
153
|
+
# python3.5 is deprecated this can be removed in favor of a simple type
|
|
154
|
+
# annotation on the main class.
|
|
155
|
+
logger = ExtendedDebugLogger("") # type: ExtendedDebugLogger
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class HasExtendedDebugLogger(_BaseHasExtendedDebugLogger):
|
|
159
|
+
pass
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from importlib import (
|
|
2
|
+
import_module,
|
|
3
|
+
)
|
|
4
|
+
from typing import (
|
|
5
|
+
Any,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def import_string(dotted_path: str) -> Any:
|
|
10
|
+
"""
|
|
11
|
+
Import a variable using its path and name.
|
|
12
|
+
|
|
13
|
+
:param dotted_path: dotted module path and variable/class name
|
|
14
|
+
:return: the attribute/class designated by the last name in the path
|
|
15
|
+
:raise: ImportError, if the import failed
|
|
16
|
+
|
|
17
|
+
Source: django.utils.module_loading
|
|
18
|
+
"""
|
|
19
|
+
try:
|
|
20
|
+
module_path, class_name = dotted_path.rsplit(".", 1)
|
|
21
|
+
except ValueError:
|
|
22
|
+
msg = f"{dotted_path} doesn't look like a module path"
|
|
23
|
+
raise ImportError(msg)
|
|
24
|
+
|
|
25
|
+
module = import_module(module_path)
|
|
26
|
+
|
|
27
|
+
try:
|
|
28
|
+
return getattr(module, class_name)
|
|
29
|
+
except AttributeError:
|
|
30
|
+
msg = f'Module "{module_path}" does not define a "{class_name}" attribute/class'
|
|
31
|
+
raise ImportError(msg)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from abc import (
|
|
2
|
+
ABC,
|
|
3
|
+
abstractmethod,
|
|
4
|
+
)
|
|
5
|
+
import decimal
|
|
6
|
+
import numbers
|
|
7
|
+
from typing import (
|
|
8
|
+
Any,
|
|
9
|
+
TypeVar,
|
|
10
|
+
Union,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Comparable(ABC):
|
|
15
|
+
@abstractmethod
|
|
16
|
+
def __lt__(self, other: Any) -> bool:
|
|
17
|
+
...
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
def __gt__(self, other: Any) -> bool:
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
TComparable = Union[Comparable, numbers.Real, int, float, decimal.Decimal]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
TValue = TypeVar("TValue", bound=TComparable)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def clamp(lower_bound: TValue, upper_bound: TValue, value: TValue) -> TValue:
|
|
31
|
+
# The `mypy` ignore statements here are due to doing a comparison of
|
|
32
|
+
# `Union` types which isn't allowed. (per cburgdorf). This approach was
|
|
33
|
+
# chosen over using `typing.overload` to define multiple signatures for
|
|
34
|
+
# each comparison type here since the added value of "proper" typing
|
|
35
|
+
# doesn't seem to justify the complexity of having a bunch of different
|
|
36
|
+
# signatures defined. The external library perspective on this function
|
|
37
|
+
# should still be adequate under this approach
|
|
38
|
+
if value < lower_bound: # type: ignore
|
|
39
|
+
return lower_bound
|
|
40
|
+
elif value > upper_bound: # type: ignore
|
|
41
|
+
return upper_bound
|
|
42
|
+
else:
|
|
43
|
+
return value
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from ...toolz import ( # noqa: F401
|
|
2
|
+
accumulate,
|
|
3
|
+
assoc,
|
|
4
|
+
assoc_in,
|
|
5
|
+
comp,
|
|
6
|
+
complement,
|
|
7
|
+
compose,
|
|
8
|
+
concat,
|
|
9
|
+
concatv,
|
|
10
|
+
cons,
|
|
11
|
+
count,
|
|
12
|
+
countby,
|
|
13
|
+
curried,
|
|
14
|
+
curry,
|
|
15
|
+
dicttoolz,
|
|
16
|
+
diff,
|
|
17
|
+
dissoc,
|
|
18
|
+
do,
|
|
19
|
+
drop,
|
|
20
|
+
excepts,
|
|
21
|
+
filter,
|
|
22
|
+
first,
|
|
23
|
+
flip,
|
|
24
|
+
frequencies,
|
|
25
|
+
functoolz,
|
|
26
|
+
get,
|
|
27
|
+
get_in,
|
|
28
|
+
groupby,
|
|
29
|
+
identity,
|
|
30
|
+
interleave,
|
|
31
|
+
interpose,
|
|
32
|
+
isdistinct,
|
|
33
|
+
isiterable,
|
|
34
|
+
itemfilter,
|
|
35
|
+
itemmap,
|
|
36
|
+
iterate,
|
|
37
|
+
itertoolz,
|
|
38
|
+
join,
|
|
39
|
+
juxt,
|
|
40
|
+
keyfilter,
|
|
41
|
+
keymap,
|
|
42
|
+
last,
|
|
43
|
+
map,
|
|
44
|
+
mapcat,
|
|
45
|
+
memoize,
|
|
46
|
+
merge,
|
|
47
|
+
merge_sorted,
|
|
48
|
+
merge_with,
|
|
49
|
+
nth,
|
|
50
|
+
partial,
|
|
51
|
+
partition,
|
|
52
|
+
partition_all,
|
|
53
|
+
partitionby,
|
|
54
|
+
peek,
|
|
55
|
+
pipe,
|
|
56
|
+
pluck,
|
|
57
|
+
random_sample,
|
|
58
|
+
recipes,
|
|
59
|
+
reduce,
|
|
60
|
+
reduceby,
|
|
61
|
+
remove,
|
|
62
|
+
second,
|
|
63
|
+
sliding_window,
|
|
64
|
+
sorted,
|
|
65
|
+
tail,
|
|
66
|
+
take,
|
|
67
|
+
take_nth,
|
|
68
|
+
thread_first,
|
|
69
|
+
thread_last,
|
|
70
|
+
topk,
|
|
71
|
+
unique,
|
|
72
|
+
update_in,
|
|
73
|
+
utils,
|
|
74
|
+
valfilter,
|
|
75
|
+
valmap,
|
|
76
|
+
)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import collections.abc
|
|
2
|
+
import numbers
|
|
3
|
+
from typing import (
|
|
4
|
+
Any,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
bytes_types = (bytes, bytearray)
|
|
8
|
+
integer_types = (int,)
|
|
9
|
+
text_types = (str,)
|
|
10
|
+
string_types = (bytes, str, bytearray)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def is_integer(value: Any) -> bool:
|
|
14
|
+
return isinstance(value, integer_types) and not isinstance(value, bool)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def is_bytes(value: Any) -> bool:
|
|
18
|
+
return isinstance(value, bytes_types)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def is_text(value: Any) -> bool:
|
|
22
|
+
return isinstance(value, text_types)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def is_string(value: Any) -> bool:
|
|
26
|
+
return isinstance(value, string_types)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def is_boolean(value: Any) -> bool:
|
|
30
|
+
return isinstance(value, bool)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def is_dict(obj: Any) -> bool:
|
|
34
|
+
return isinstance(obj, collections.abc.Mapping)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def is_list_like(obj: Any) -> bool:
|
|
38
|
+
return not is_string(obj) and isinstance(obj, collections.abc.Sequence)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def is_list(obj: Any) -> bool:
|
|
42
|
+
return isinstance(obj, list)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def is_tuple(obj: Any) -> bool:
|
|
46
|
+
return isinstance(obj, tuple)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def is_null(obj: Any) -> bool:
|
|
50
|
+
return obj is None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def is_number(obj: Any) -> bool:
|
|
54
|
+
return isinstance(obj, numbers.Number)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
|
|
3
|
+
from .misc import (
|
|
4
|
+
Address,
|
|
5
|
+
AnyAddress,
|
|
6
|
+
ChecksumAddress,
|
|
7
|
+
HexAddress,
|
|
8
|
+
HexStr,
|
|
9
|
+
Primitives,
|
|
10
|
+
T,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
warnings.warn(
|
|
14
|
+
"The eth_utils.typing module will be deprecated in favor "
|
|
15
|
+
"of eth-typing in the next major version bump.",
|
|
16
|
+
category=DeprecationWarning,
|
|
17
|
+
stacklevel=2,
|
|
18
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import decimal
|
|
2
|
+
|
|
3
|
+
# Units are in their own module here, so that they can keep this
|
|
4
|
+
# formatting, as this module is excluded from black in pyproject.toml
|
|
5
|
+
# fmt: off
|
|
6
|
+
units = {
|
|
7
|
+
'wei': decimal.Decimal('1'), # noqa: E241
|
|
8
|
+
'kwei': decimal.Decimal('1000'), # noqa: E241
|
|
9
|
+
'babbage': decimal.Decimal('1000'), # noqa: E241
|
|
10
|
+
'femtoether': decimal.Decimal('1000'), # noqa: E241
|
|
11
|
+
'mwei': decimal.Decimal('1000000'), # noqa: E241
|
|
12
|
+
'lovelace': decimal.Decimal('1000000'), # noqa: E241
|
|
13
|
+
'picoether': decimal.Decimal('1000000'), # noqa: E241
|
|
14
|
+
'gwei': decimal.Decimal('1000000000'), # noqa: E241
|
|
15
|
+
'shannon': decimal.Decimal('1000000000'), # noqa: E241
|
|
16
|
+
'nanoether': decimal.Decimal('1000000000'), # noqa: E241
|
|
17
|
+
'nano': decimal.Decimal('1000000000'), # noqa: E241
|
|
18
|
+
'szabo': decimal.Decimal('1000000000000'), # noqa: E241
|
|
19
|
+
'microether': decimal.Decimal('1000000000000'), # noqa: E241
|
|
20
|
+
'micro': decimal.Decimal('1000000000000'), # noqa: E241
|
|
21
|
+
'finney': decimal.Decimal('1000000000000000'), # noqa: E241
|
|
22
|
+
'milliether': decimal.Decimal('1000000000000000'), # noqa: E241
|
|
23
|
+
'milli': decimal.Decimal('1000000000000000'), # noqa: E241
|
|
24
|
+
'ether': decimal.Decimal('1000000000000000000'), # noqa: E241
|
|
25
|
+
'kether': decimal.Decimal('1000000000000000000000'), # noqa: E241
|
|
26
|
+
'grand': decimal.Decimal('1000000000000000000000'), # noqa: E241
|
|
27
|
+
'mether': decimal.Decimal('1000000000000000000000000'), # noqa: E241
|
|
28
|
+
'gether': decimal.Decimal('1000000000000000000000000000'), # noqa: E241
|
|
29
|
+
'tether': decimal.Decimal('1000000000000000000000000000000'), # noqa: E241
|
|
30
|
+
}
|
|
31
|
+
# fmt: on
|