ccxt 4.3.29__py2.py3-none-any.whl → 4.3.31__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/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/base/ws/aiohttp_client.py +1 -0
- ccxt/async_support/base/ws/future.py +27 -29
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +22 -22
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +424 -448
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +80 -40
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +39 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +22 -22
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +424 -448
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +19 -19
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +80 -40
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/RECORD +260 -260
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/async_support/oceanex.py
CHANGED
@@ -163,7 +163,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
163
163
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
164
164
|
:returns dict[]: an array of objects representing market data
|
165
165
|
"""
|
166
|
-
request = {'show_details': True}
|
166
|
+
request: dict = {'show_details': True}
|
167
167
|
response = await self.publicGetMarkets(self.extend(request, params))
|
168
168
|
#
|
169
169
|
# {
|
@@ -250,7 +250,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
250
250
|
"""
|
251
251
|
await self.load_markets()
|
252
252
|
market = self.market(symbol)
|
253
|
-
request = {
|
253
|
+
request: dict = {
|
254
254
|
'pair': market['id'],
|
255
255
|
}
|
256
256
|
response = await self.publicGetTickersPair(self.extend(request, params))
|
@@ -287,7 +287,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
287
287
|
if symbols is None:
|
288
288
|
symbols = self.symbols
|
289
289
|
marketIds = self.market_ids(symbols)
|
290
|
-
request = {'markets': marketIds}
|
290
|
+
request: dict = {'markets': marketIds}
|
291
291
|
response = await self.publicGetTickersMulti(self.extend(request, params))
|
292
292
|
#
|
293
293
|
# {
|
@@ -307,7 +307,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
307
307
|
# }
|
308
308
|
#
|
309
309
|
data = self.safe_value(response, 'data', [])
|
310
|
-
result = {}
|
310
|
+
result: dict = {}
|
311
311
|
for i in range(0, len(data)):
|
312
312
|
ticker = data[i]
|
313
313
|
marketId = self.safe_string(ticker, 'market')
|
@@ -367,7 +367,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
367
367
|
"""
|
368
368
|
await self.load_markets()
|
369
369
|
market = self.market(symbol)
|
370
|
-
request = {
|
370
|
+
request: dict = {
|
371
371
|
'market': market['id'],
|
372
372
|
}
|
373
373
|
if limit is not None:
|
@@ -409,7 +409,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
409
409
|
if symbols is None:
|
410
410
|
symbols = self.symbols
|
411
411
|
marketIds = self.market_ids(symbols)
|
412
|
-
request = {
|
412
|
+
request: dict = {
|
413
413
|
'markets': marketIds,
|
414
414
|
}
|
415
415
|
if limit is not None:
|
@@ -439,7 +439,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
439
439
|
# }
|
440
440
|
#
|
441
441
|
data = self.safe_value(response, 'data', [])
|
442
|
-
result = {}
|
442
|
+
result: dict = {}
|
443
443
|
for i in range(0, len(data)):
|
444
444
|
orderbook = data[i]
|
445
445
|
marketId = self.safe_string(orderbook, 'market')
|
@@ -460,7 +460,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
460
460
|
"""
|
461
461
|
await self.load_markets()
|
462
462
|
market = self.market(symbol)
|
463
|
-
request = {
|
463
|
+
request: dict = {
|
464
464
|
'market': market['id'],
|
465
465
|
}
|
466
466
|
if limit is not None:
|
@@ -487,7 +487,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
487
487
|
data = self.safe_list(response, 'data')
|
488
488
|
return self.parse_trades(data, market, since, limit)
|
489
489
|
|
490
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
490
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
491
491
|
#
|
492
492
|
# fetchTrades(public)
|
493
493
|
#
|
@@ -552,7 +552,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
552
552
|
"""
|
553
553
|
response = await self.publicGetFeesTrading(params)
|
554
554
|
data = self.safe_value(response, 'data', [])
|
555
|
-
result = {}
|
555
|
+
result: dict = {}
|
556
556
|
for i in range(0, len(data)):
|
557
557
|
group = data[i]
|
558
558
|
maker = self.safe_value(group, 'ask_fee', {})
|
@@ -575,7 +575,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
575
575
|
def parse_balance(self, response) -> Balances:
|
576
576
|
data = self.safe_value(response, 'data')
|
577
577
|
balances = self.safe_value(data, 'accounts', [])
|
578
|
-
result = {'info': response}
|
578
|
+
result: dict = {'info': response}
|
579
579
|
for i in range(0, len(balances)):
|
580
580
|
balance = balances[i]
|
581
581
|
currencyId = self.safe_value(balance, 'currency')
|
@@ -611,7 +611,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
611
611
|
"""
|
612
612
|
await self.load_markets()
|
613
613
|
market = self.market(symbol)
|
614
|
-
request = {
|
614
|
+
request: dict = {
|
615
615
|
'market': market['id'],
|
616
616
|
'side': side,
|
617
617
|
'ord_type': type,
|
@@ -636,7 +636,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
636
636
|
if symbol is not None:
|
637
637
|
market = self.market(symbol)
|
638
638
|
ids = [id]
|
639
|
-
request = {'ids': ids}
|
639
|
+
request: dict = {'ids': ids}
|
640
640
|
response = await self.privateGetOrders(self.extend(request, params))
|
641
641
|
data = self.safe_value(response, 'data')
|
642
642
|
dataLength = len(data)
|
@@ -659,7 +659,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
659
659
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
660
660
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
661
661
|
"""
|
662
|
-
request = {
|
662
|
+
request: dict = {
|
663
663
|
'states': ['wait'],
|
664
664
|
}
|
665
665
|
return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -674,7 +674,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
674
674
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
675
675
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
676
676
|
"""
|
677
|
-
request = {
|
677
|
+
request: dict = {
|
678
678
|
'states': ['done', 'cancel'],
|
679
679
|
}
|
680
680
|
return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -695,7 +695,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
695
695
|
market = self.market(symbol)
|
696
696
|
states = self.safe_value(params, 'states', ['wait', 'done', 'cancel'])
|
697
697
|
query = self.omit(params, 'states')
|
698
|
-
request = {
|
698
|
+
request: dict = {
|
699
699
|
'market': market['id'],
|
700
700
|
'states': states,
|
701
701
|
'need_price': 'True',
|
@@ -743,7 +743,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
743
743
|
"""
|
744
744
|
await self.load_markets()
|
745
745
|
market = self.market(symbol)
|
746
|
-
request = {
|
746
|
+
request: dict = {
|
747
747
|
'market': market['id'],
|
748
748
|
'period': self.safe_string(self.timeframes, timeframe, timeframe),
|
749
749
|
}
|
@@ -755,7 +755,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
755
755
|
ohlcvs = self.safe_list(response, 'data', [])
|
756
756
|
return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
|
757
757
|
|
758
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
758
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
759
759
|
#
|
760
760
|
# {
|
761
761
|
# "created_at": "2019-01-18T00:38:18Z",
|
@@ -809,8 +809,8 @@ class oceanex(Exchange, ImplicitAPI):
|
|
809
809
|
'fee': None,
|
810
810
|
}, market)
|
811
811
|
|
812
|
-
def parse_order_status(self, status):
|
813
|
-
statuses = {
|
812
|
+
def parse_order_status(self, status: Str):
|
813
|
+
statuses: dict = {
|
814
814
|
'wait': 'open',
|
815
815
|
'done': 'closed',
|
816
816
|
'cancel': 'canceled',
|
@@ -875,7 +875,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
875
875
|
url += '?' + self.urlencode(query)
|
876
876
|
elif api == 'private':
|
877
877
|
self.check_required_credentials()
|
878
|
-
request = {
|
878
|
+
request: dict = {
|
879
879
|
'uid': self.apiKey,
|
880
880
|
'data': query,
|
881
881
|
}
|
ccxt/async_support/okcoin.py
CHANGED
@@ -636,7 +636,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
636
636
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
637
637
|
:returns dict[]: an array of objects representing market data
|
638
638
|
"""
|
639
|
-
request = {
|
639
|
+
request: dict = {
|
640
640
|
'instType': 'SPOT',
|
641
641
|
}
|
642
642
|
response = await self.publicGetPublicInstruments(self.extend(request, params))
|
@@ -726,7 +726,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
726
726
|
})
|
727
727
|
|
728
728
|
def safe_network(self, networkId):
|
729
|
-
networksById = {
|
729
|
+
networksById: dict = {
|
730
730
|
'Bitcoin': 'BTC',
|
731
731
|
'Omni': 'OMNI',
|
732
732
|
'TRON': 'TRC20',
|
@@ -746,7 +746,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
746
746
|
else:
|
747
747
|
response = await self.privateGetAssetCurrencies(params)
|
748
748
|
data = self.safe_value(response, 'data', [])
|
749
|
-
result = {}
|
749
|
+
result: dict = {}
|
750
750
|
dataByCurrencyId = self.group_by(data, 'ccy')
|
751
751
|
currencyIds = list(dataByCurrencyId.keys())
|
752
752
|
for i in range(0, len(currencyIds)):
|
@@ -754,7 +754,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
754
754
|
currency = self.safe_currency(currencyId)
|
755
755
|
code = currency['code']
|
756
756
|
chains = dataByCurrencyId[currencyId]
|
757
|
-
networks = {}
|
757
|
+
networks: dict = {}
|
758
758
|
currencyActive = False
|
759
759
|
depositEnabled = False
|
760
760
|
withdrawEnabled = False
|
@@ -826,7 +826,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
826
826
|
"""
|
827
827
|
await self.load_markets()
|
828
828
|
market = self.market(symbol)
|
829
|
-
request = {
|
829
|
+
request: dict = {
|
830
830
|
'instId': market['id'],
|
831
831
|
}
|
832
832
|
limit = 20 if (limit is None) else limit
|
@@ -924,7 +924,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
924
924
|
"""
|
925
925
|
await self.load_markets()
|
926
926
|
market = self.market(symbol)
|
927
|
-
request = {
|
927
|
+
request: dict = {
|
928
928
|
'instId': market['id'],
|
929
929
|
}
|
930
930
|
response = await self.publicGetMarketTicker(self.extend(request, params))
|
@@ -967,14 +967,14 @@ class okcoin(Exchange, ImplicitAPI):
|
|
967
967
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
968
968
|
"""
|
969
969
|
symbols = self.market_symbols(symbols)
|
970
|
-
request = {
|
970
|
+
request: dict = {
|
971
971
|
'instType': 'SPOT',
|
972
972
|
}
|
973
973
|
response = await self.publicGetMarketTickers(self.extend(request, params))
|
974
974
|
data = self.safe_list(response, 'data', [])
|
975
975
|
return self.parse_tickers(data, symbols, params)
|
976
976
|
|
977
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
977
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
978
978
|
#
|
979
979
|
# public fetchTrades
|
980
980
|
#
|
@@ -1062,7 +1062,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1062
1062
|
market = self.market(symbol)
|
1063
1063
|
if (limit is None) or (limit > 100):
|
1064
1064
|
limit = 100 # maximum = default = 100
|
1065
|
-
request = {
|
1065
|
+
request: dict = {
|
1066
1066
|
'instId': market['id'],
|
1067
1067
|
}
|
1068
1068
|
method = None
|
@@ -1118,7 +1118,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1118
1118
|
timezone = self.safe_string(options, 'timezone', 'UTC')
|
1119
1119
|
if (timezone == 'UTC') and (duration >= 21600): # if utc and timeframe >= 6h
|
1120
1120
|
bar += timezone.lower()
|
1121
|
-
request = {
|
1121
|
+
request: dict = {
|
1122
1122
|
'instId': market['id'],
|
1123
1123
|
'bar': bar,
|
1124
1124
|
}
|
@@ -1176,7 +1176,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1176
1176
|
# }
|
1177
1177
|
# ]
|
1178
1178
|
#
|
1179
|
-
result = {
|
1179
|
+
result: dict = {
|
1180
1180
|
'info': response,
|
1181
1181
|
'timestamp': None,
|
1182
1182
|
'datetime': None,
|
@@ -1200,7 +1200,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1200
1200
|
"""
|
1201
1201
|
await self.load_markets()
|
1202
1202
|
marketType, query = self.handle_market_type_and_params('fetchBalance', None, params)
|
1203
|
-
request = {
|
1203
|
+
request: dict = {
|
1204
1204
|
# 'ccy': 'BTC,ETH', # comma-separated list of currency ids
|
1205
1205
|
}
|
1206
1206
|
response = None
|
@@ -1232,7 +1232,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1232
1232
|
return self.parse_trading_balance(response)
|
1233
1233
|
|
1234
1234
|
def parse_trading_balance(self, response):
|
1235
|
-
result = {'info': response}
|
1235
|
+
result: dict = {'info': response}
|
1236
1236
|
data = self.safe_value(response, 'data', [])
|
1237
1237
|
first = self.safe_value(data, 0, {})
|
1238
1238
|
timestamp = self.safe_integer(first, 'uTime')
|
@@ -1257,7 +1257,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1257
1257
|
return self.safe_balance(result)
|
1258
1258
|
|
1259
1259
|
def parse_funding_balance(self, response):
|
1260
|
-
result = {'info': response}
|
1260
|
+
result: dict = {'info': response}
|
1261
1261
|
data = self.safe_value(response, 'data', [])
|
1262
1262
|
for i in range(0, len(data)):
|
1263
1263
|
balance = data[i]
|
@@ -1345,7 +1345,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1345
1345
|
|
1346
1346
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1347
1347
|
market = self.market(symbol)
|
1348
|
-
request = {
|
1348
|
+
request: dict = {
|
1349
1349
|
'instId': market['id'],
|
1350
1350
|
# 'ccy': currency['id'], # only applicable to cross MARGIN orders in single-currency margin
|
1351
1351
|
# 'clOrdId': clientOrderId, # up to 32 characters, must be unique
|
@@ -1558,7 +1558,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1558
1558
|
orderInner = await self.cancel_orders([id], symbol, params)
|
1559
1559
|
return self.safe_value(orderInner, 0)
|
1560
1560
|
market = self.market(symbol)
|
1561
|
-
request = {
|
1561
|
+
request: dict = {
|
1562
1562
|
'instId': market['id'],
|
1563
1563
|
# 'ordId': id, # either ordId or clOrdId is required
|
1564
1564
|
# 'clOrdId': clientOrderId,
|
@@ -1658,8 +1658,8 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1658
1658
|
ordersData = self.safe_list(response, 'data', [])
|
1659
1659
|
return self.parse_orders(ordersData, market, None, None, params)
|
1660
1660
|
|
1661
|
-
def parse_order_status(self, status):
|
1662
|
-
statuses = {
|
1661
|
+
def parse_order_status(self, status: Str):
|
1662
|
+
statuses: dict = {
|
1663
1663
|
'canceled': 'canceled',
|
1664
1664
|
'live': 'open',
|
1665
1665
|
'partially_filled': 'open',
|
@@ -1668,7 +1668,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1668
1668
|
}
|
1669
1669
|
return self.safe_string(statuses, status, status)
|
1670
1670
|
|
1671
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1671
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1672
1672
|
#
|
1673
1673
|
# createOrder
|
1674
1674
|
#
|
@@ -1872,7 +1872,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1872
1872
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
1873
1873
|
await self.load_markets()
|
1874
1874
|
market = self.market(symbol)
|
1875
|
-
request = {
|
1875
|
+
request: dict = {
|
1876
1876
|
'instId': market['id'],
|
1877
1877
|
# 'clOrdId': 'abcdef12345', # optional, [a-z0-9]{1,32}
|
1878
1878
|
# 'ordId': id,
|
@@ -1913,7 +1913,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1913
1913
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1914
1914
|
"""
|
1915
1915
|
await self.load_markets()
|
1916
|
-
request = {
|
1916
|
+
request: dict = {
|
1917
1917
|
# 'instId': market['id'],
|
1918
1918
|
# 'ordType': 'limit', # market, limit, post_only, fok, ioc, comma-separated, stop orders: conditional, oco, trigger, move_order_stop, iceberg, or twap
|
1919
1919
|
# 'state': 'live', # live, partially_filled
|
@@ -1955,7 +1955,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1955
1955
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1956
1956
|
"""
|
1957
1957
|
await self.load_markets()
|
1958
|
-
request = {
|
1958
|
+
request: dict = {
|
1959
1959
|
'instType': 'SPOT',
|
1960
1960
|
}
|
1961
1961
|
market = None
|
@@ -2140,7 +2140,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2140
2140
|
"""
|
2141
2141
|
await self.load_markets()
|
2142
2142
|
currency = self.currency(code)
|
2143
|
-
request = {
|
2143
|
+
request: dict = {
|
2144
2144
|
'ccy': currency['id'],
|
2145
2145
|
}
|
2146
2146
|
response = await self.privateGetAssetDepositAddress(self.extend(request, params))
|
@@ -2186,7 +2186,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2186
2186
|
accountsByType = self.safe_value(self.options, 'accountsByType', {})
|
2187
2187
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
2188
2188
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
2189
|
-
request = {
|
2189
|
+
request: dict = {
|
2190
2190
|
'ccy': currency['id'],
|
2191
2191
|
'amt': self.currency_to_precision(code, amount),
|
2192
2192
|
'type': '0', # 0 = transfer within account by default, 1 = master account to sub-account, 2 = sub-account to master account, 3 = sub-account to master account(Only applicable to APIKey from sub-account), 4 = sub-account to sub-account
|
@@ -2304,7 +2304,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2304
2304
|
}
|
2305
2305
|
|
2306
2306
|
def parse_transfer_status(self, status: Str) -> Str:
|
2307
|
-
statuses = {
|
2307
|
+
statuses: dict = {
|
2308
2308
|
'success': 'ok',
|
2309
2309
|
}
|
2310
2310
|
return self.safe_string(statuses, status, status)
|
@@ -2326,7 +2326,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2326
2326
|
currency = self.currency(code)
|
2327
2327
|
if (tag is not None) and (len(tag) > 0):
|
2328
2328
|
address = address + ':' + tag
|
2329
|
-
request = {
|
2329
|
+
request: dict = {
|
2330
2330
|
'ccy': currency['id'],
|
2331
2331
|
'toAddr': address,
|
2332
2332
|
'dest': '4',
|
@@ -2374,7 +2374,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2374
2374
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2375
2375
|
"""
|
2376
2376
|
await self.load_markets()
|
2377
|
-
request = {
|
2377
|
+
request: dict = {
|
2378
2378
|
# 'ccy': currency['id'],
|
2379
2379
|
# 'state': 2, # 0 waiting for confirmation, 1 deposit credited, 2 deposit successful
|
2380
2380
|
# 'after': since,
|
@@ -2443,7 +2443,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2443
2443
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2444
2444
|
"""
|
2445
2445
|
await self.load_markets()
|
2446
|
-
request = {
|
2446
|
+
request: dict = {
|
2447
2447
|
# 'ccy': currency['id'],
|
2448
2448
|
# 'state': 2, # -3: pending cancel, -2 canceled, -1 failed, 0, pending, 1 sending, 2 sent, 3 awaiting email verification, 4 awaiting manual verification, 5 awaiting identity verification
|
2449
2449
|
# 'after': since,
|
@@ -2517,7 +2517,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2517
2517
|
# "5": "awaiting identity confirmation"
|
2518
2518
|
# }
|
2519
2519
|
#
|
2520
|
-
statuses = {
|
2520
|
+
statuses: dict = {
|
2521
2521
|
'-3': 'pending',
|
2522
2522
|
'-2': 'canceled',
|
2523
2523
|
'-1': 'failed',
|
@@ -2530,7 +2530,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2530
2530
|
}
|
2531
2531
|
return self.safe_string(statuses, status, status)
|
2532
2532
|
|
2533
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2533
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
2534
2534
|
#
|
2535
2535
|
# withdraw
|
2536
2536
|
#
|
@@ -2635,7 +2635,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2635
2635
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
2636
2636
|
"""
|
2637
2637
|
await self.load_markets()
|
2638
|
-
request = {
|
2638
|
+
request: dict = {
|
2639
2639
|
'instType': 'SPOT',
|
2640
2640
|
}
|
2641
2641
|
if (limit is not None) and (limit > 100):
|
@@ -2664,7 +2664,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2664
2664
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2665
2665
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
2666
2666
|
"""
|
2667
|
-
request = {
|
2667
|
+
request: dict = {
|
2668
2668
|
# 'instrument_id': market['id'],
|
2669
2669
|
'order_id': id,
|
2670
2670
|
# 'after': '1', # return the page after the specified page number
|
@@ -2688,7 +2688,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2688
2688
|
await self.load_markets()
|
2689
2689
|
method = None
|
2690
2690
|
method, params = self.handle_option_and_params(params, 'fetchLedger', 'method', 'privateGetAccountBills')
|
2691
|
-
request = {
|
2691
|
+
request: dict = {
|
2692
2692
|
# 'instType': None, # 'SPOT', 'MARGIN', 'SWAP', 'FUTURES", 'OPTION'
|
2693
2693
|
# 'ccy': None, # currency['id'],
|
2694
2694
|
# 'ctType': None, # 'linear', 'inverse', only applicable to FUTURES/SWAP
|
@@ -2766,7 +2766,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2766
2766
|
return self.parse_ledger(data, currency, since, limit)
|
2767
2767
|
|
2768
2768
|
def parse_ledger_entry_type(self, type):
|
2769
|
-
types = {
|
2769
|
+
types: dict = {
|
2770
2770
|
'1': 'transfer', # transfer
|
2771
2771
|
'2': 'trade', # trade
|
2772
2772
|
'3': 'trade', # delivery
|
@@ -2781,7 +2781,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2781
2781
|
}
|
2782
2782
|
return self.safe_string(types, type, type)
|
2783
2783
|
|
2784
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
2784
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2785
2785
|
#
|
2786
2786
|
# privateGetAccountBills, privateGetAccountBillsArchive
|
2787
2787
|
#
|