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/cryptocom.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.cryptocom import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -611,7 +611,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
611
611
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
612
612
|
"""
|
613
613
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
614
|
-
:see: https://exchange-docs.crypto.com/
|
614
|
+
:see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#public-get-tickers
|
615
615
|
:see: https://exchange-docs.crypto.com/derivatives/index.html#public-get-tickers
|
616
616
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
617
617
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1660,6 +1660,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1660
1660
|
def fetch_deposit_address(self, code: str, params={}):
|
1661
1661
|
"""
|
1662
1662
|
fetch the deposit address for a currency associated with self account
|
1663
|
+
:see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-deposit-address
|
1663
1664
|
:param str code: unified currency code
|
1664
1665
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1665
1666
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -2219,11 +2220,11 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2219
2220
|
currencyMap = self.safe_list(data, 'currency_map')
|
2220
2221
|
return self.parse_deposit_withdraw_fees(currencyMap, codes, 'full_name')
|
2221
2222
|
|
2222
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2223
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
2223
2224
|
"""
|
2224
2225
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2225
2226
|
:see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-transactions
|
2226
|
-
:param str code: unified currency code
|
2227
|
+
:param str [code]: unified currency code
|
2227
2228
|
:param int [since]: timestamp in ms of the earliest ledger entry
|
2228
2229
|
:param int [limit]: max number of ledger entries to return
|
2229
2230
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2277,7 +2278,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2277
2278
|
ledger = self.safe_value(result, 'data', [])
|
2278
2279
|
return self.parse_ledger(ledger, currency, since, limit)
|
2279
2280
|
|
2280
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2281
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2281
2282
|
#
|
2282
2283
|
# {
|
2283
2284
|
# "account_id": "ce075cef-1234-4321-bd6e-gf9007351e64",
|
@@ -2300,6 +2301,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2300
2301
|
#
|
2301
2302
|
timestamp = self.safe_integer(item, 'event_timestamp_ms')
|
2302
2303
|
currencyId = self.safe_string(item, 'instrument_name')
|
2304
|
+
code = self.safe_currency_code(currencyId, currency)
|
2305
|
+
currency = self.safe_currency(currencyId, currency)
|
2303
2306
|
amount = self.safe_string(item, 'transaction_qty')
|
2304
2307
|
direction = None
|
2305
2308
|
if Precise.string_lt(amount, '0'):
|
@@ -2307,14 +2310,15 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2307
2310
|
amount = Precise.string_abs(amount)
|
2308
2311
|
else:
|
2309
2312
|
direction = 'in'
|
2310
|
-
return {
|
2313
|
+
return self.safe_ledger_entry({
|
2314
|
+
'info': item,
|
2311
2315
|
'id': self.safe_string(item, 'order_id'),
|
2312
2316
|
'direction': direction,
|
2313
2317
|
'account': self.safe_string(item, 'account_id'),
|
2314
2318
|
'referenceId': self.safe_string(item, 'trade_id'),
|
2315
2319
|
'referenceAccount': self.safe_string(item, 'trade_match_id'),
|
2316
2320
|
'type': self.parse_ledger_entry_type(self.safe_string(item, 'journal_type')),
|
2317
|
-
'currency':
|
2321
|
+
'currency': code,
|
2318
2322
|
'amount': self.parse_number(amount),
|
2319
2323
|
'timestamp': timestamp,
|
2320
2324
|
'datetime': self.iso8601(timestamp),
|
@@ -2325,8 +2329,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2325
2329
|
'currency': None,
|
2326
2330
|
'cost': None,
|
2327
2331
|
},
|
2328
|
-
|
2329
|
-
}
|
2332
|
+
}, currency)
|
2330
2333
|
|
2331
2334
|
def parse_ledger_entry_type(self, type):
|
2332
2335
|
ledgerType: dict = {
|
ccxt/currencycom.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.currencycom import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Leverage, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, 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
|
@@ -1619,13 +1619,13 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1619
1619
|
}
|
1620
1620
|
return self.safe_string(types, type, type)
|
1621
1621
|
|
1622
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1622
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
1623
1623
|
"""
|
1624
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
1624
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
1625
1625
|
:see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getLedgerUsingGET
|
1626
|
-
:param str code: unified currency code, default is None
|
1626
|
+
:param str [code]: unified currency code, default is None
|
1627
1627
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1628
|
-
:param int [limit]: max number of ledger
|
1628
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
1629
1629
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1630
1630
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
1631
1631
|
"""
|
@@ -1668,19 +1668,20 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1668
1668
|
#
|
1669
1669
|
return self.parse_ledger(response, currency, since, limit)
|
1670
1670
|
|
1671
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
1671
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
1672
1672
|
id = self.safe_string(item, 'id')
|
1673
1673
|
amountString = self.safe_string(item, 'amount')
|
1674
1674
|
amount = Precise.string_abs(amountString)
|
1675
1675
|
timestamp = self.safe_integer(item, 'timestamp')
|
1676
1676
|
currencyId = self.safe_string(item, 'currency')
|
1677
1677
|
code = self.safe_currency_code(currencyId, currency)
|
1678
|
+
currency = self.safe_currency(currencyId, currency)
|
1678
1679
|
feeCost = self.safe_string(item, 'commission')
|
1679
1680
|
fee = None
|
1680
1681
|
if feeCost is not None:
|
1681
1682
|
fee = {'currency': code, 'cost': feeCost}
|
1682
1683
|
direction = 'out' if Precise.string_lt(amountString, '0') else 'in'
|
1683
|
-
|
1684
|
+
return self.safe_ledger_entry({
|
1684
1685
|
'id': id,
|
1685
1686
|
'timestamp': timestamp,
|
1686
1687
|
'datetime': self.iso8601(timestamp),
|
@@ -1696,8 +1697,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1696
1697
|
'status': self.parse_ledger_entry_status(self.safe_string(item, 'status')),
|
1697
1698
|
'fee': fee,
|
1698
1699
|
'info': item,
|
1699
|
-
}
|
1700
|
-
return result
|
1700
|
+
}, currency)
|
1701
1701
|
|
1702
1702
|
def parse_ledger_entry_status(self, status):
|
1703
1703
|
statuses: dict = {
|
ccxt/delta.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.delta import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Greeks, Int, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Greeks, Int, LedgerEntry, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -2104,13 +2104,13 @@ class delta(Exchange, ImplicitAPI):
|
|
2104
2104
|
result = self.safe_list(response, 'result', [])
|
2105
2105
|
return self.parse_trades(result, market, since, limit)
|
2106
2106
|
|
2107
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2107
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
2108
2108
|
"""
|
2109
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
2109
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2110
2110
|
:see: https://docs.delta.exchange/#get-wallet-transactions
|
2111
|
-
:param str code: unified currency code, default is None
|
2111
|
+
:param str [code]: unified currency code, default is None
|
2112
2112
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2113
|
-
:param int [limit]: max number of ledger
|
2113
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
2114
2114
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2115
2115
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
2116
2116
|
"""
|
@@ -2168,7 +2168,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2168
2168
|
}
|
2169
2169
|
return self.safe_string(types, type, type)
|
2170
2170
|
|
2171
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2171
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2172
2172
|
#
|
2173
2173
|
# {
|
2174
2174
|
# "amount":"29.889184",
|
@@ -2205,7 +2205,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2205
2205
|
after = self.safe_string(item, 'balance')
|
2206
2206
|
before = Precise.string_max('0', Precise.string_sub(after, amount))
|
2207
2207
|
status = 'ok'
|
2208
|
-
return {
|
2208
|
+
return self.safe_ledger_entry({
|
2209
2209
|
'info': item,
|
2210
2210
|
'id': id,
|
2211
2211
|
'direction': direction,
|
@@ -2221,7 +2221,7 @@ class delta(Exchange, ImplicitAPI):
|
|
2221
2221
|
'timestamp': timestamp,
|
2222
2222
|
'datetime': self.iso8601(timestamp),
|
2223
2223
|
'fee': None,
|
2224
|
-
}
|
2224
|
+
}, currency)
|
2225
2225
|
|
2226
2226
|
def fetch_deposit_address(self, code: str, params={}):
|
2227
2227
|
"""
|
ccxt/digifinex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.digifinex import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LedgerEntry, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -2383,7 +2383,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2383
2383
|
types: dict = {}
|
2384
2384
|
return self.safe_string(types, type, type)
|
2385
2385
|
|
2386
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2386
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2387
2387
|
#
|
2388
2388
|
# spot and margin
|
2389
2389
|
#
|
@@ -2405,13 +2405,15 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2405
2405
|
# }
|
2406
2406
|
#
|
2407
2407
|
type = self.parse_ledger_entry_type(self.safe_string_2(item, 'type', 'finance_type'))
|
2408
|
-
|
2408
|
+
currencyId = self.safe_string_2(item, 'currency_mark', 'currency')
|
2409
|
+
code = self.safe_currency_code(currencyId, currency)
|
2410
|
+
currency = self.safe_currency(currencyId, currency)
|
2409
2411
|
amount = self.safe_number_2(item, 'num', 'change')
|
2410
2412
|
after = self.safe_number(item, 'balance')
|
2411
2413
|
timestamp = self.safe_timestamp(item, 'time')
|
2412
2414
|
if timestamp is None:
|
2413
2415
|
timestamp = self.safe_integer(item, 'timestamp')
|
2414
|
-
return {
|
2416
|
+
return self.safe_ledger_entry({
|
2415
2417
|
'info': item,
|
2416
2418
|
'id': None,
|
2417
2419
|
'direction': None,
|
@@ -2427,16 +2429,16 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2427
2429
|
'timestamp': timestamp,
|
2428
2430
|
'datetime': self.iso8601(timestamp),
|
2429
2431
|
'fee': None,
|
2430
|
-
}
|
2432
|
+
}, currency)
|
2431
2433
|
|
2432
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2434
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
2433
2435
|
"""
|
2434
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
2436
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2435
2437
|
:see: https://docs.digifinex.com/en-ww/spot/v3/rest.html#spot-margin-otc-financial-logs
|
2436
2438
|
:see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#bills
|
2437
|
-
:param str code: unified currency code, default is None
|
2439
|
+
:param str [code]: unified currency code, default is None
|
2438
2440
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2439
|
-
:param int [limit]: max number of ledger
|
2441
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
2440
2442
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2441
2443
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
2442
2444
|
"""
|
ccxt/gate.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.gate import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, 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
|
@@ -6138,7 +6138,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6138
6138
|
result.append(self.parse_settlement(settlements[i], market))
|
6139
6139
|
return result
|
6140
6140
|
|
6141
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
6141
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
6142
6142
|
"""
|
6143
6143
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
6144
6144
|
:see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book
|
@@ -6146,12 +6146,12 @@ class gate(Exchange, ImplicitAPI):
|
|
6146
6146
|
:see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
6147
6147
|
:see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
6148
6148
|
:see: https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
|
6149
|
-
:param str code: unified currency code
|
6149
|
+
:param str [code]: unified currency code
|
6150
6150
|
:param int [since]: timestamp in ms of the earliest ledger entry
|
6151
6151
|
:param int [limit]: max number of ledger entries to return
|
6152
6152
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6153
6153
|
:param int [params.until]: end time in ms
|
6154
|
-
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [
|
6154
|
+
: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)
|
6155
6155
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
6156
6156
|
"""
|
6157
6157
|
self.load_markets()
|
@@ -6242,7 +6242,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6242
6242
|
#
|
6243
6243
|
return self.parse_ledger(response, currency, since, limit)
|
6244
6244
|
|
6245
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
6245
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
6246
6246
|
#
|
6247
6247
|
# spot
|
6248
6248
|
#
|
@@ -6295,6 +6295,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6295
6295
|
else:
|
6296
6296
|
direction = 'in'
|
6297
6297
|
currencyId = self.safe_string(item, 'currency')
|
6298
|
+
currency = self.safe_currency(currencyId, currency)
|
6298
6299
|
type = self.safe_string(item, 'type')
|
6299
6300
|
rawTimestamp = self.safe_string(item, 'time')
|
6300
6301
|
timestamp = None
|
@@ -6305,7 +6306,8 @@ class gate(Exchange, ImplicitAPI):
|
|
6305
6306
|
balanceString = self.safe_string(item, 'balance')
|
6306
6307
|
changeString = self.safe_string(item, 'change')
|
6307
6308
|
before = self.parse_number(Precise.string_sub(balanceString, changeString))
|
6308
|
-
return {
|
6309
|
+
return self.safe_ledger_entry({
|
6310
|
+
'info': item,
|
6309
6311
|
'id': self.safe_string(item, 'id'),
|
6310
6312
|
'direction': direction,
|
6311
6313
|
'account': None,
|
@@ -6320,8 +6322,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6320
6322
|
'after': self.safe_number(item, 'balance'),
|
6321
6323
|
'status': None,
|
6322
6324
|
'fee': None,
|
6323
|
-
|
6324
|
-
}
|
6325
|
+
}, currency)
|
6325
6326
|
|
6326
6327
|
def parse_ledger_entry_type(self, type):
|
6327
6328
|
ledgerType: dict = {
|
ccxt/hashkey.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hashkey import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, Int, LastPrice, LastPrices, Leverage, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, Int, LastPrice, LastPrices, LedgerEntry, Leverage, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, 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
|
@@ -2147,13 +2147,13 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2147
2147
|
}
|
2148
2148
|
return self.safe_integer(types, type, type)
|
2149
2149
|
|
2150
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2150
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
2151
2151
|
"""
|
2152
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
2152
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
2153
2153
|
:see: https://hashkeyglobal-apidoc.readme.io/reference/get-account-transaction-list
|
2154
|
-
:param str code: unified currency code, default is None(not used)
|
2154
|
+
:param str [code]: unified currency code, default is None(not used)
|
2155
2155
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2156
|
-
:param int [limit]: max number of ledger
|
2156
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
2157
2157
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2158
2158
|
:param int [params.until]: the latest time in ms to fetch entries for
|
2159
2159
|
:param int [params.flowType]: trade, fee, transfer, deposit, withdrawal
|
@@ -2213,7 +2213,7 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2213
2213
|
}
|
2214
2214
|
return self.safe_string(types, type, type)
|
2215
2215
|
|
2216
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2216
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
2217
2217
|
#
|
2218
2218
|
# {
|
2219
2219
|
# "id": "1740844413612065537",
|
@@ -2233,7 +2233,9 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2233
2233
|
account = self.safe_string(item, 'accountId')
|
2234
2234
|
timestamp = self.safe_integer(item, 'created')
|
2235
2235
|
type = self.parse_ledger_entry_type(self.safe_string(item, 'flowTypeValue'))
|
2236
|
-
|
2236
|
+
currencyId = self.safe_string(item, 'coin')
|
2237
|
+
code = self.safe_currency_code(currencyId, currency)
|
2238
|
+
currency = self.safe_currency(currencyId, currency)
|
2237
2239
|
amountString = self.safe_string(item, 'change')
|
2238
2240
|
amount = self.parse_number(amountString)
|
2239
2241
|
direction = 'in'
|
@@ -2242,9 +2244,9 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2242
2244
|
afterString = self.safe_string(item, 'total')
|
2243
2245
|
after = self.parse_number(afterString)
|
2244
2246
|
status = 'ok'
|
2245
|
-
return {
|
2246
|
-
'id': id,
|
2247
|
+
return self.safe_ledger_entry({
|
2247
2248
|
'info': item,
|
2249
|
+
'id': id,
|
2248
2250
|
'timestamp': timestamp,
|
2249
2251
|
'datetime': self.iso8601(timestamp),
|
2250
2252
|
'account': account,
|
@@ -2259,7 +2261,7 @@ class hashkey(Exchange, ImplicitAPI):
|
|
2259
2261
|
'after': after,
|
2260
2262
|
'status': status,
|
2261
2263
|
'fee': None,
|
2262
|
-
}
|
2264
|
+
}, currency)
|
2263
2265
|
|
2264
2266
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
|
2265
2267
|
"""
|
ccxt/htx.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.htx import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -7392,7 +7392,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7392
7392
|
}
|
7393
7393
|
return self.safe_string(types, type, type)
|
7394
7394
|
|
7395
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
7395
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
7396
7396
|
#
|
7397
7397
|
# {
|
7398
7398
|
# "accountId": 10000001,
|
@@ -7406,44 +7406,41 @@ class htx(Exchange, ImplicitAPI):
|
|
7406
7406
|
# "transferee": 13496526
|
7407
7407
|
# }
|
7408
7408
|
#
|
7409
|
-
id = self.safe_string(item, 'transactId')
|
7410
7409
|
currencyId = self.safe_string(item, 'currency')
|
7411
7410
|
code = self.safe_currency_code(currencyId, currency)
|
7412
|
-
|
7411
|
+
currency = self.safe_currency(currencyId, currency)
|
7412
|
+
id = self.safe_string(item, 'transactId')
|
7413
7413
|
transferType = self.safe_string(item, 'transferType')
|
7414
|
-
type = self.parse_ledger_entry_type(transferType)
|
7415
|
-
direction = self.safe_string(item, 'direction')
|
7416
7414
|
timestamp = self.safe_integer(item, 'transactTime')
|
7417
|
-
datetime = self.iso8601(timestamp)
|
7418
7415
|
account = self.safe_string(item, 'accountId')
|
7419
|
-
return {
|
7416
|
+
return self.safe_ledger_entry({
|
7417
|
+
'info': item,
|
7420
7418
|
'id': id,
|
7421
|
-
'direction': direction,
|
7419
|
+
'direction': self.safe_string(item, 'direction'),
|
7422
7420
|
'account': account,
|
7423
7421
|
'referenceId': id,
|
7424
7422
|
'referenceAccount': account,
|
7425
|
-
'type':
|
7423
|
+
'type': self.parse_ledger_entry_type(transferType),
|
7426
7424
|
'currency': code,
|
7427
|
-
'amount':
|
7425
|
+
'amount': self.safe_number(item, 'transactAmt'),
|
7428
7426
|
'timestamp': timestamp,
|
7429
|
-
'datetime':
|
7427
|
+
'datetime': self.iso8601(timestamp),
|
7430
7428
|
'before': None,
|
7431
7429
|
'after': None,
|
7432
7430
|
'status': None,
|
7433
7431
|
'fee': None,
|
7434
|
-
|
7435
|
-
}
|
7432
|
+
}, currency)
|
7436
7433
|
|
7437
|
-
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
7434
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
7438
7435
|
"""
|
7436
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
7439
7437
|
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
|
7440
|
-
|
7441
|
-
:param str code: unified currency code, default is None
|
7438
|
+
:param str [code]: unified currency code, default is None
|
7442
7439
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
7443
|
-
:param int [limit]: max number of ledger
|
7440
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
7444
7441
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7445
7442
|
:param int [params.until]: the latest time in ms to fetch entries for
|
7446
|
-
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [
|
7443
|
+
: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)
|
7447
7444
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
7448
7445
|
"""
|
7449
7446
|
self.load_markets()
|