ccxt 4.3.70__py2.py3-none-any.whl → 4.3.72__py2.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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (151) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/paradex.py +40 -0
  3. ccxt/async_support/__init__.py +3 -1
  4. ccxt/async_support/base/exchange.py +1 -1
  5. ccxt/async_support/paradex.py +1966 -0
  6. ccxt/async_support/woo.py +4 -2
  7. ccxt/base/exchange.py +58 -1
  8. ccxt/paradex.py +1966 -0
  9. ccxt/pro/__init__.py +3 -1
  10. ccxt/pro/bequant.py +4 -0
  11. ccxt/pro/paradex.py +340 -0
  12. ccxt/static_dependencies/__init__.py +1 -1
  13. ccxt/static_dependencies/lark/__init__.py +38 -0
  14. ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
  15. ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
  16. ccxt/static_dependencies/lark/ast_utils.py +59 -0
  17. ccxt/static_dependencies/lark/common.py +86 -0
  18. ccxt/static_dependencies/lark/exceptions.py +292 -0
  19. ccxt/static_dependencies/lark/grammar.py +130 -0
  20. ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
  21. ccxt/static_dependencies/lark/indenter.py +143 -0
  22. ccxt/static_dependencies/lark/lark.py +658 -0
  23. ccxt/static_dependencies/lark/lexer.py +678 -0
  24. ccxt/static_dependencies/lark/load_grammar.py +1428 -0
  25. ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
  26. ccxt/static_dependencies/lark/parser_frontends.py +257 -0
  27. ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
  28. ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
  29. ccxt/static_dependencies/lark/parsers/earley.py +314 -0
  30. ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
  31. ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
  32. ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
  33. ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
  34. ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
  35. ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
  36. ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
  37. ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
  38. ccxt/static_dependencies/lark/py.typed +0 -0
  39. ccxt/static_dependencies/lark/reconstruct.py +107 -0
  40. ccxt/static_dependencies/lark/tools/__init__.py +70 -0
  41. ccxt/static_dependencies/lark/tools/nearley.py +202 -0
  42. ccxt/static_dependencies/lark/tools/serialize.py +32 -0
  43. ccxt/static_dependencies/lark/tools/standalone.py +196 -0
  44. ccxt/static_dependencies/lark/tree.py +267 -0
  45. ccxt/static_dependencies/lark/tree_matcher.py +186 -0
  46. ccxt/static_dependencies/lark/tree_templates.py +180 -0
  47. ccxt/static_dependencies/lark/utils.py +343 -0
  48. ccxt/static_dependencies/lark/visitors.py +596 -0
  49. ccxt/static_dependencies/marshmallow/__init__.py +81 -0
  50. ccxt/static_dependencies/marshmallow/base.py +65 -0
  51. ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
  52. ccxt/static_dependencies/marshmallow/decorators.py +231 -0
  53. ccxt/static_dependencies/marshmallow/error_store.py +60 -0
  54. ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
  55. ccxt/static_dependencies/marshmallow/fields.py +2114 -0
  56. ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
  57. ccxt/static_dependencies/marshmallow/py.typed +0 -0
  58. ccxt/static_dependencies/marshmallow/schema.py +1228 -0
  59. ccxt/static_dependencies/marshmallow/types.py +12 -0
  60. ccxt/static_dependencies/marshmallow/utils.py +378 -0
  61. ccxt/static_dependencies/marshmallow/validate.py +678 -0
  62. ccxt/static_dependencies/marshmallow/warnings.py +2 -0
  63. ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
  64. ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
  65. ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
  66. ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
  67. ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
  68. ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
  69. ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
  70. ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
  71. ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
  72. ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
  73. ccxt/static_dependencies/starknet/__init__.py +0 -0
  74. ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
  75. ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
  76. ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
  77. ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
  78. ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
  79. ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
  80. ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
  81. ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
  82. ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
  83. ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
  84. ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
  85. ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
  86. ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
  87. ccxt/static_dependencies/starknet/common.py +15 -0
  88. ccxt/static_dependencies/starknet/constants.py +39 -0
  89. ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
  90. ccxt/static_dependencies/starknet/hash/address.py +79 -0
  91. ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
  92. ccxt/static_dependencies/starknet/hash/selector.py +16 -0
  93. ccxt/static_dependencies/starknet/hash/storage.py +12 -0
  94. ccxt/static_dependencies/starknet/hash/utils.py +78 -0
  95. ccxt/static_dependencies/starknet/models/__init__.py +0 -0
  96. ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
  97. ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
  98. ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
  99. ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
  100. ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
  101. ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
  102. ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
  103. ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
  104. ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
  105. ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
  106. ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
  107. ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
  108. ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
  109. ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
  110. ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
  111. ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
  112. ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
  113. ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
  114. ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
  115. ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
  116. ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
  117. ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
  118. ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
  119. ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
  120. ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
  121. ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
  122. ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
  123. ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
  124. ccxt/static_dependencies/starknet/utils/schema.py +13 -0
  125. ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
  126. ccxt/static_dependencies/starkware/__init__.py +0 -0
  127. ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
  128. ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
  129. ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
  130. ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
  131. ccxt/static_dependencies/starkware/crypto/utils.py +58 -0
  132. ccxt/static_dependencies/sympy/__init__.py +0 -0
  133. ccxt/static_dependencies/sympy/core/__init__.py +0 -0
  134. ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
  135. ccxt/static_dependencies/sympy/external/__init__.py +0 -0
  136. ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
  137. ccxt/static_dependencies/sympy/external/importtools.py +187 -0
  138. ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
  139. ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
  140. ccxt/static_dependencies/typing_extensions/__init__.py +0 -0
  141. ccxt/static_dependencies/typing_extensions/typing_extensions.py +3839 -0
  142. ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
  143. ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
  144. ccxt/test/tests_async.py +43 -1
  145. ccxt/test/tests_sync.py +43 -1
  146. ccxt/woo.py +4 -2
  147. {ccxt-4.3.70.dist-info → ccxt-4.3.72.dist-info}/METADATA +7 -6
  148. {ccxt-4.3.70.dist-info → ccxt-4.3.72.dist-info}/RECORD +151 -16
  149. {ccxt-4.3.70.dist-info → ccxt-4.3.72.dist-info}/LICENSE.txt +0 -0
  150. {ccxt-4.3.70.dist-info → ccxt-4.3.72.dist-info}/WHEEL +0 -0
  151. {ccxt-4.3.70.dist-info → ccxt-4.3.72.dist-info}/top_level.txt +0 -0
