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 @@
1
+ // TODO: add web3
@@ -0,0 +1 @@
1
+ __all__ = ['ecdsa', 'keccak', 'aiohttp_socks', 'ethereum', 'parsimonious', 'toolz', 'starknet', 'marshmallow', 'marshmallow_oneofschema', 'lark', 'starkware', 'sympy']
@@ -0,0 +1,14 @@
1
+ from .keys import SigningKey, VerifyingKey, BadSignatureError, BadDigestError
2
+ from .curves import NIST192p, NIST224p, NIST256p, NIST384p, NIST521p, SECP256k1
3
+
4
+ # This code comes from http://github.com/warner/python-ecdsa
5
+ #from ._version import get_versions
6
+ __version__ = 'ccxt' # custom ccxt version
7
+ #del get_versions
8
+
9
+ __all__ = ["curves", "der", "ecdsa", "ellipticcurve", "keys", "numbertheory",
10
+ "util"]
11
+
12
+ _hush_pyflakes = [SigningKey, VerifyingKey, BadSignatureError, BadDigestError,
13
+ NIST192p, NIST224p, NIST256p, NIST384p, NIST521p, SECP256k1]
14
+ del _hush_pyflakes
@@ -0,0 +1,520 @@
1
+
2
+ # This file helps to compute a version number in source trees obtained from
3
+ # git-archive tarball (such as those provided by githubs download-from-tag
4
+ # feature). Distribution tarballs (built by setup.py sdist) and build
5
+ # directories (produced by setup.py build) will contain a much shorter file
6
+ # that just contains the computed version number.
7
+
8
+ # This file is released into the public domain. Generated by
9
+ # versioneer-0.17 (https://github.com/warner/python-versioneer)
10
+
11
+ """Git implementation of _version.py."""
12
+
13
+ import errno
14
+ import os
15
+ import re
16
+ import subprocess
17
+ import sys
18
+
19
+
20
+ def get_keywords():
21
+ """Get the keywords needed to look up the version information."""
22
+ # these strings will be replaced by git during git-archive.
23
+ # setup.py/versioneer.py will grep for the variable names, so they must
24
+ # each be defined on a line of their own. _version.py will just call
25
+ # get_keywords().
26
+ git_refnames = "$Format:%d$"
27
+ git_full = "$Format:%H$"
28
+ git_date = "$Format:%ci$"
29
+ keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
30
+ return keywords
31
+
32
+
33
+ class VersioneerConfig:
34
+ """Container for Versioneer configuration parameters."""
35
+
36
+
37
+ def get_config():
38
+ """Create, populate and return the VersioneerConfig() object."""
39
+ # these strings are filled in when 'setup.py versioneer' creates
40
+ # _version.py
41
+ cfg = VersioneerConfig()
42
+ cfg.VCS = "git"
43
+ cfg.style = "pep440"
44
+ cfg.tag_prefix = "python-ecdsa-"
45
+ cfg.parentdir_prefix = "ecdsa-"
46
+ cfg.versionfile_source = "ecdsa/_version.py"
47
+ cfg.verbose = False
48
+ return cfg
49
+
50
+
51
+ class NotThisMethod(Exception):
52
+ """Exception raised if a method is not valid for the current scenario."""
53
+
54
+
55
+ LONG_VERSION_PY = {}
56
+ HANDLERS = {}
57
+
58
+
59
+ def register_vcs_handler(vcs, method): # decorator
60
+ """Decorator to mark a method as the handler for a particular VCS."""
61
+ def decorate(f):
62
+ """Store f in HANDLERS[vcs][method]."""
63
+ if vcs not in HANDLERS:
64
+ HANDLERS[vcs] = {}
65
+ HANDLERS[vcs][method] = f
66
+ return f
67
+ return decorate
68
+
69
+
70
+ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
71
+ env=None):
72
+ """Call the given command(s)."""
73
+ assert isinstance(commands, list)
74
+ p = None
75
+ for c in commands:
76
+ try:
77
+ dispcmd = str([c] + args)
78
+ # remember shell=False, so use git.cmd on windows, not just git
79
+ p = subprocess.Popen([c] + args, cwd=cwd, env=env,
80
+ stdout=subprocess.PIPE,
81
+ stderr=(subprocess.PIPE if hide_stderr
82
+ else None))
83
+ break
84
+ except EnvironmentError:
85
+ e = sys.exc_info()[1]
86
+ if e.errno == errno.ENOENT:
87
+ continue
88
+ if verbose:
89
+ print("unable to run %s" % dispcmd)
90
+ print(e)
91
+ return None, None
92
+ else:
93
+ if verbose:
94
+ print("unable to find command, tried %s" % (commands,))
95
+ return None, None
96
+ stdout = p.communicate()[0].strip()
97
+ if sys.version_info[0] >= 3:
98
+ stdout = stdout.decode()
99
+ if p.returncode != 0:
100
+ if verbose:
101
+ print("unable to run %s (error)" % dispcmd)
102
+ print("stdout was %s" % stdout)
103
+ return None, p.returncode
104
+ return stdout, p.returncode
105
+
106
+
107
+ def versions_from_parentdir(parentdir_prefix, root, verbose):
108
+ """Try to determine the version from the parent directory name.
109
+
110
+ Source tarballs conventionally unpack into a directory that includes both
111
+ the project name and a version string. We will also support searching up
112
+ two directory levels for an appropriately named parent directory
113
+ """
114
+ rootdirs = []
115
+
116
+ for i in range(3):
117
+ dirname = os.path.basename(root)
118
+ if dirname.startswith(parentdir_prefix):
119
+ return {"version": dirname[len(parentdir_prefix):],
120
+ "full-revisionid": None,
121
+ "dirty": False, "error": None, "date": None}
122
+ else:
123
+ rootdirs.append(root)
124
+ root = os.path.dirname(root) # up a level
125
+
126
+ if verbose:
127
+ print("Tried directories %s but none started with prefix %s" %
128
+ (str(rootdirs), parentdir_prefix))
129
+ raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
130
+
131
+
132
+ @register_vcs_handler("git", "get_keywords")
133
+ def git_get_keywords(versionfile_abs):
134
+ """Extract version information from the given file."""
135
+ # the code embedded in _version.py can just fetch the value of these
136
+ # keywords. When used from setup.py, we don't want to import _version.py,
137
+ # so we do it with a regexp instead. This function is not used from
138
+ # _version.py.
139
+ keywords = {}
140
+ try:
141
+ f = open(versionfile_abs, "r")
142
+ for line in f.readlines():
143
+ if line.strip().startswith("git_refnames ="):
144
+ mo = re.search(r'=\s*"(.*)"', line)
145
+ if mo:
146
+ keywords["refnames"] = mo.group(1)
147
+ if line.strip().startswith("git_full ="):
148
+ mo = re.search(r'=\s*"(.*)"', line)
149
+ if mo:
150
+ keywords["full"] = mo.group(1)
151
+ if line.strip().startswith("git_date ="):
152
+ mo = re.search(r'=\s*"(.*)"', line)
153
+ if mo:
154
+ keywords["date"] = mo.group(1)
155
+ f.close()
156
+ except EnvironmentError:
157
+ pass
158
+ return keywords
159
+
160
+
161
+ @register_vcs_handler("git", "keywords")
162
+ def git_versions_from_keywords(keywords, tag_prefix, verbose):
163
+ """Get version information from git keywords."""
164
+ if not keywords:
165
+ raise NotThisMethod("no keywords at all, weird")
166
+ date = keywords.get("date")
167
+ if date is not None:
168
+ # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant
169
+ # datestamp. However we prefer "%ci" (which expands to an "ISO-8601
170
+ # -like" string, which we must then edit to make compliant), because
171
+ # it's been around since git-1.5.3, and it's too difficult to
172
+ # discover which version we're using, or to work around using an
173
+ # older one.
174
+ date = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
175
+ refnames = keywords["refnames"].strip()
176
+ if refnames.startswith("$Format"):
177
+ if verbose:
178
+ print("keywords are unexpanded, not using")
179
+ raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
180
+ refs = set([r.strip() for r in refnames.strip("()").split(",")])
181
+ # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
182
+ # just "foo-1.0". If we see a "tag: " prefix, prefer those.
183
+ TAG = "tag: "
184
+ tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
185
+ if not tags:
186
+ # Either we're using git < 1.8.3, or there really are no tags. We use
187
+ # a heuristic: assume all version tags have a digit. The old git %d
188
+ # expansion behaves like git log --decorate=short and strips out the
189
+ # refs/heads/ and refs/tags/ prefixes that would let us distinguish
190
+ # between branches and tags. By ignoring refnames without digits, we
191
+ # filter out many common branch names like "release" and
192
+ # "stabilization", as well as "HEAD" and "master".
193
+ tags = set([r for r in refs if re.search(r'\d', r)])
194
+ if verbose:
195
+ print("discarding '%s', no digits" % ",".join(refs - tags))
196
+ if verbose:
197
+ print("likely tags: %s" % ",".join(sorted(tags)))
198
+ for ref in sorted(tags):
199
+ # sorting will prefer e.g. "2.0" over "2.0rc1"
200
+ if ref.startswith(tag_prefix):
201
+ r = ref[len(tag_prefix):]
202
+ if verbose:
203
+ print("picking %s" % r)
204
+ return {"version": r,
205
+ "full-revisionid": keywords["full"].strip(),
206
+ "dirty": False, "error": None,
207
+ "date": date}
208
+ # no suitable tags, so version is "0+unknown", but full hex is still there
209
+ if verbose:
210
+ print("no suitable tags, using unknown + full revision id")
211
+ return {"version": "0+unknown",
212
+ "full-revisionid": keywords["full"].strip(),
213
+ "dirty": False, "error": "no suitable tags", "date": None}
214
+
215
+
216
+ @register_vcs_handler("git", "pieces_from_vcs")
217
+ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
218
+ """Get version from 'git describe' in the root of the source tree.
219
+
220
+ This only gets called if the git-archive 'subst' keywords were *not*
221
+ expanded, and _version.py hasn't already been rewritten with a short
222
+ version string, meaning we're inside a checked out source tree.
223
+ """
224
+ GITS = ["git"]
225
+ if sys.platform == "win32":
226
+ GITS = ["git.cmd", "git.exe"]
227
+
228
+ out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root,
229
+ hide_stderr=True)
230
+ if rc != 0:
231
+ if verbose:
232
+ print("Directory %s not under git control" % root)
233
+ raise NotThisMethod("'git rev-parse --git-dir' returned error")
234
+
235
+ # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
236
+ # if there isn't one, this yields HEX[-dirty] (no NUM)
237
+ describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
238
+ "--always", "--long",
239
+ "--match", "%s*" % tag_prefix],
240
+ cwd=root)
241
+ # --long was added in git-1.5.5
242
+ if describe_out is None:
243
+ raise NotThisMethod("'git describe' failed")
244
+ describe_out = describe_out.strip()
245
+ full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
246
+ if full_out is None:
247
+ raise NotThisMethod("'git rev-parse' failed")
248
+ full_out = full_out.strip()
249
+
250
+ pieces = {}
251
+ pieces["long"] = full_out
252
+ pieces["short"] = full_out[:7] # maybe improved later
253
+ pieces["error"] = None
254
+
255
+ # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
256
+ # TAG might have hyphens.
257
+ git_describe = describe_out
258
+
259
+ # look for -dirty suffix
260
+ dirty = git_describe.endswith("-dirty")
261
+ pieces["dirty"] = dirty
262
+ if dirty:
263
+ git_describe = git_describe[:git_describe.rindex("-dirty")]
264
+
265
+ # now we have TAG-NUM-gHEX or HEX
266
+
267
+ if "-" in git_describe:
268
+ # TAG-NUM-gHEX
269
+ mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
270
+ if not mo:
271
+ # unparseable. Maybe git-describe is misbehaving?
272
+ pieces["error"] = ("unable to parse git-describe output: '%s'"
273
+ % describe_out)
274
+ return pieces
275
+
276
+ # tag
277
+ full_tag = mo.group(1)
278
+ if not full_tag.startswith(tag_prefix):
279
+ if verbose:
280
+ fmt = "tag '%s' doesn't start with prefix '%s'"
281
+ print(fmt % (full_tag, tag_prefix))
282
+ pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
283
+ % (full_tag, tag_prefix))
284
+ return pieces
285
+ pieces["closest-tag"] = full_tag[len(tag_prefix):]
286
+
287
+ # distance: number of commits since tag
288
+ pieces["distance"] = int(mo.group(2))
289
+
290
+ # commit: short hex revision ID
291
+ pieces["short"] = mo.group(3)
292
+
293
+ else:
294
+ # HEX: no tags
295
+ pieces["closest-tag"] = None
296
+ count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
297
+ cwd=root)
298
+ pieces["distance"] = int(count_out) # total number of commits
299
+
300
+ # commit date: see ISO-8601 comment in git_versions_from_keywords()
301
+ date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
302
+ cwd=root)[0].strip()
303
+ pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)
304
+
305
+ return pieces
306
+
307
+
308
+ def plus_or_dot(pieces):
309
+ """Return a + if we don't already have one, else return a ."""
310
+ if "+" in pieces.get("closest-tag", ""):
311
+ return "."
312
+ return "+"
313
+
314
+
315
+ def render_pep440(pieces):
316
+ """Build up version string, with post-release "local version identifier".
317
+
318
+ Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
319
+ get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
320
+
321
+ Exceptions:
322
+ 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
323
+ """
324
+ if pieces["closest-tag"]:
325
+ rendered = pieces["closest-tag"]
326
+ if pieces["distance"] or pieces["dirty"]:
327
+ rendered += plus_or_dot(pieces)
328
+ rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
329
+ if pieces["dirty"]:
330
+ rendered += ".dirty"
331
+ else:
332
+ # exception #1
333
+ rendered = "0+untagged.%d.g%s" % (pieces["distance"],
334
+ pieces["short"])
335
+ if pieces["dirty"]:
336
+ rendered += ".dirty"
337
+ return rendered
338
+
339
+
340
+ def render_pep440_pre(pieces):
341
+ """TAG[.post.devDISTANCE] -- No -dirty.
342
+
343
+ Exceptions:
344
+ 1: no tags. 0.post.devDISTANCE
345
+ """
346
+ if pieces["closest-tag"]:
347
+ rendered = pieces["closest-tag"]
348
+ if pieces["distance"]:
349
+ rendered += ".post.dev%d" % pieces["distance"]
350
+ else:
351
+ # exception #1
352
+ rendered = "0.post.dev%d" % pieces["distance"]
353
+ return rendered
354
+
355
+
356
+ def render_pep440_post(pieces):
357
+ """TAG[.postDISTANCE[.dev0]+gHEX] .
358
+
359
+ The ".dev0" means dirty. Note that .dev0 sorts backwards
360
+ (a dirty tree will appear "older" than the corresponding clean one),
361
+ but you shouldn't be releasing software with -dirty anyways.
362
+
363
+ Exceptions:
364
+ 1: no tags. 0.postDISTANCE[.dev0]
365
+ """
366
+ if pieces["closest-tag"]:
367
+ rendered = pieces["closest-tag"]
368
+ if pieces["distance"] or pieces["dirty"]:
369
+ rendered += ".post%d" % pieces["distance"]
370
+ if pieces["dirty"]:
371
+ rendered += ".dev0"
372
+ rendered += plus_or_dot(pieces)
373
+ rendered += "g%s" % pieces["short"]
374
+ else:
375
+ # exception #1
376
+ rendered = "0.post%d" % pieces["distance"]
377
+ if pieces["dirty"]:
378
+ rendered += ".dev0"
379
+ rendered += "+g%s" % pieces["short"]
380
+ return rendered
381
+
382
+
383
+ def render_pep440_old(pieces):
384
+ """TAG[.postDISTANCE[.dev0]] .
385
+
386
+ The ".dev0" means dirty.
387
+
388
+ Eexceptions:
389
+ 1: no tags. 0.postDISTANCE[.dev0]
390
+ """
391
+ if pieces["closest-tag"]:
392
+ rendered = pieces["closest-tag"]
393
+ if pieces["distance"] or pieces["dirty"]:
394
+ rendered += ".post%d" % pieces["distance"]
395
+ if pieces["dirty"]:
396
+ rendered += ".dev0"
397
+ else:
398
+ # exception #1
399
+ rendered = "0.post%d" % pieces["distance"]
400
+ if pieces["dirty"]:
401
+ rendered += ".dev0"
402
+ return rendered
403
+
404
+
405
+ def render_git_describe(pieces):
406
+ """TAG[-DISTANCE-gHEX][-dirty].
407
+
408
+ Like 'git describe --tags --dirty --always'.
409
+
410
+ Exceptions:
411
+ 1: no tags. HEX[-dirty] (note: no 'g' prefix)
412
+ """
413
+ if pieces["closest-tag"]:
414
+ rendered = pieces["closest-tag"]
415
+ if pieces["distance"]:
416
+ rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
417
+ else:
418
+ # exception #1
419
+ rendered = pieces["short"]
420
+ if pieces["dirty"]:
421
+ rendered += "-dirty"
422
+ return rendered
423
+
424
+
425
+ def render_git_describe_long(pieces):
426
+ """TAG-DISTANCE-gHEX[-dirty].
427
+
428
+ Like 'git describe --tags --dirty --always -long'.
429
+ The distance/hash is unconditional.
430
+
431
+ Exceptions:
432
+ 1: no tags. HEX[-dirty] (note: no 'g' prefix)
433
+ """
434
+ if pieces["closest-tag"]:
435
+ rendered = pieces["closest-tag"]
436
+ rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
437
+ else:
438
+ # exception #1
439
+ rendered = pieces["short"]
440
+ if pieces["dirty"]:
441
+ rendered += "-dirty"
442
+ return rendered
443
+
444
+
445
+ def render(pieces, style):
446
+ """Render the given version pieces into the requested style."""
447
+ if pieces["error"]:
448
+ return {"version": "unknown",
449
+ "full-revisionid": pieces.get("long"),
450
+ "dirty": None,
451
+ "error": pieces["error"],
452
+ "date": None}
453
+
454
+ if not style or style == "default":
455
+ style = "pep440" # the default
456
+
457
+ if style == "pep440":
458
+ rendered = render_pep440(pieces)
459
+ elif style == "pep440-pre":
460
+ rendered = render_pep440_pre(pieces)
461
+ elif style == "pep440-post":
462
+ rendered = render_pep440_post(pieces)
463
+ elif style == "pep440-old":
464
+ rendered = render_pep440_old(pieces)
465
+ elif style == "git-describe":
466
+ rendered = render_git_describe(pieces)
467
+ elif style == "git-describe-long":
468
+ rendered = render_git_describe_long(pieces)
469
+ else:
470
+ raise ValueError("unknown style '%s'" % style)
471
+
472
+ return {"version": rendered, "full-revisionid": pieces["long"],
473
+ "dirty": pieces["dirty"], "error": None,
474
+ "date": pieces.get("date")}
475
+
476
+
477
+ def get_versions():
478
+ """Get version information or return default if unable to do so."""
479
+ # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
480
+ # __file__, we can work backwards from there to the root. Some
481
+ # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
482
+ # case we can only use expanded keywords.
483
+
484
+ cfg = get_config()
485
+ verbose = cfg.verbose
486
+
487
+ try:
488
+ return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
489
+ verbose)
490
+ except NotThisMethod:
491
+ pass
492
+
493
+ try:
494
+ root = os.path.realpath(__file__)
495
+ # versionfile_source is the relative path from the top of the source
496
+ # tree (where the .git directory might live) to this file. Invert
497
+ # this to find the root from __file__.
498
+ for i in cfg.versionfile_source.split('/'):
499
+ root = os.path.dirname(root)
500
+ except NameError:
501
+ return {"version": "0+unknown", "full-revisionid": None,
502
+ "dirty": None,
503
+ "error": "unable to find root of source tree",
504
+ "date": None}
505
+
506
+ try:
507
+ pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
508
+ return render(pieces, cfg.style)
509
+ except NotThisMethod:
510
+ pass
511
+
512
+ try:
513
+ if cfg.parentdir_prefix:
514
+ return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
515
+ except NotThisMethod:
516
+ pass
517
+
518
+ return {"version": "0+unknown", "full-revisionid": None,
519
+ "dirty": None,
520
+ "error": "unable to compute version", "date": None}
@@ -0,0 +1,56 @@
1
+ from __future__ import division
2
+
3
+ from . import der, ecdsa
4
+
5
+
6
+ class UnknownCurveError(Exception):
7
+ pass
8
+
9
+
10
+ def orderlen(order):
11
+ return (1+len("%x" % order))//2 # bytes
12
+
13
+
14
+ # the NIST curves
15
+ class Curve:
16
+ def __init__(self, name, curve, generator, oid, openssl_name=None):
17
+ self.name = name
18
+ self.openssl_name = openssl_name # maybe None
19
+ self.curve = curve
20
+ self.generator = generator
21
+ self.order = generator.order()
22
+ self.baselen = orderlen(self.order)
23
+ self.verifying_key_length = 2*self.baselen
24
+ self.signature_length = 2*self.baselen
25
+ self.oid = oid
26
+ self.encoded_oid = der.encode_oid(*oid)
27
+
28
+ NIST192p = Curve("NIST192p", ecdsa.curve_192,
29
+ ecdsa.generator_192,
30
+ (1, 2, 840, 10045, 3, 1, 1), "prime192v1")
31
+ NIST224p = Curve("NIST224p", ecdsa.curve_224,
32
+ ecdsa.generator_224,
33
+ (1, 3, 132, 0, 33), "secp224r1")
34
+ NIST256p = Curve("NIST256p", ecdsa.curve_256,
35
+ ecdsa.generator_256,
36
+ (1, 2, 840, 10045, 3, 1, 7), "prime256v1")
37
+ NIST384p = Curve("NIST384p", ecdsa.curve_384,
38
+ ecdsa.generator_384,
39
+ (1, 3, 132, 0, 34), "secp384r1")
40
+ NIST521p = Curve("NIST521p", ecdsa.curve_521,
41
+ ecdsa.generator_521,
42
+ (1, 3, 132, 0, 35), "secp521r1")
43
+ SECP256k1 = Curve("SECP256k1", ecdsa.curve_secp256k1,
44
+ ecdsa.generator_secp256k1,
45
+ (1, 3, 132, 0, 10), "secp256k1")
46
+
47
+ curves = [NIST192p, NIST224p, NIST256p, NIST384p, NIST521p, SECP256k1]
48
+
49
+
50
+ def find_curve(oid_curve):
51
+ for c in curves:
52
+ if c.oid == oid_curve:
53
+ return c
54
+ raise UnknownCurveError("I don't know about the curve with oid %s."
55
+ "I only know about these: %s" %
56
+ (oid_curve, [c.name for c in curves]))