ccxt 4.4.88__py2.py3-none-any.whl → 4.4.91__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.
Files changed (101) hide show
  1. ccxt/__init__.py +1 -3
  2. ccxt/abstract/bitget.py +58 -0
  3. ccxt/abstract/bitrue.py +65 -65
  4. ccxt/abstract/cryptocom.py +2 -0
  5. ccxt/abstract/luno.py +1 -0
  6. ccxt/async_support/__init__.py +1 -3
  7. ccxt/async_support/base/exchange.py +6 -3
  8. ccxt/async_support/base/ws/client.py +173 -64
  9. ccxt/async_support/base/ws/future.py +23 -50
  10. ccxt/async_support/binance.py +2 -2
  11. ccxt/async_support/bingx.py +55 -29
  12. ccxt/async_support/bitget.py +469 -147
  13. ccxt/async_support/bitmex.py +2 -1
  14. ccxt/async_support/bitrue.py +72 -66
  15. ccxt/async_support/bitvavo.py +34 -0
  16. ccxt/async_support/btcalpha.py +35 -0
  17. ccxt/async_support/btcbox.py +35 -0
  18. ccxt/async_support/btcmarkets.py +35 -0
  19. ccxt/async_support/btcturk.py +35 -0
  20. ccxt/async_support/bybit.py +9 -3
  21. ccxt/async_support/cex.py +61 -0
  22. ccxt/async_support/coinbase.py +1 -3
  23. ccxt/async_support/cryptocom.py +66 -2
  24. ccxt/async_support/cryptomus.py +1 -1
  25. ccxt/async_support/delta.py +2 -2
  26. ccxt/async_support/digifinex.py +39 -99
  27. ccxt/async_support/exmo.py +14 -7
  28. ccxt/async_support/gate.py +14 -7
  29. ccxt/async_support/hashkey.py +15 -28
  30. ccxt/async_support/hollaex.py +27 -22
  31. ccxt/async_support/hyperliquid.py +104 -53
  32. ccxt/async_support/kraken.py +54 -50
  33. ccxt/async_support/luno.py +87 -1
  34. ccxt/async_support/mexc.py +1 -0
  35. ccxt/async_support/modetrade.py +2 -2
  36. ccxt/async_support/okx.py +2 -1
  37. ccxt/async_support/paradex.py +1 -1
  38. ccxt/async_support/phemex.py +16 -8
  39. ccxt/async_support/tradeogre.py +3 -3
  40. ccxt/async_support/xt.py +1 -1
  41. ccxt/base/exchange.py +20 -8
  42. ccxt/binance.py +2 -2
  43. ccxt/bingx.py +55 -29
  44. ccxt/bitget.py +469 -147
  45. ccxt/bitmex.py +2 -1
  46. ccxt/bitrue.py +72 -66
  47. ccxt/bitvavo.py +34 -0
  48. ccxt/btcalpha.py +35 -0
  49. ccxt/btcbox.py +35 -0
  50. ccxt/btcmarkets.py +35 -0
  51. ccxt/btcturk.py +35 -0
  52. ccxt/bybit.py +9 -3
  53. ccxt/cex.py +61 -0
  54. ccxt/coinbase.py +1 -3
  55. ccxt/cryptocom.py +66 -2
  56. ccxt/cryptomus.py +1 -1
  57. ccxt/delta.py +2 -2
  58. ccxt/digifinex.py +39 -99
  59. ccxt/exmo.py +13 -7
  60. ccxt/gate.py +14 -7
  61. ccxt/hashkey.py +15 -28
  62. ccxt/hollaex.py +27 -22
  63. ccxt/hyperliquid.py +104 -53
  64. ccxt/kraken.py +53 -50
  65. ccxt/luno.py +87 -1
  66. ccxt/mexc.py +1 -0
  67. ccxt/modetrade.py +2 -2
  68. ccxt/okx.py +2 -1
  69. ccxt/paradex.py +1 -1
  70. ccxt/phemex.py +16 -8
  71. ccxt/pro/__init__.py +1 -127
  72. ccxt/pro/bitstamp.py +1 -1
  73. ccxt/pro/bybit.py +6 -136
  74. ccxt/pro/coinbase.py +2 -0
  75. ccxt/pro/cryptocom.py +27 -0
  76. ccxt/pro/kraken.py +249 -267
  77. ccxt/pro/mexc.py +0 -1
  78. ccxt/tradeogre.py +3 -3
  79. ccxt/xt.py +1 -1
  80. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/METADATA +64 -23
  81. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/RECORD +84 -101
  82. ccxt/abstract/coinlist.py +0 -57
  83. ccxt/async_support/base/ws/aiohttp_client.py +0 -147
  84. ccxt/async_support/bitcoincom.py +0 -18
  85. ccxt/async_support/bitfinex1.py +0 -1711
  86. ccxt/async_support/bitpanda.py +0 -17
  87. ccxt/async_support/coinlist.py +0 -2542
  88. ccxt/async_support/poloniexfutures.py +0 -1875
  89. ccxt/bitcoincom.py +0 -18
  90. ccxt/bitfinex1.py +0 -1710
  91. ccxt/bitpanda.py +0 -17
  92. ccxt/coinlist.py +0 -2542
  93. ccxt/poloniexfutures.py +0 -1875
  94. ccxt/pro/bitcoincom.py +0 -35
  95. ccxt/pro/bitfinex1.py +0 -635
  96. ccxt/pro/bitpanda.py +0 -16
  97. ccxt/pro/poloniexfutures.py +0 -1004
  98. ccxt/pro/wazirx.py +0 -766
  99. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/LICENSE.txt +0 -0
  100. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/WHEEL +0 -0
  101. {ccxt-4.4.88.dist-info → ccxt-4.4.91.dist-info}/top_level.txt +0 -0