ccxt/async_support/woo.py CHANGED
@@ -2464,11 +2464,13 @@ class woo(Exchange, ImplicitAPI):
2464
2464
  #
2465
2465
  marketId = self.safe_string(income, 'symbol')
2466
2466
  symbol = self.safe_symbol(marketId, market)
2467
- amount = self.safe_number(income, 'funding_fee')
2467
+ amount = self.safe_string(income, 'funding_fee')
2468
2468
  code = self.safe_currency_code('USD')
2469
2469
  id = self.safe_string(income, 'id')
2470
2470
  timestamp = self.safe_timestamp(income, 'updated_time')
2471
2471
  rate = self.safe_number(income, 'funding_rate')
2472
+ paymentType = self.safe_string(income, 'payment_type')
2473
+ amount = Precise.string_neg(amount) if (paymentType == 'Pay') else amount
2472
2474
  return {
2473
2475
  'info': income,
2474
2476
  'symbol': symbol,
@@ -2476,7 +2478,7 @@ class woo(Exchange, ImplicitAPI):
2476
2478
  'timestamp': timestamp,
2477
2479
  'datetime': self.iso8601(timestamp),
2478
2480
  'id': id,
2479
- 'amount': amount,
2481
+ 'amount': self.parse_number(amount),
2480
2482
  'rate': rate,
2481
2483
  }
2482
2484
 
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.3.70'
7
+ __version__ = '4.3.72'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -59,6 +59,12 @@ from ccxt.static_dependencies.ethereum import abi
59
59
  from ccxt.static_dependencies.ethereum import account
60
60
  from ccxt.static_dependencies.msgpack import packb
61
61
 
62
+ # starknet
63
+ from ccxt.static_dependencies.starknet.ccxt_utils import get_private_key_from_eth_signature
64
+ from ccxt.static_dependencies.starknet.hash.address import compute_address
65
+ from ccxt.static_dependencies.starknet.hash.selector import get_selector_from_name
66
+ from ccxt.static_dependencies.starknet.hash.utils import message_signature, private_to_stark_key
67
+ from ccxt.static_dependencies.starknet.utils.typed_data import TypedData as TypedDataDataclass
62
68
 
63
69
  # -----------------------------------------------------------------------------
64
70
 
@@ -1286,6 +1292,57 @@ class Exchange(object):
1286
1292
  encodedData = account.messages.encode_typed_data(domain, messageTypes, message)
1287
1293
  return Exchange.binary_concat(b"\x19\x01", encodedData.header, encodedData.body)
1288
1294
 
1295
+ @staticmethod
1296
+ def retrieve_stark_account (signature, accountClassHash, accountProxyClassHash):
1297
+ privateKey = get_private_key_from_eth_signature(signature)
1298
+ publicKey = private_to_stark_key(privateKey)
1299
+ calldata = [
1300
+ int(accountClassHash, 16),
1301
+ get_selector_from_name("initialize"),
1302
+ 2,
1303
+ publicKey,
1304
+ 0,
1305
+ ]
1306
+
1307
+ address = compute_address(
1308
+ class_hash=int(accountProxyClassHash, 16),
1309
+ constructor_calldata=calldata,
1310
+ salt=publicKey,
1311
+ )
1312
+ return {
1313
+ 'privateKey': privateKey,
1314
+ 'publicKey': publicKey,
1315
+ 'address': hex(address)
1316
+ }
1317
+
1318
+ @staticmethod
1319
+ def starknet_encode_structured_data (domain, messageTypes, messageData, address):
1320
+ types = list(messageTypes.keys())
1321
+ if len(types) > 1:
1322
+ raise NotSupported(this.id + 'starknetEncodeStructuredData only support single type')
1323
+
1324
+ request = {
1325
+ 'domain': domain,
1326
+ 'primaryType': types[0],
1327
+ 'types': Exchange.extend({
1328
+ 'StarkNetDomain': [
1329
+ {'name': "name", 'type': "felt"},
1330
+ {'name': "chainId", 'type': "felt"},
1331
+ {'name': "version", 'type': "felt"},
1332
+ ],
1333
+ }, messageTypes),
1334
+ 'message': messageData,
1335
+ }
1336
+ typedDataClass = TypedDataDataclass.from_dict(request)
1337
+ msgHash = typedDataClass.message_hash(int(address, 16))
1338
+ return msgHash
1339
+
1340
+ @staticmethod
1341
+ def starknet_sign (hash, pri):
1342
+ # // TODO: unify to ecdsa
1343
+ r, s = message_signature(hash, pri)
1344
+ return Exchange.json([hex(r), hex(s)])
1345
+
1289
1346
  @staticmethod
1290
1347
  def packb(o):
1291
1348
  return packb(o)