ccxt 4.4.67__py2.py3-none-any.whl → 4.4.69__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/paradex.py +23 -0
- ccxt/abstract/tradeogre.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +10 -5
- ccxt/async_support/binance.py +16 -2
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bitstamp.py +2 -3
- ccxt/async_support/bybit.py +1 -1
- ccxt/async_support/coinbase.py +69 -2
- ccxt/async_support/cryptomus.py +122 -6
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/luno.py +113 -1
- ccxt/async_support/paradex.py +173 -5
- ccxt/async_support/phemex.py +2 -2
- ccxt/async_support/tradeogre.py +14 -9
- ccxt/async_support/whitebit.py +210 -2
- ccxt/base/exchange.py +6 -4
- ccxt/binance.py +16 -2
- ccxt/bitrue.py +1 -1
- ccxt/bitstamp.py +2 -3
- ccxt/bybit.py +1 -1
- ccxt/coinbase.py +69 -2
- ccxt/cryptomus.py +122 -6
- ccxt/hyperliquid.py +1 -1
- ccxt/luno.py +113 -1
- ccxt/paradex.py +173 -5
- ccxt/phemex.py +2 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/test/tests_async.py +22 -0
- ccxt/test/tests_sync.py +22 -0
- ccxt/tradeogre.py +14 -9
- ccxt/whitebit.py +210 -2
- {ccxt-4.4.67.dist-info → ccxt-4.4.69.dist-info}/METADATA +6 -6
- {ccxt-4.4.67.dist-info → ccxt-4.4.69.dist-info}/RECORD +38 -38
- {ccxt-4.4.67.dist-info → ccxt-4.4.69.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.67.dist-info → ccxt-4.4.69.dist-info}/WHEEL +0 -0
- {ccxt-4.4.67.dist-info → ccxt-4.4.69.dist-info}/top_level.txt +0 -0
ccxt/async_support/luno.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.luno import ImplicitAPI
|
8
|
-
from ccxt.base.types import Account, Any, Balances, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface
|
8
|
+
from ccxt.base.types import Account, Any, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -35,6 +35,7 @@ class luno(Exchange, ImplicitAPI):
|
|
35
35
|
'cancelOrder': True,
|
36
36
|
'closeAllPositions': False,
|
37
37
|
'closePosition': False,
|
38
|
+
'createDepositAddress': True,
|
38
39
|
'createOrder': True,
|
39
40
|
'createReduceOnlyOrder': False,
|
40
41
|
'fetchAccounts': True,
|
@@ -43,6 +44,7 @@ class luno(Exchange, ImplicitAPI):
|
|
43
44
|
'fetchClosedOrders': True,
|
44
45
|
'fetchCrossBorrowRate': False,
|
45
46
|
'fetchCrossBorrowRates': False,
|
47
|
+
'fetchDepositAddress': True,
|
46
48
|
'fetchFundingHistory': False,
|
47
49
|
'fetchFundingRate': False,
|
48
50
|
'fetchFundingRateHistory': False,
|
@@ -1158,6 +1160,116 @@ class luno(Exchange, ImplicitAPI):
|
|
1158
1160
|
'fee': None,
|
1159
1161
|
}, currency)
|
1160
1162
|
|
1163
|
+
async def create_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1164
|
+
"""
|
1165
|
+
create a currency deposit address
|
1166
|
+
|
1167
|
+
https://www.luno.com/en/developers/api#tag/Receive/operation/createFundingAddress
|
1168
|
+
|
1169
|
+
:param str code: unified currency code of the currency for the deposit address
|
1170
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1171
|
+
:param str [params.name]: an optional name for the new address
|
1172
|
+
:param int [params.account_id]: an optional account id for the new address
|
1173
|
+
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
1174
|
+
"""
|
1175
|
+
await self.load_markets()
|
1176
|
+
currency = self.currency(code)
|
1177
|
+
request: dict = {
|
1178
|
+
'asset': currency['id'],
|
1179
|
+
}
|
1180
|
+
response = await self.privatePostFundingAddress(self.extend(request, params))
|
1181
|
+
#
|
1182
|
+
# {
|
1183
|
+
# "account_id": "string",
|
1184
|
+
# "address": "string",
|
1185
|
+
# "address_meta": [
|
1186
|
+
# {
|
1187
|
+
# "label": "string",
|
1188
|
+
# "value": "string"
|
1189
|
+
# }
|
1190
|
+
# ],
|
1191
|
+
# "asset": "string",
|
1192
|
+
# "assigned_at": 0,
|
1193
|
+
# "name": "string",
|
1194
|
+
# "network": 0,
|
1195
|
+
# "qr_code_uri": "string",
|
1196
|
+
# "receive_fee": "string",
|
1197
|
+
# "total_received": "string",
|
1198
|
+
# "total_unconfirmed": "string"
|
1199
|
+
# }
|
1200
|
+
#
|
1201
|
+
return self.parse_deposit_address(response, currency)
|
1202
|
+
|
1203
|
+
async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1204
|
+
"""
|
1205
|
+
fetch the deposit address for a currency associated with self account
|
1206
|
+
|
1207
|
+
https://www.luno.com/en/developers/api#tag/Receive/operation/getFundingAddress
|
1208
|
+
|
1209
|
+
:param str code: unified currency code
|
1210
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1211
|
+
:param str [params.address]: a specific cryptocurrency address to retrieve
|
1212
|
+
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
1213
|
+
"""
|
1214
|
+
await self.load_markets()
|
1215
|
+
currency = self.currency(code)
|
1216
|
+
request: dict = {
|
1217
|
+
'asset': currency['id'],
|
1218
|
+
}
|
1219
|
+
response = await self.privateGetFundingAddress(self.extend(request, params))
|
1220
|
+
#
|
1221
|
+
# {
|
1222
|
+
# "account_id": "string",
|
1223
|
+
# "address": "string",
|
1224
|
+
# "address_meta": [
|
1225
|
+
# {
|
1226
|
+
# "label": "string",
|
1227
|
+
# "value": "string"
|
1228
|
+
# }
|
1229
|
+
# ],
|
1230
|
+
# "asset": "string",
|
1231
|
+
# "assigned_at": 0,
|
1232
|
+
# "name": "string",
|
1233
|
+
# "network": 0,
|
1234
|
+
# "qr_code_uri": "string",
|
1235
|
+
# "receive_fee": "string",
|
1236
|
+
# "total_received": "string",
|
1237
|
+
# "total_unconfirmed": "string"
|
1238
|
+
# }
|
1239
|
+
#
|
1240
|
+
return self.parse_deposit_address(response, currency)
|
1241
|
+
|
1242
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
|
1243
|
+
#
|
1244
|
+
# {
|
1245
|
+
# "account_id": "string",
|
1246
|
+
# "address": "string",
|
1247
|
+
# "address_meta": [
|
1248
|
+
# {
|
1249
|
+
# "label": "string",
|
1250
|
+
# "value": "string"
|
1251
|
+
# }
|
1252
|
+
# ],
|
1253
|
+
# "asset": "string",
|
1254
|
+
# "assigned_at": 0,
|
1255
|
+
# "name": "string",
|
1256
|
+
# "network": 0,
|
1257
|
+
# "qr_code_uri": "string",
|
1258
|
+
# "receive_fee": "string",
|
1259
|
+
# "total_received": "string",
|
1260
|
+
# "total_unconfirmed": "string"
|
1261
|
+
# }
|
1262
|
+
#
|
1263
|
+
currencyId = self.safe_string_upper(depositAddress, 'currency')
|
1264
|
+
code = self.safe_currency_code(currencyId, currency)
|
1265
|
+
return {
|
1266
|
+
'info': depositAddress,
|
1267
|
+
'currency': code,
|
1268
|
+
'network': None,
|
1269
|
+
'address': self.safe_string(depositAddress, 'address'),
|
1270
|
+
'tag': self.safe_string(depositAddress, 'name'),
|
1271
|
+
}
|
1272
|
+
|
1161
1273
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
1162
1274
|
url = self.urls['api'][api] + '/' + self.version + '/' + self.implode_params(path, params)
|
1163
1275
|
query = self.omit(params, self.extract_params(path))
|
ccxt/async_support/paradex.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.paradex import ImplicitAPI
|
8
|
-
from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
8
|
+
from ccxt.base.types import Any, Balances, Currency, Int, Leverage, MarginMode, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -79,10 +79,10 @@ class paradex(Exchange, ImplicitAPI):
|
|
79
79
|
'fetchIsolatedBorrowRate': False,
|
80
80
|
'fetchIsolatedBorrowRates': False,
|
81
81
|
'fetchLedger': False,
|
82
|
-
'fetchLeverage':
|
82
|
+
'fetchLeverage': True,
|
83
83
|
'fetchLeverageTiers': False,
|
84
84
|
'fetchLiquidations': True,
|
85
|
-
'fetchMarginMode':
|
85
|
+
'fetchMarginMode': True,
|
86
86
|
'fetchMarketLeverageTiers': False,
|
87
87
|
'fetchMarkets': True,
|
88
88
|
'fetchMarkOHLCV': False,
|
@@ -116,8 +116,8 @@ class paradex(Exchange, ImplicitAPI):
|
|
116
116
|
'repayCrossMargin': False,
|
117
117
|
'repayIsolatedMargin': False,
|
118
118
|
'sandbox': True,
|
119
|
-
'setLeverage':
|
120
|
-
'setMarginMode':
|
119
|
+
'setLeverage': True,
|
120
|
+
'setMarginMode': True,
|
121
121
|
'setPositionMode': False,
|
122
122
|
'transfer': False,
|
123
123
|
'withdraw': False,
|
@@ -159,12 +159,23 @@ class paradex(Exchange, ImplicitAPI):
|
|
159
159
|
'system/state': 1,
|
160
160
|
'system/time': 1,
|
161
161
|
'trades': 1,
|
162
|
+
'vaults': 1,
|
163
|
+
'vaults/balance': 1,
|
164
|
+
'vaults/config': 1,
|
165
|
+
'vaults/history': 1,
|
166
|
+
'vaults/positions': 1,
|
167
|
+
'vaults/summary': 1,
|
168
|
+
'vaults/transfers': 1,
|
162
169
|
},
|
163
170
|
},
|
164
171
|
'private': {
|
165
172
|
'get': {
|
166
173
|
'account': 1,
|
174
|
+
'account/info': 1,
|
175
|
+
'account/history': 1,
|
176
|
+
'account/margin': 1,
|
167
177
|
'account/profile': 1,
|
178
|
+
'account/subaccounts': 1,
|
168
179
|
'balance': 1,
|
169
180
|
'fills': 1,
|
170
181
|
'funding/payments': 1,
|
@@ -177,20 +188,34 @@ class paradex(Exchange, ImplicitAPI):
|
|
177
188
|
'orders/by_client_id/{client_id}': 1,
|
178
189
|
'orders/{order_id}': 1,
|
179
190
|
'points_data/{market}/{program}': 1,
|
191
|
+
'referrals/qr-code': 1,
|
180
192
|
'referrals/summary': 1,
|
181
193
|
'transfers': 1,
|
194
|
+
'algo/orders': 1,
|
195
|
+
'algo/orders-history': 1,
|
196
|
+
'algo/orders/{algo_id}': 1,
|
197
|
+
'vaults/account-summary': 1,
|
182
198
|
},
|
183
199
|
'post': {
|
200
|
+
'account/margin/{market}': 1,
|
201
|
+
'account/profile/max_slippage': 1,
|
184
202
|
'account/profile/referral_code': 1,
|
185
203
|
'account/profile/username': 1,
|
186
204
|
'auth': 1,
|
187
205
|
'onboarding': 1,
|
188
206
|
'orders': 1,
|
207
|
+
'orders/batch': 1,
|
208
|
+
'algo/orders': 1,
|
209
|
+
'vaults': 1,
|
210
|
+
},
|
211
|
+
'put': {
|
212
|
+
'orders/{order_id}': 1,
|
189
213
|
},
|
190
214
|
'delete': {
|
191
215
|
'orders': 1,
|
192
216
|
'orders/by_client_id/{client_id}': 1,
|
193
217
|
'orders/{order_id}': 1,
|
218
|
+
'algo/orders/{algo_id}': 1,
|
194
219
|
},
|
195
220
|
},
|
196
221
|
},
|
@@ -2063,6 +2088,149 @@ class paradex(Exchange, ImplicitAPI):
|
|
2063
2088
|
}
|
2064
2089
|
return self.safe_string(statuses, status, status)
|
2065
2090
|
|
2091
|
+
async def fetch_margin_mode(self, symbol: str, params={}) -> MarginMode:
|
2092
|
+
"""
|
2093
|
+
fetches the margin mode of a specific symbol
|
2094
|
+
|
2095
|
+
https://docs.api.testnet.paradex.trade/#get-account-margin-configuration
|
2096
|
+
|
2097
|
+
:param str symbol: unified symbol of the market the order was made in
|
2098
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2099
|
+
:returns dict: a `margin mode structure <https://docs.ccxt.com/#/?id=margin-mode-structure>`
|
2100
|
+
"""
|
2101
|
+
await self.authenticate_rest()
|
2102
|
+
await self.load_markets()
|
2103
|
+
market = self.market(symbol)
|
2104
|
+
request: dict = {
|
2105
|
+
'market': market['id'],
|
2106
|
+
}
|
2107
|
+
response = await self.privateGetAccountMargin(self.extend(request, params))
|
2108
|
+
#
|
2109
|
+
# {
|
2110
|
+
# "account": "0x6343248026a845b39a8a73fbe9c7ef0a841db31ed5c61ec1446aa9d25e54dbc",
|
2111
|
+
# "configs": [
|
2112
|
+
# {
|
2113
|
+
# "market": "SOL-USD-PERP",
|
2114
|
+
# "leverage": 50,
|
2115
|
+
# "margin_type": "CROSS"
|
2116
|
+
# }
|
2117
|
+
# ]
|
2118
|
+
# }
|
2119
|
+
#
|
2120
|
+
configs = self.safe_list(response, 'configs')
|
2121
|
+
return self.parse_margin_mode(self.safe_dict(configs, 0), market)
|
2122
|
+
|
2123
|
+
def parse_margin_mode(self, rawMarginMode: dict, market=None) -> MarginMode:
|
2124
|
+
marketId = self.safe_string(rawMarginMode, 'market')
|
2125
|
+
market = self.safe_market(marketId, market)
|
2126
|
+
marginMode = self.safe_string_lower(rawMarginMode, 'margin_type')
|
2127
|
+
return {
|
2128
|
+
'info': rawMarginMode,
|
2129
|
+
'symbol': market['symbol'],
|
2130
|
+
'marginMode': marginMode,
|
2131
|
+
}
|
2132
|
+
|
2133
|
+
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
2134
|
+
"""
|
2135
|
+
set margin mode to 'cross' or 'isolated'
|
2136
|
+
|
2137
|
+
https://docs.api.testnet.paradex.trade/#set-margin-configuration
|
2138
|
+
|
2139
|
+
:param str marginMode: 'cross' or 'isolated'
|
2140
|
+
:param str symbol: unified market symbol
|
2141
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2142
|
+
:param float [params.leverage]: the rate of leverage
|
2143
|
+
:returns dict: response from the exchange
|
2144
|
+
"""
|
2145
|
+
self.check_required_argument('setMarginMode', symbol, 'symbol')
|
2146
|
+
await self.authenticate_rest()
|
2147
|
+
await self.load_markets()
|
2148
|
+
market: Market = self.market(symbol)
|
2149
|
+
leverage: Str = None
|
2150
|
+
leverage, params = self.handle_option_and_params(params, 'setMarginMode', 'leverage', 1)
|
2151
|
+
request: dict = {
|
2152
|
+
'market': market['id'],
|
2153
|
+
'leverage': leverage,
|
2154
|
+
'margin_type': self.encode_margin_mode(marginMode),
|
2155
|
+
}
|
2156
|
+
return await self.privatePostAccountMarginMarket(self.extend(request, params))
|
2157
|
+
|
2158
|
+
async def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
2159
|
+
"""
|
2160
|
+
fetch the set leverage for a market
|
2161
|
+
|
2162
|
+
https://docs.api.testnet.paradex.trade/#get-account-margin-configuration
|
2163
|
+
|
2164
|
+
:param str symbol: unified market symbol
|
2165
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2166
|
+
:returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
|
2167
|
+
"""
|
2168
|
+
await self.authenticate_rest()
|
2169
|
+
await self.load_markets()
|
2170
|
+
market = self.market(symbol)
|
2171
|
+
request: dict = {
|
2172
|
+
'market': market['id'],
|
2173
|
+
}
|
2174
|
+
response = await self.privateGetAccountMargin(self.extend(request, params))
|
2175
|
+
#
|
2176
|
+
# {
|
2177
|
+
# "account": "0x6343248026a845b39a8a73fbe9c7ef0a841db31ed5c61ec1446aa9d25e54dbc",
|
2178
|
+
# "configs": [
|
2179
|
+
# {
|
2180
|
+
# "market": "SOL-USD-PERP",
|
2181
|
+
# "leverage": 50,
|
2182
|
+
# "margin_type": "CROSS"
|
2183
|
+
# }
|
2184
|
+
# ]
|
2185
|
+
# }
|
2186
|
+
#
|
2187
|
+
configs = self.safe_list(response, 'configs')
|
2188
|
+
return self.parse_leverage(self.safe_dict(configs, 0), market)
|
2189
|
+
|
2190
|
+
def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
|
2191
|
+
marketId = self.safe_string(leverage, 'market')
|
2192
|
+
market = self.safe_market(marketId, market)
|
2193
|
+
marginMode = self.safe_string_lower(leverage, 'margin_type')
|
2194
|
+
return {
|
2195
|
+
'info': leverage,
|
2196
|
+
'symbol': self.safe_symbol(marketId, market),
|
2197
|
+
'marginMode': marginMode,
|
2198
|
+
'longLeverage': self.safe_integer(leverage, 'leverage'),
|
2199
|
+
'shortLeverage': self.safe_integer(leverage, 'leverage'),
|
2200
|
+
}
|
2201
|
+
|
2202
|
+
def encode_margin_mode(self, mode):
|
2203
|
+
modes = {
|
2204
|
+
'cross': 'CROSS',
|
2205
|
+
'isolated': 'ISOLATED',
|
2206
|
+
}
|
2207
|
+
return self.safe_string(modes, mode, mode)
|
2208
|
+
|
2209
|
+
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
2210
|
+
"""
|
2211
|
+
set the level of leverage for a market
|
2212
|
+
|
2213
|
+
https://docs.api.testnet.paradex.trade/#set-margin-configuration
|
2214
|
+
|
2215
|
+
:param float leverage: the rate of leverage
|
2216
|
+
:param str [symbol]: unified market symbol(is mandatory for swap markets)
|
2217
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2218
|
+
:param str [params.marginMode]: 'cross' or 'isolated'
|
2219
|
+
:returns dict: response from the exchange
|
2220
|
+
"""
|
2221
|
+
self.check_required_argument('setLeverage', symbol, 'symbol')
|
2222
|
+
await self.authenticate_rest()
|
2223
|
+
await self.load_markets()
|
2224
|
+
market: Market = self.market(symbol)
|
2225
|
+
marginMode: Str = None
|
2226
|
+
marginMode, params = self.handle_margin_mode_and_params('setLeverage', params, 'cross')
|
2227
|
+
request: dict = {
|
2228
|
+
'market': market['id'],
|
2229
|
+
'leverage': leverage,
|
2230
|
+
'margin_type': self.encode_margin_mode(marginMode),
|
2231
|
+
}
|
2232
|
+
return await self.privatePostAccountMarginMarket(self.extend(request, params))
|
2233
|
+
|
2066
2234
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
2067
2235
|
url = self.implode_hostname(self.urls['api'][self.version]) + '/' + self.implode_params(path, params)
|
2068
2236
|
query = self.omit(params, self.extract_params(path))
|
ccxt/async_support/phemex.py
CHANGED
@@ -3581,14 +3581,14 @@ class phemex(Exchange, ImplicitAPI):
|
|
3581
3581
|
|
3582
3582
|
:param str[] [symbols]: list of unified market symbols
|
3583
3583
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3584
|
-
:param str [params.code]: the currency code to fetch positions for, USD, BTC or USDT,
|
3584
|
+
:param str [params.code]: the currency code to fetch positions for, USD, BTC or USDT, USDT is the default
|
3585
3585
|
:param str [params.method]: *USDT contracts only* 'privateGetGAccountsAccountPositions' or 'privateGetAccountsPositions' default is 'privateGetGAccountsAccountPositions'
|
3586
3586
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
3587
3587
|
"""
|
3588
3588
|
await self.load_markets()
|
3589
3589
|
symbols = self.market_symbols(symbols)
|
3590
3590
|
subType = None
|
3591
|
-
code = self.safe_string_2(params, 'currency', 'code', '
|
3591
|
+
code = self.safe_string_2(params, 'currency', 'code', 'USDT')
|
3592
3592
|
params = self.omit(params, ['currency', 'code'])
|
3593
3593
|
settle = None
|
3594
3594
|
market = None
|
ccxt/async_support/tradeogre.py
CHANGED
@@ -135,6 +135,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
135
135
|
'ticker/{market}': 1,
|
136
136
|
'history/{market}': 1,
|
137
137
|
'chart/{interval}/{market}/{timestamp}': 1,
|
138
|
+
'chart/{interval}/{market}': 1,
|
138
139
|
},
|
139
140
|
},
|
140
141
|
'private': {
|
@@ -422,15 +423,15 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
422
423
|
'ask': self.safe_string(ticker, 'ask'),
|
423
424
|
'askVolume': None,
|
424
425
|
'vwap': None,
|
425
|
-
'open': self.safe_string(ticker, '
|
426
|
-
'close':
|
426
|
+
'open': self.safe_string(ticker, 'initialprice'),
|
427
|
+
'close': self.safe_string(ticker, 'price'),
|
427
428
|
'last': None,
|
428
429
|
'previousClose': None,
|
429
430
|
'change': None,
|
430
431
|
'percentage': None,
|
431
432
|
'average': None,
|
432
|
-
'baseVolume':
|
433
|
-
'quoteVolume':
|
433
|
+
'baseVolume': None,
|
434
|
+
'quoteVolume': self.safe_string(ticker, 'volume'),
|
434
435
|
'info': ticker,
|
435
436
|
}, market)
|
436
437
|
|
@@ -442,6 +443,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
442
443
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
443
444
|
:param int [limit]: the maximum amount of candles to fetch
|
444
445
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
446
|
+
:param int [params.until]: timestamp of the latest candle in ms
|
445
447
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
446
448
|
"""
|
447
449
|
await self.load_markets()
|
@@ -450,11 +452,14 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
450
452
|
'market': market['id'],
|
451
453
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
452
454
|
}
|
453
|
-
|
454
|
-
|
455
|
+
response = None
|
456
|
+
until = self.safe_integer(params, 'until')
|
457
|
+
if until is not None:
|
458
|
+
params = self.omit(params, 'until')
|
459
|
+
request['timestamp'] = self.parse_to_int(until / 1000)
|
460
|
+
response = await self.publicGetChartIntervalMarketTimestamp(self.extend(request, params))
|
455
461
|
else:
|
456
|
-
|
457
|
-
response = await self.publicGetChartIntervalMarketTimestamp(self.extend(request, params))
|
462
|
+
response = await self.publicGetChartIntervalMarket(self.extend(request, params))
|
458
463
|
#
|
459
464
|
# [
|
460
465
|
# [
|
@@ -483,9 +488,9 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
483
488
|
return [
|
484
489
|
self.safe_timestamp(ohlcv, 0),
|
485
490
|
self.safe_number(ohlcv, 1),
|
491
|
+
self.safe_number(ohlcv, 2),
|
486
492
|
self.safe_number(ohlcv, 3),
|
487
493
|
self.safe_number(ohlcv, 4),
|
488
|
-
self.safe_number(ohlcv, 2),
|
489
494
|
self.safe_number(ohlcv, 5),
|
490
495
|
]
|
491
496
|
|