ccxt 4.4.3__py2.py3-none-any.whl → 4.4.5__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.
- ccxt/__init__.py +1 -1
- ccxt/abstract/binanceus.py +36 -36
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +24 -13
- ccxt/async_support/base/ws/cache.py +1 -0
- ccxt/async_support/binance.py +43 -18
- ccxt/async_support/binanceus.py +1 -0
- ccxt/async_support/bingx.py +1 -0
- ccxt/async_support/bitfinex2.py +10 -9
- ccxt/async_support/bitget.py +55 -99
- ccxt/async_support/bitmex.py +14 -13
- ccxt/async_support/bitso.py +8 -7
- ccxt/async_support/bitstamp.py +12 -12
- ccxt/async_support/blofin.py +24 -26
- ccxt/async_support/bybit.py +101 -29
- ccxt/async_support/coinbase.py +31 -10
- ccxt/async_support/coinbaseexchange.py +14 -14
- ccxt/async_support/coinlist.py +9 -8
- ccxt/async_support/coinmetro.py +6 -6
- ccxt/async_support/cryptocom.py +10 -8
- ccxt/async_support/currencycom.py +9 -9
- ccxt/async_support/delta.py +8 -8
- ccxt/async_support/digifinex.py +11 -9
- ccxt/async_support/gate.py +9 -8
- ccxt/async_support/hashkey.py +12 -10
- ccxt/async_support/htx.py +16 -19
- ccxt/async_support/hyperliquid.py +70 -117
- ccxt/async_support/kraken.py +12 -10
- ccxt/async_support/kucoin.py +12 -11
- ccxt/async_support/luno.py +13 -12
- ccxt/async_support/lykke.py +2 -2
- ccxt/async_support/mexc.py +41 -3
- ccxt/async_support/ndax.py +9 -8
- ccxt/async_support/okcoin.py +21 -30
- ccxt/async_support/okx.py +21 -29
- ccxt/async_support/paradex.py +1 -1
- ccxt/async_support/woo.py +10 -9
- ccxt/async_support/woofipro.py +11 -9
- ccxt/async_support/xt.py +7 -6
- ccxt/async_support/zonda.py +9 -8
- ccxt/base/exchange.py +3 -1
- ccxt/binance.py +43 -18
- ccxt/binanceus.py +1 -0
- ccxt/bingx.py +1 -0
- ccxt/bitfinex2.py +10 -9
- ccxt/bitget.py +55 -99
- ccxt/bitmex.py +14 -13
- ccxt/bitso.py +8 -7
- ccxt/bitstamp.py +12 -12
- ccxt/blofin.py +24 -26
- ccxt/bybit.py +101 -29
- ccxt/coinbase.py +31 -10
- ccxt/coinbaseexchange.py +14 -14
- ccxt/coinlist.py +9 -8
- ccxt/coinmetro.py +6 -6
- ccxt/cryptocom.py +10 -8
- ccxt/currencycom.py +9 -9
- ccxt/delta.py +8 -8
- ccxt/digifinex.py +11 -9
- ccxt/gate.py +9 -8
- ccxt/hashkey.py +12 -10
- ccxt/htx.py +16 -19
- ccxt/hyperliquid.py +70 -117
- ccxt/kraken.py +12 -10
- ccxt/kucoin.py +12 -11
- ccxt/luno.py +13 -12
- ccxt/lykke.py +2 -2
- ccxt/mexc.py +40 -3
- ccxt/ndax.py +9 -8
- ccxt/okcoin.py +21 -30
- ccxt/okx.py +21 -29
- ccxt/paradex.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +6 -2
- ccxt/pro/binanceus.py +2 -1
- ccxt/pro/bybit.py +51 -0
- ccxt/pro/hyperliquid.py +14 -1
- ccxt/pro/mexc.py +78 -0
- ccxt/pro/paradex.py +1 -0
- ccxt/test/tests_async.py +1 -1
- ccxt/test/tests_sync.py +1 -1
- ccxt/woo.py +10 -9
- ccxt/woofipro.py +11 -9
- ccxt/xt.py +7 -6
- ccxt/zonda.py +9 -8
- {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/METADATA +5 -5
- {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/RECORD +90 -90
- {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/WHEEL +0 -0
- {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/top_level.txt +0 -0
ccxt/pro/mexc.py
CHANGED
@@ -10,6 +10,8 @@ from ccxt.base.types import Balances, Int, Order, OrderBook, Str, Strings, Ticke
|
|
10
10
|
from ccxt.async_support.base.ws.client import Client
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
13
|
+
from ccxt.base.errors import ArgumentsRequired
|
14
|
+
from ccxt.base.errors import NotSupported
|
13
15
|
|
14
16
|
|
15
17
|
class mexc(ccxt.async_support.mexc):
|
@@ -34,6 +36,7 @@ class mexc(ccxt.async_support.mexc):
|
|
34
36
|
'watchOrders': True,
|
35
37
|
'watchTicker': True,
|
36
38
|
'watchTickers': True,
|
39
|
+
'watchBidsAsks': True,
|
37
40
|
'watchTrades': True,
|
38
41
|
'watchTradesForSymbols': False,
|
39
42
|
},
|
@@ -110,6 +113,7 @@ class mexc(ccxt.async_support.mexc):
|
|
110
113
|
# "t": 1678643605721
|
111
114
|
# }
|
112
115
|
#
|
116
|
+
self.handle_bid_ask(client, message)
|
113
117
|
rawTicker = self.safe_value_2(message, 'd', 'data')
|
114
118
|
marketId = self.safe_string_2(message, 's', 'symbol')
|
115
119
|
timestamp = self.safe_integer(message, 't')
|
@@ -229,6 +233,80 @@ class mexc(ccxt.async_support.mexc):
|
|
229
233
|
'info': ticker,
|
230
234
|
}, market)
|
231
235
|
|
236
|
+
async def watch_bids_asks(self, symbols: Strings = None, params={}) -> Tickers:
|
237
|
+
"""
|
238
|
+
:see: https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
|
239
|
+
watches best bid & ask for symbols
|
240
|
+
:param str[] symbols: unified symbol of the market to fetch the ticker for
|
241
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
242
|
+
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
243
|
+
"""
|
244
|
+
await self.load_markets()
|
245
|
+
symbols = self.market_symbols(symbols, None, True, False, True)
|
246
|
+
marketType = None
|
247
|
+
if symbols is None:
|
248
|
+
raise ArgumentsRequired(self.id + 'watchBidsAsks required symbols argument')
|
249
|
+
markets = self.markets_for_symbols(symbols)
|
250
|
+
marketType, params = self.handle_market_type_and_params('watchBidsAsks', markets[0], params)
|
251
|
+
isSpot = marketType == 'spot'
|
252
|
+
if not isSpot:
|
253
|
+
raise NotSupported(self.id + 'watchBidsAsks only support spot market')
|
254
|
+
messageHashes = []
|
255
|
+
topics = []
|
256
|
+
for i in range(0, len(symbols)):
|
257
|
+
if isSpot:
|
258
|
+
market = self.market(symbols[i])
|
259
|
+
topics.append('spot@public.bookTicker.v3.api@' + market['id'])
|
260
|
+
messageHashes.append('bidask:' + symbols[i])
|
261
|
+
url = self.urls['api']['ws']['spot']
|
262
|
+
request: dict = {
|
263
|
+
'method': 'SUBSCRIPTION',
|
264
|
+
'params': topics,
|
265
|
+
}
|
266
|
+
ticker = await self.watch_multiple(url, messageHashes, self.extend(request, params), messageHashes)
|
267
|
+
if self.newUpdates:
|
268
|
+
tickers: dict = {}
|
269
|
+
tickers[ticker['symbol']] = ticker
|
270
|
+
return tickers
|
271
|
+
return self.filter_by_array(self.bidsasks, 'symbol', symbols)
|
272
|
+
|
273
|
+
def handle_bid_ask(self, client: Client, message):
|
274
|
+
#
|
275
|
+
# {
|
276
|
+
# "c": "spot@public.bookTicker.v3.api@BTCUSDT",
|
277
|
+
# "d": {
|
278
|
+
# "A": "4.70432",
|
279
|
+
# "B": "6.714863",
|
280
|
+
# "a": "20744.54",
|
281
|
+
# "b": "20744.17"
|
282
|
+
# },
|
283
|
+
# "s": "BTCUSDT",
|
284
|
+
# "t": 1678643605721
|
285
|
+
# }
|
286
|
+
#
|
287
|
+
parsedTicker = self.parse_ws_bid_ask(message)
|
288
|
+
symbol = parsedTicker['symbol']
|
289
|
+
self.bidsasks[symbol] = parsedTicker
|
290
|
+
messageHash = 'bidask:' + symbol
|
291
|
+
client.resolve(parsedTicker, messageHash)
|
292
|
+
|
293
|
+
def parse_ws_bid_ask(self, ticker, market=None):
|
294
|
+
data = self.safe_dict(ticker, 'd')
|
295
|
+
marketId = self.safe_string(ticker, 's')
|
296
|
+
market = self.safe_market(marketId, market)
|
297
|
+
symbol = self.safe_string(market, 'symbol')
|
298
|
+
timestamp = self.safe_integer(ticker, 't')
|
299
|
+
return self.safe_ticker({
|
300
|
+
'symbol': symbol,
|
301
|
+
'timestamp': timestamp,
|
302
|
+
'datetime': self.iso8601(timestamp),
|
303
|
+
'ask': self.safe_number(data, 'a'),
|
304
|
+
'askVolume': self.safe_number(data, 'A'),
|
305
|
+
'bid': self.safe_number(data, 'b'),
|
306
|
+
'bidVolume': self.safe_number(data, 'B'),
|
307
|
+
'info': ticker,
|
308
|
+
}, market)
|
309
|
+
|
232
310
|
async def watch_spot_public(self, channel, messageHash, params={}):
|
233
311
|
url = self.urls['api']['ws']['spot']
|
234
312
|
request: dict = {
|
ccxt/pro/paradex.py
CHANGED
@@ -211,6 +211,7 @@ class paradex(ccxt.async_support.paradex):
|
|
211
211
|
async def watch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
212
212
|
"""
|
213
213
|
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
214
|
+
:see: https://docs.api.testnet.paradex.trade/#sub-markets_summary-operation
|
214
215
|
:param str[] symbols: unified symbol of the market to fetch the ticker for
|
215
216
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
216
217
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
ccxt/test/tests_async.py
CHANGED
@@ -282,7 +282,7 @@ class testMainClass(baseMainTestClass):
|
|
282
282
|
else:
|
283
283
|
# wait and retry again
|
284
284
|
# (increase wait time on every retry)
|
285
|
-
await exchange.sleep(i * 1000)
|
285
|
+
await exchange.sleep((i + 1) * 1000)
|
286
286
|
continue
|
287
287
|
else:
|
288
288
|
# if it's loadMarkets, then fail test, because it's mandatory for tests
|
ccxt/test/tests_sync.py
CHANGED
@@ -279,7 +279,7 @@ class testMainClass(baseMainTestClass):
|
|
279
279
|
else:
|
280
280
|
# wait and retry again
|
281
281
|
# (increase wait time on every retry)
|
282
|
-
exchange.sleep(i * 1000)
|
282
|
+
exchange.sleep((i + 1) * 1000)
|
283
283
|
continue
|
284
284
|
else:
|
285
285
|
# if it's loadMarkets, then fail test, because it's mandatory for tests
|
ccxt/woo.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.woo import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Bool, Conversion, Currencies, Currency, Int, Leverage, MarginModification, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Bool, Conversion, Currencies, Currency, Int, LedgerEntry, Leverage, MarginModification, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from typing import Any
|
12
12
|
from ccxt.base.errors import ExchangeError
|
@@ -1991,29 +1991,31 @@ class woo(Exchange, ImplicitAPI):
|
|
1991
1991
|
# }
|
1992
1992
|
return [currency, self.safe_list(response, 'rows', [])]
|
1993
1993
|
|
1994
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1994
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
1995
1995
|
"""
|
1996
1996
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
1997
1997
|
:see: https://docs.woo.org/#get-asset-history
|
1998
|
-
:param str code: unified currency code, default is None
|
1998
|
+
:param str [code]: unified currency code, default is None
|
1999
1999
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2000
|
-
:param int [limit]: max number of ledger
|
2000
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
2001
2001
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2002
2002
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
2003
2003
|
"""
|
2004
2004
|
currency, rows = self.get_asset_history_rows(code, since, limit, params)
|
2005
2005
|
return self.parse_ledger(rows, currency, since, limit, params)
|
2006
2006
|
|
2007
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2007
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2008
2008
|
networkizedCode = self.safe_string(item, 'token')
|
2009
2009
|
currencyDefined = self.get_currency_from_chaincode(networkizedCode, currency)
|
2010
2010
|
code = currencyDefined['code']
|
2011
|
+
currency = self.safe_currency(code, currency)
|
2011
2012
|
amount = self.safe_number(item, 'amount')
|
2012
2013
|
side = self.safe_string(item, 'token_side')
|
2013
2014
|
direction = 'in' if (side == 'DEPOSIT') else 'out'
|
2014
2015
|
timestamp = self.safe_timestamp(item, 'created_time')
|
2015
2016
|
fee = self.parse_token_and_fee_temp(item, 'fee_token', 'fee_amount')
|
2016
|
-
return {
|
2017
|
+
return self.safe_ledger_entry({
|
2018
|
+
'info': item,
|
2017
2019
|
'id': self.safe_string(item, 'id'),
|
2018
2020
|
'currency': code,
|
2019
2021
|
'account': self.safe_string(item, 'account'),
|
@@ -2023,13 +2025,12 @@ class woo(Exchange, ImplicitAPI):
|
|
2023
2025
|
'amount': amount,
|
2024
2026
|
'before': None,
|
2025
2027
|
'after': None,
|
2026
|
-
'fee': fee,
|
2027
2028
|
'direction': direction,
|
2028
2029
|
'timestamp': timestamp,
|
2029
2030
|
'datetime': self.iso8601(timestamp),
|
2030
2031
|
'type': self.parse_ledger_entry_type(self.safe_string(item, 'type')),
|
2031
|
-
'
|
2032
|
-
}
|
2032
|
+
'fee': fee,
|
2033
|
+
}, currency)
|
2033
2034
|
|
2034
2035
|
def parse_ledger_entry_type(self, type):
|
2035
2036
|
types: dict = {
|
ccxt/woofipro.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.woofipro import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction
|
8
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TradingFees, Transaction
|
9
9
|
from typing import List
|
10
10
|
from typing import Any
|
11
11
|
from ccxt.base.errors import ExchangeError
|
@@ -1987,14 +1987,16 @@ class woofipro(Exchange, ImplicitAPI):
|
|
1987
1987
|
data = self.safe_dict(response, 'data', {})
|
1988
1988
|
return [currency, self.safe_list(data, 'rows', [])]
|
1989
1989
|
|
1990
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
1991
|
-
|
1990
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
1991
|
+
currencyId = self.safe_string(item, 'token')
|
1992
|
+
code = self.safe_currency_code(currencyId, currency)
|
1993
|
+
currency = self.safe_currency(currencyId, currency)
|
1992
1994
|
amount = self.safe_number(item, 'amount')
|
1993
1995
|
side = self.safe_string(item, 'token_side')
|
1994
1996
|
direction = 'in' if (side == 'DEPOSIT') else 'out'
|
1995
1997
|
timestamp = self.safe_integer(item, 'created_time')
|
1996
1998
|
fee = self.parse_token_and_fee_temp(item, 'fee_token', 'fee_amount')
|
1997
|
-
return {
|
1999
|
+
return self.safe_ledger_entry({
|
1998
2000
|
'id': self.safe_string(item, 'id'),
|
1999
2001
|
'currency': code,
|
2000
2002
|
'account': self.safe_string(item, 'account'),
|
@@ -2010,7 +2012,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
2010
2012
|
'datetime': self.iso8601(timestamp),
|
2011
2013
|
'type': self.parse_ledger_entry_type(self.safe_string(item, 'type')),
|
2012
2014
|
'info': item,
|
2013
|
-
}
|
2015
|
+
}, currency)
|
2014
2016
|
|
2015
2017
|
def parse_ledger_entry_type(self, type):
|
2016
2018
|
types: dict = {
|
@@ -2019,13 +2021,13 @@ class woofipro(Exchange, ImplicitAPI):
|
|
2019
2021
|
}
|
2020
2022
|
return self.safe_string(types, type, type)
|
2021
2023
|
|
2022
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2024
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
2023
2025
|
"""
|
2024
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
2026
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2025
2027
|
:see: https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
|
2026
|
-
:param str code: unified currency code, default is None
|
2028
|
+
:param str [code]: unified currency code, default is None
|
2027
2029
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2028
|
-
:param int [limit]: max number of ledger
|
2030
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
2029
2031
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2030
2032
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
2031
2033
|
"""
|
ccxt/xt.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.xt import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Currencies, Currency, Int, LeverageTier, MarginModification, Market, Num, Order, OrderSide, OrderType, Str, Tickers, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Currencies, Currency, Int, LedgerEntry, LeverageTier, MarginModification, Market, Num, Order, OrderSide, OrderType, Str, Tickers, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -3310,7 +3310,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3310
3310
|
}
|
3311
3311
|
return self.safe_string(statuses, status, status)
|
3312
3312
|
|
3313
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3313
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
3314
3314
|
"""
|
3315
3315
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
3316
3316
|
:see: https://doc.xt.com/#futures_usergetBalanceBill
|
@@ -3367,7 +3367,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3367
3367
|
ledger = self.safe_value(data, 'items', [])
|
3368
3368
|
return self.parse_ledger(ledger, currency, since, limit)
|
3369
3369
|
|
3370
|
-
def parse_ledger_entry(self, item, currency=None):
|
3370
|
+
def parse_ledger_entry(self, item, currency=None) -> LedgerEntry:
|
3371
3371
|
#
|
3372
3372
|
# {
|
3373
3373
|
# "id": "207260567109387524",
|
@@ -3383,8 +3383,10 @@ class xt(Exchange, ImplicitAPI):
|
|
3383
3383
|
side = self.safe_string(item, 'side')
|
3384
3384
|
direction = 'in' if (side == 'ADD') else 'out'
|
3385
3385
|
currencyId = self.safe_string(item, 'coin')
|
3386
|
+
currency = self.safe_currency(currencyId, currency)
|
3386
3387
|
timestamp = self.safe_integer(item, 'createdTime')
|
3387
|
-
return {
|
3388
|
+
return self.safe_ledger_entry({
|
3389
|
+
'info': item,
|
3388
3390
|
'id': self.safe_string(item, 'id'),
|
3389
3391
|
'direction': direction,
|
3390
3392
|
'account': None,
|
@@ -3402,8 +3404,7 @@ class xt(Exchange, ImplicitAPI):
|
|
3402
3404
|
'currency': None,
|
3403
3405
|
'cost': None,
|
3404
3406
|
},
|
3405
|
-
|
3406
|
-
}
|
3407
|
+
}, currency)
|
3407
3408
|
|
3408
3409
|
def parse_ledger_entry_type(self, type):
|
3409
3410
|
ledgerType = {
|
ccxt/zonda.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.zonda import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -804,13 +804,13 @@ class zonda(Exchange, ImplicitAPI):
|
|
804
804
|
items = self.safe_dict(response, 'items')
|
805
805
|
return self.parse_tickers(items, symbols)
|
806
806
|
|
807
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
807
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
808
808
|
"""
|
809
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
809
810
|
:see: https://docs.zondacrypto.exchange/reference/operations-history
|
810
|
-
|
811
|
-
:param str code: unified currency code, default is None
|
811
|
+
:param str [code]: unified currency code, default is None
|
812
812
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
813
|
-
:param int [limit]: max number of ledger
|
813
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
814
814
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
815
815
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
816
816
|
"""
|
@@ -830,7 +830,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
830
830
|
items = response['items']
|
831
831
|
return self.parse_ledger(items, None, since, limit)
|
832
832
|
|
833
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
833
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
834
834
|
#
|
835
835
|
# FUNDS_MIGRATION
|
836
836
|
# {
|
@@ -1101,6 +1101,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1101
1101
|
timestamp = self.safe_integer(item, 'time')
|
1102
1102
|
balance = self.safe_value(item, 'balance', {})
|
1103
1103
|
currencyId = self.safe_string(balance, 'currency')
|
1104
|
+
currency = self.safe_currency(currencyId, currency)
|
1104
1105
|
change = self.safe_value(item, 'change', {})
|
1105
1106
|
amount = self.safe_string(change, 'total')
|
1106
1107
|
direction = 'in'
|
@@ -1111,7 +1112,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1111
1112
|
# that can be used to enrich the transfers with txid, address etc(you need to use info.detailId parameter)
|
1112
1113
|
fundsBefore = self.safe_value(item, 'fundsBefore', {})
|
1113
1114
|
fundsAfter = self.safe_value(item, 'fundsAfter', {})
|
1114
|
-
return {
|
1115
|
+
return self.safe_ledger_entry({
|
1115
1116
|
'info': item,
|
1116
1117
|
'id': self.safe_string(item, 'historyId'),
|
1117
1118
|
'direction': direction,
|
@@ -1127,7 +1128,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1127
1128
|
'timestamp': timestamp,
|
1128
1129
|
'datetime': self.iso8601(timestamp),
|
1129
1130
|
'fee': None,
|
1130
|
-
}
|
1131
|
+
}, currency)
|
1131
1132
|
|
1132
1133
|
def parse_ledger_entry_type(self, type):
|
1133
1134
|
types: dict = {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ccxt
|
3
|
-
Version: 4.4.
|
3
|
+
Version: 4.4.5
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
|
5
5
|
Home-page: https://ccxt.com
|
6
6
|
Author: Igor Kroitor
|
@@ -70,7 +70,7 @@ Current feature list:
|
|
70
70
|
|
71
71
|
|
72
72
|
## Sponsored Promotion
|
73
|
-
[](https://www.bitmart.com/activity/BitMartxCCXT/en-US)
|
74
74
|
|
75
75
|
## See Also
|
76
76
|
|
@@ -272,13 +272,13 @@ console.log(version, Object.keys(exchanges));
|
|
272
272
|
|
273
273
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
274
274
|
|
275
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.4.
|
276
|
-
* unpkg: https://unpkg.com/ccxt@4.4.
|
275
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.4.5/dist/ccxt.browser.min.js
|
276
|
+
* unpkg: https://unpkg.com/ccxt@4.4.5/dist/ccxt.browser.min.js
|
277
277
|
|
278
278
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
279
279
|
|
280
280
|
```HTML
|
281
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.4.
|
281
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.4.5/dist/ccxt.browser.min.js"></script>
|
282
282
|
```
|
283
283
|
|
284
284
|
Creates a global `ccxt` object:
|