ccxt 4.3.17__py2.py3-none-any.whl → 4.3.19__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 +3 -1
- ccxt/abstract/bybit.py +1 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/woofipro.py +119 -0
- ccxt/ace.py +1 -1
- ccxt/ascendex.py +7 -8
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/ascendex.py +7 -8
- ccxt/async_support/base/exchange.py +23 -2
- ccxt/async_support/bigone.py +4 -4
- ccxt/async_support/binance.py +34 -17
- ccxt/async_support/bingx.py +4 -4
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +28 -4
- ccxt/async_support/bitfinex2.py +62 -54
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +8 -11
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +8 -8
- ccxt/async_support/bitmex.py +2 -2
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +3 -3
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +3 -5
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +3 -3
- ccxt/async_support/btcalpha.py +1 -1
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +9 -8
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +2 -2
- ccxt/async_support/coinbasepro.py +1 -1
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +320 -520
- ccxt/async_support/coinlist.py +6 -7
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +2 -2
- ccxt/async_support/delta.py +4 -4
- ccxt/async_support/deribit.py +8 -8
- ccxt/async_support/digifinex.py +5 -5
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/gate.py +5 -5
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hitbtc.py +3 -3
- ccxt/async_support/hollaex.py +4 -4
- ccxt/async_support/htx.py +4 -4
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/idex.py +1 -1
- ccxt/async_support/independentreserve.py +1 -1
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/krakenfutures.py +3 -3
- ccxt/async_support/kucoin.py +3 -3
- ccxt/async_support/kucoinfutures.py +3 -3
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/latoken.py +6 -6
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +7 -7
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +3 -4
- ccxt/async_support/okcoin.py +3 -3
- ccxt/async_support/okx.py +27 -10
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/paymium.py +3 -3
- ccxt/async_support/phemex.py +5 -5
- ccxt/async_support/poloniex.py +3 -4
- ccxt/async_support/poloniexfutures.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/wavesexchange.py +3 -3
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +25 -10
- ccxt/async_support/woofipro.py +2524 -0
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +3 -3
- ccxt/base/exchange.py +63 -17
- ccxt/base/types.py +20 -0
- ccxt/bigone.py +4 -4
- ccxt/binance.py +34 -17
- ccxt/bingx.py +4 -4
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +28 -4
- ccxt/bitfinex2.py +62 -54
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +8 -11
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +8 -8
- ccxt/bitmex.py +2 -2
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +3 -3
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +3 -5
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +1 -1
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +3 -3
- ccxt/btcalpha.py +1 -1
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +9 -8
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +2 -2
- ccxt/coinbasepro.py +1 -1
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +320 -520
- ccxt/coinlist.py +6 -7
- ccxt/coinmate.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +2 -2
- ccxt/delta.py +4 -4
- ccxt/deribit.py +8 -8
- ccxt/digifinex.py +5 -5
- ccxt/exmo.py +1 -1
- ccxt/gate.py +5 -5
- ccxt/gemini.py +1 -1
- ccxt/hitbtc.py +3 -3
- ccxt/hollaex.py +4 -4
- ccxt/htx.py +4 -4
- ccxt/huobijp.py +1 -1
- ccxt/idex.py +1 -1
- ccxt/independentreserve.py +1 -1
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +2 -2
- ccxt/krakenfutures.py +3 -3
- ccxt/kucoin.py +3 -3
- ccxt/kucoinfutures.py +3 -3
- ccxt/kuna.py +1 -1
- ccxt/latoken.py +6 -6
- ccxt/lbank.py +1 -1
- ccxt/luno.py +1 -1
- ccxt/lykke.py +1 -1
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +7 -7
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +3 -4
- ccxt/okcoin.py +3 -3
- ccxt/okx.py +27 -10
- ccxt/onetrading.py +1 -1
- ccxt/paymium.py +3 -3
- ccxt/phemex.py +5 -5
- ccxt/poloniex.py +3 -4
- ccxt/poloniexfutures.py +1 -1
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bitget.py +127 -190
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +4 -3
- ccxt/pro/coinbaseinternational.py +11 -4
- ccxt/pro/okx.py +79 -1
- ccxt/pro/woofipro.py +1183 -0
- ccxt/probit.py +1 -1
- ccxt/test/test_async.py +31 -1
- ccxt/test/test_sync.py +31 -1
- ccxt/timex.py +1 -1
- ccxt/tokocrypto.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/wavesexchange.py +3 -3
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +25 -10
- ccxt/woofipro.py +2524 -0
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +3 -3
- {ccxt-4.3.17.dist-info → ccxt-4.3.19.dist-info}/METADATA +8 -6
- {ccxt-4.3.17.dist-info → ccxt-4.3.19.dist-info}/RECORD +195 -191
- {ccxt-4.3.17.dist-info → ccxt-4.3.19.dist-info}/WHEEL +0 -0
- {ccxt-4.3.17.dist-info → ccxt-4.3.19.dist-info}/top_level.txt +0 -0
ccxt/async_support/latoken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.latoken import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry, TransferEntries
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -585,7 +585,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
585
585
|
#
|
586
586
|
return self.parse_order_book(response, symbol, None, 'bid', 'ask', 'price', 'quantity')
|
587
587
|
|
588
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
588
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
589
589
|
#
|
590
590
|
# {
|
591
591
|
# "symbol": "92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5",
|
@@ -608,7 +608,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
608
608
|
#
|
609
609
|
marketId = self.safe_string(ticker, 'symbol')
|
610
610
|
last = self.safe_string(ticker, 'lastPrice')
|
611
|
-
timestamp = self.
|
611
|
+
timestamp = self.safe_integer_omit_zero(ticker, 'updateTimestamp') # sometimes latoken provided '0' ts from /ticker endpoint
|
612
612
|
return self.safe_ticker({
|
613
613
|
'symbol': self.safe_symbol(marketId, market),
|
614
614
|
'timestamp': timestamp,
|
@@ -1472,7 +1472,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
1472
1472
|
}
|
1473
1473
|
return self.safe_string(types, type, type)
|
1474
1474
|
|
1475
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1475
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> TransferEntries:
|
1476
1476
|
"""
|
1477
1477
|
fetch a history of internal transfers made on an account
|
1478
1478
|
:see: https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
|
@@ -1570,7 +1570,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
1570
1570
|
#
|
1571
1571
|
return self.parse_transfer(response)
|
1572
1572
|
|
1573
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
1573
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
1574
1574
|
#
|
1575
1575
|
# {
|
1576
1576
|
# "id": "e6fc4ace-7750-44e4-b7e9-6af038ac7107",
|
@@ -1608,7 +1608,7 @@ class latoken(Exchange, ImplicitAPI):
|
|
1608
1608
|
'status': self.parse_transfer_status(status),
|
1609
1609
|
}
|
1610
1610
|
|
1611
|
-
def parse_transfer_status(self, status):
|
1611
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
1612
1612
|
statuses = {
|
1613
1613
|
'TRANSFER_STATUS_COMPLETED': 'ok',
|
1614
1614
|
'TRANSFER_STATUS_PENDING': 'pending',
|
ccxt/async_support/lbank.py
CHANGED
@@ -535,7 +535,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
535
535
|
})
|
536
536
|
return result
|
537
537
|
|
538
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
538
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
539
539
|
#
|
540
540
|
# spot: fetchTicker, fetchTickers
|
541
541
|
#
|
ccxt/async_support/luno.py
CHANGED
@@ -509,7 +509,7 @@ class luno(Exchange, ImplicitAPI):
|
|
509
509
|
"""
|
510
510
|
return await self.fetch_orders_by_state('COMPLETE', symbol, since, limit, params)
|
511
511
|
|
512
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
512
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
513
513
|
# {
|
514
514
|
# "pair":"XBTAUD",
|
515
515
|
# "timestamp":1642201439301,
|
ccxt/async_support/lykke.py
CHANGED
ccxt/async_support/mercado.py
CHANGED
@@ -268,7 +268,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
268
268
|
response = await self.publicGetCoinOrderbook(self.extend(request, params))
|
269
269
|
return self.parse_order_book(response, market['symbol'])
|
270
270
|
|
271
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
271
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
272
272
|
#
|
273
273
|
# {
|
274
274
|
# "high":"103.96000000",
|
ccxt/async_support/mexc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.mexc import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Currencies, Currency, IndexType, Int, Leverage, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, IndexType, Int, Leverage, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry, TransferEntries
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -1947,7 +1947,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
1947
1947
|
# when it's single symbol request, the returned structure is different(singular object) for both spot & swap, thus we need to wrap inside array
|
1948
1948
|
return self.parse_ticker(ticker, market)
|
1949
1949
|
|
1950
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1950
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1951
1951
|
marketId = self.safe_string(ticker, 'symbol')
|
1952
1952
|
market = self.safe_market(marketId, market)
|
1953
1953
|
timestamp = None
|
@@ -4661,7 +4661,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4661
4661
|
'lastUpdateTimestamp': None,
|
4662
4662
|
})
|
4663
4663
|
|
4664
|
-
async def fetch_transfer(self, id: str,
|
4664
|
+
async def fetch_transfer(self, id: str, code: Str = None, params={}) -> TransferEntry:
|
4665
4665
|
marketType, query = self.handle_market_type_and_params('fetchTransfer', None, params)
|
4666
4666
|
await self.load_markets()
|
4667
4667
|
if marketType == 'spot':
|
@@ -4688,7 +4688,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4688
4688
|
raise BadRequest(self.id + ' fetchTransfer() is not supported for ' + marketType)
|
4689
4689
|
return None
|
4690
4690
|
|
4691
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
4691
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> TransferEntries:
|
4692
4692
|
"""
|
4693
4693
|
fetch a history of internal transfers made on an account
|
4694
4694
|
:param str code: unified currency code of the currency transferred
|
@@ -4819,7 +4819,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4819
4819
|
'toAccount': toAccount,
|
4820
4820
|
})
|
4821
4821
|
|
4822
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
4822
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
4823
4823
|
#
|
4824
4824
|
# spot: fetchTransfer
|
4825
4825
|
#
|
@@ -4883,7 +4883,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4883
4883
|
}
|
4884
4884
|
return self.safe_string(statuses, status, status)
|
4885
4885
|
|
4886
|
-
def parse_transfer_status(self, status):
|
4886
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
4887
4887
|
statuses = {
|
4888
4888
|
'SUCCESS': 'ok',
|
4889
4889
|
'FAILED': 'failed',
|
@@ -5181,7 +5181,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
5181
5181
|
data = self.safe_list(response, 'data', [])
|
5182
5182
|
return self.parse_leverage(data, market)
|
5183
5183
|
|
5184
|
-
def parse_leverage(self, leverage, market=None) -> Leverage:
|
5184
|
+
def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
|
5185
5185
|
marginMode = None
|
5186
5186
|
longLeverage = None
|
5187
5187
|
shortLeverage = None
|
ccxt/async_support/ndax.py
CHANGED
@@ -596,7 +596,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
596
596
|
#
|
597
597
|
return self.parse_order_book(response, symbol)
|
598
598
|
|
599
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
599
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
600
600
|
#
|
601
601
|
# fetchTicker
|
602
602
|
#
|
ccxt/async_support/novadax.py
CHANGED
@@ -330,7 +330,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
330
330
|
'info': market,
|
331
331
|
}
|
332
332
|
|
333
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
333
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
334
334
|
#
|
335
335
|
# fetchTicker, fetchTickers
|
336
336
|
#
|
@@ -1128,7 +1128,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
1128
1128
|
transfer['amount'] = amount
|
1129
1129
|
return transfer
|
1130
1130
|
|
1131
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
1131
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
1132
1132
|
#
|
1133
1133
|
# {
|
1134
1134
|
# "code":"A10000",
|
@@ -1143,7 +1143,6 @@ class novadax(Exchange, ImplicitAPI):
|
|
1143
1143
|
'info': transfer,
|
1144
1144
|
'id': id,
|
1145
1145
|
'amount': None,
|
1146
|
-
'code': currencyCode, # kept here for backward-compatibility, but will be removed soon
|
1147
1146
|
'currency': currencyCode,
|
1148
1147
|
'fromAccount': None,
|
1149
1148
|
'toAccount': None,
|
@@ -1152,7 +1151,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
1152
1151
|
'status': status,
|
1153
1152
|
}
|
1154
1153
|
|
1155
|
-
def parse_transfer_status(self, status):
|
1154
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
1156
1155
|
statuses = {
|
1157
1156
|
'SUCCESS': 'pending',
|
1158
1157
|
}
|
ccxt/async_support/okcoin.py
CHANGED
@@ -859,7 +859,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
859
859
|
timestamp = self.safe_integer(first, 'ts')
|
860
860
|
return self.parse_order_book(first, symbol, timestamp)
|
861
861
|
|
862
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
862
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
863
863
|
#
|
864
864
|
# {
|
865
865
|
# "instType": "SPOT",
|
@@ -2227,7 +2227,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2227
2227
|
rawTransfer = self.safe_dict(data, 0, {})
|
2228
2228
|
return self.parse_transfer(rawTransfer, currency)
|
2229
2229
|
|
2230
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
2230
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
2231
2231
|
#
|
2232
2232
|
# transfer
|
2233
2233
|
#
|
@@ -2303,7 +2303,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2303
2303
|
'status': self.parse_transfer_status(self.safe_string(transfer, 'state')),
|
2304
2304
|
}
|
2305
2305
|
|
2306
|
-
def parse_transfer_status(self, status):
|
2306
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
2307
2307
|
statuses = {
|
2308
2308
|
'success': 'ok',
|
2309
2309
|
}
|
ccxt/async_support/okx.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.okx import ImplicitAPI
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
|
-
from ccxt.base.types import Account, Balances, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Greeks, Int, Leverage, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Account, Balances, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Greeks, Int, Leverage, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry, TransferEntries
|
11
11
|
from typing import List
|
12
12
|
from typing import Any
|
13
13
|
from ccxt.base.errors import ExchangeError
|
@@ -505,6 +505,7 @@ class okx(Exchange, ImplicitAPI):
|
|
505
505
|
'tradingBot/grid/compute-margin-balance': 1,
|
506
506
|
'tradingBot/grid/margin-balance': 1,
|
507
507
|
'tradingBot/grid/min-investment': 1,
|
508
|
+
'tradingBot/grid/adjust-investment': 1,
|
508
509
|
'tradingBot/signal/create-signal': 1,
|
509
510
|
'tradingBot/signal/order-algo': 1,
|
510
511
|
'tradingBot/signal/stop-order-algo': 1,
|
@@ -1759,7 +1760,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1759
1760
|
timestamp = self.safe_integer(first, 'ts')
|
1760
1761
|
return self.parse_order_book(first, symbol, timestamp)
|
1761
1762
|
|
1762
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1763
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1763
1764
|
#
|
1764
1765
|
# {
|
1765
1766
|
# "instType": "SPOT",
|
@@ -4979,7 +4980,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4979
4980
|
data = self.safe_list(response, 'data', [])
|
4980
4981
|
return self.parse_leverage(data, market)
|
4981
4982
|
|
4982
|
-
def parse_leverage(self, leverage, market=None) -> Leverage:
|
4983
|
+
def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
|
4983
4984
|
marketId = None
|
4984
4985
|
marginMode = None
|
4985
4986
|
longLeverage = None
|
@@ -5386,7 +5387,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5386
5387
|
rawTransfer = self.safe_dict(data, 0, {})
|
5387
5388
|
return self.parse_transfer(rawTransfer, currency)
|
5388
5389
|
|
5389
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
5390
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
5390
5391
|
#
|
5391
5392
|
# transfer
|
5392
5393
|
#
|
@@ -5462,13 +5463,13 @@ class okx(Exchange, ImplicitAPI):
|
|
5462
5463
|
'status': self.parse_transfer_status(self.safe_string(transfer, 'state')),
|
5463
5464
|
}
|
5464
5465
|
|
5465
|
-
def parse_transfer_status(self, status):
|
5466
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
5466
5467
|
statuses = {
|
5467
5468
|
'success': 'ok',
|
5468
5469
|
}
|
5469
5470
|
return self.safe_string(statuses, status, status)
|
5470
5471
|
|
5471
|
-
async def fetch_transfer(self, id: str, code: Str = None, params={}):
|
5472
|
+
async def fetch_transfer(self, id: str, code: Str = None, params={}) -> TransferEntry:
|
5472
5473
|
await self.load_markets()
|
5473
5474
|
request = {
|
5474
5475
|
'transId': id,
|
@@ -5499,7 +5500,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5499
5500
|
transfer = self.safe_dict(data, 0)
|
5500
5501
|
return self.parse_transfer(transfer)
|
5501
5502
|
|
5502
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
5503
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> TransferEntries:
|
5503
5504
|
"""
|
5504
5505
|
fetch a history of internal transfers made on an account
|
5505
5506
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
@@ -5618,6 +5619,22 @@ class okx(Exchange, ImplicitAPI):
|
|
5618
5619
|
# "nextFundingRate": "0.00017",
|
5619
5620
|
# "nextFundingTime": "1634284800000"
|
5620
5621
|
# }
|
5622
|
+
# ws
|
5623
|
+
# {
|
5624
|
+
# "fundingRate":"0.0001875391284828",
|
5625
|
+
# "fundingTime":"1700726400000",
|
5626
|
+
# "instId":"BTC-USD-SWAP",
|
5627
|
+
# "instType":"SWAP",
|
5628
|
+
# "method": "next_period",
|
5629
|
+
# "maxFundingRate":"0.00375",
|
5630
|
+
# "minFundingRate":"-0.00375",
|
5631
|
+
# "nextFundingRate":"0.0002608059239328",
|
5632
|
+
# "nextFundingTime":"1700755200000",
|
5633
|
+
# "premium": "0.0001233824646391",
|
5634
|
+
# "settFundingRate":"0.0001699799259033",
|
5635
|
+
# "settState":"settled",
|
5636
|
+
# "ts":"1700724675402"
|
5637
|
+
# }
|
5621
5638
|
#
|
5622
5639
|
# in the response above nextFundingRate is actually two funding rates from now
|
5623
5640
|
#
|
@@ -7032,7 +7049,7 @@ class okx(Exchange, ImplicitAPI):
|
|
7032
7049
|
return self.parse_greeks(entry, market)
|
7033
7050
|
return None
|
7034
7051
|
|
7035
|
-
def parse_greeks(self, greeks, market: Market = None):
|
7052
|
+
def parse_greeks(self, greeks: dict, market: Market = None) -> Greeks:
|
7036
7053
|
#
|
7037
7054
|
# {
|
7038
7055
|
# "askVol": "0",
|
@@ -7230,7 +7247,7 @@ class okx(Exchange, ImplicitAPI):
|
|
7230
7247
|
result = self.safe_list(response, 'data', [])
|
7231
7248
|
return self.parse_option_chain(result, None, 'instId')
|
7232
7249
|
|
7233
|
-
def parse_option(self, chain, currency: Currency = None, market: Market = None):
|
7250
|
+
def parse_option(self, chain: dict, currency: Currency = None, market: Market = None) -> Option:
|
7234
7251
|
#
|
7235
7252
|
# {
|
7236
7253
|
# "instType": "OPTION",
|
@@ -7465,7 +7482,7 @@ class okx(Exchange, ImplicitAPI):
|
|
7465
7482
|
rows = self.safe_list(response, 'data', [])
|
7466
7483
|
return self.parse_conversions(rows, code, 'baseCcy', 'quoteCcy', since, limit)
|
7467
7484
|
|
7468
|
-
def parse_conversion(self, conversion, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
7485
|
+
def parse_conversion(self, conversion: dict, fromCurrency: Currency = None, toCurrency: Currency = None) -> Conversion:
|
7469
7486
|
#
|
7470
7487
|
# fetchConvertQuote
|
7471
7488
|
#
|
ccxt/async_support/onetrading.py
CHANGED
@@ -561,7 +561,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
561
561
|
'taker': takerFees,
|
562
562
|
}
|
563
563
|
|
564
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
564
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
565
565
|
#
|
566
566
|
# fetchTicker, fetchTickers
|
567
567
|
#
|
ccxt/async_support/paymium.py
CHANGED
@@ -158,7 +158,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
158
158
|
response = await self.publicGetDataCurrencyDepth(self.extend(request, params))
|
159
159
|
return self.parse_order_book(response, market['symbol'], None, 'bids', 'asks', 'price', 'amount')
|
160
160
|
|
161
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
161
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
162
162
|
#
|
163
163
|
# {
|
164
164
|
# "high":"33740.82",
|
@@ -467,7 +467,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
467
467
|
#
|
468
468
|
return self.parse_transfer(response, currency)
|
469
469
|
|
470
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
470
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
471
471
|
#
|
472
472
|
# {
|
473
473
|
# "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
|
@@ -518,7 +518,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
518
518
|
'status': self.parse_transfer_status(status),
|
519
519
|
}
|
520
520
|
|
521
|
-
def parse_transfer_status(self, status):
|
521
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
522
522
|
statuses = {
|
523
523
|
'executed': 'ok',
|
524
524
|
# what are the other statuses?
|
ccxt/async_support/phemex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.phemex import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import numbers
|
10
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
10
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, TransferEntries
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -1270,7 +1270,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1270
1270
|
rows = self.safe_list(data, 'rows', [])
|
1271
1271
|
return self.parse_ohlcvs(rows, market, timeframe, since, userLimit)
|
1272
1272
|
|
1273
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1273
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1274
1274
|
#
|
1275
1275
|
# spot
|
1276
1276
|
#
|
@@ -4139,7 +4139,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4139
4139
|
transfer['currency'] = code
|
4140
4140
|
return transfer
|
4141
4141
|
|
4142
|
-
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
4142
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> TransferEntries:
|
4143
4143
|
"""
|
4144
4144
|
fetch a history of internal transfers made on an account
|
4145
4145
|
:param str code: unified currency code of the currency transferred
|
@@ -4184,7 +4184,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4184
4184
|
transfers = self.safe_list(data, 'rows', [])
|
4185
4185
|
return self.parse_transfers(transfers, currency, since, limit)
|
4186
4186
|
|
4187
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
4187
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
4188
4188
|
#
|
4189
4189
|
# transfer
|
4190
4190
|
#
|
@@ -4238,7 +4238,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4238
4238
|
'status': self.parse_transfer_status(status),
|
4239
4239
|
}
|
4240
4240
|
|
4241
|
-
def parse_transfer_status(self, status):
|
4241
|
+
def parse_transfer_status(self, status: Str) -> Str:
|
4242
4242
|
statuses = {
|
4243
4243
|
'3': 'rejected', # 'Rejected',
|
4244
4244
|
'6': 'canceled', # 'Got error and wait for recovery',
|
ccxt/async_support/poloniex.py
CHANGED
@@ -580,7 +580,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
580
580
|
response = await self.publicGetTimestamp(params)
|
581
581
|
return self.safe_integer(response, 'serverTime')
|
582
582
|
|
583
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
583
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
584
584
|
#
|
585
585
|
# {
|
586
586
|
# "symbol" : "BTC_USDT",
|
@@ -1752,12 +1752,11 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1752
1752
|
"""
|
1753
1753
|
await self.load_markets()
|
1754
1754
|
currency = self.currency(code)
|
1755
|
-
amount = self.currency_to_precision(code, amount)
|
1756
1755
|
accountsByType = self.safe_value(self.options, 'accountsByType', {})
|
1757
1756
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
1758
1757
|
toId = self.safe_string(accountsByType, toAccount, fromAccount)
|
1759
1758
|
request = {
|
1760
|
-
'amount': amount,
|
1759
|
+
'amount': self.currency_to_precision(code, amount),
|
1761
1760
|
'currency': currency['id'],
|
1762
1761
|
'fromAccount': fromId,
|
1763
1762
|
'toAccount': toId,
|
@@ -1770,7 +1769,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1770
1769
|
#
|
1771
1770
|
return self.parse_transfer(response, currency)
|
1772
1771
|
|
1773
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
1772
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
1774
1773
|
#
|
1775
1774
|
# {
|
1776
1775
|
# "transferId" : "168041074"
|
@@ -356,7 +356,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
356
356
|
'info': market,
|
357
357
|
}
|
358
358
|
|
359
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
359
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
360
360
|
#
|
361
361
|
# {
|
362
362
|
# "symbol": "BTCUSDTPERP", # Market of the symbol
|
ccxt/async_support/probit.py
CHANGED
@@ -659,7 +659,7 @@ class probit(Exchange, ImplicitAPI):
|
|
659
659
|
raise BadResponse(self.id + ' fetchTicker() returned an empty response')
|
660
660
|
return self.parse_ticker(ticker, market)
|
661
661
|
|
662
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
662
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
663
663
|
#
|
664
664
|
# {
|
665
665
|
# "last":"0.022902",
|
ccxt/async_support/timex.py
CHANGED
@@ -1304,7 +1304,7 @@ class timex(Exchange, ImplicitAPI):
|
|
1304
1304
|
'networks': {},
|
1305
1305
|
}
|
1306
1306
|
|
1307
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1307
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1308
1308
|
#
|
1309
1309
|
# {
|
1310
1310
|
# "ask": 0.017,
|
ccxt/async_support/tokocrypto.py
CHANGED
@@ -1088,7 +1088,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1088
1088
|
#
|
1089
1089
|
return self.parse_trades(response, market, since, limit)
|
1090
1090
|
|
1091
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1091
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1092
1092
|
#
|
1093
1093
|
# {
|
1094
1094
|
# "symbol": "ETHBTC",
|
ccxt/async_support/upbit.py
CHANGED
@@ -599,7 +599,7 @@ class upbit(Exchange, ImplicitAPI):
|
|
599
599
|
orderbooks = await self.fetch_order_books([symbol], limit, params)
|
600
600
|
return self.safe_value(orderbooks, symbol)
|
601
601
|
|
602
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
602
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
603
603
|
#
|
604
604
|
# { market: "BTC-ETH",
|
605
605
|
# "trade_date": "20181122",
|
@@ -753,7 +753,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
753
753
|
return self.options['accessToken']
|
754
754
|
return None
|
755
755
|
|
756
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
756
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
757
757
|
#
|
758
758
|
# {
|
759
759
|
# "symbol": "WAVES/BTC",
|
@@ -1185,7 +1185,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1185
1185
|
amountPrecision = self.number_to_string(self.to_precision(amount, self.number_to_string(self.markets[symbol]['precision']['amount'])))
|
1186
1186
|
return self.parse_to_int(float(amountPrecision))
|
1187
1187
|
|
1188
|
-
def
|
1188
|
+
def custom_currency_to_precision(self, code, amount, networkCode=None):
|
1189
1189
|
amountPrecision = self.number_to_string(self.to_precision(amount, self.currencies[code]['precision']))
|
1190
1190
|
return self.parse_to_int(float(amountPrecision))
|
1191
1191
|
|
@@ -2374,7 +2374,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
2374
2374
|
feeAssetId = 'WAVES'
|
2375
2375
|
type = 4 # transfer
|
2376
2376
|
version = 2
|
2377
|
-
amountInteger = self.
|
2377
|
+
amountInteger = self.custom_currency_to_precision(code, amount)
|
2378
2378
|
currency = self.currency(code)
|
2379
2379
|
timestamp = self.milliseconds()
|
2380
2380
|
byteArray = [
|
ccxt/async_support/wazirx.py
CHANGED
@@ -564,7 +564,7 @@ class wazirx(Exchange, ImplicitAPI):
|
|
564
564
|
#
|
565
565
|
return self.safe_integer(response, 'serverTime')
|
566
566
|
|
567
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
567
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
568
568
|
#
|
569
569
|
# {
|
570
570
|
# "symbol":"btcinr",
|
ccxt/async_support/whitebit.py
CHANGED
@@ -754,7 +754,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
754
754
|
ticker = self.safe_dict(response, 'result', {})
|
755
755
|
return self.parse_ticker(ticker, market)
|
756
756
|
|
757
|
-
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
757
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
758
758
|
#
|
759
759
|
# FetchTicker(v1)
|
760
760
|
#
|
@@ -1794,7 +1794,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1794
1794
|
#
|
1795
1795
|
return self.parse_transfer(response, currency)
|
1796
1796
|
|
1797
|
-
def parse_transfer(self, transfer, currency: Currency = None):
|
1797
|
+
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
1798
1798
|
#
|
1799
1799
|
# []
|
1800
1800
|
#
|