ccxt 4.3.40__py2.py3-none-any.whl → 4.3.42__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/abstract/okx.py +7 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +3 -0
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bithumb.py +9 -1
- ccxt/async_support/bitmart.py +191 -100
- ccxt/async_support/bitstamp.py +38 -2
- ccxt/async_support/blockchaincom.py +11 -7
- ccxt/async_support/coinex.py +1 -1
- ccxt/async_support/coinlist.py +19 -1
- ccxt/async_support/coinmate.py +19 -3
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinspot.py +11 -2
- ccxt/async_support/independentreserve.py +33 -1
- ccxt/async_support/indodax.py +43 -2
- ccxt/async_support/kraken.py +30 -3
- ccxt/async_support/krakenfutures.py +55 -1
- ccxt/async_support/kucoin.py +59 -2
- ccxt/async_support/okx.py +7 -0
- ccxt/async_support/upbit.py +13 -8
- ccxt/async_support/woo.py +6 -2
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +3 -0
- ccxt/bitfinex2.py +1 -1
- ccxt/bithumb.py +9 -1
- ccxt/bitmart.py +191 -100
- ccxt/bitstamp.py +38 -2
- ccxt/blockchaincom.py +11 -7
- ccxt/coinex.py +1 -1
- ccxt/coinlist.py +19 -1
- ccxt/coinmate.py +19 -3
- ccxt/coinone.py +1 -1
- ccxt/coinspot.py +11 -2
- ccxt/independentreserve.py +33 -1
- ccxt/indodax.py +43 -2
- ccxt/kraken.py +30 -3
- ccxt/krakenfutures.py +55 -1
- ccxt/kucoin.py +59 -2
- ccxt/okx.py +7 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +5 -5
- ccxt/pro/ascendex.py +3 -3
- ccxt/pro/bingx.py +258 -42
- ccxt/pro/bitget.py +11 -5
- ccxt/pro/bitrue.py +3 -4
- ccxt/pro/currencycom.py +6 -5
- ccxt/pro/exmo.py +5 -6
- ccxt/pro/gemini.py +4 -3
- ccxt/pro/independentreserve.py +7 -7
- ccxt/pro/lbank.py +4 -4
- ccxt/pro/mexc.py +1 -1
- ccxt/pro/phemex.py +5 -5
- ccxt/pro/probit.py +4 -4
- ccxt/pro/upbit.py +299 -4
- ccxt/pro/wazirx.py +12 -12
- ccxt/pro/woo.py +1 -1
- ccxt/upbit.py +13 -8
- ccxt/woo.py +6 -2
- {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/METADATA +4 -4
- {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/RECORD +68 -68
- {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/WHEEL +0 -0
- {ccxt-4.3.40.dist-info → ccxt-4.3.42.dist-info}/top_level.txt +0 -0
ccxt/bitmart.py
CHANGED
@@ -1126,27 +1126,46 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1126
1126
|
|
1127
1127
|
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
1128
1128
|
#
|
1129
|
-
# spot(REST)
|
1129
|
+
# spot(REST) fetchTickers
|
1130
1130
|
#
|
1131
|
-
#
|
1132
|
-
#
|
1133
|
-
#
|
1134
|
-
#
|
1135
|
-
#
|
1136
|
-
#
|
1137
|
-
#
|
1138
|
-
#
|
1139
|
-
#
|
1140
|
-
#
|
1141
|
-
#
|
1142
|
-
#
|
1143
|
-
#
|
1144
|
-
#
|
1145
|
-
#
|
1146
|
-
#
|
1147
|
-
#
|
1131
|
+
# {
|
1132
|
+
# 'result': [
|
1133
|
+
# "AFIN_USDT", # symbol
|
1134
|
+
# "0.001047", # last
|
1135
|
+
# "11110", # v_24h
|
1136
|
+
# "11.632170", # qv_24h
|
1137
|
+
# "0.001048", # open_24h
|
1138
|
+
# "0.001048", # high_24h
|
1139
|
+
# "0.001047", # low_24h
|
1140
|
+
# "-0.00095", # price_change_24h
|
1141
|
+
# "0.001029", # bid_px
|
1142
|
+
# "5555", # bid_sz
|
1143
|
+
# "0.001041", # ask_px
|
1144
|
+
# "5297", # ask_sz
|
1145
|
+
# "1717122550482" # timestamp
|
1146
|
+
# ]
|
1147
|
+
# }
|
1148
|
+
#
|
1149
|
+
# spot(REST) fetchTicker
|
1150
|
+
#
|
1151
|
+
# {
|
1152
|
+
# "symbol": "BTC_USDT",
|
1153
|
+
# "last": "68500.00",
|
1154
|
+
# "v_24h": "10491.65490",
|
1155
|
+
# "qv_24h": "717178990.42",
|
1156
|
+
# "open_24h": "68149.75",
|
1157
|
+
# "high_24h": "69499.99",
|
1158
|
+
# "low_24h": "67132.40",
|
1159
|
+
# "fluctuation": "0.00514",
|
1160
|
+
# "bid_px": "68500",
|
1161
|
+
# "bid_sz": "0.00162",
|
1162
|
+
# "ask_px": "68500.01",
|
1163
|
+
# "ask_sz": "0.01722",
|
1164
|
+
# "ts": "1717131391671"
|
1165
|
+
# }
|
1148
1166
|
#
|
1149
1167
|
# spot(WS)
|
1168
|
+
#
|
1150
1169
|
# {
|
1151
1170
|
# "symbol":"BTC_USDT",
|
1152
1171
|
# "last_price":"146.24",
|
@@ -1172,19 +1191,44 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1172
1191
|
# "legal_coin_price":"0.1302699"
|
1173
1192
|
# }
|
1174
1193
|
#
|
1175
|
-
|
1176
|
-
|
1177
|
-
# ticker from WS has a different field(in seconds)
|
1178
|
-
timestamp = self.safe_integer_product(ticker, 's_t', 1000)
|
1194
|
+
result = self.safe_list(ticker, 'result', [])
|
1195
|
+
average = self.safe_string_2(ticker, 'avg_price', 'index_price')
|
1179
1196
|
marketId = self.safe_string_2(ticker, 'symbol', 'contract_symbol')
|
1197
|
+
timestamp = self.safe_integer_2(ticker, 'timestamp', 'ts')
|
1198
|
+
last = self.safe_string_2(ticker, 'last_price', 'last')
|
1199
|
+
percentage = self.safe_string(ticker, 'price_change_percent_24h')
|
1200
|
+
change = self.safe_string(ticker, 'fluctuation')
|
1201
|
+
high = self.safe_string_2(ticker, 'high_24h', 'high_price')
|
1202
|
+
low = self.safe_string_2(ticker, 'low_24h', 'low_price')
|
1203
|
+
bid = self.safe_string_2(ticker, 'best_bid', 'bid_px')
|
1204
|
+
bidVolume = self.safe_string_2(ticker, 'best_bid_size', 'bid_sz')
|
1205
|
+
ask = self.safe_string_2(ticker, 'best_ask', 'ask_px')
|
1206
|
+
askVolume = self.safe_string_2(ticker, 'best_ask_size', 'ask_sz')
|
1207
|
+
open = self.safe_string(ticker, 'open_24h')
|
1208
|
+
baseVolume = self.safe_string_2(ticker, 'base_volume_24h', 'v_24h')
|
1209
|
+
quoteVolume = self.safe_string_lower_2(ticker, 'quote_volume_24h', 'qv_24h')
|
1210
|
+
listMarketId = self.safe_string(result, 0)
|
1211
|
+
if listMarketId is not None:
|
1212
|
+
marketId = listMarketId
|
1213
|
+
timestamp = self.safe_integer(result, 12)
|
1214
|
+
high = self.safe_string(result, 5)
|
1215
|
+
low = self.safe_string(result, 6)
|
1216
|
+
bid = self.safe_string(result, 8)
|
1217
|
+
bidVolume = self.safe_string(result, 9)
|
1218
|
+
ask = self.safe_string(result, 10)
|
1219
|
+
askVolume = self.safe_string(result, 11)
|
1220
|
+
open = self.safe_string(result, 4)
|
1221
|
+
last = self.safe_string(result, 1)
|
1222
|
+
change = self.safe_string(result, 7)
|
1223
|
+
baseVolume = self.safe_string(result, 2)
|
1224
|
+
quoteVolume = self.safe_string_lower(result, 3)
|
1180
1225
|
market = self.safe_market(marketId, market)
|
1181
1226
|
symbol = market['symbol']
|
1182
|
-
|
1183
|
-
|
1227
|
+
if timestamp is None:
|
1228
|
+
# ticker from WS has a different field(in seconds)
|
1229
|
+
timestamp = self.safe_integer_product(ticker, 's_t', 1000)
|
1184
1230
|
if percentage is None:
|
1185
|
-
percentage = Precise.string_mul(
|
1186
|
-
baseVolume = self.safe_string(ticker, 'base_volume_24h')
|
1187
|
-
quoteVolume = self.safe_string(ticker, 'quote_volume_24h')
|
1231
|
+
percentage = Precise.string_mul(change, '100')
|
1188
1232
|
if quoteVolume is None:
|
1189
1233
|
if baseVolume is None:
|
1190
1234
|
# self is swap
|
@@ -1194,25 +1238,22 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1194
1238
|
# contrary to name and documentation, base_volume_24h is actually the quote volume
|
1195
1239
|
quoteVolume = baseVolume
|
1196
1240
|
baseVolume = None
|
1197
|
-
average = self.safe_string_2(ticker, 'avg_price', 'index_price')
|
1198
|
-
high = self.safe_string_2(ticker, 'high_24h', 'high_price')
|
1199
|
-
low = self.safe_string_2(ticker, 'low_24h', 'low_price')
|
1200
1241
|
return self.safe_ticker({
|
1201
1242
|
'symbol': symbol,
|
1202
1243
|
'timestamp': timestamp,
|
1203
1244
|
'datetime': self.iso8601(timestamp),
|
1204
1245
|
'high': high,
|
1205
1246
|
'low': low,
|
1206
|
-
'bid':
|
1207
|
-
'bidVolume':
|
1208
|
-
'ask':
|
1209
|
-
'askVolume':
|
1247
|
+
'bid': bid,
|
1248
|
+
'bidVolume': bidVolume,
|
1249
|
+
'ask': ask,
|
1250
|
+
'askVolume': askVolume,
|
1210
1251
|
'vwap': None,
|
1211
|
-
'open':
|
1252
|
+
'open': open,
|
1212
1253
|
'close': last,
|
1213
1254
|
'last': last,
|
1214
1255
|
'previousClose': None,
|
1215
|
-
'change':
|
1256
|
+
'change': change,
|
1216
1257
|
'percentage': percentage,
|
1217
1258
|
'average': average,
|
1218
1259
|
'baseVolume': baseVolume,
|
@@ -1223,6 +1264,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1223
1264
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1224
1265
|
"""
|
1225
1266
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
1267
|
+
:see: https://developer-pro.bitmart.com/en/spot/#get-ticker-of-a-trading-pair-v3
|
1226
1268
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1227
1269
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1228
1270
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1234,79 +1276,73 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1234
1276
|
if market['swap']:
|
1235
1277
|
request['contract_symbol'] = market['id']
|
1236
1278
|
response = self.publicGetContractV1Tickers(self.extend(request, params))
|
1279
|
+
#
|
1280
|
+
# {
|
1281
|
+
# "message":"OK",
|
1282
|
+
# "code":1000,
|
1283
|
+
# "trace":"4a0ebceb-d3f7-45a3-8feb-f61e230e24cd",
|
1284
|
+
# "data":{
|
1285
|
+
# "tickers":[
|
1286
|
+
# {
|
1287
|
+
# "contract_symbol":"DOGEUSDT",
|
1288
|
+
# "last_price":"0.130180",
|
1289
|
+
# "index_price":"0.13028635",
|
1290
|
+
# "last_funding_rate":"0.00002025",
|
1291
|
+
# "price_change_percent_24h":"-2.326",
|
1292
|
+
# "volume_24h":"116789313.01797258",
|
1293
|
+
# "url":"https://futures.bitmart.com/en?symbol=DOGEUSDT",
|
1294
|
+
# "high_price":"0.134520",
|
1295
|
+
# "low_price":"0.128570",
|
1296
|
+
# "legal_coin_price":"0.13017401"
|
1297
|
+
# }
|
1298
|
+
# ]
|
1299
|
+
# }
|
1300
|
+
# }
|
1301
|
+
#
|
1237
1302
|
elif market['spot']:
|
1238
1303
|
request['symbol'] = market['id']
|
1239
|
-
response = self.
|
1304
|
+
response = self.publicGetSpotQuotationV3Ticker(self.extend(request, params))
|
1305
|
+
#
|
1306
|
+
# {
|
1307
|
+
# "code": 1000,
|
1308
|
+
# "trace": "f2194c2c202d2.99.1717535",
|
1309
|
+
# "message": "success",
|
1310
|
+
# "data": {
|
1311
|
+
# "symbol": "BTC_USDT",
|
1312
|
+
# "last": "68500.00",
|
1313
|
+
# "v_24h": "10491.65490",
|
1314
|
+
# "qv_24h": "717178990.42",
|
1315
|
+
# "open_24h": "68149.75",
|
1316
|
+
# "high_24h": "69499.99",
|
1317
|
+
# "low_24h": "67132.40",
|
1318
|
+
# "fluctuation": "0.00514",
|
1319
|
+
# "bid_px": "68500",
|
1320
|
+
# "bid_sz": "0.00162",
|
1321
|
+
# "ask_px": "68500.01",
|
1322
|
+
# "ask_sz": "0.01722",
|
1323
|
+
# "ts": "1717131391671"
|
1324
|
+
# }
|
1325
|
+
# }
|
1326
|
+
#
|
1240
1327
|
else:
|
1241
1328
|
raise NotSupported(self.id + ' fetchTicker() does not support ' + market['type'] + ' markets, only spot and swap markets are accepted')
|
1242
|
-
#
|
1243
|
-
# spot
|
1244
|
-
#
|
1245
|
-
# {
|
1246
|
-
# "message":"OK",
|
1247
|
-
# "code":1000,
|
1248
|
-
# "trace":"6aa5b923-2f57-46e3-876d-feca190e0b82",
|
1249
|
-
# "data":{
|
1250
|
-
# "tickers":[
|
1251
|
-
# {
|
1252
|
-
# "symbol":"ETH_BTC",
|
1253
|
-
# "last_price":"0.036037",
|
1254
|
-
# "quote_volume_24h":"4380.6660000000",
|
1255
|
-
# "base_volume_24h":"159.3582006712",
|
1256
|
-
# "high_24h":"0.036972",
|
1257
|
-
# "low_24h":"0.035524",
|
1258
|
-
# "open_24h":"0.036561",
|
1259
|
-
# "close_24h":"0.036037",
|
1260
|
-
# "best_ask":"0.036077",
|
1261
|
-
# "best_ask_size":"9.9500",
|
1262
|
-
# "best_bid":"0.035983",
|
1263
|
-
# "best_bid_size":"4.2792",
|
1264
|
-
# "fluctuation":"-0.0143",
|
1265
|
-
# "url":"https://www.bitmart.com/trade?symbol=ETH_BTC"
|
1266
|
-
# }
|
1267
|
-
# ]
|
1268
|
-
# }
|
1269
|
-
# }
|
1270
|
-
#
|
1271
|
-
# swap
|
1272
|
-
#
|
1273
|
-
# {
|
1274
|
-
# "message":"OK",
|
1275
|
-
# "code":1000,
|
1276
|
-
# "trace":"4a0ebceb-d3f7-45a3-8feb-f61e230e24cd",
|
1277
|
-
# "data":{
|
1278
|
-
# "tickers":[
|
1279
|
-
# {
|
1280
|
-
# "contract_symbol":"DOGEUSDT",
|
1281
|
-
# "last_price":"0.130180",
|
1282
|
-
# "index_price":"0.13028635",
|
1283
|
-
# "last_funding_rate":"0.00002025",
|
1284
|
-
# "price_change_percent_24h":"-2.326",
|
1285
|
-
# "volume_24h":"116789313.01797258",
|
1286
|
-
# "url":"https://futures.bitmart.com/en?symbol=DOGEUSDT",
|
1287
|
-
# "high_price":"0.134520",
|
1288
|
-
# "low_price":"0.128570",
|
1289
|
-
# "legal_coin_price":"0.13017401"
|
1290
|
-
# }
|
1291
|
-
# ]
|
1292
|
-
# }
|
1293
|
-
# }
|
1294
|
-
#
|
1295
|
-
data = self.safe_value(response, 'data', {})
|
1296
|
-
tickers = self.safe_value(data, 'tickers', [])
|
1297
1329
|
# fails in naming for contract tickers 'contract_symbol'
|
1298
1330
|
tickersById = None
|
1331
|
+
tickers = []
|
1332
|
+
ticker: dict = {}
|
1299
1333
|
if market['spot']:
|
1300
|
-
|
1301
|
-
|
1334
|
+
ticker = self.safe_dict(response, 'data', {})
|
1335
|
+
else:
|
1336
|
+
data = self.safe_dict(response, 'data', {})
|
1337
|
+
tickers = self.safe_list(data, 'tickers', [])
|
1302
1338
|
tickersById = self.index_by(tickers, 'contract_symbol')
|
1303
|
-
|
1339
|
+
ticker = self.safe_dict(tickersById, market['id'])
|
1304
1340
|
return self.parse_ticker(ticker, market)
|
1305
1341
|
|
1306
1342
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1307
1343
|
"""
|
1308
1344
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
1309
|
-
:see: https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-
|
1345
|
+
:see: https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v3
|
1310
1346
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1311
1347
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1312
1348
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1321,16 +1357,71 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1321
1357
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
1322
1358
|
response = None
|
1323
1359
|
if type == 'spot':
|
1324
|
-
response = self.
|
1360
|
+
response = self.publicGetSpotQuotationV3Tickers(params)
|
1361
|
+
#
|
1362
|
+
# {
|
1363
|
+
# "code": 1000,
|
1364
|
+
# "trace": "17c5e5d9ac49f9b71efca2bed55f1a.105.171225637482393",
|
1365
|
+
# "message": "success",
|
1366
|
+
# "data": [
|
1367
|
+
# [
|
1368
|
+
# "AFIN_USDT",
|
1369
|
+
# "0.001047",
|
1370
|
+
# "11110",
|
1371
|
+
# "11.632170",
|
1372
|
+
# "0.001048",
|
1373
|
+
# "0.001048",
|
1374
|
+
# "0.001047",
|
1375
|
+
# "-0.00095",
|
1376
|
+
# "0.001029",
|
1377
|
+
# "5555",
|
1378
|
+
# "0.001041",
|
1379
|
+
# "5297",
|
1380
|
+
# "1717122550482"
|
1381
|
+
# ],
|
1382
|
+
# ]
|
1383
|
+
# }
|
1384
|
+
#
|
1325
1385
|
elif type == 'swap':
|
1326
1386
|
response = self.publicGetContractV1Tickers(params)
|
1387
|
+
#
|
1388
|
+
# {
|
1389
|
+
# "message": "OK",
|
1390
|
+
# "code": 1000,
|
1391
|
+
# "trace": "c1dec681c24ea5d.105.171712565",
|
1392
|
+
# "data": {
|
1393
|
+
# "tickers": [
|
1394
|
+
# {
|
1395
|
+
# "contract_symbol": "SNTUSDT",
|
1396
|
+
# "last_price": "0.0366600",
|
1397
|
+
# "index_price": "0.03587373",
|
1398
|
+
# "last_funding_rate": "0.00005000",
|
1399
|
+
# "price_change_percent_24h": "-2.629",
|
1400
|
+
# "volume_24h": "10102540.19909109848",
|
1401
|
+
# "url": "https://futures.bitmart.com/en?symbol=SNTUSDT",
|
1402
|
+
# "high_price": "0.0405600",
|
1403
|
+
# "low_price": "0.0355000",
|
1404
|
+
# "legal_coin_price": "0.03666697"
|
1405
|
+
# },
|
1406
|
+
# ]
|
1407
|
+
# }
|
1408
|
+
# }
|
1409
|
+
#
|
1327
1410
|
else:
|
1328
1411
|
raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets, only spot and swap markets are accepted')
|
1329
|
-
|
1330
|
-
|
1412
|
+
tickers = []
|
1413
|
+
if type == 'spot':
|
1414
|
+
tickers = self.safe_list(response, 'data', [])
|
1415
|
+
else:
|
1416
|
+
data = self.safe_dict(response, 'data', {})
|
1417
|
+
tickers = self.safe_list(data, 'tickers', [])
|
1331
1418
|
result: dict = {}
|
1332
1419
|
for i in range(0, len(tickers)):
|
1333
|
-
ticker =
|
1420
|
+
ticker: dict = {}
|
1421
|
+
if type == 'spot':
|
1422
|
+
ticker = self.parse_ticker({'result': tickers[i]})
|
1423
|
+
else:
|
1424
|
+
ticker = self.parse_ticker(tickers[i])
|
1334
1425
|
symbol = ticker['symbol']
|
1335
1426
|
result[symbol] = ticker
|
1336
1427
|
return self.filter_by_array_tickers(result, 'symbol', symbols)
|
ccxt/bitstamp.py
CHANGED
@@ -1376,7 +1376,17 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1376
1376
|
request: dict = {
|
1377
1377
|
'id': id,
|
1378
1378
|
}
|
1379
|
-
|
1379
|
+
response = self.privatePostCancelOrder(self.extend(request, params))
|
1380
|
+
#
|
1381
|
+
# {
|
1382
|
+
# "id": 1453282316578816,
|
1383
|
+
# "amount": "0.02035278",
|
1384
|
+
# "price": "2100.45",
|
1385
|
+
# "type": 0,
|
1386
|
+
# "market": "BTC/USD"
|
1387
|
+
# }
|
1388
|
+
#
|
1389
|
+
return self.parse_order(response)
|
1380
1390
|
|
1381
1391
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1382
1392
|
"""
|
@@ -1397,7 +1407,23 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1397
1407
|
response = self.privatePostCancelAllOrdersPair(self.extend(request, params))
|
1398
1408
|
else:
|
1399
1409
|
response = self.privatePostCancelAllOrders(self.extend(request, params))
|
1400
|
-
|
1410
|
+
#
|
1411
|
+
# {
|
1412
|
+
# "canceled": [
|
1413
|
+
# {
|
1414
|
+
# "id": 1453282316578816,
|
1415
|
+
# "amount": "0.02035278",
|
1416
|
+
# "price": "2100.45",
|
1417
|
+
# "type": 0,
|
1418
|
+
# "currency_pair": "BTC/USD",
|
1419
|
+
# "market": "BTC/USD"
|
1420
|
+
# }
|
1421
|
+
# ],
|
1422
|
+
# "success": True
|
1423
|
+
# }
|
1424
|
+
#
|
1425
|
+
canceled = self.safe_list(response, 'canceled')
|
1426
|
+
return self.parse_orders(canceled)
|
1401
1427
|
|
1402
1428
|
def parse_order_status(self, status: Str):
|
1403
1429
|
statuses: dict = {
|
@@ -1743,6 +1769,16 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1743
1769
|
# "id": "2814205012"
|
1744
1770
|
# }
|
1745
1771
|
#
|
1772
|
+
# cancelOrder
|
1773
|
+
#
|
1774
|
+
# {
|
1775
|
+
# "id": 1453282316578816,
|
1776
|
+
# "amount": "0.02035278",
|
1777
|
+
# "price": "2100.45",
|
1778
|
+
# "type": 0,
|
1779
|
+
# "market": "BTC/USD"
|
1780
|
+
# }
|
1781
|
+
#
|
1746
1782
|
id = self.safe_string(order, 'id')
|
1747
1783
|
clientOrderId = self.safe_string(order, 'client_order_id')
|
1748
1784
|
side = self.safe_string(order, 'type')
|
ccxt/blockchaincom.py
CHANGED
@@ -589,15 +589,15 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
589
589
|
'orderId': id,
|
590
590
|
}
|
591
591
|
response = self.privateDeleteOrdersOrderId(self.extend(request, params))
|
592
|
-
return {
|
592
|
+
return self.safe_order({
|
593
593
|
'id': id,
|
594
594
|
'info': response,
|
595
|
-
}
|
595
|
+
})
|
596
596
|
|
597
597
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
598
598
|
"""
|
599
599
|
cancel all open orders
|
600
|
-
:see: https://api.blockchain.com/v3
|
600
|
+
:see: https://api.blockchain.com/v3/#deleteallorders
|
601
601
|
:param str symbol: unified market symbol of the market to cancel orders in, all markets are used if None, default is None
|
602
602
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
603
603
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -612,10 +612,14 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
612
612
|
marketId = self.market_id(symbol)
|
613
613
|
request['symbol'] = marketId
|
614
614
|
response = self.privateDeleteOrders(self.extend(request, params))
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
615
|
+
#
|
616
|
+
# {}
|
617
|
+
#
|
618
|
+
return [
|
619
|
+
self.safe_order({
|
620
|
+
'info': response,
|
621
|
+
}),
|
622
|
+
]
|
619
623
|
|
620
624
|
def fetch_trading_fees(self, params={}) -> TradingFees:
|
621
625
|
"""
|
ccxt/coinex.py
CHANGED
@@ -5439,7 +5439,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5439
5439
|
preparedString += nonce + self.secret
|
5440
5440
|
signature = self.hash(self.encode(preparedString), 'sha256')
|
5441
5441
|
headers = {
|
5442
|
-
'Content-Type': 'application/json
|
5442
|
+
'Content-Type': 'application/json',
|
5443
5443
|
'Accept': 'application/json',
|
5444
5444
|
'X-COINEX-KEY': self.apiKey,
|
5445
5445
|
'X-COINEX-SIGN': signature,
|
ccxt/coinlist.py
CHANGED
@@ -1397,7 +1397,25 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1397
1397
|
self.load_markets()
|
1398
1398
|
params = ids
|
1399
1399
|
response = self.privateDeleteV1OrdersBulk(params)
|
1400
|
-
|
1400
|
+
#
|
1401
|
+
# {
|
1402
|
+
# "message": "Cancel order requests received.",
|
1403
|
+
# "order_ids": [
|
1404
|
+
# "ff132955-43bc-4fe5-9d9c-5ba226cc89a0"
|
1405
|
+
# ],
|
1406
|
+
# "timestamp": "2024-06-01T02:32:30.305Z"
|
1407
|
+
# }
|
1408
|
+
#
|
1409
|
+
orderIds = self.safe_list(response, 'order_ids', [])
|
1410
|
+
orders = []
|
1411
|
+
datetime = self.safe_string(response, 'timestamp')
|
1412
|
+
for i in range(0, len(orderIds)):
|
1413
|
+
orders.append(self.safe_order({
|
1414
|
+
'info': orderIds[i],
|
1415
|
+
'id': orderIds[i],
|
1416
|
+
'lastUpdateTimestamp': self.parse8601(datetime),
|
1417
|
+
}))
|
1418
|
+
return orders
|
1401
1419
|
|
1402
1420
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1403
1421
|
"""
|
ccxt/coinmate.py
CHANGED
@@ -895,6 +895,13 @@ class coinmate(Exchange, ImplicitAPI):
|
|
895
895
|
# "trailing": False,
|
896
896
|
# }
|
897
897
|
#
|
898
|
+
# cancelOrder
|
899
|
+
#
|
900
|
+
# {
|
901
|
+
# "success": True,
|
902
|
+
# "remainingAmount": 0.1
|
903
|
+
# }
|
904
|
+
#
|
898
905
|
id = self.safe_string(order, 'id')
|
899
906
|
timestamp = self.safe_integer(order, 'timestamp')
|
900
907
|
side = self.safe_string_lower(order, 'type')
|
@@ -1003,9 +1010,18 @@ class coinmate(Exchange, ImplicitAPI):
|
|
1003
1010
|
# {"error":false,"errorMessage":null,"data":{"success":true,"remainingAmount":0.01}}
|
1004
1011
|
request: dict = {'orderId': id}
|
1005
1012
|
response = self.privatePostCancelOrderWithInfo(self.extend(request, params))
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1013
|
+
#
|
1014
|
+
# {
|
1015
|
+
# "error": False,
|
1016
|
+
# "errorMessage": null,
|
1017
|
+
# "data": {
|
1018
|
+
# "success": True,
|
1019
|
+
# "remainingAmount": 0.1
|
1020
|
+
# }
|
1021
|
+
# }
|
1022
|
+
#
|
1023
|
+
data = self.safe_dict(response, 'data')
|
1024
|
+
return self.parse_order(data)
|
1009
1025
|
|
1010
1026
|
def nonce(self):
|
1011
1027
|
return self.milliseconds()
|
ccxt/coinone.py
CHANGED
ccxt/coinspot.py
CHANGED
@@ -505,11 +505,20 @@ class coinspot(Exchange, ImplicitAPI):
|
|
505
505
|
if side != 'buy' and side != 'sell':
|
506
506
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a side parameter, "buy" or "sell"')
|
507
507
|
params = self.omit(params, 'side')
|
508
|
-
method = 'privatePostMy' + self.capitalize(side) + 'Cancel'
|
509
508
|
request: dict = {
|
510
509
|
'id': id,
|
511
510
|
}
|
512
|
-
|
511
|
+
response = None
|
512
|
+
if side == 'buy':
|
513
|
+
response = self.privatePostMyBuyCancel(self.extend(request, params))
|
514
|
+
else:
|
515
|
+
response = self.privatePostMySellCancel(self.extend(request, params))
|
516
|
+
#
|
517
|
+
# status - ok, error
|
518
|
+
#
|
519
|
+
return self.safe_order({
|
520
|
+
'info': response,
|
521
|
+
})
|
513
522
|
|
514
523
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
515
524
|
url = self.urls['api'][api] + '/' + path
|
ccxt/independentreserve.py
CHANGED
@@ -375,6 +375,21 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
375
375
|
# "FeePercent": 0.005,
|
376
376
|
# }
|
377
377
|
#
|
378
|
+
# cancelOrder
|
379
|
+
#
|
380
|
+
# {
|
381
|
+
# "AvgPrice": 455.48,
|
382
|
+
# "CreatedTimestampUtc": "2022-08-05T06:42:11.3032208Z",
|
383
|
+
# "OrderGuid": "719c495c-a39e-4884-93ac-280b37245037",
|
384
|
+
# "Price": 485.76,
|
385
|
+
# "PrimaryCurrencyCode": "Xbt",
|
386
|
+
# "ReservedAmount": 0.358,
|
387
|
+
# "SecondaryCurrencyCode": "Usd",
|
388
|
+
# "Status": "Cancelled",
|
389
|
+
# "Type": "LimitOffer",
|
390
|
+
# "VolumeFilled": 0,
|
391
|
+
# "VolumeOrdered": 0.358
|
392
|
+
# }
|
378
393
|
symbol = None
|
379
394
|
baseId = self.safe_string(order, 'PrimaryCurrencyCode')
|
380
395
|
quoteId = self.safe_string(order, 'SecondaryCurrencyCode')
|
@@ -666,6 +681,7 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
666
681
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
667
682
|
"""
|
668
683
|
cancels an open order
|
684
|
+
:see: https://www.independentreserve.com/features/api#CancelOrder
|
669
685
|
:param str id: order id
|
670
686
|
:param str symbol: unified symbol of the market the order was made in
|
671
687
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -675,7 +691,23 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
675
691
|
request: dict = {
|
676
692
|
'orderGuid': id,
|
677
693
|
}
|
678
|
-
|
694
|
+
response = self.privatePostCancelOrder(self.extend(request, params))
|
695
|
+
#
|
696
|
+
# {
|
697
|
+
# "AvgPrice": 455.48,
|
698
|
+
# "CreatedTimestampUtc": "2022-08-05T06:42:11.3032208Z",
|
699
|
+
# "OrderGuid": "719c495c-a39e-4884-93ac-280b37245037",
|
700
|
+
# "Price": 485.76,
|
701
|
+
# "PrimaryCurrencyCode": "Xbt",
|
702
|
+
# "ReservedAmount": 0.358,
|
703
|
+
# "SecondaryCurrencyCode": "Usd",
|
704
|
+
# "Status": "Cancelled",
|
705
|
+
# "Type": "LimitOffer",
|
706
|
+
# "VolumeFilled": 0,
|
707
|
+
# "VolumeOrdered": 0.358
|
708
|
+
# }
|
709
|
+
#
|
710
|
+
return self.parse_order(response)
|
679
711
|
|
680
712
|
def fetch_deposit_address(self, code: str, params={}):
|
681
713
|
"""
|