ccxt 4.4.34__py2.py3-none-any.whl → 4.4.36__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/bingx.py +1 -0
- ccxt/abstract/bitopro.py +1 -0
- ccxt/abstract/bitpanda.py +0 -12
- ccxt/abstract/bitrue.py +3 -3
- ccxt/abstract/bybit.py +15 -0
- ccxt/abstract/defx.py +69 -0
- ccxt/abstract/deribit.py +1 -0
- ccxt/abstract/gate.py +14 -0
- ccxt/abstract/gateio.py +14 -0
- ccxt/abstract/okx.py +1 -0
- ccxt/abstract/onetrading.py +0 -12
- ccxt/abstract/xt.py +5 -5
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bingx.py +324 -138
- ccxt/async_support/bitfinex2.py +18 -13
- ccxt/async_support/bitmex.py +104 -2
- ccxt/async_support/bitopro.py +21 -4
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +2 -1
- ccxt/async_support/btcmarkets.py +3 -3
- ccxt/async_support/btcturk.py +19 -19
- ccxt/async_support/bybit.py +21 -1
- ccxt/async_support/defx.py +1981 -0
- ccxt/async_support/deribit.py +27 -12
- ccxt/async_support/gate.py +156 -39
- ccxt/async_support/htx.py +11 -2
- ccxt/async_support/hyperliquid.py +68 -11
- ccxt/async_support/idex.py +3 -4
- ccxt/async_support/kraken.py +97 -90
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/okx.py +1 -0
- ccxt/async_support/onetrading.py +47 -369
- ccxt/async_support/xt.py +10 -10
- ccxt/base/exchange.py +2 -1
- ccxt/bingx.py +324 -138
- ccxt/bitfinex2.py +18 -13
- ccxt/bitmex.py +104 -2
- ccxt/bitopro.py +21 -4
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +2 -1
- ccxt/btcmarkets.py +3 -3
- ccxt/btcturk.py +19 -19
- ccxt/bybit.py +21 -1
- ccxt/defx.py +1980 -0
- ccxt/deribit.py +27 -12
- ccxt/gate.py +156 -39
- ccxt/htx.py +11 -2
- ccxt/hyperliquid.py +68 -11
- ccxt/idex.py +3 -4
- ccxt/kraken.py +97 -90
- ccxt/kucoin.py +1 -1
- ccxt/okx.py +1 -0
- ccxt/onetrading.py +47 -369
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/bitrue.py +13 -11
- ccxt/pro/defx.py +832 -0
- ccxt/pro/probit.py +54 -66
- ccxt/test/tests_async.py +44 -3
- ccxt/test/tests_sync.py +44 -3
- ccxt/xt.py +10 -10
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/METADATA +7 -6
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/RECORD +67 -63
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/WHEEL +0 -0
- {ccxt-4.4.34.dist-info → ccxt-4.4.36.dist-info}/top_level.txt +0 -0
ccxt/onetrading.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.onetrading import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currencies,
|
8
|
+
from ccxt.base.types import Balances, Currencies, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -47,7 +47,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
47
47
|
'cancelOrders': True,
|
48
48
|
'closeAllPositions': False,
|
49
49
|
'closePosition': False,
|
50
|
-
'createDepositAddress':
|
50
|
+
'createDepositAddress': False,
|
51
51
|
'createOrder': True,
|
52
52
|
'createReduceOnlyOrder': False,
|
53
53
|
'createStopLimitOrder': True,
|
@@ -62,10 +62,10 @@ class onetrading(Exchange, ImplicitAPI):
|
|
62
62
|
'fetchCrossBorrowRates': False,
|
63
63
|
'fetchCurrencies': True,
|
64
64
|
'fetchDeposit': False,
|
65
|
-
'fetchDepositAddress':
|
65
|
+
'fetchDepositAddress': False,
|
66
66
|
'fetchDepositAddresses': False,
|
67
67
|
'fetchDepositAddressesByNetwork': False,
|
68
|
-
'fetchDeposits':
|
68
|
+
'fetchDeposits': False,
|
69
69
|
'fetchDepositsWithdrawals': False,
|
70
70
|
'fetchFundingHistory': False,
|
71
71
|
'fetchFundingRate': False,
|
@@ -98,7 +98,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
98
98
|
'fetchTicker': True,
|
99
99
|
'fetchTickers': True,
|
100
100
|
'fetchTime': True,
|
101
|
-
'fetchTrades':
|
101
|
+
'fetchTrades': False,
|
102
102
|
'fetchTradingFee': False,
|
103
103
|
'fetchTradingFees': True,
|
104
104
|
'fetchTransactionFee': False,
|
@@ -107,14 +107,14 @@ class onetrading(Exchange, ImplicitAPI):
|
|
107
107
|
'fetchTransfer': False,
|
108
108
|
'fetchTransfers': False,
|
109
109
|
'fetchWithdrawal': False,
|
110
|
-
'fetchWithdrawals':
|
110
|
+
'fetchWithdrawals': False,
|
111
111
|
'reduceMargin': False,
|
112
112
|
'setLeverage': False,
|
113
113
|
'setMargin': False,
|
114
114
|
'setMarginMode': False,
|
115
115
|
'setPositionMode': False,
|
116
116
|
'transfer': False,
|
117
|
-
'withdraw':
|
117
|
+
'withdraw': False,
|
118
118
|
},
|
119
119
|
'timeframes': {
|
120
120
|
'1m': '1/MINUTES',
|
@@ -149,32 +149,20 @@ class onetrading(Exchange, ImplicitAPI):
|
|
149
149
|
'order-book/{instrument_code}',
|
150
150
|
'market-ticker',
|
151
151
|
'market-ticker/{instrument_code}',
|
152
|
-
'price-ticks/{instrument_code}',
|
153
152
|
'time',
|
154
153
|
],
|
155
154
|
},
|
156
155
|
'private': {
|
157
156
|
'get': [
|
158
157
|
'account/balances',
|
159
|
-
'account/deposit/crypto/{currency_code}',
|
160
|
-
'account/deposit/fiat/EUR',
|
161
|
-
'account/deposits',
|
162
|
-
'account/deposits/bitpanda',
|
163
|
-
'account/withdrawals',
|
164
|
-
'account/withdrawals/bitpanda',
|
165
158
|
'account/fees',
|
166
159
|
'account/orders',
|
167
160
|
'account/orders/{order_id}',
|
168
161
|
'account/orders/{order_id}/trades',
|
169
162
|
'account/trades',
|
170
163
|
'account/trades/{trade_id}',
|
171
|
-
'account/trading-volume',
|
172
164
|
],
|
173
165
|
'post': [
|
174
|
-
'account/deposit/crypto',
|
175
|
-
'account/withdraw/crypto',
|
176
|
-
'account/withdraw/fiat',
|
177
|
-
'account/fees',
|
178
166
|
'account/orders',
|
179
167
|
],
|
180
168
|
'delete': [
|
@@ -636,6 +624,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
636
624
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
637
625
|
"""
|
638
626
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
627
|
+
|
628
|
+
https://docs.onetrading.com/#market-ticker-for-instrument
|
629
|
+
|
639
630
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
640
631
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
641
632
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -669,7 +660,10 @@ class onetrading(Exchange, ImplicitAPI):
|
|
669
660
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
670
661
|
"""
|
671
662
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
672
|
-
|
663
|
+
|
664
|
+
https://docs.onetrading.com/#market-ticker
|
665
|
+
|
666
|
+
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
673
667
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
674
668
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
675
669
|
"""
|
@@ -706,6 +700,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
706
700
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
707
701
|
"""
|
708
702
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
703
|
+
|
704
|
+
https://docs.onetrading.com/#order-book
|
705
|
+
|
709
706
|
:param str symbol: unified symbol of the market to fetch the order book for
|
710
707
|
:param int [limit]: the maximum amount of order book entries to return
|
711
708
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -828,6 +825,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
828
825
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
829
826
|
"""
|
830
827
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
828
|
+
|
829
|
+
https://docs.onetrading.com/#candlesticks
|
830
|
+
|
831
831
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
832
832
|
:param str timeframe: the length of time each candle represents
|
833
833
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -946,44 +946,6 @@ class onetrading(Exchange, ImplicitAPI):
|
|
946
946
|
'info': trade,
|
947
947
|
}, market)
|
948
948
|
|
949
|
-
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
950
|
-
"""
|
951
|
-
get the list of most recent trades for a particular symbol
|
952
|
-
:param str symbol: unified symbol of the market to fetch trades for
|
953
|
-
:param int [since]: timestamp in ms of the earliest trade to fetch
|
954
|
-
:param int [limit]: the maximum amount of trades to fetch
|
955
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
956
|
-
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
957
|
-
"""
|
958
|
-
self.load_markets()
|
959
|
-
market = self.market(symbol)
|
960
|
-
request: dict = {
|
961
|
-
'instrument_code': market['id'],
|
962
|
-
# 'from': self.iso8601(since),
|
963
|
-
# 'to': self.iso8601(self.milliseconds()),
|
964
|
-
}
|
965
|
-
if since is not None:
|
966
|
-
# returns price ticks for a specific market with an interval of maximum of 4 hours
|
967
|
-
# sorted by latest first
|
968
|
-
request['from'] = self.iso8601(since)
|
969
|
-
request['to'] = self.iso8601(self.sum(since, 14400000))
|
970
|
-
response = self.publicGetPriceTicksInstrumentCode(self.extend(request, params))
|
971
|
-
#
|
972
|
-
# [
|
973
|
-
# {
|
974
|
-
# "instrument_code":"BTC_EUR",
|
975
|
-
# "price":"8137.28",
|
976
|
-
# "amount":"0.22269",
|
977
|
-
# "taker_side":"BUY",
|
978
|
-
# "volume":"1812.0908832",
|
979
|
-
# "time":"2020-07-10T14:44:32.299Z",
|
980
|
-
# "trade_timestamp":1594392272299,
|
981
|
-
# "sequence":603047
|
982
|
-
# }
|
983
|
-
# ]
|
984
|
-
#
|
985
|
-
return self.parse_trades(response, market, since, limit)
|
986
|
-
|
987
949
|
def parse_balance(self, response) -> Balances:
|
988
950
|
balances = self.safe_value(response, 'balances', [])
|
989
951
|
result: dict = {'info': response}
|
@@ -1000,6 +962,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1000
962
|
def fetch_balance(self, params={}) -> Balances:
|
1001
963
|
"""
|
1002
964
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
965
|
+
|
966
|
+
https://docs.onetrading.com/#balances
|
967
|
+
|
1003
968
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1004
969
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1005
970
|
"""
|
@@ -1023,317 +988,6 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1023
988
|
#
|
1024
989
|
return self.parse_balance(response)
|
1025
990
|
|
1026
|
-
def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
|
1027
|
-
code = None
|
1028
|
-
if currency is not None:
|
1029
|
-
code = currency['code']
|
1030
|
-
address = self.safe_string(depositAddress, 'address')
|
1031
|
-
tag = self.safe_string(depositAddress, 'destination_tag')
|
1032
|
-
self.check_address(address)
|
1033
|
-
return {
|
1034
|
-
'info': depositAddress,
|
1035
|
-
'currency': code,
|
1036
|
-
'network': None,
|
1037
|
-
'address': address,
|
1038
|
-
'tag': tag,
|
1039
|
-
}
|
1040
|
-
|
1041
|
-
def create_deposit_address(self, code: str, params={}):
|
1042
|
-
"""
|
1043
|
-
create a currency deposit address
|
1044
|
-
:param str code: unified currency code of the currency for the deposit address
|
1045
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1046
|
-
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
1047
|
-
"""
|
1048
|
-
self.load_markets()
|
1049
|
-
currency = self.currency(code)
|
1050
|
-
request: dict = {
|
1051
|
-
'currency': currency['id'],
|
1052
|
-
}
|
1053
|
-
response = self.privatePostAccountDepositCrypto(self.extend(request, params))
|
1054
|
-
#
|
1055
|
-
# {
|
1056
|
-
# "address":"rBnNhk95FrdNisZtXcStzriFS8vEzz53DM",
|
1057
|
-
# "destination_tag":"865690307",
|
1058
|
-
# "enabled":true,
|
1059
|
-
# "is_smart_contract":false
|
1060
|
-
# }
|
1061
|
-
#
|
1062
|
-
return self.parse_deposit_address(response, currency)
|
1063
|
-
|
1064
|
-
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1065
|
-
"""
|
1066
|
-
fetch the deposit address for a currency associated with self account
|
1067
|
-
:param str code: unified currency code
|
1068
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1069
|
-
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
1070
|
-
"""
|
1071
|
-
self.load_markets()
|
1072
|
-
currency = self.currency(code)
|
1073
|
-
request: dict = {
|
1074
|
-
'currency_code': currency['id'],
|
1075
|
-
}
|
1076
|
-
response = self.privateGetAccountDepositCryptoCurrencyCode(self.extend(request, params))
|
1077
|
-
#
|
1078
|
-
# {
|
1079
|
-
# "address":"rBnNhk95FrdNisZtXcStzriFS8vEzz53DM",
|
1080
|
-
# "destination_tag":"865690307",
|
1081
|
-
# "enabled":true,
|
1082
|
-
# "is_smart_contract":false,
|
1083
|
-
# "can_create_more":false
|
1084
|
-
# }
|
1085
|
-
#
|
1086
|
-
return self.parse_deposit_address(response, currency)
|
1087
|
-
|
1088
|
-
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1089
|
-
"""
|
1090
|
-
fetch all deposits made to an account
|
1091
|
-
:param str code: unified currency code
|
1092
|
-
:param int [since]: the earliest time in ms to fetch deposits for
|
1093
|
-
:param int [limit]: the maximum number of deposits structures to retrieve
|
1094
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1095
|
-
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1096
|
-
"""
|
1097
|
-
self.load_markets()
|
1098
|
-
request: dict = {
|
1099
|
-
# 'cursor': 'string', # pointer specifying the position from which the next pages should be returned
|
1100
|
-
}
|
1101
|
-
currency = None
|
1102
|
-
if code is not None:
|
1103
|
-
currency = self.currency(code)
|
1104
|
-
request['currency_code'] = currency['id']
|
1105
|
-
if limit is not None:
|
1106
|
-
request['max_page_size'] = limit
|
1107
|
-
if since is not None:
|
1108
|
-
to = self.safe_string(params, 'to')
|
1109
|
-
if to is None:
|
1110
|
-
raise ArgumentsRequired(self.id + ' fetchDeposits() requires a "to" iso8601 string param with the since argument is specified')
|
1111
|
-
request['from'] = self.iso8601(since)
|
1112
|
-
response = self.privateGetAccountDeposits(self.extend(request, params))
|
1113
|
-
#
|
1114
|
-
# {
|
1115
|
-
# "deposit_history": [
|
1116
|
-
# {
|
1117
|
-
# "transaction_id": "e5342efcd-d5b7-4a56-8e12-b69ffd68c5ef",
|
1118
|
-
# "account_id": "c2d0076a-c20d-41f8-9e9a-1a1d028b2b58",
|
1119
|
-
# "amount": "100",
|
1120
|
-
# "type": "CRYPTO",
|
1121
|
-
# "funds_source": "INTERNAL",
|
1122
|
-
# "time": "2020-04-22T09:57:47Z",
|
1123
|
-
# "currency": "BTC",
|
1124
|
-
# "fee_amount": "0.0",
|
1125
|
-
# "fee_currency": "BTC"
|
1126
|
-
# },
|
1127
|
-
# {
|
1128
|
-
# "transaction_id": "79793d00-2899-4a4d-95b7-73ae6b31384f",
|
1129
|
-
# "account_id": "c2d0076a-c20d-41f8-9e9a-1a1d028b2b58",
|
1130
|
-
# "time": "2020-05-05T11:22:07.925Z",
|
1131
|
-
# "currency": "EUR",
|
1132
|
-
# "funds_source": "EXTERNAL",
|
1133
|
-
# "type": "FIAT",
|
1134
|
-
# "amount": "50.0",
|
1135
|
-
# "fee_amount": "0.01",
|
1136
|
-
# "fee_currency": "EUR"
|
1137
|
-
# }
|
1138
|
-
# ],
|
1139
|
-
# "max_page_size": 2,
|
1140
|
-
# "cursor": "eyJhY2NvdW50X2lkIjp7InMiOiJlMzY5YWM4MC00NTc3LTExZTktYWUwOC05YmVkYzQ3OTBiODQiLCJzcyI6W10sIm5zIjpbXSwiYnMiOltdLCJtIjp7fSwibCI6W119LCJpdGVtX2tleSI6eyJzIjoiV0lUSERSQVdBTDo6MmFlMjYwY2ItOTk3MC00YmNiLTgxNmEtZGY4MDVmY2VhZTY1Iiwic3MiOltdLCJucyI6W10sImJzIjpbXSwibSI6e30sImwiOltdfSwiZ2xvYmFsX3dpdGhkcmF3YWxfaW5kZXhfaGFzaF9rZXkiOnsicyI6ImUzNjlhYzgwLTQ1NzctMTFlOS1hZTA4LTliZWRjNDc5MGI4NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX0sInRpbWVzdGFtcCI6eyJuIjoiMTU4ODA1ODc2Nzk0OCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX19"
|
1141
|
-
# }
|
1142
|
-
#
|
1143
|
-
depositHistory = self.safe_list(response, 'deposit_history', [])
|
1144
|
-
return self.parse_transactions(depositHistory, currency, since, limit, {'type': 'deposit'})
|
1145
|
-
|
1146
|
-
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1147
|
-
"""
|
1148
|
-
fetch all withdrawals made from an account
|
1149
|
-
:param str code: unified currency code
|
1150
|
-
:param int [since]: the earliest time in ms to fetch withdrawals for
|
1151
|
-
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
1152
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1153
|
-
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1154
|
-
"""
|
1155
|
-
self.load_markets()
|
1156
|
-
request: dict = {
|
1157
|
-
# 'cursor': 'string', # pointer specifying the position from which the next pages should be returned
|
1158
|
-
}
|
1159
|
-
currency = None
|
1160
|
-
if code is not None:
|
1161
|
-
currency = self.currency(code)
|
1162
|
-
request['currency_code'] = currency['id']
|
1163
|
-
if limit is not None:
|
1164
|
-
request['max_page_size'] = limit
|
1165
|
-
if since is not None:
|
1166
|
-
to = self.safe_string(params, 'to')
|
1167
|
-
if to is None:
|
1168
|
-
raise ArgumentsRequired(self.id + ' fetchWithdrawals() requires a "to" iso8601 string param with the since argument is specified')
|
1169
|
-
request['from'] = self.iso8601(since)
|
1170
|
-
response = self.privateGetAccountWithdrawals(self.extend(request, params))
|
1171
|
-
#
|
1172
|
-
# {
|
1173
|
-
# "withdrawal_history": [
|
1174
|
-
# {
|
1175
|
-
# "account_id": "e369ac80-4577-11e9-ae08-9bedc4790b84",
|
1176
|
-
# "amount": "0.1",
|
1177
|
-
# "currency": "BTC",
|
1178
|
-
# "fee_amount": "0.00002",
|
1179
|
-
# "fee_currency": "BTC",
|
1180
|
-
# "funds_source": "EXTERNAL",
|
1181
|
-
# "related_transaction_id": "e298341a-3855-405e-bce3-92db368a3157",
|
1182
|
-
# "time": "2020-05-05T11:11:32.110Z",
|
1183
|
-
# "transaction_id": "6693ff40-bb10-4dcf-ada7-3b287727c882",
|
1184
|
-
# "type": "CRYPTO"
|
1185
|
-
# },
|
1186
|
-
# {
|
1187
|
-
# "account_id": "e369ac80-4577-11e9-ae08-9bedc4790b84",
|
1188
|
-
# "amount": "0.1",
|
1189
|
-
# "currency": "BTC",
|
1190
|
-
# "fee_amount": "0.0",
|
1191
|
-
# "fee_currency": "BTC",
|
1192
|
-
# "funds_source": "INTERNAL",
|
1193
|
-
# "time": "2020-05-05T10:29:53.464Z",
|
1194
|
-
# "transaction_id": "ec9703b1-954b-4f76-adea-faac66eabc0b",
|
1195
|
-
# "type": "CRYPTO"
|
1196
|
-
# }
|
1197
|
-
# ],
|
1198
|
-
# "cursor": "eyJhY2NvdW50X2lkIjp7InMiOiJlMzY5YWM4MC00NTc3LTExZTktYWUwOC05YmVkYzQ3OTBiODQiLCJzcyI6W10sIm5zIjpbXSwiYnMiOltdLCJtIjp7fSwibCI6W119LCJpdGVtX2tleSI6eyJzIjoiV0lUSERSQVdBTDo6ZWM5NzAzYjEtOTU0Yi00Zjc2LWFkZWEtZmFhYzY2ZWFiYzBiIiwic3MiOltdLCJucyI6W10sImJzIjpbXSwibSI6e30sImwiOltdfSwiZ2xvYmFsX3dpdGhkcmF3YWxfaW5kZXhfaGFzaF9rZXkiOnsicyI6ImUzNjlhYzgwLTQ1NzctMTFlOS1hZTA4LTliZWRjNDc5MGI4NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX0sInRpbWVzdGFtcCI6eyJuIjoiMTU4ODY3NDU5MzQ2NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX19",
|
1199
|
-
# "max_page_size": 2
|
1200
|
-
# }
|
1201
|
-
#
|
1202
|
-
withdrawalHistory = self.safe_list(response, 'withdrawal_history', [])
|
1203
|
-
return self.parse_transactions(withdrawalHistory, currency, since, limit, {'type': 'withdrawal'})
|
1204
|
-
|
1205
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1206
|
-
"""
|
1207
|
-
make a withdrawal
|
1208
|
-
:param str code: unified currency code
|
1209
|
-
:param float amount: the amount to withdraw
|
1210
|
-
:param str address: the address to withdraw to
|
1211
|
-
:param str tag:
|
1212
|
-
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1213
|
-
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1214
|
-
"""
|
1215
|
-
tag, params = self.handle_withdraw_tag_and_params(tag, params)
|
1216
|
-
self.check_address(address)
|
1217
|
-
self.load_markets()
|
1218
|
-
currency = self.currency(code)
|
1219
|
-
request: dict = {
|
1220
|
-
'currency': code,
|
1221
|
-
'amount': self.currency_to_precision(code, amount),
|
1222
|
-
# 'payout_account_id': '66756a10-3e86-48f4-9678-b634c4b135b2', # fiat only
|
1223
|
-
# 'recipient': { # crypto only
|
1224
|
-
# 'address': address,
|
1225
|
-
# # 'destination_tag': '',
|
1226
|
-
# },
|
1227
|
-
}
|
1228
|
-
options = self.safe_value(self.options, 'fiat', [])
|
1229
|
-
isFiat = self.in_array(code, options)
|
1230
|
-
method = 'privatePostAccountWithdrawFiat' if isFiat else 'privatePostAccountWithdrawCrypto'
|
1231
|
-
if isFiat:
|
1232
|
-
payoutAccountId = self.safe_string(params, 'payout_account_id')
|
1233
|
-
if payoutAccountId is None:
|
1234
|
-
raise ArgumentsRequired(self.id + ' withdraw() requires a payout_account_id param for fiat ' + code + ' withdrawals')
|
1235
|
-
else:
|
1236
|
-
recipient: dict = {'address': address}
|
1237
|
-
if tag is not None:
|
1238
|
-
recipient['destination_tag'] = tag
|
1239
|
-
request['recipient'] = recipient
|
1240
|
-
response = getattr(self, method)(self.extend(request, params))
|
1241
|
-
#
|
1242
|
-
# crypto
|
1243
|
-
#
|
1244
|
-
# {
|
1245
|
-
# "amount": "1234.5678",
|
1246
|
-
# "fee": "1234.5678",
|
1247
|
-
# "recipient": "3NacQ7rzZdhfyAtfJ5a11k8jFPdcMP2Bq7",
|
1248
|
-
# "destination_tag": "",
|
1249
|
-
# "transaction_id": "d0f8529f-f832-4e6a-9dc5-b8d5797badb2"
|
1250
|
-
# }
|
1251
|
-
#
|
1252
|
-
# fiat
|
1253
|
-
#
|
1254
|
-
# {
|
1255
|
-
# "transaction_id": "54236cd0-4413-11e9-93fb-5fea7e5b5df6"
|
1256
|
-
# }
|
1257
|
-
#
|
1258
|
-
return self.parse_transaction(response, currency)
|
1259
|
-
|
1260
|
-
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1261
|
-
#
|
1262
|
-
# fetchDeposits, fetchWithdrawals
|
1263
|
-
#
|
1264
|
-
# {
|
1265
|
-
# "transaction_id": "C2b42efcd-d5b7-4a56-8e12-b69ffd68c5ef",
|
1266
|
-
# "type": "FIAT",
|
1267
|
-
# "account_id": "c2d0076a-c20d-41f8-9e9a-1a1d028b2b58",
|
1268
|
-
# "amount": "1234.5678",
|
1269
|
-
# "time": "2019-08-24T14:15:22Z",
|
1270
|
-
# "funds_source": "INTERNAL",
|
1271
|
-
# "currency": "BTC",
|
1272
|
-
# "fee_amount": "1234.5678",
|
1273
|
-
# "fee_currency": "BTC",
|
1274
|
-
# "blockchain_transaction_id": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
|
1275
|
-
# "related_transaction_id": "e298341a-3855-405e-bce3-92db368a3157"
|
1276
|
-
# }
|
1277
|
-
#
|
1278
|
-
# withdraw
|
1279
|
-
#
|
1280
|
-
#
|
1281
|
-
# crypto
|
1282
|
-
#
|
1283
|
-
# {
|
1284
|
-
# "amount": "1234.5678",
|
1285
|
-
# "fee": "1234.5678",
|
1286
|
-
# "recipient": "3NacQ7rzZdhfyAtfJ5a11k8jFPdcMP2Bq7",
|
1287
|
-
# "destination_tag": "",
|
1288
|
-
# "transaction_id": "d0f8529f-f832-4e6a-9dc5-b8d5797badb2"
|
1289
|
-
# }
|
1290
|
-
#
|
1291
|
-
# fiat
|
1292
|
-
#
|
1293
|
-
# {
|
1294
|
-
# "transaction_id": "54236cd0-4413-11e9-93fb-5fea7e5b5df6"
|
1295
|
-
# }
|
1296
|
-
#
|
1297
|
-
id = self.safe_string(transaction, 'transaction_id')
|
1298
|
-
amount = self.safe_number(transaction, 'amount')
|
1299
|
-
timestamp = self.parse8601(self.safe_string(transaction, 'time'))
|
1300
|
-
currencyId = self.safe_string(transaction, 'currency')
|
1301
|
-
currency = self.safe_currency(currencyId, currency)
|
1302
|
-
status = 'ok' # the exchange returns cleared transactions only
|
1303
|
-
feeCost = self.safe_number_2(transaction, 'fee_amount', 'fee')
|
1304
|
-
fee = None
|
1305
|
-
addressTo = self.safe_string(transaction, 'recipient')
|
1306
|
-
tagTo = self.safe_string(transaction, 'destination_tag')
|
1307
|
-
if feeCost is not None:
|
1308
|
-
feeCurrencyId = self.safe_string(transaction, 'fee_currency', currencyId)
|
1309
|
-
feeCurrencyCode = self.safe_currency_code(feeCurrencyId)
|
1310
|
-
fee = {
|
1311
|
-
'cost': feeCost,
|
1312
|
-
'currency': feeCurrencyCode,
|
1313
|
-
}
|
1314
|
-
return {
|
1315
|
-
'info': transaction,
|
1316
|
-
'id': id,
|
1317
|
-
'currency': currency['code'],
|
1318
|
-
'amount': amount,
|
1319
|
-
'network': None,
|
1320
|
-
'address': addressTo,
|
1321
|
-
'addressFrom': None,
|
1322
|
-
'addressTo': addressTo,
|
1323
|
-
'tag': tagTo,
|
1324
|
-
'tagFrom': None,
|
1325
|
-
'tagTo': tagTo,
|
1326
|
-
'status': status,
|
1327
|
-
'type': None,
|
1328
|
-
'updated': None,
|
1329
|
-
'txid': self.safe_string(transaction, 'blockchain_transaction_id'),
|
1330
|
-
'comment': None,
|
1331
|
-
'internal': None,
|
1332
|
-
'timestamp': timestamp,
|
1333
|
-
'datetime': self.iso8601(timestamp),
|
1334
|
-
'fee': fee,
|
1335
|
-
}
|
1336
|
-
|
1337
991
|
def parse_order_status(self, status: Str):
|
1338
992
|
statuses: dict = {
|
1339
993
|
'FILLED': 'open',
|
@@ -1535,6 +1189,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1535
1189
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1536
1190
|
"""
|
1537
1191
|
cancels an open order
|
1192
|
+
|
1193
|
+
https://docs.onetrading.com/#close-order-by-order-id
|
1194
|
+
|
1538
1195
|
:param str id: order id
|
1539
1196
|
:param str symbol: not used by bitmex cancelOrder()
|
1540
1197
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1559,6 +1216,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1559
1216
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1560
1217
|
"""
|
1561
1218
|
cancel all open orders
|
1219
|
+
|
1220
|
+
https://docs.onetrading.com/#close-all-orders
|
1221
|
+
|
1562
1222
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1563
1223
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1564
1224
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1579,6 +1239,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1579
1239
|
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1580
1240
|
"""
|
1581
1241
|
cancel multiple orders
|
1242
|
+
|
1243
|
+
https://docs.onetrading.com/#close-all-orders
|
1244
|
+
|
1582
1245
|
:param str[] ids: order ids
|
1583
1246
|
:param str symbol: unified market symbol, default is None
|
1584
1247
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1599,6 +1262,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1599
1262
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1600
1263
|
"""
|
1601
1264
|
fetches information on an order made by the user
|
1265
|
+
|
1266
|
+
https://docs.onetrading.com/#get-order
|
1267
|
+
|
1602
1268
|
:param str id: the order id
|
1603
1269
|
:param str symbol: not used by onetrading fetchOrder
|
1604
1270
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1655,6 +1321,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1655
1321
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1656
1322
|
"""
|
1657
1323
|
fetch all unfilled currently open orders
|
1324
|
+
|
1325
|
+
https://docs.onetrading.com/#get-orders
|
1326
|
+
|
1658
1327
|
:param str symbol: unified market symbol
|
1659
1328
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1660
1329
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -1769,6 +1438,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1769
1438
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1770
1439
|
"""
|
1771
1440
|
fetches information on multiple closed orders made by the user
|
1441
|
+
|
1442
|
+
https://docs.onetrading.com/#get-orders
|
1443
|
+
|
1772
1444
|
:param str symbol: unified market symbol of the market orders were made in
|
1773
1445
|
:param int [since]: the earliest time in ms to fetch orders for
|
1774
1446
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -1783,6 +1455,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1783
1455
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1784
1456
|
"""
|
1785
1457
|
fetch all the trades made from a single order
|
1458
|
+
|
1459
|
+
https://docs.onetrading.com/#trades-for-order
|
1460
|
+
|
1786
1461
|
:param str id: order id
|
1787
1462
|
:param str symbol: unified market symbol
|
1788
1463
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -1838,6 +1513,9 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1838
1513
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1839
1514
|
"""
|
1840
1515
|
fetch all trades made by the user
|
1516
|
+
|
1517
|
+
https://docs.onetrading.com/#all-trades
|
1518
|
+
|
1841
1519
|
:param str symbol: unified market symbol
|
1842
1520
|
:param int [since]: the earliest time in ms to fetch trades for
|
1843
1521
|
:param int [limit]: the maximum number of trades structures to retrieve
|
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.4.
|
7
|
+
__version__ = '4.4.36'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -46,6 +46,7 @@ from ccxt.pro.coinex import coinex # noqa
|
|
46
46
|
from ccxt.pro.coinone import coinone # noqa: F401
|
47
47
|
from ccxt.pro.cryptocom import cryptocom # noqa: F401
|
48
48
|
from ccxt.pro.currencycom import currencycom # noqa: F401
|
49
|
+
from ccxt.pro.defx import defx # noqa: F401
|
49
50
|
from ccxt.pro.deribit import deribit # noqa: F401
|
50
51
|
from ccxt.pro.exmo import exmo # noqa: F401
|
51
52
|
from ccxt.pro.gate import gate # noqa: F401
|
@@ -121,6 +122,7 @@ exchanges = [
|
|
121
122
|
'coinone',
|
122
123
|
'cryptocom',
|
123
124
|
'currencycom',
|
125
|
+
'defx',
|
124
126
|
'deribit',
|
125
127
|
'exmo',
|
126
128
|
'gate',
|
ccxt/pro/bitrue.py
CHANGED
@@ -36,15 +36,17 @@ class bitrue(ccxt.async_support.bitrue):
|
|
36
36
|
},
|
37
37
|
'api': {
|
38
38
|
'open': {
|
39
|
-
'
|
40
|
-
'
|
41
|
-
'
|
42
|
-
|
43
|
-
|
44
|
-
'
|
45
|
-
|
46
|
-
|
47
|
-
'
|
39
|
+
'v1': {
|
40
|
+
'private': {
|
41
|
+
'post': {
|
42
|
+
'poseidon/api/v1/listenKey': 1,
|
43
|
+
},
|
44
|
+
'put': {
|
45
|
+
'poseidon/api/v1/listenKey/{listenKey}': 1,
|
46
|
+
},
|
47
|
+
'delete': {
|
48
|
+
'poseidon/api/v1/listenKey/{listenKey}': 1,
|
49
|
+
},
|
48
50
|
},
|
49
51
|
},
|
50
52
|
},
|
@@ -405,7 +407,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
405
407
|
async def authenticate(self, params={}):
|
406
408
|
listenKey = self.safe_value(self.options, 'listenKey')
|
407
409
|
if listenKey is None:
|
408
|
-
response = await self.
|
410
|
+
response = await self.openV1PrivatePostPoseidonApiV1ListenKey(params)
|
409
411
|
#
|
410
412
|
# {
|
411
413
|
# "msg": "succ",
|
@@ -429,7 +431,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
429
431
|
'listenKey': listenKey,
|
430
432
|
}
|
431
433
|
try:
|
432
|
-
await self.
|
434
|
+
await self.openV1PrivatePutPoseidonApiV1ListenKeyListenKey(self.extend(request, params))
|
433
435
|
#
|
434
436
|
# ಠ_ಠ
|
435
437
|
# {
|