@@ -1,147 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- orjson = None
4
- try:
5
- import orjson as orjson
6
- except ImportError:
7
- pass
8
-
9
- import json
10
- from asyncio import sleep, ensure_future
11
- from aiohttp import WSMsgType
12
- from .functions import milliseconds, iso8601, is_json_encoded_object
13
- from ccxt.async_support.base.ws.client import Client
14
- from ccxt.async_support.base.ws.functions import gunzip, inflate
15
- from ccxt import NetworkError, RequestTimeout, ExchangeClosedByUser
16
-
17
-
18
- class AiohttpClient(Client):
19
-
20
- proxy = None
21
-
22
- def closed(self):
23
- return (self.connection is None) or self.connection.closed
24
-
25
- def receive(self):
26
- return self.connection.receive()
27
-
28
- # helper method for binary and text messages
29
- def handle_text_or_binary_message(self, data):
30
- if self.verbose:
31
- self.log(iso8601(milliseconds()), 'message', data)
32
- if isinstance(data, bytes):
33
- data = data.decode()
34
- # decoded = json.loads(data) if is_json_encoded_object(data) else data
35
- decode = None
36
- if is_json_encoded_object(data):
37
- if orjson is None:
38
- decode = json.loads(data)
39
- else:
40
- decode = orjson.loads(data)
41
- else:
42
- decode = data
43
- self.on_message_callback(self, decode)
44
-
45
- def handle_message(self, message):
46
- # self.log(iso8601(milliseconds()), message)
47
- if message.type == WSMsgType.TEXT:
48
- self.handle_text_or_binary_message(message.data)
49
- elif message.type == WSMsgType.BINARY:
50
- data = message.data
51
- if self.gunzip:
52
- data = gunzip(data)
53
- elif self.inflate:
54
- data = inflate(data)
55
- self.handle_text_or_binary_message(data)
56
- # autoping is responsible for automatically replying with pong
57
- # to a ping incoming from a server, we have to disable autoping
58
- # with aiohttp's websockets and respond with pong manually
59
- # otherwise aiohttp's websockets client won't trigger WSMsgType.PONG
60
- elif message.type == WSMsgType.PING:
61
- if self.verbose:
62
- self.log(iso8601(milliseconds()), 'ping', message)
63
- ensure_future(self.connection.pong(message.data), loop=self.asyncio_loop)
64
- elif message.type == WSMsgType.PONG:
65
- self.lastPong = milliseconds()
66
- if self.verbose:
67
- self.log(iso8601(milliseconds()), 'pong', message)
68
- pass
69
- elif message.type == WSMsgType.CLOSE:
70
- if self.verbose:
71
- self.log(iso8601(milliseconds()), 'close', self.closed(), message)
72
- self.on_close(message.data)
73
- elif message.type == WSMsgType.CLOSED:
74
- if self.verbose:
75
- self.log(iso8601(milliseconds()), 'closed', self.closed(), message)
76
- self.on_close(1000)
77
- elif message.type == WSMsgType.ERROR:
78
- if self.verbose:
79
- self.log(iso8601(milliseconds()), 'error', message)
80
- error = NetworkError(str(message))
81
- self.on_error(error)
82
-
83
- def create_connection(self, session):
84
- # autoping is responsible for automatically replying with pong
85
- # to a ping incoming from a server, we have to disable autoping
86
- # with aiohttp's websockets and respond with pong manually
87
- # otherwise aiohttp's websockets client won't trigger WSMsgType.PONG
88
- # call aenter here to simulate async with otherwise we get the error "await not called with future"
89
- # if connecting to a non-existent endpoint
90
- if (self.proxy):
91
- return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), proxy=self.proxy, max_msg_size=10485760).__aenter__()
92
- return session.ws_connect(self.url, autoping=False, autoclose=False, headers=self.options.get('headers'), max_msg_size=10485760).__aenter__()
93
-
94
- async def send(self, message):
95
- if self.verbose:
96
- self.log(iso8601(milliseconds()), 'sending', message)
97
- send_msg = None
98
- if isinstance(message, str):
99
- send_msg = message
100
- else:
101
- if orjson is None:
102
- send_msg = json.dumps(message, separators=(',', ':'))
103
- else:
104
- send_msg = orjson.dumps(message).decode('utf-8')
105
- return await self.connection.send_str(send_msg)
106
-
107
- async def close(self, code=1000):
108
- if self.verbose:
109
- self.log(iso8601(milliseconds()), 'closing', code)
110
- if not self.closed():
111
- await self.connection.close()
112
- # these will end automatically once self.closed() = True
113
- # so we don't need to cancel them
114
- if self.ping_looper:
115
- self.ping_looper.cancel()
116
- if self.receive_looper:
117
- self.receive_looper.cancel() # cancel all pending futures stored in self.futures
118
- for key in self.futures:
119
- future = self.futures[key]
120
- if not future.done():
121
- if future.is_race_future:
122
- future.cancel() # this is an "internal" future so we want to cancel it silently
123
- else:
124
- future.reject(ExchangeClosedByUser('Connection closed by the user'))
125
-
126
-
127
- async def ping_loop(self):
128
- if self.verbose:
129
- self.log(iso8601(milliseconds()), 'ping loop')
130
- while self.keepAlive and not self.closed():
131
- now = milliseconds()
132
- self.lastPong = now if self.lastPong is None else self.lastPong
133
- if (self.lastPong + self.keepAlive * self.maxPingPongMisses) < now:
134
- self.on_error(RequestTimeout('Connection to ' + self.url + ' timed out due to a ping-pong keepalive missing on time'))
135
- # the following ping-clause is not necessary with aiohttp's built-in ws
136
- # since it has a heartbeat option (see create_connection above)
137
- # however some exchanges require a text-type ping message
138
- # therefore we need this clause anyway
139
- else:
140
- if self.ping:
141
- try:
142
- await self.send(self.ping(self))
143
- except Exception as e:
144
- self.on_error(e)
145
- else:
146
- await self.connection.ping()
147
- await sleep(self.keepAlive / 1000)
@@ -1,18 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
- # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
-
6
- from ccxt.async_support.fmfwio import fmfwio
7
- from ccxt.abstract.bitcoincom import ImplicitAPI
8
- from ccxt.base.types import Any
9
-
10
-
11
- class bitcoincom(fmfwio, ImplicitAPI):
12
-
13
- def describe(self) -> Any:
14
- return self.deep_extend(super(bitcoincom, self).describe(), {
15
- 'id': 'bitcoincom',
16
- 'name': 'Bitcoin.com',
17
- 'alias': True,
18
- })