ccxt 4.4.2__py2.py3-none-any.whl → 4.4.4__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/bitmart.py +1 -0
- 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 +50 -25
- ccxt/async_support/bingx.py +1 -0
- ccxt/async_support/bitfinex2.py +10 -9
- ccxt/async_support/bitget.py +13 -9
- ccxt/async_support/bitmart.py +3 -1
- ccxt/async_support/bitmex.py +14 -13
- ccxt/async_support/bitso.py +8 -7
- ccxt/async_support/bitstamp.py +36 -48
- ccxt/async_support/blofin.py +24 -26
- ccxt/async_support/bybit.py +26 -23
- 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 +12 -9
- 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/mexc.py +49 -2
- ccxt/async_support/ndax.py +9 -8
- ccxt/async_support/okcoin.py +21 -30
- ccxt/async_support/okx.py +21 -29
- ccxt/async_support/woo.py +10 -9
- ccxt/async_support/woofipro.py +11 -9
- ccxt/async_support/xt.py +12 -7
- ccxt/async_support/zonda.py +9 -8
- ccxt/base/exchange.py +3 -1
- ccxt/binance.py +50 -25
- ccxt/bingx.py +1 -0
- ccxt/bitfinex2.py +10 -9
- ccxt/bitget.py +13 -9
- ccxt/bitmart.py +3 -1
- ccxt/bitmex.py +14 -13
- ccxt/bitso.py +8 -7
- ccxt/bitstamp.py +36 -48
- ccxt/blofin.py +24 -26
- ccxt/bybit.py +26 -23
- ccxt/coinbase.py +31 -10
- ccxt/coinbaseexchange.py +14 -14
- ccxt/coinlist.py +9 -8
- ccxt/coinmetro.py +6 -6
- ccxt/cryptocom.py +12 -9
- 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/mexc.py +48 -2
- ccxt/ndax.py +9 -8
- ccxt/okcoin.py +21 -30
- ccxt/okx.py +21 -29
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bybit.py +51 -0
- ccxt/pro/cryptocom.py +181 -22
- ccxt/pro/mexc.py +154 -4
- ccxt/pro/okx.py +5 -3
- ccxt/pro/oxfun.py +70 -0
- ccxt/pro/phemex.py +41 -2
- ccxt/pro/woofipro.py +64 -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 +12 -7
- ccxt/zonda.py +9 -8
- {ccxt-4.4.2.dist-info → ccxt-4.4.4.dist-info}/METADATA +5 -5
- {ccxt-4.4.2.dist-info → ccxt-4.4.4.dist-info}/RECORD +87 -87
- {ccxt-4.4.2.dist-info → ccxt-4.4.4.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.2.dist-info → ccxt-4.4.4.dist-info}/WHEEL +0 -0
- {ccxt-4.4.2.dist-info → ccxt-4.4.4.dist-info}/top_level.txt +0 -0
ccxt/async_support/zonda.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.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
|
-
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
807
|
+
async 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 = {
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.4'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -140,6 +140,8 @@ class Exchange(object):
|
|
140
140
|
aiohttp_trust_env = False
|
141
141
|
requests_trust_env = False
|
142
142
|
session = None # Session () by default
|
143
|
+
tcp_connector = None # aiohttp.TCPConnector
|
144
|
+
aiohttp_socks_connector = None
|
143
145
|
socks_proxy_sessions = None
|
144
146
|
verify = True # SSL verification
|
145
147
|
validateServerSsl = True
|
ccxt/binance.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.binance import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -6032,8 +6032,8 @@ class binance(Exchange, ImplicitAPI):
|
|
6032
6032
|
marginMode, params = self.handle_margin_mode_and_params('fetchOrders', params)
|
6033
6033
|
isPortfolioMargin = None
|
6034
6034
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'fetchOrders', 'papi', 'portfolioMargin', False)
|
6035
|
-
isConditional = self.
|
6036
|
-
params = self.omit(params, ['stop', 'conditional', 'type'])
|
6035
|
+
isConditional = self.safe_bool_n(params, ['stop', 'trigger', 'conditional'])
|
6036
|
+
params = self.omit(params, ['stop', 'trigger', 'conditional', 'type'])
|
6037
6037
|
request: dict = {
|
6038
6038
|
'symbol': market['id'],
|
6039
6039
|
}
|
@@ -6282,7 +6282,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6282
6282
|
marginMode, params = self.handle_margin_mode_and_params('fetchOpenOrders', params)
|
6283
6283
|
isPortfolioMargin = None
|
6284
6284
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'fetchOpenOrders', 'papi', 'portfolioMargin', False)
|
6285
|
-
isConditional = self.safe_bool_n(params, ['stop', '
|
6285
|
+
isConditional = self.safe_bool_n(params, ['stop', 'trigger', 'conditional'])
|
6286
6286
|
if symbol is not None:
|
6287
6287
|
market = self.market(symbol)
|
6288
6288
|
request['symbol'] = market['id']
|
@@ -6296,7 +6296,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6296
6296
|
type = self.safe_string(params, 'type', defaultType)
|
6297
6297
|
subType = None
|
6298
6298
|
subType, params = self.handle_sub_type_and_params('fetchOpenOrders', market, params)
|
6299
|
-
params = self.omit(params, ['type', 'stop', '
|
6299
|
+
params = self.omit(params, ['type', 'stop', 'trigger', 'conditional'])
|
6300
6300
|
response = None
|
6301
6301
|
if type == 'option':
|
6302
6302
|
if since is not None:
|
@@ -6357,8 +6357,8 @@ class binance(Exchange, ImplicitAPI):
|
|
6357
6357
|
}
|
6358
6358
|
isPortfolioMargin = None
|
6359
6359
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'fetchOpenOrder', 'papi', 'portfolioMargin', False)
|
6360
|
-
isConditional = self.safe_bool_n(params, ['stop', '
|
6361
|
-
params = self.omit(params, ['stop', '
|
6360
|
+
isConditional = self.safe_bool_n(params, ['stop', 'trigger', 'conditional'])
|
6361
|
+
params = self.omit(params, ['stop', 'trigger', 'conditional'])
|
6362
6362
|
isPortfolioMarginConditional = (isPortfolioMargin and isConditional)
|
6363
6363
|
orderIdRequest = 'strategyId' if isPortfolioMarginConditional else 'orderId'
|
6364
6364
|
request[orderIdRequest] = id
|
@@ -6648,7 +6648,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6648
6648
|
marginMode, params = self.handle_margin_mode_and_params('cancelOrder', params)
|
6649
6649
|
isPortfolioMargin = None
|
6650
6650
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'cancelOrder', 'papi', 'portfolioMargin', False)
|
6651
|
-
isConditional = self.
|
6651
|
+
isConditional = self.safe_bool_n(params, ['stop', 'trigger', 'conditional'])
|
6652
6652
|
request: dict = {
|
6653
6653
|
'symbol': market['id'],
|
6654
6654
|
}
|
@@ -6666,7 +6666,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6666
6666
|
request['strategyId'] = id
|
6667
6667
|
else:
|
6668
6668
|
request['orderId'] = id
|
6669
|
-
params = self.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'conditional'])
|
6669
|
+
params = self.omit(params, ['type', 'origClientOrderId', 'clientOrderId', 'newClientStrategyId', 'stop', 'trigger', 'conditional'])
|
6670
6670
|
response = None
|
6671
6671
|
if market['option']:
|
6672
6672
|
response = self.eapiPrivateDeleteOrder(self.extend(request, params))
|
@@ -6725,9 +6725,9 @@ class binance(Exchange, ImplicitAPI):
|
|
6725
6725
|
}
|
6726
6726
|
isPortfolioMargin = None
|
6727
6727
|
isPortfolioMargin, params = self.handle_option_and_params_2(params, 'cancelAllOrders', 'papi', 'portfolioMargin', False)
|
6728
|
-
isConditional = self.
|
6728
|
+
isConditional = self.safe_bool_n(params, ['stop', 'trigger', 'conditional'])
|
6729
6729
|
type = self.safe_string(params, 'type', market['type'])
|
6730
|
-
params = self.omit(params, ['type', 'stop', 'conditional'])
|
6730
|
+
params = self.omit(params, ['type', 'stop', 'trigger', 'conditional'])
|
6731
6731
|
marginMode = None
|
6732
6732
|
marginMode, params = self.handle_margin_mode_and_params('cancelAllOrders', params)
|
6733
6733
|
response = None
|
@@ -10361,19 +10361,42 @@ class binance(Exchange, ImplicitAPI):
|
|
10361
10361
|
result.append(self.parse_settlement(settlements[i], market))
|
10362
10362
|
return result
|
10363
10363
|
|
10364
|
-
def fetch_ledger_entry(self, id: str, code: Str = None, params={}):
|
10364
|
+
def fetch_ledger_entry(self, id: str, code: Str = None, params={}) -> LedgerEntry:
|
10365
|
+
"""
|
10366
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
10367
|
+
:see: https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
10368
|
+
:param str id: the identification number of the ledger entry
|
10369
|
+
:param str code: unified currency code
|
10370
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10371
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
10372
|
+
"""
|
10365
10373
|
self.load_markets()
|
10366
10374
|
type = None
|
10367
10375
|
type, params = self.handle_market_type_and_params('fetchLedgerEntry', None, params)
|
10368
|
-
query: dict = {
|
10369
|
-
'recordId': id,
|
10370
|
-
'type': type,
|
10371
|
-
}
|
10372
10376
|
if type != 'option':
|
10373
10377
|
raise BadRequest(self.id + ' fetchLedgerEntry() can only be used for type option')
|
10374
|
-
|
10378
|
+
self.check_required_argument('fetchLedgerEntry', code, 'code')
|
10379
|
+
currency = self.currency(code)
|
10380
|
+
request: dict = {
|
10381
|
+
'recordId': id,
|
10382
|
+
'currency': currency['id'],
|
10383
|
+
}
|
10384
|
+
response = self.eapiPrivateGetBill(self.extend(request, params))
|
10385
|
+
#
|
10386
|
+
# [
|
10387
|
+
# {
|
10388
|
+
# "id": "1125899906845701870",
|
10389
|
+
# "asset": "USDT",
|
10390
|
+
# "amount": "-0.16518203",
|
10391
|
+
# "type": "FEE",
|
10392
|
+
# "createDate": 1676621042489
|
10393
|
+
# }
|
10394
|
+
# ]
|
10395
|
+
#
|
10396
|
+
first = self.safe_dict(response, 0, response)
|
10397
|
+
return self.parse_ledger_entry(first, currency)
|
10375
10398
|
|
10376
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
10399
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
10377
10400
|
"""
|
10378
10401
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
10379
10402
|
:see: https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
@@ -10381,9 +10404,9 @@ class binance(Exchange, ImplicitAPI):
|
|
10381
10404
|
:see: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
10382
10405
|
:see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
10383
10406
|
:see: https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
10384
|
-
:param str code: unified currency code
|
10407
|
+
:param str [code]: unified currency code
|
10385
10408
|
:param int [since]: timestamp in ms of the earliest ledger entry
|
10386
|
-
:param int [limit]: max number of ledger
|
10409
|
+
:param int [limit]: max number of ledger entries to return
|
10387
10410
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
10388
10411
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
10389
10412
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
@@ -10461,7 +10484,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10461
10484
|
#
|
10462
10485
|
return self.parse_ledger(response, currency, since, limit)
|
10463
10486
|
|
10464
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
10487
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
10465
10488
|
#
|
10466
10489
|
# options(eapi)
|
10467
10490
|
#
|
@@ -10494,16 +10517,19 @@ class binance(Exchange, ImplicitAPI):
|
|
10494
10517
|
else:
|
10495
10518
|
direction = 'in'
|
10496
10519
|
currencyId = self.safe_string(item, 'asset')
|
10520
|
+
code = self.safe_currency_code(currencyId, currency)
|
10521
|
+
currency = self.safe_currency(currencyId, currency)
|
10497
10522
|
timestamp = self.safe_integer_2(item, 'createDate', 'time')
|
10498
10523
|
type = self.safe_string_2(item, 'type', 'incomeType')
|
10499
|
-
return {
|
10524
|
+
return self.safe_ledger_entry({
|
10525
|
+
'info': item,
|
10500
10526
|
'id': self.safe_string_2(item, 'id', 'tranId'),
|
10501
10527
|
'direction': direction,
|
10502
10528
|
'account': None,
|
10503
10529
|
'referenceAccount': None,
|
10504
10530
|
'referenceId': self.safe_string(item, 'tradeId'),
|
10505
10531
|
'type': self.parse_ledger_entry_type(type),
|
10506
|
-
'currency':
|
10532
|
+
'currency': code,
|
10507
10533
|
'amount': self.parse_number(amount),
|
10508
10534
|
'timestamp': timestamp,
|
10509
10535
|
'datetime': self.iso8601(timestamp),
|
@@ -10511,8 +10537,7 @@ class binance(Exchange, ImplicitAPI):
|
|
10511
10537
|
'after': None,
|
10512
10538
|
'status': None,
|
10513
10539
|
'fee': None,
|
10514
|
-
|
10515
|
-
}
|
10540
|
+
}, currency)
|
10516
10541
|
|
10517
10542
|
def parse_ledger_entry_type(self, type):
|
10518
10543
|
ledgerType: dict = {
|
ccxt/bingx.py
CHANGED
ccxt/bitfinex2.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitfinex2 import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2729,7 +2729,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2729
2729
|
else:
|
2730
2730
|
return type
|
2731
2731
|
|
2732
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2732
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2733
2733
|
#
|
2734
2734
|
# [
|
2735
2735
|
# [
|
@@ -2750,6 +2750,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2750
2750
|
id = self.safe_string(itemList, 0)
|
2751
2751
|
currencyId = self.safe_string(itemList, 1)
|
2752
2752
|
code = self.safe_currency_code(currencyId, currency)
|
2753
|
+
currency = self.safe_currency(currencyId, currency)
|
2753
2754
|
timestamp = self.safe_integer(itemList, 3)
|
2754
2755
|
amount = self.safe_number(itemList, 5)
|
2755
2756
|
after = self.safe_number(itemList, 6)
|
@@ -2758,7 +2759,8 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2758
2759
|
parts = description.split(' @ ')
|
2759
2760
|
first = self.safe_string_lower(parts, 0)
|
2760
2761
|
type = self.parse_ledger_entry_type(first)
|
2761
|
-
return {
|
2762
|
+
return self.safe_ledger_entry({
|
2763
|
+
'info': item,
|
2762
2764
|
'id': id,
|
2763
2765
|
'direction': None,
|
2764
2766
|
'account': None,
|
@@ -2773,16 +2775,15 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
2773
2775
|
'after': after,
|
2774
2776
|
'status': None,
|
2775
2777
|
'fee': None,
|
2776
|
-
|
2777
|
-
}
|
2778
|
+
}, currency)
|
2778
2779
|
|
2779
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2780
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
2780
2781
|
"""
|
2781
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
2782
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2782
2783
|
:see: https://docs.bitfinex.com/reference/rest-auth-ledgers
|
2783
|
-
:param str code: unified currency code, default is None
|
2784
|
+
:param str [code]: unified currency code, default is None
|
2784
2785
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2785
|
-
:param int [limit]: max number of ledger
|
2786
|
+
:param int [limit]: max number of ledger entries to return, default is None, max is 2500
|
2786
2787
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2787
2788
|
:param int [params.until]: timestamp in ms of the latest ledger entry
|
2788
2789
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
ccxt/bitget.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bitget import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, FundingHistory, Int, IsolatedBorrowRate, Leverage, LeverageTier, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -5492,14 +5492,14 @@ class bitget(Exchange, ImplicitAPI):
|
|
5492
5492
|
orders = self.safe_list(response, 'data', [])
|
5493
5493
|
return self.parse_orders(orders, market, since, limit)
|
5494
5494
|
|
5495
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
5495
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
5496
5496
|
"""
|
5497
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
5497
5498
|
:see: https://www.bitget.com/api-doc/spot/account/Get-Account-Bills
|
5498
5499
|
:see: https://www.bitget.com/api-doc/contract/account/Get-Account-Bill
|
5499
|
-
|
5500
|
-
:param str code: unified currency code, default is None
|
5500
|
+
:param str [code]: unified currency code, default is None
|
5501
5501
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
5502
|
-
:param int [limit]: max number of ledger
|
5502
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
5503
5503
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5504
5504
|
:param int [params.until]: end time in ms
|
5505
5505
|
:param str [params.symbol]: *contract only* unified market symbol
|
@@ -5597,7 +5597,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5597
5597
|
return self.parse_ledger(bills, currency, since, limit)
|
5598
5598
|
return self.parse_ledger(data, currency, since, limit)
|
5599
5599
|
|
5600
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
5600
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
5601
5601
|
#
|
5602
5602
|
# spot
|
5603
5603
|
#
|
@@ -5627,6 +5627,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5627
5627
|
#
|
5628
5628
|
currencyId = self.safe_string(item, 'coin')
|
5629
5629
|
code = self.safe_currency_code(currencyId, currency)
|
5630
|
+
currency = self.safe_currency(currencyId, currency)
|
5630
5631
|
timestamp = self.safe_integer(item, 'cTime')
|
5631
5632
|
after = self.safe_number(item, 'balance')
|
5632
5633
|
fee = self.safe_number_2(item, 'fees', 'fee')
|
@@ -5635,7 +5636,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5635
5636
|
direction = 'in'
|
5636
5637
|
if amountRaw.find('-') >= 0:
|
5637
5638
|
direction = 'out'
|
5638
|
-
return {
|
5639
|
+
return self.safe_ledger_entry({
|
5639
5640
|
'info': item,
|
5640
5641
|
'id': self.safe_string(item, 'billId'),
|
5641
5642
|
'timestamp': timestamp,
|
@@ -5650,8 +5651,11 @@ class bitget(Exchange, ImplicitAPI):
|
|
5650
5651
|
'before': None,
|
5651
5652
|
'after': after,
|
5652
5653
|
'status': None,
|
5653
|
-
'fee':
|
5654
|
-
|
5654
|
+
'fee': {
|
5655
|
+
'currency': code,
|
5656
|
+
'cost': fee,
|
5657
|
+
},
|
5658
|
+
}, currency)
|
5655
5659
|
|
5656
5660
|
def parse_ledger_type(self, type):
|
5657
5661
|
types: dict = {
|
ccxt/bitmart.py
CHANGED
@@ -248,6 +248,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
248
248
|
'spot/v4/query/trades': 5, # 12 times/2 sec = 6/s => 30/6 = 5
|
249
249
|
'spot/v4/query/order-trades': 5, # 12 times/2 sec = 6/s => 30/6 = 5
|
250
250
|
'spot/v4/cancel_orders': 3,
|
251
|
+
'spot/v4/cancel_all': 90,
|
251
252
|
'spot/v4/batch_orders': 3,
|
252
253
|
# newer endpoint
|
253
254
|
'spot/v3/cancel_order': 1,
|
@@ -2789,6 +2790,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2789
2790
|
"""
|
2790
2791
|
cancel all open orders in a market
|
2791
2792
|
:see: https://developer-pro.bitmart.com/en/spot/#cancel-all-orders
|
2793
|
+
:see: https://developer-pro.bitmart.com/en/spot/#new-batch-order-v4-signed
|
2792
2794
|
:see: https://developer-pro.bitmart.com/en/futures/#cancel-all-orders-signed
|
2793
2795
|
:see: https://developer-pro.bitmart.com/en/futuresv2/#cancel-all-orders-signed
|
2794
2796
|
:param str symbol: unified market symbol of the market to cancel orders in
|
@@ -2806,7 +2808,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2806
2808
|
type = None
|
2807
2809
|
type, params = self.handle_market_type_and_params('cancelAllOrders', market, params)
|
2808
2810
|
if type == 'spot':
|
2809
|
-
response = self.
|
2811
|
+
response = self.privatePostSpotV4CancelAll(self.extend(request, params))
|
2810
2812
|
elif type == 'swap':
|
2811
2813
|
if symbol is None:
|
2812
2814
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
ccxt/bitmex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitmex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, Leverages, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Leverages, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -1050,7 +1050,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1050
1050
|
}
|
1051
1051
|
return self.safe_string(types, type, type)
|
1052
1052
|
|
1053
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
1053
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
1054
1054
|
#
|
1055
1055
|
# {
|
1056
1056
|
# "transactID": "69573da3-7744-5467-3207-89fd6efe7a47",
|
@@ -1099,6 +1099,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1099
1099
|
type = self.parse_ledger_entry_type(self.safe_string(item, 'transactType'))
|
1100
1100
|
currencyId = self.safe_string(item, 'currency')
|
1101
1101
|
code = self.safe_currency_code(currencyId, currency)
|
1102
|
+
currency = self.safe_currency(currencyId, currency)
|
1102
1103
|
amountString = self.safe_string(item, 'amount')
|
1103
1104
|
amount = self.convert_to_real_amount(code, amountString)
|
1104
1105
|
timestamp = self.parse8601(self.safe_string(item, 'transactTime'))
|
@@ -1111,13 +1112,13 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1111
1112
|
if feeCost is not None:
|
1112
1113
|
feeCost = self.convert_to_real_amount(code, feeCost)
|
1113
1114
|
fee = {
|
1114
|
-
'cost': self.
|
1115
|
+
'cost': self.parse_to_numeric(feeCost),
|
1115
1116
|
'currency': code,
|
1116
1117
|
}
|
1117
1118
|
after = self.safe_string(item, 'walletBalance')
|
1118
1119
|
if after is not None:
|
1119
1120
|
after = self.convert_to_real_amount(code, after)
|
1120
|
-
before = self.
|
1121
|
+
before = self.parse_to_numeric(Precise.string_sub(self.number_to_string(after), self.number_to_string(amount)))
|
1121
1122
|
direction = None
|
1122
1123
|
if Precise.string_lt(amountString, '0'):
|
1123
1124
|
direction = 'out'
|
@@ -1125,9 +1126,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1125
1126
|
else:
|
1126
1127
|
direction = 'in'
|
1127
1128
|
status = self.parse_transaction_status(self.safe_string(item, 'transactStatus'))
|
1128
|
-
return {
|
1129
|
-
'id': id,
|
1129
|
+
return self.safe_ledger_entry({
|
1130
1130
|
'info': item,
|
1131
|
+
'id': id,
|
1131
1132
|
'timestamp': timestamp,
|
1132
1133
|
'datetime': self.iso8601(timestamp),
|
1133
1134
|
'direction': direction,
|
@@ -1136,20 +1137,20 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1136
1137
|
'referenceAccount': referenceAccount,
|
1137
1138
|
'type': type,
|
1138
1139
|
'currency': code,
|
1139
|
-
'amount': amount,
|
1140
|
+
'amount': self.parse_to_numeric(amount),
|
1140
1141
|
'before': before,
|
1141
|
-
'after': self.
|
1142
|
+
'after': self.parse_to_numeric(after),
|
1142
1143
|
'status': status,
|
1143
1144
|
'fee': fee,
|
1144
|
-
}
|
1145
|
+
}, currency)
|
1145
1146
|
|
1146
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1147
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
1147
1148
|
"""
|
1148
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
1149
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
1149
1150
|
:see: https://www.bitmex.com/api/explorer/#not /User/User_getWalletHistory
|
1150
|
-
:param str code: unified currency code, default is None
|
1151
|
+
:param str [code]: unified currency code, default is None
|
1151
1152
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1152
|
-
:param int [limit]: max number of ledger
|
1153
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
1153
1154
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1154
1155
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
1155
1156
|
"""
|
ccxt/bitso.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.bitso import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -195,12 +195,12 @@ class bitso(Exchange, ImplicitAPI):
|
|
195
195
|
},
|
196
196
|
})
|
197
197
|
|
198
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
198
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
199
199
|
"""
|
200
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
201
|
-
:param str code: unified currency code, default is None
|
200
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
201
|
+
:param str [code]: unified currency code, default is None
|
202
202
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
203
|
-
:param int [limit]: max number of ledger
|
203
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
204
204
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
205
205
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
206
206
|
"""
|
@@ -244,7 +244,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
244
244
|
}
|
245
245
|
return self.safe_string(types, type, type)
|
246
246
|
|
247
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
247
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
248
248
|
#
|
249
249
|
# {
|
250
250
|
# "eid": "2510b3e2bc1c87f584500a18084f35ed",
|
@@ -308,6 +308,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
308
308
|
amount = self.safe_string(firstBalance, 'amount')
|
309
309
|
currencyId = self.safe_string(firstBalance, 'currency')
|
310
310
|
code = self.safe_currency_code(currencyId, currency)
|
311
|
+
currency = self.safe_currency(currencyId, currency)
|
311
312
|
details = self.safe_value(item, 'details', {})
|
312
313
|
referenceId = self.safe_string_2(details, 'fid', 'wid')
|
313
314
|
if referenceId is None:
|
@@ -327,6 +328,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
327
328
|
}
|
328
329
|
timestamp = self.parse8601(self.safe_string(item, 'created_at'))
|
329
330
|
return self.safe_ledger_entry({
|
331
|
+
'info': item,
|
330
332
|
'id': self.safe_string(item, 'eid'),
|
331
333
|
'direction': direction,
|
332
334
|
'account': None,
|
@@ -341,7 +343,6 @@ class bitso(Exchange, ImplicitAPI):
|
|
341
343
|
'after': None,
|
342
344
|
'status': 'ok',
|
343
345
|
'fee': fee,
|
344
|
-
'info': item,
|
345
346
|
}, currency)
|
346
347
|
|
347
348
|
def fetch_markets(self, params={}) -> List[Market]:
|