coinex-api 0.0.13__py3-none-any.whl → 0.0.14__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.
Files changed (289) hide show
  1. coinex/__init__.py +7 -0
  2. coinex/ccxt/__init__.py +101 -0
  3. coinex/ccxt/abstract/coinex.py +237 -0
  4. coinex/ccxt/async_support/__init__.py +80 -0
  5. coinex/ccxt/async_support/base/__init__.py +1 -0
  6. coinex/ccxt/async_support/base/exchange.py +2100 -0
  7. coinex/ccxt/async_support/base/throttler.py +50 -0
  8. coinex/ccxt/async_support/base/ws/__init__.py +38 -0
  9. coinex/ccxt/async_support/base/ws/aiohttp_client.py +147 -0
  10. coinex/ccxt/async_support/base/ws/cache.py +213 -0
  11. coinex/ccxt/async_support/base/ws/client.py +214 -0
  12. coinex/ccxt/async_support/base/ws/fast_client.py +97 -0
  13. coinex/ccxt/async_support/base/ws/functions.py +59 -0
  14. coinex/ccxt/async_support/base/ws/future.py +69 -0
  15. coinex/ccxt/async_support/base/ws/order_book.py +78 -0
  16. coinex/ccxt/async_support/base/ws/order_book_side.py +174 -0
  17. coinex/ccxt/async_support/coinex.py +5833 -0
  18. coinex/ccxt/base/__init__.py +27 -0
  19. coinex/ccxt/base/decimal_to_precision.py +174 -0
  20. coinex/ccxt/base/errors.py +267 -0
  21. coinex/ccxt/base/exchange.py +6769 -0
  22. coinex/ccxt/base/precise.py +297 -0
  23. coinex/ccxt/base/types.py +577 -0
  24. coinex/ccxt/coinex.py +5832 -0
  25. coinex/ccxt/pro/__init__.py +21 -0
  26. coinex/ccxt/pro/coinex.py +1366 -0
  27. coinex/ccxt/static_dependencies/README.md +1 -0
  28. coinex/ccxt/static_dependencies/__init__.py +1 -0
  29. coinex/ccxt/static_dependencies/ecdsa/__init__.py +14 -0
  30. coinex/ccxt/static_dependencies/ecdsa/_version.py +520 -0
  31. coinex/ccxt/static_dependencies/ecdsa/curves.py +56 -0
  32. coinex/ccxt/static_dependencies/ecdsa/der.py +221 -0
  33. coinex/ccxt/static_dependencies/ecdsa/ecdsa.py +310 -0
  34. coinex/ccxt/static_dependencies/ecdsa/ellipticcurve.py +197 -0
  35. coinex/ccxt/static_dependencies/ecdsa/keys.py +332 -0
  36. coinex/ccxt/static_dependencies/ecdsa/numbertheory.py +531 -0
  37. coinex/ccxt/static_dependencies/ecdsa/rfc6979.py +100 -0
  38. coinex/ccxt/static_dependencies/ecdsa/util.py +266 -0
  39. coinex/ccxt/static_dependencies/ethereum/__init__.py +7 -0
  40. coinex/ccxt/static_dependencies/ethereum/abi/__init__.py +16 -0
  41. coinex/ccxt/static_dependencies/ethereum/abi/abi.py +19 -0
  42. coinex/ccxt/static_dependencies/ethereum/abi/base.py +152 -0
  43. coinex/ccxt/static_dependencies/ethereum/abi/codec.py +217 -0
  44. coinex/ccxt/static_dependencies/ethereum/abi/constants.py +3 -0
  45. coinex/ccxt/static_dependencies/ethereum/abi/decoding.py +565 -0
  46. coinex/ccxt/static_dependencies/ethereum/abi/encoding.py +720 -0
  47. coinex/ccxt/static_dependencies/ethereum/abi/exceptions.py +139 -0
  48. coinex/ccxt/static_dependencies/ethereum/abi/grammar.py +443 -0
  49. coinex/ccxt/static_dependencies/ethereum/abi/packed.py +13 -0
  50. coinex/ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
  51. coinex/ccxt/static_dependencies/ethereum/abi/registry.py +643 -0
  52. coinex/ccxt/static_dependencies/ethereum/abi/tools/__init__.py +3 -0
  53. coinex/ccxt/static_dependencies/ethereum/abi/tools/_strategies.py +230 -0
  54. coinex/ccxt/static_dependencies/ethereum/abi/utils/__init__.py +0 -0
  55. coinex/ccxt/static_dependencies/ethereum/abi/utils/numeric.py +83 -0
  56. coinex/ccxt/static_dependencies/ethereum/abi/utils/padding.py +27 -0
  57. coinex/ccxt/static_dependencies/ethereum/abi/utils/string.py +19 -0
  58. coinex/ccxt/static_dependencies/ethereum/account/__init__.py +3 -0
  59. coinex/ccxt/static_dependencies/ethereum/account/encode_typed_data/__init__.py +4 -0
  60. coinex/ccxt/static_dependencies/ethereum/account/encode_typed_data/encoding_and_hashing.py +239 -0
  61. coinex/ccxt/static_dependencies/ethereum/account/encode_typed_data/helpers.py +40 -0
  62. coinex/ccxt/static_dependencies/ethereum/account/messages.py +263 -0
  63. coinex/ccxt/static_dependencies/ethereum/account/py.typed +0 -0
  64. coinex/ccxt/static_dependencies/ethereum/hexbytes/__init__.py +5 -0
  65. coinex/ccxt/static_dependencies/ethereum/hexbytes/_utils.py +54 -0
  66. coinex/ccxt/static_dependencies/ethereum/hexbytes/main.py +65 -0
  67. coinex/ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
  68. coinex/ccxt/static_dependencies/ethereum/typing/__init__.py +63 -0
  69. coinex/ccxt/static_dependencies/ethereum/typing/abi.py +6 -0
  70. coinex/ccxt/static_dependencies/ethereum/typing/bls.py +7 -0
  71. coinex/ccxt/static_dependencies/ethereum/typing/discovery.py +5 -0
  72. coinex/ccxt/static_dependencies/ethereum/typing/encoding.py +7 -0
  73. coinex/ccxt/static_dependencies/ethereum/typing/enums.py +17 -0
  74. coinex/ccxt/static_dependencies/ethereum/typing/ethpm.py +9 -0
  75. coinex/ccxt/static_dependencies/ethereum/typing/evm.py +20 -0
  76. coinex/ccxt/static_dependencies/ethereum/typing/networks.py +1122 -0
  77. coinex/ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
  78. coinex/ccxt/static_dependencies/ethereum/utils/__init__.py +115 -0
  79. coinex/ccxt/static_dependencies/ethereum/utils/abi.py +72 -0
  80. coinex/ccxt/static_dependencies/ethereum/utils/address.py +171 -0
  81. coinex/ccxt/static_dependencies/ethereum/utils/applicators.py +151 -0
  82. coinex/ccxt/static_dependencies/ethereum/utils/conversions.py +190 -0
  83. coinex/ccxt/static_dependencies/ethereum/utils/currency.py +107 -0
  84. coinex/ccxt/static_dependencies/ethereum/utils/curried/__init__.py +269 -0
  85. coinex/ccxt/static_dependencies/ethereum/utils/debug.py +20 -0
  86. coinex/ccxt/static_dependencies/ethereum/utils/decorators.py +132 -0
  87. coinex/ccxt/static_dependencies/ethereum/utils/encoding.py +6 -0
  88. coinex/ccxt/static_dependencies/ethereum/utils/exceptions.py +4 -0
  89. coinex/ccxt/static_dependencies/ethereum/utils/functional.py +75 -0
  90. coinex/ccxt/static_dependencies/ethereum/utils/hexadecimal.py +74 -0
  91. coinex/ccxt/static_dependencies/ethereum/utils/humanize.py +188 -0
  92. coinex/ccxt/static_dependencies/ethereum/utils/logging.py +159 -0
  93. coinex/ccxt/static_dependencies/ethereum/utils/module_loading.py +31 -0
  94. coinex/ccxt/static_dependencies/ethereum/utils/numeric.py +43 -0
  95. coinex/ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
  96. coinex/ccxt/static_dependencies/ethereum/utils/toolz.py +76 -0
  97. coinex/ccxt/static_dependencies/ethereum/utils/types.py +54 -0
  98. coinex/ccxt/static_dependencies/ethereum/utils/typing/__init__.py +18 -0
  99. coinex/ccxt/static_dependencies/ethereum/utils/typing/misc.py +14 -0
  100. coinex/ccxt/static_dependencies/ethereum/utils/units.py +31 -0
  101. coinex/ccxt/static_dependencies/keccak/__init__.py +3 -0
  102. coinex/ccxt/static_dependencies/keccak/keccak.py +197 -0
  103. coinex/ccxt/static_dependencies/lark/__init__.py +38 -0
  104. coinex/ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
  105. coinex/ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
  106. coinex/ccxt/static_dependencies/lark/ast_utils.py +59 -0
  107. coinex/ccxt/static_dependencies/lark/common.py +86 -0
  108. coinex/ccxt/static_dependencies/lark/exceptions.py +292 -0
  109. coinex/ccxt/static_dependencies/lark/grammar.py +130 -0
  110. coinex/ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
  111. coinex/ccxt/static_dependencies/lark/grammars/common.lark +59 -0
  112. coinex/ccxt/static_dependencies/lark/grammars/lark.lark +62 -0
  113. coinex/ccxt/static_dependencies/lark/grammars/python.lark +302 -0
  114. coinex/ccxt/static_dependencies/lark/grammars/unicode.lark +7 -0
  115. coinex/ccxt/static_dependencies/lark/indenter.py +143 -0
  116. coinex/ccxt/static_dependencies/lark/lark.py +658 -0
  117. coinex/ccxt/static_dependencies/lark/lexer.py +678 -0
  118. coinex/ccxt/static_dependencies/lark/load_grammar.py +1428 -0
  119. coinex/ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
  120. coinex/ccxt/static_dependencies/lark/parser_frontends.py +257 -0
  121. coinex/ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
  122. coinex/ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
  123. coinex/ccxt/static_dependencies/lark/parsers/earley.py +314 -0
  124. coinex/ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
  125. coinex/ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
  126. coinex/ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
  127. coinex/ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
  128. coinex/ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
  129. coinex/ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
  130. coinex/ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
  131. coinex/ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
  132. coinex/ccxt/static_dependencies/lark/py.typed +0 -0
  133. coinex/ccxt/static_dependencies/lark/reconstruct.py +107 -0
  134. coinex/ccxt/static_dependencies/lark/tools/__init__.py +70 -0
  135. coinex/ccxt/static_dependencies/lark/tools/nearley.py +202 -0
  136. coinex/ccxt/static_dependencies/lark/tools/serialize.py +32 -0
  137. coinex/ccxt/static_dependencies/lark/tools/standalone.py +196 -0
  138. coinex/ccxt/static_dependencies/lark/tree.py +267 -0
  139. coinex/ccxt/static_dependencies/lark/tree_matcher.py +186 -0
  140. coinex/ccxt/static_dependencies/lark/tree_templates.py +180 -0
  141. coinex/ccxt/static_dependencies/lark/utils.py +343 -0
  142. coinex/ccxt/static_dependencies/lark/visitors.py +596 -0
  143. coinex/ccxt/static_dependencies/marshmallow/__init__.py +81 -0
  144. coinex/ccxt/static_dependencies/marshmallow/base.py +65 -0
  145. coinex/ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
  146. coinex/ccxt/static_dependencies/marshmallow/decorators.py +231 -0
  147. coinex/ccxt/static_dependencies/marshmallow/error_store.py +60 -0
  148. coinex/ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
  149. coinex/ccxt/static_dependencies/marshmallow/fields.py +2114 -0
  150. coinex/ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
  151. coinex/ccxt/static_dependencies/marshmallow/py.typed +0 -0
  152. coinex/ccxt/static_dependencies/marshmallow/schema.py +1228 -0
  153. coinex/ccxt/static_dependencies/marshmallow/types.py +12 -0
  154. coinex/ccxt/static_dependencies/marshmallow/utils.py +378 -0
  155. coinex/ccxt/static_dependencies/marshmallow/validate.py +678 -0
  156. coinex/ccxt/static_dependencies/marshmallow/warnings.py +2 -0
  157. coinex/ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
  158. coinex/ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
  159. coinex/ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
  160. coinex/ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
  161. coinex/ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
  162. coinex/ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
  163. coinex/ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
  164. coinex/ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
  165. coinex/ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
  166. coinex/ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
  167. coinex/ccxt/static_dependencies/msgpack/__init__.py +55 -0
  168. coinex/ccxt/static_dependencies/msgpack/_cmsgpack.pyx +11 -0
  169. coinex/ccxt/static_dependencies/msgpack/_packer.pyx +374 -0
  170. coinex/ccxt/static_dependencies/msgpack/_unpacker.pyx +547 -0
  171. coinex/ccxt/static_dependencies/msgpack/buff_converter.h +8 -0
  172. coinex/ccxt/static_dependencies/msgpack/exceptions.py +48 -0
  173. coinex/ccxt/static_dependencies/msgpack/ext.py +168 -0
  174. coinex/ccxt/static_dependencies/msgpack/fallback.py +951 -0
  175. coinex/ccxt/static_dependencies/msgpack/pack.h +89 -0
  176. coinex/ccxt/static_dependencies/msgpack/pack_template.h +820 -0
  177. coinex/ccxt/static_dependencies/msgpack/sysdep.h +194 -0
  178. coinex/ccxt/static_dependencies/msgpack/unpack.h +391 -0
  179. coinex/ccxt/static_dependencies/msgpack/unpack_define.h +95 -0
  180. coinex/ccxt/static_dependencies/msgpack/unpack_template.h +464 -0
  181. coinex/ccxt/static_dependencies/parsimonious/__init__.py +10 -0
  182. coinex/ccxt/static_dependencies/parsimonious/exceptions.py +105 -0
  183. coinex/ccxt/static_dependencies/parsimonious/expressions.py +479 -0
  184. coinex/ccxt/static_dependencies/parsimonious/grammar.py +487 -0
  185. coinex/ccxt/static_dependencies/parsimonious/nodes.py +325 -0
  186. coinex/ccxt/static_dependencies/parsimonious/utils.py +40 -0
  187. coinex/ccxt/static_dependencies/starknet/__init__.py +0 -0
  188. coinex/ccxt/static_dependencies/starknet/abi/v0/__init__.py +2 -0
  189. coinex/ccxt/static_dependencies/starknet/abi/v0/model.py +44 -0
  190. coinex/ccxt/static_dependencies/starknet/abi/v0/parser.py +216 -0
  191. coinex/ccxt/static_dependencies/starknet/abi/v0/schemas.py +72 -0
  192. coinex/ccxt/static_dependencies/starknet/abi/v0/shape.py +63 -0
  193. coinex/ccxt/static_dependencies/starknet/abi/v1/__init__.py +2 -0
  194. coinex/ccxt/static_dependencies/starknet/abi/v1/core_structures.json +14 -0
  195. coinex/ccxt/static_dependencies/starknet/abi/v1/model.py +39 -0
  196. coinex/ccxt/static_dependencies/starknet/abi/v1/parser.py +220 -0
  197. coinex/ccxt/static_dependencies/starknet/abi/v1/parser_transformer.py +179 -0
  198. coinex/ccxt/static_dependencies/starknet/abi/v1/schemas.py +66 -0
  199. coinex/ccxt/static_dependencies/starknet/abi/v1/shape.py +47 -0
  200. coinex/ccxt/static_dependencies/starknet/abi/v2/__init__.py +2 -0
  201. coinex/ccxt/static_dependencies/starknet/abi/v2/model.py +89 -0
  202. coinex/ccxt/static_dependencies/starknet/abi/v2/parser.py +293 -0
  203. coinex/ccxt/static_dependencies/starknet/abi/v2/parser_transformer.py +192 -0
  204. coinex/ccxt/static_dependencies/starknet/abi/v2/schemas.py +132 -0
  205. coinex/ccxt/static_dependencies/starknet/abi/v2/shape.py +107 -0
  206. coinex/ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
  207. coinex/ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
  208. coinex/ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
  209. coinex/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
  210. coinex/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
  211. coinex/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
  212. coinex/ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
  213. coinex/ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
  214. coinex/ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
  215. coinex/ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
  216. coinex/ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
  217. coinex/ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
  218. coinex/ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
  219. coinex/ccxt/static_dependencies/starknet/common.py +15 -0
  220. coinex/ccxt/static_dependencies/starknet/constants.py +39 -0
  221. coinex/ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
  222. coinex/ccxt/static_dependencies/starknet/hash/address.py +79 -0
  223. coinex/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
  224. coinex/ccxt/static_dependencies/starknet/hash/selector.py +16 -0
  225. coinex/ccxt/static_dependencies/starknet/hash/storage.py +12 -0
  226. coinex/ccxt/static_dependencies/starknet/hash/utils.py +78 -0
  227. coinex/ccxt/static_dependencies/starknet/models/__init__.py +0 -0
  228. coinex/ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
  229. coinex/ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
  230. coinex/ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
  231. coinex/ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
  232. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
  233. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
  234. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
  235. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
  236. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
  237. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
  238. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
  239. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
  240. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
  241. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
  242. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
  243. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
  244. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
  245. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
  246. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
  247. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
  248. coinex/ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
  249. coinex/ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
  250. coinex/ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
  251. coinex/ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
  252. coinex/ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
  253. coinex/ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
  254. coinex/ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
  255. coinex/ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
  256. coinex/ccxt/static_dependencies/starknet/utils/schema.py +13 -0
  257. coinex/ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
  258. coinex/ccxt/static_dependencies/starkware/__init__.py +0 -0
  259. coinex/ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
  260. coinex/ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
  261. coinex/ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
  262. coinex/ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
  263. coinex/ccxt/static_dependencies/starkware/crypto/utils.py +63 -0
  264. coinex/ccxt/static_dependencies/sympy/__init__.py +0 -0
  265. coinex/ccxt/static_dependencies/sympy/core/__init__.py +0 -0
  266. coinex/ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
  267. coinex/ccxt/static_dependencies/sympy/external/__init__.py +0 -0
  268. coinex/ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
  269. coinex/ccxt/static_dependencies/sympy/external/importtools.py +187 -0
  270. coinex/ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
  271. coinex/ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
  272. coinex/ccxt/static_dependencies/toolz/__init__.py +26 -0
  273. coinex/ccxt/static_dependencies/toolz/_signatures.py +784 -0
  274. coinex/ccxt/static_dependencies/toolz/_version.py +520 -0
  275. coinex/ccxt/static_dependencies/toolz/compatibility.py +30 -0
  276. coinex/ccxt/static_dependencies/toolz/curried/__init__.py +101 -0
  277. coinex/ccxt/static_dependencies/toolz/curried/exceptions.py +22 -0
  278. coinex/ccxt/static_dependencies/toolz/curried/operator.py +22 -0
  279. coinex/ccxt/static_dependencies/toolz/dicttoolz.py +339 -0
  280. coinex/ccxt/static_dependencies/toolz/functoolz.py +1049 -0
  281. coinex/ccxt/static_dependencies/toolz/itertoolz.py +1057 -0
  282. coinex/ccxt/static_dependencies/toolz/recipes.py +46 -0
  283. coinex/ccxt/static_dependencies/toolz/utils.py +9 -0
  284. coinex/ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
  285. coinex/ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
  286. {coinex_api-0.0.13.dist-info → coinex_api-0.0.14.dist-info}/METADATA +1 -1
  287. coinex_api-0.0.14.dist-info/RECORD +288 -0
  288. coinex_api-0.0.13.dist-info/RECORD +0 -3
  289. {coinex_api-0.0.13.dist-info → coinex_api-0.0.14.dist-info}/WHEEL +0 -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
@@ -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,14 @@
1
+ from typing import (
2
+ TypeVar,
3
+ )
4
+
5
+ from ...typing import ( # noqa: F401
6
+ Address,
7
+ AnyAddress,
8
+ ChecksumAddress,
9
+ HexAddress,
10
+ HexStr,
11
+ Primitives,
12
+ )
13
+
14
+ T = TypeVar("T")
@@ -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
@@ -0,0 +1,3 @@
1
+ from .keccak import SHA3
2
+
3
+ __all__ = ['SHA3']