ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +2 -2
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bitbank.py +1 -0
- ccxt/abstract/coinbase.py +2 -0
- ccxt/abstract/htx.py +3 -0
- ccxt/abstract/huobi.py +3 -0
- ccxt/abstract/huobipro.py +3 -0
- ccxt/abstract/okex.py +3 -1
- ccxt/abstract/okex5.py +3 -1
- ccxt/abstract/okx.py +3 -1
- ccxt/ace.py +23 -23
- ccxt/alpaca.py +8 -8
- ccxt/ascendex.py +26 -26
- ccxt/async_support/__init__.py +2 -2
- ccxt/async_support/ace.py +23 -23
- ccxt/async_support/alpaca.py +8 -8
- ccxt/async_support/ascendex.py +26 -26
- ccxt/async_support/base/exchange.py +4 -2216
- ccxt/async_support/bigone.py +21 -24
- ccxt/async_support/binance.py +61 -54
- ccxt/async_support/bingx.py +28 -28
- ccxt/async_support/bit2c.py +9 -9
- ccxt/async_support/bitbank.py +11 -10
- ccxt/async_support/bitbns.py +11 -11
- ccxt/async_support/bitfinex.py +15 -15
- ccxt/async_support/bitfinex2.py +22 -22
- ccxt/async_support/bitflyer.py +13 -13
- ccxt/async_support/bitforex.py +10 -10
- ccxt/async_support/bitget.py +44 -44
- ccxt/async_support/bithumb.py +9 -9
- ccxt/async_support/bitmart.py +85 -104
- ccxt/async_support/bitmex.py +27 -27
- ccxt/async_support/bitopro.py +18 -18
- ccxt/async_support/bitpanda.py +18 -18
- ccxt/async_support/bitrue.py +14 -14
- ccxt/async_support/bitso.py +17 -17
- ccxt/async_support/bitstamp.py +17 -17
- ccxt/async_support/bittrex.py +22 -24
- ccxt/async_support/bitvavo.py +15 -15
- ccxt/async_support/bl3p.py +4 -4
- ccxt/async_support/blockchaincom.py +17 -17
- ccxt/async_support/btcalpha.py +14 -14
- ccxt/async_support/btcbox.py +9 -9
- ccxt/async_support/btcmarkets.py +17 -17
- ccxt/async_support/btcturk.py +9 -9
- ccxt/async_support/bybit.py +46 -46
- ccxt/async_support/cex.py +10 -10
- ccxt/async_support/coinbase.py +69 -25
- ccxt/async_support/coinbasepro.py +19 -19
- ccxt/async_support/coincheck.py +10 -10
- ccxt/async_support/coinex.py +57 -66
- ccxt/async_support/coinlist.py +22 -22
- ccxt/async_support/coinmate.py +10 -10
- ccxt/async_support/coinone.py +10 -10
- ccxt/async_support/coinsph.py +17 -17
- ccxt/async_support/coinspot.py +5 -5
- ccxt/async_support/cryptocom.py +27 -27
- ccxt/async_support/currencycom.py +18 -18
- ccxt/async_support/delta.py +21 -21
- ccxt/async_support/deribit.py +24 -24
- ccxt/async_support/digifinex.py +35 -35
- ccxt/async_support/exmo.py +19 -19
- ccxt/async_support/gate.py +38 -38
- ccxt/async_support/gemini.py +11 -11
- ccxt/async_support/hitbtc.py +27 -27
- ccxt/async_support/hollaex.py +19 -19
- ccxt/async_support/htx.py +47 -44
- ccxt/async_support/huobijp.py +22 -22
- ccxt/async_support/idex.py +20 -20
- ccxt/async_support/independentreserve.py +9 -9
- ccxt/async_support/indodax.py +10 -10
- ccxt/async_support/kraken.py +25 -25
- ccxt/async_support/krakenfutures.py +17 -17
- ccxt/async_support/kucoin.py +27 -27
- ccxt/async_support/kucoinfutures.py +20 -20
- ccxt/async_support/kuna.py +19 -19
- ccxt/async_support/latoken.py +14 -14
- ccxt/async_support/lbank.py +18 -18
- ccxt/async_support/luno.py +14 -14
- ccxt/async_support/lykke.py +12 -12
- ccxt/async_support/mercado.py +11 -11
- ccxt/async_support/mexc.py +36 -36
- ccxt/async_support/ndax.py +18 -18
- ccxt/async_support/novadax.py +17 -17
- ccxt/async_support/oceanex.py +12 -12
- ccxt/async_support/okcoin.py +19 -19
- ccxt/async_support/okx.py +48 -45
- ccxt/async_support/p2b.py +6 -6
- ccxt/async_support/paymium.py +6 -6
- ccxt/async_support/phemex.py +57 -57
- ccxt/async_support/poloniex.py +31 -30
- ccxt/async_support/poloniexfutures.py +16 -16
- ccxt/async_support/probit.py +22 -22
- ccxt/async_support/tidex.py +15 -15
- ccxt/async_support/timex.py +20 -20
- ccxt/async_support/tokocrypto.py +16 -16
- ccxt/async_support/upbit.py +15 -15
- ccxt/async_support/wavesexchange.py +12 -12
- ccxt/async_support/wazirx.py +13 -13
- ccxt/async_support/whitebit.py +26 -26
- ccxt/async_support/woo.py +47 -47
- ccxt/async_support/yobit.py +8 -8
- ccxt/async_support/zaif.py +10 -10
- ccxt/async_support/zonda.py +16 -16
- ccxt/base/errors.py +17 -16
- ccxt/base/exchange.py +57 -97
- ccxt/base/types.py +138 -139
- ccxt/bigone.py +21 -24
- ccxt/binance.py +61 -54
- ccxt/bingx.py +28 -28
- ccxt/bit2c.py +9 -9
- ccxt/bitbank.py +11 -10
- ccxt/bitbns.py +11 -11
- ccxt/bitfinex.py +15 -15
- ccxt/bitfinex2.py +22 -22
- ccxt/bitflyer.py +13 -13
- ccxt/bitforex.py +10 -10
- ccxt/bitget.py +44 -44
- ccxt/bithumb.py +9 -9
- ccxt/bitmart.py +85 -104
- ccxt/bitmex.py +27 -27
- ccxt/bitopro.py +18 -18
- ccxt/bitpanda.py +18 -18
- ccxt/bitrue.py +14 -14
- ccxt/bitso.py +17 -17
- ccxt/bitstamp.py +17 -17
- ccxt/bittrex.py +22 -24
- ccxt/bitvavo.py +15 -15
- ccxt/bl3p.py +4 -4
- ccxt/blockchaincom.py +17 -17
- ccxt/btcalpha.py +14 -14
- ccxt/btcbox.py +9 -9
- ccxt/btcmarkets.py +17 -17
- ccxt/btcturk.py +9 -9
- ccxt/bybit.py +46 -46
- ccxt/cex.py +10 -10
- ccxt/coinbase.py +69 -25
- ccxt/coinbasepro.py +19 -19
- ccxt/coincheck.py +10 -10
- ccxt/coinex.py +57 -66
- ccxt/coinlist.py +22 -22
- ccxt/coinmate.py +10 -10
- ccxt/coinone.py +10 -10
- ccxt/coinsph.py +17 -17
- ccxt/coinspot.py +5 -5
- ccxt/cryptocom.py +27 -27
- ccxt/currencycom.py +18 -18
- ccxt/delta.py +21 -21
- ccxt/deribit.py +24 -24
- ccxt/digifinex.py +35 -35
- ccxt/exmo.py +19 -19
- ccxt/gate.py +38 -38
- ccxt/gemini.py +11 -11
- ccxt/hitbtc.py +27 -27
- ccxt/hollaex.py +19 -19
- ccxt/htx.py +47 -44
- ccxt/huobijp.py +22 -22
- ccxt/idex.py +20 -20
- ccxt/independentreserve.py +9 -9
- ccxt/indodax.py +10 -10
- ccxt/kraken.py +25 -25
- ccxt/krakenfutures.py +17 -17
- ccxt/kucoin.py +27 -27
- ccxt/kucoinfutures.py +20 -20
- ccxt/kuna.py +19 -19
- ccxt/latoken.py +14 -14
- ccxt/lbank.py +18 -18
- ccxt/luno.py +14 -14
- ccxt/lykke.py +12 -12
- ccxt/mercado.py +11 -11
- ccxt/mexc.py +36 -36
- ccxt/ndax.py +18 -18
- ccxt/novadax.py +17 -17
- ccxt/oceanex.py +12 -12
- ccxt/okcoin.py +19 -19
- ccxt/okx.py +48 -45
- ccxt/p2b.py +6 -6
- ccxt/paymium.py +6 -6
- ccxt/phemex.py +57 -57
- ccxt/poloniex.py +31 -30
- ccxt/poloniexfutures.py +16 -16
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/binance.py +9 -9
- ccxt/pro/bingx.py +3 -3
- ccxt/pro/bitfinex.py +3 -3
- ccxt/pro/bitfinex2.py +3 -3
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +3 -3
- ccxt/pro/bitpanda.py +3 -3
- ccxt/pro/bitrue.py +2 -2
- ccxt/pro/bitstamp.py +2 -2
- ccxt/pro/bittrex.py +3 -3
- ccxt/pro/bitvavo.py +3 -3
- ccxt/pro/blockchaincom.py +2 -2
- ccxt/pro/bybit.py +4 -4
- ccxt/pro/cex.py +3 -3
- ccxt/pro/coinbasepro.py +3 -3
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/cryptocom.py +5 -5
- ccxt/pro/deribit.py +3 -3
- ccxt/pro/exmo.py +2 -2
- ccxt/pro/gate.py +3 -3
- ccxt/pro/gemini.py +2 -2
- ccxt/pro/hitbtc.py +4 -4
- ccxt/pro/hollaex.py +3 -3
- ccxt/pro/htx.py +3 -3
- ccxt/pro/idex.py +3 -3
- ccxt/pro/kraken.py +7 -7
- ccxt/pro/krakenfutures.py +4 -4
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/kucoinfutures.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +6 -6
- ccxt/pro/phemex.py +3 -3
- ccxt/pro/poloniex.py +3 -3
- ccxt/pro/poloniexfutures.py +3 -3
- ccxt/pro/probit.py +3 -3
- ccxt/pro/wazirx.py +3 -3
- ccxt/pro/whitebit.py +3 -3
- ccxt/pro/woo.py +2 -2
- ccxt/probit.py +22 -22
- ccxt/test/base/test_shared_methods.py +3 -3
- ccxt/test/test_async.py +543 -535
- ccxt/test/test_sync.py +542 -534
- ccxt/tidex.py +15 -15
- ccxt/timex.py +20 -20
- ccxt/tokocrypto.py +16 -16
- ccxt/upbit.py +15 -15
- ccxt/wavesexchange.py +12 -12
- ccxt/wazirx.py +13 -13
- ccxt/whitebit.py +26 -26
- ccxt/woo.py +47 -47
- ccxt/yobit.py +8 -8
- ccxt/zaif.py +10 -10
- ccxt/zonda.py +16 -16
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
- ccxt-4.1.56.dist-info/RECORD +449 -0
- ccxt/async_support/bitstamp1.py +0 -402
- ccxt/async_support/lbank2.py +0 -2620
- ccxt/bitstamp1.py +0 -402
- ccxt/lbank2.py +0 -2619
- ccxt-4.1.54.dist-info/RECORD +0 -453
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
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 Balances, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType,
|
10
|
+
from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -204,6 +204,7 @@ class okx(Exchange, ImplicitAPI):
|
|
204
204
|
'market/open-oracle': 50,
|
205
205
|
'market/exchange-rate': 20,
|
206
206
|
'market/index-components': 1,
|
207
|
+
'public/economic-calendar': 50,
|
207
208
|
'market/block-tickers': 1,
|
208
209
|
'market/block-ticker': 1,
|
209
210
|
'public/block-trades': 1,
|
@@ -335,7 +336,6 @@ class okx(Exchange, ImplicitAPI):
|
|
335
336
|
'asset/subaccount/bills': 5 / 3,
|
336
337
|
'asset/subaccount/managed-subaccount-bills': 5 / 3,
|
337
338
|
'users/entrust-subaccount-list': 10,
|
338
|
-
'users/partner/if-rebate': 1,
|
339
339
|
'account/subaccount/interest-limits': 4,
|
340
340
|
# grid trading
|
341
341
|
'tradingBot/grid/orders-algo-pending': 1,
|
@@ -382,6 +382,9 @@ class okx(Exchange, ImplicitAPI):
|
|
382
382
|
'finance/sfp/dcd/orders': 2,
|
383
383
|
'broker/fd/rebate-per-orders': 300,
|
384
384
|
'broker/fd/if-rebate': 5,
|
385
|
+
# affiliate
|
386
|
+
'affiliate/invitee/detail': 1,
|
387
|
+
'users/partner/if-rebate': 1,
|
385
388
|
},
|
386
389
|
'post': {
|
387
390
|
# rfq
|
@@ -1673,7 +1676,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1673
1676
|
timestamp = self.safe_integer(first, 'ts')
|
1674
1677
|
return self.parse_order_book(first, symbol, timestamp)
|
1675
1678
|
|
1676
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
1679
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1677
1680
|
#
|
1678
1681
|
# {
|
1679
1682
|
# "instType": "SPOT",
|
@@ -1831,7 +1834,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1831
1834
|
type, query = self.handle_market_type_and_params('fetchTickers', market, params)
|
1832
1835
|
return await self.fetch_tickers_by_type(type, symbols, query)
|
1833
1836
|
|
1834
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
1837
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1835
1838
|
#
|
1836
1839
|
# public fetchTrades
|
1837
1840
|
#
|
@@ -1991,7 +1994,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1991
1994
|
data = self.safe_value(response, 'data', [])
|
1992
1995
|
return self.parse_trades(data, market, since, limit)
|
1993
1996
|
|
1994
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
1997
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1995
1998
|
#
|
1996
1999
|
# [
|
1997
2000
|
# "1678928760000", # timestamp
|
@@ -2109,7 +2112,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2109
2112
|
data = self.safe_value(response, 'data', [])
|
2110
2113
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
2111
2114
|
|
2112
|
-
async def fetch_funding_rate_history(self, symbol:
|
2115
|
+
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2113
2116
|
"""
|
2114
2117
|
fetches historical funding rate prices
|
2115
2118
|
:see: https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
|
@@ -2218,7 +2221,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2218
2221
|
result[code] = account
|
2219
2222
|
return self.safe_balance(result)
|
2220
2223
|
|
2221
|
-
def parse_trading_fee(self, fee, market=None):
|
2224
|
+
def parse_trading_fee(self, fee, market: Market = None):
|
2222
2225
|
# https://www.okx.com/docs-v5/en/#rest-api-account-get-fee-rates
|
2223
2226
|
#
|
2224
2227
|
# {
|
@@ -2518,7 +2521,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2518
2521
|
request['ordType'] = 'ioc'
|
2519
2522
|
elif fok:
|
2520
2523
|
request['ordType'] = 'fok'
|
2521
|
-
|
2524
|
+
if stopLossDefined or takeProfitDefined:
|
2522
2525
|
if stopLossDefined:
|
2523
2526
|
stopLossTriggerPrice = self.safe_value_n(stopLoss, ['triggerPrice', 'stopPrice', 'slTriggerPx'])
|
2524
2527
|
if stopLossTriggerPrice is None:
|
@@ -2806,7 +2809,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2806
2809
|
order['side'] = side
|
2807
2810
|
return order
|
2808
2811
|
|
2809
|
-
async def cancel_order(self, id: str, symbol:
|
2812
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2810
2813
|
"""
|
2811
2814
|
cancels an open order
|
2812
2815
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-order
|
@@ -2850,7 +2853,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2850
2853
|
else:
|
2851
2854
|
return ids
|
2852
2855
|
|
2853
|
-
async def cancel_orders(self, ids, symbol:
|
2856
|
+
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
2854
2857
|
"""
|
2855
2858
|
cancel multiple orders
|
2856
2859
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
|
@@ -2942,7 +2945,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2942
2945
|
}
|
2943
2946
|
return self.safe_string(statuses, status, status)
|
2944
2947
|
|
2945
|
-
def parse_order(self, order, market=None) -> Order:
|
2948
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
2946
2949
|
#
|
2947
2950
|
# createOrder
|
2948
2951
|
#
|
@@ -3142,7 +3145,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3142
3145
|
'reduceOnly': reduceOnly,
|
3143
3146
|
}, market)
|
3144
3147
|
|
3145
|
-
async def fetch_order(self, id: str, symbol:
|
3148
|
+
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
3146
3149
|
"""
|
3147
3150
|
fetch an order by the id
|
3148
3151
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-details
|
@@ -3279,7 +3282,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3279
3282
|
order = self.safe_value(data, 0)
|
3280
3283
|
return self.parse_order(order, market)
|
3281
3284
|
|
3282
|
-
async def fetch_open_orders(self, symbol:
|
3285
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
3283
3286
|
"""
|
3284
3287
|
Fetch orders that are still open
|
3285
3288
|
fetch all unfilled currently open orders
|
@@ -3428,7 +3431,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3428
3431
|
data = self.safe_value(response, 'data', [])
|
3429
3432
|
return self.parse_orders(data, market, since, limit)
|
3430
3433
|
|
3431
|
-
async def fetch_canceled_orders(self, symbol:
|
3434
|
+
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3432
3435
|
"""
|
3433
3436
|
fetches information on multiple canceled orders made by the user
|
3434
3437
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
@@ -3593,7 +3596,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3593
3596
|
data = self.safe_value(response, 'data', [])
|
3594
3597
|
return self.parse_orders(data, market, since, limit)
|
3595
3598
|
|
3596
|
-
async def fetch_closed_orders(self, symbol:
|
3599
|
+
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
3597
3600
|
"""
|
3598
3601
|
fetches information on multiple closed orders made by the user
|
3599
3602
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
|
@@ -3755,7 +3758,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3755
3758
|
data = self.safe_value(response, 'data', [])
|
3756
3759
|
return self.parse_orders(data, market, since, limit)
|
3757
3760
|
|
3758
|
-
async def fetch_my_trades(self, symbol:
|
3761
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3759
3762
|
"""
|
3760
3763
|
fetch all trades made by the user
|
3761
3764
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
@@ -3819,7 +3822,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3819
3822
|
data = self.safe_value(response, 'data', [])
|
3820
3823
|
return self.parse_trades(data, market, since, limit, query)
|
3821
3824
|
|
3822
|
-
async def fetch_order_trades(self, id: str, symbol:
|
3825
|
+
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3823
3826
|
"""
|
3824
3827
|
fetch all the trades made from a single order
|
3825
3828
|
:see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
|
@@ -3839,7 +3842,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3839
3842
|
}
|
3840
3843
|
return await self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
3841
3844
|
|
3842
|
-
async def fetch_ledger(self, code:
|
3845
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3843
3846
|
"""
|
3844
3847
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
3845
3848
|
:see: https://www.okx.com/docs-v5/en/#rest-api-account-get-bills-details-last-7-days
|
@@ -3961,7 +3964,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3961
3964
|
}
|
3962
3965
|
return self.safe_string(types, type, type)
|
3963
3966
|
|
3964
|
-
def parse_ledger_entry(self, item, currency=None):
|
3967
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
3965
3968
|
#
|
3966
3969
|
# privateGetAccountBills, privateGetAccountBillsArchive
|
3967
3970
|
#
|
@@ -4038,7 +4041,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4038
4041
|
'fee': fee,
|
4039
4042
|
}
|
4040
4043
|
|
4041
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
4044
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
4042
4045
|
#
|
4043
4046
|
# {
|
4044
4047
|
# "addr": "okbtothemoon",
|
@@ -4273,7 +4276,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4273
4276
|
transaction = self.safe_value(data, 0)
|
4274
4277
|
return self.parse_transaction(transaction, currency)
|
4275
4278
|
|
4276
|
-
async def fetch_deposits(self, code:
|
4279
|
+
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4277
4280
|
"""
|
4278
4281
|
fetch all deposits made to an account
|
4279
4282
|
:see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
|
@@ -4348,7 +4351,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4348
4351
|
data = self.safe_value(response, 'data', [])
|
4349
4352
|
return self.parse_transactions(data, currency, since, limit, params)
|
4350
4353
|
|
4351
|
-
async def fetch_deposit(self, id: str, code:
|
4354
|
+
async def fetch_deposit(self, id: str, code: Str = None, params={}):
|
4352
4355
|
"""
|
4353
4356
|
fetch data on a currency deposit via the deposit id
|
4354
4357
|
:see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
|
@@ -4370,7 +4373,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4370
4373
|
deposit = self.safe_value(data, 0, {})
|
4371
4374
|
return self.parse_transaction(deposit, currency)
|
4372
4375
|
|
4373
|
-
async def fetch_withdrawals(self, code:
|
4376
|
+
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
4374
4377
|
"""
|
4375
4378
|
fetch all withdrawals made from an account
|
4376
4379
|
:see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
|
@@ -4437,7 +4440,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4437
4440
|
data = self.safe_value(response, 'data', [])
|
4438
4441
|
return self.parse_transactions(data, currency, since, limit, params)
|
4439
4442
|
|
4440
|
-
async def fetch_withdrawal(self, id: str, code:
|
4443
|
+
async def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
4441
4444
|
"""
|
4442
4445
|
fetch data on a currency withdrawal via the withdrawal id
|
4443
4446
|
:see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
|
@@ -4517,7 +4520,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4517
4520
|
}
|
4518
4521
|
return self.safe_string(statuses, status, status)
|
4519
4522
|
|
4520
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
4523
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
4521
4524
|
#
|
4522
4525
|
# withdraw
|
4523
4526
|
#
|
@@ -4799,7 +4802,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4799
4802
|
result.append(self.parse_position(positions[i]))
|
4800
4803
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
4801
4804
|
|
4802
|
-
def parse_position(self, position, market=None):
|
4805
|
+
def parse_position(self, position, market: Market = None):
|
4803
4806
|
#
|
4804
4807
|
# {
|
4805
4808
|
# "adl": "3",
|
@@ -4988,7 +4991,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4988
4991
|
rawTransfer = self.safe_value(data, 0, {})
|
4989
4992
|
return self.parse_transfer(rawTransfer, currency)
|
4990
4993
|
|
4991
|
-
def parse_transfer(self, transfer, currency=None):
|
4994
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
4992
4995
|
#
|
4993
4996
|
# transfer
|
4994
4997
|
#
|
@@ -5070,7 +5073,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5070
5073
|
}
|
5071
5074
|
return self.safe_string(statuses, status, status)
|
5072
5075
|
|
5073
|
-
async def fetch_transfer(self, id: str, code:
|
5076
|
+
async def fetch_transfer(self, id: str, code: Str = None, params={}):
|
5074
5077
|
await self.load_markets()
|
5075
5078
|
request = {
|
5076
5079
|
'transId': id,
|
@@ -5101,7 +5104,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5101
5104
|
transfer = self.safe_value(data, 0)
|
5102
5105
|
return self.parse_transfer(transfer)
|
5103
5106
|
|
5104
|
-
async def fetch_transfers(self, code:
|
5107
|
+
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
5105
5108
|
"""
|
5106
5109
|
fetch a history of internal transfers made on an account
|
5107
5110
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
@@ -5210,7 +5213,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5210
5213
|
headers['OK-ACCESS-SIGN'] = signature
|
5211
5214
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
5212
5215
|
|
5213
|
-
def parse_funding_rate(self, contract, market=None):
|
5216
|
+
def parse_funding_rate(self, contract, market: Market = None):
|
5214
5217
|
#
|
5215
5218
|
# {
|
5216
5219
|
# "fundingRate": "0.00027815",
|
@@ -5286,7 +5289,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5286
5289
|
entry = self.safe_value(data, 0, {})
|
5287
5290
|
return self.parse_funding_rate(entry, market)
|
5288
5291
|
|
5289
|
-
async def fetch_funding_history(self, symbol:
|
5292
|
+
async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5290
5293
|
"""
|
5291
5294
|
fetch the history of funding payments paid and received on self account
|
5292
5295
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
|
@@ -5436,7 +5439,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5436
5439
|
sorted = self.sort_by(result, 'timestamp')
|
5437
5440
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
5438
5441
|
|
5439
|
-
async def set_leverage(self, leverage, symbol:
|
5442
|
+
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
5440
5443
|
"""
|
5441
5444
|
set the level of leverage for a market
|
5442
5445
|
:see: https://www.okx.com/docs-v5/en/#rest-api-account-set-leverage
|
@@ -5488,7 +5491,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5488
5491
|
#
|
5489
5492
|
return response
|
5490
5493
|
|
5491
|
-
async def set_position_mode(self, hedged, symbol:
|
5494
|
+
async def set_position_mode(self, hedged, symbol: Str = None, params={}):
|
5492
5495
|
"""
|
5493
5496
|
set hedged to True or False for a market
|
5494
5497
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-position-mode
|
@@ -5519,7 +5522,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5519
5522
|
#
|
5520
5523
|
return response
|
5521
5524
|
|
5522
|
-
async def set_margin_mode(self, marginMode, symbol:
|
5525
|
+
async def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
|
5523
5526
|
"""
|
5524
5527
|
set margin mode to 'cross' or 'isolated'
|
5525
5528
|
:see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-leverage
|
@@ -5631,7 +5634,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5631
5634
|
rate = self.safe_value(data, 0)
|
5632
5635
|
return self.parse_borrow_rate(rate)
|
5633
5636
|
|
5634
|
-
def parse_borrow_rate(self, info, currency=None):
|
5637
|
+
def parse_borrow_rate(self, info, currency: Currency = None):
|
5635
5638
|
#
|
5636
5639
|
# {
|
5637
5640
|
# "amt": "992.10341195",
|
@@ -5794,7 +5797,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5794
5797
|
#
|
5795
5798
|
return self.parse_margin_modification(response, market)
|
5796
5799
|
|
5797
|
-
def parse_margin_modification(self, data, market=None):
|
5800
|
+
def parse_margin_modification(self, data, market: Market = None):
|
5798
5801
|
innerData = self.safe_value(data, 'data', [])
|
5799
5802
|
entry = self.safe_value(innerData, 0, {})
|
5800
5803
|
errorCode = self.safe_string(data, 'code')
|
@@ -5888,7 +5891,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5888
5891
|
data = self.safe_value(response, 'data')
|
5889
5892
|
return self.parse_market_leverage_tiers(data, market)
|
5890
5893
|
|
5891
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
5894
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
5892
5895
|
"""
|
5893
5896
|
* @ignore
|
5894
5897
|
:param dict info: Exchange response for 1 market
|
@@ -5926,7 +5929,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5926
5929
|
})
|
5927
5930
|
return tiers
|
5928
5931
|
|
5929
|
-
async def fetch_borrow_interest(self, code:
|
5932
|
+
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
5930
5933
|
"""
|
5931
5934
|
fetch the interest owed by the user for borrowing currency for margin trading
|
5932
5935
|
:see: https://www.okx.com/docs-v5/en/#rest-api-account-get-interest-accrued-data
|
@@ -5982,7 +5985,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5982
5985
|
interest = self.parse_borrow_interests(data)
|
5983
5986
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
5984
5987
|
|
5985
|
-
def parse_borrow_interest(self, info, market=None):
|
5988
|
+
def parse_borrow_interest(self, info, market: Market = None):
|
5986
5989
|
instId = self.safe_string(info, 'instId')
|
5987
5990
|
if instId is not None:
|
5988
5991
|
market = self.safe_market(instId, market)
|
@@ -5999,7 +6002,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5999
6002
|
'info': info,
|
6000
6003
|
}
|
6001
6004
|
|
6002
|
-
async def borrow_margin(self, code: str, amount, symbol:
|
6005
|
+
async def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
|
6003
6006
|
"""
|
6004
6007
|
create a loan to borrow margin
|
6005
6008
|
:see: https://www.okx.com/docs-v5/en/#rest-api-account-vip-loans-borrow-and-repay
|
@@ -6041,7 +6044,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6041
6044
|
'symbol': symbol,
|
6042
6045
|
})
|
6043
6046
|
|
6044
|
-
async def repay_margin(self, code: str, amount, symbol:
|
6047
|
+
async def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
|
6045
6048
|
"""
|
6046
6049
|
repay borrowed margin and interest
|
6047
6050
|
:see: https://www.okx.com/docs-v5/en/#rest-api-account-vip-loans-borrow-and-repay
|
@@ -6083,7 +6086,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6083
6086
|
'symbol': symbol,
|
6084
6087
|
})
|
6085
6088
|
|
6086
|
-
def parse_margin_loan(self, info, currency=None):
|
6089
|
+
def parse_margin_loan(self, info, currency: Currency = None):
|
6087
6090
|
#
|
6088
6091
|
# {
|
6089
6092
|
# "amt": "102",
|
@@ -6206,7 +6209,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6206
6209
|
data = self.safe_value(response, 'data', [])
|
6207
6210
|
return self.parse_open_interests(data, None, since, limit)
|
6208
6211
|
|
6209
|
-
def parse_open_interest(self, interest, market=None):
|
6212
|
+
def parse_open_interest(self, interest, market: Market = None):
|
6210
6213
|
#
|
6211
6214
|
# fetchOpenInterestHistory
|
6212
6215
|
#
|
@@ -6378,7 +6381,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6378
6381
|
depositWithdrawFees[code] = self.assign_default_deposit_withdraw_fees(depositWithdrawFees[code], currency)
|
6379
6382
|
return depositWithdrawFees
|
6380
6383
|
|
6381
|
-
async def fetch_settlement_history(self, symbol:
|
6384
|
+
async def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6382
6385
|
"""
|
6383
6386
|
fetches historical settlement records
|
6384
6387
|
:see: https://www.okx.com/docs-v5/en/#rest-api-public-data-get-delivery-exercise-history
|
@@ -6558,7 +6561,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6558
6561
|
if entryMarketId == marketId:
|
6559
6562
|
return self.parse_greeks(entry, market)
|
6560
6563
|
|
6561
|
-
def parse_greeks(self, greeks, market=None):
|
6564
|
+
def parse_greeks(self, greeks, market: Market = None):
|
6562
6565
|
#
|
6563
6566
|
# {
|
6564
6567
|
# "askVol": "0",
|
ccxt/async_support/p2b.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.p2b import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Int, Order, OrderSide, OrderType, Strings, Ticker, Tickers
|
9
|
+
from ccxt.base.types import Int, Market, Order, OrderSide, OrderType, Strings, Ticker, Tickers
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
12
12
|
from ccxt.base.errors import BadRequest
|
@@ -114,7 +114,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
114
114
|
'urls': {
|
115
115
|
'extension': '.json',
|
116
116
|
'referral': 'https://p2pb2b.com?referral=ee784c53',
|
117
|
-
'logo': 'https://
|
117
|
+
'logo': 'https://github.com/ccxt/ccxt/assets/43336371/8da13a80-1f0a-49be-bb90-ff8b25164755',
|
118
118
|
'api': {
|
119
119
|
'public': 'https://api.p2pb2b.com/api/v2/public',
|
120
120
|
'private': 'https://api.p2pb2b.com/api/v2',
|
@@ -416,7 +416,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
416
416
|
self.parse_ticker(result, market)
|
417
417
|
)
|
418
418
|
|
419
|
-
def parse_ticker(self, ticker, market=None):
|
419
|
+
def parse_ticker(self, ticker, market: Market = None):
|
420
420
|
#
|
421
421
|
# parseTickers
|
422
422
|
#
|
@@ -570,7 +570,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
570
570
|
result = self.safe_value(response, 'result', [])
|
571
571
|
return self.parse_trades(result, market, since, limit)
|
572
572
|
|
573
|
-
def parse_trade(self, trade, market=None):
|
573
|
+
def parse_trade(self, trade, market: Market = None):
|
574
574
|
#
|
575
575
|
# fetchTrades
|
576
576
|
#
|
@@ -683,7 +683,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
683
683
|
result = self.safe_value(response, 'result', [])
|
684
684
|
return self.parse_ohlcvs(result, market, timeframe, since, limit)
|
685
685
|
|
686
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
686
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
687
687
|
#
|
688
688
|
# [
|
689
689
|
# 1699253400, # Kline open time
|
@@ -1094,7 +1094,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
1094
1094
|
orders = self.array_concat(orders, parsedOrders)
|
1095
1095
|
return orders
|
1096
1096
|
|
1097
|
-
def parse_order(self, order, market=None) -> Order:
|
1097
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
1098
1098
|
#
|
1099
1099
|
# cancelOrder, fetchOpenOrders, createOrder
|
1100
1100
|
#
|
ccxt/async_support/paymium.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.paymium import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, OrderBook, OrderSide, OrderType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, OrderBook, OrderSide, OrderType, Str, Ticker, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
@@ -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=None) -> Ticker:
|
161
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
162
162
|
#
|
163
163
|
# {
|
164
164
|
# "high":"33740.82",
|
@@ -240,7 +240,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
240
240
|
#
|
241
241
|
return self.parse_ticker(ticker, market)
|
242
242
|
|
243
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
243
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
244
244
|
timestamp = self.safe_timestamp(trade, 'created_at_int')
|
245
245
|
id = self.safe_string(trade, 'uuid')
|
246
246
|
market = self.safe_market(None, market)
|
@@ -347,7 +347,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
347
347
|
#
|
348
348
|
return self.parse_deposit_addresses(response, codes)
|
349
349
|
|
350
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
350
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
351
351
|
#
|
352
352
|
# {
|
353
353
|
# "address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe",
|
@@ -394,7 +394,7 @@ class paymium(Exchange, ImplicitAPI):
|
|
394
394
|
'id': response['uuid'],
|
395
395
|
}, market)
|
396
396
|
|
397
|
-
async def cancel_order(self, id: str, symbol:
|
397
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
398
398
|
"""
|
399
399
|
cancels an open order
|
400
400
|
:see: https://paymium.github.io/api-documentation/#tag/Order/paths/~1user~1orders~1%7Buuid%7D/delete
|
@@ -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=None):
|
470
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
471
471
|
#
|
472
472
|
# {
|
473
473
|
# "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",
|