ccxt 4.1.12 → 4.1.13
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.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +947 -15
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -0
- package/dist/cjs/src/alpaca.js +1 -0
- package/dist/cjs/src/base/Exchange.js +30 -0
- package/dist/cjs/src/bigone.js +1 -0
- package/dist/cjs/src/binance.js +231 -1
- package/dist/cjs/src/bingx.js +1 -0
- package/dist/cjs/src/bitbank.js +1 -0
- package/dist/cjs/src/bitbns.js +1 -0
- package/dist/cjs/src/bitfinex.js +1 -0
- package/dist/cjs/src/bitfinex2.js +1 -0
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bitforex.js +1 -0
- package/dist/cjs/src/bitget.js +11 -2
- package/dist/cjs/src/bithumb.js +1 -0
- package/dist/cjs/src/bitmart.js +103 -0
- package/dist/cjs/src/bitmex.js +70 -0
- package/dist/cjs/src/bitopro.js +1 -0
- package/dist/cjs/src/bitpanda.js +1 -0
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bitso.js +1 -0
- package/dist/cjs/src/bitstamp.js +1 -0
- package/dist/cjs/src/bitvavo.js +1 -0
- package/dist/cjs/src/blockchaincom.js +1 -0
- package/dist/cjs/src/btcalpha.js +1 -0
- package/dist/cjs/src/btcmarkets.js +1 -0
- package/dist/cjs/src/btcturk.js +1 -0
- package/dist/cjs/src/bybit.js +3 -3
- package/dist/cjs/src/deribit.js +163 -0
- package/dist/cjs/src/gate.js +189 -0
- package/dist/cjs/src/huobi.js +102 -0
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/poloniex.js +20 -7
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/poloniex.d.ts +18 -5
- package/js/src/ace.js +1 -0
- package/js/src/alpaca.js +1 -0
- package/js/src/base/Exchange.d.ts +6 -2
- package/js/src/base/Exchange.js +30 -0
- package/js/src/base/types.d.ts +9 -0
- package/js/src/bigone.js +1 -0
- package/js/src/binance.d.ts +13 -1
- package/js/src/binance.js +231 -1
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +1 -0
- package/js/src/bitbank.js +1 -0
- package/js/src/bitbns.js +1 -0
- package/js/src/bitfinex.js +1 -0
- package/js/src/bitfinex2.js +1 -0
- package/js/src/bitflyer.js +1 -0
- package/js/src/bitforex.js +1 -0
- package/js/src/bitget.js +11 -2
- package/js/src/bithumb.js +1 -0
- package/js/src/bitmart.d.ts +12 -0
- package/js/src/bitmart.js +103 -0
- package/js/src/bitmex.d.ts +13 -1
- package/js/src/bitmex.js +70 -0
- package/js/src/bitopro.js +1 -0
- package/js/src/bitpanda.js +1 -0
- package/js/src/bitrue.js +1 -0
- package/js/src/bitso.js +1 -0
- package/js/src/bitstamp.js +1 -0
- package/js/src/bitvavo.js +1 -0
- package/js/src/blockchaincom.js +1 -0
- package/js/src/btcalpha.js +1 -0
- package/js/src/btcmarkets.js +1 -0
- package/js/src/btcturk.js +1 -0
- package/js/src/bybit.js +3 -3
- package/js/src/deribit.d.ts +14 -0
- package/js/src/deribit.js +163 -0
- package/js/src/gate.d.ts +13 -0
- package/js/src/gate.js +189 -0
- package/js/src/huobi.d.ts +12 -0
- package/js/src/huobi.js +102 -0
- package/js/src/kucoin.js +1 -0
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/okx.js +1 -0
- package/js/src/poloniex.js +20 -7
- package/package.json +1 -1
- package/skip-tests.json +61 -5
package/js/src/gate.js
CHANGED
|
@@ -108,10 +108,12 @@ export default class gate extends Exchange {
|
|
|
108
108
|
'fetchLedger': true,
|
|
109
109
|
'fetchLeverage': false,
|
|
110
110
|
'fetchLeverageTiers': true,
|
|
111
|
+
'fetchLiquidations': true,
|
|
111
112
|
'fetchMarginMode': false,
|
|
112
113
|
'fetchMarketLeverageTiers': 'emulated',
|
|
113
114
|
'fetchMarkets': true,
|
|
114
115
|
'fetchMarkOHLCV': true,
|
|
116
|
+
'fetchMyLiquidations': true,
|
|
115
117
|
'fetchMySettlementHistory': true,
|
|
116
118
|
'fetchMyTrades': true,
|
|
117
119
|
'fetchNetworkDepositAddress': true,
|
|
@@ -6329,6 +6331,193 @@ export default class gate extends Exchange {
|
|
|
6329
6331
|
}
|
|
6330
6332
|
return underlyings;
|
|
6331
6333
|
}
|
|
6334
|
+
async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
|
|
6335
|
+
/**
|
|
6336
|
+
* @method
|
|
6337
|
+
* @name gate#fetchLiquidations
|
|
6338
|
+
* @description retrieves the public liquidations of a trading pair
|
|
6339
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
|
|
6340
|
+
* @param {string} symbol unified CCXT market symbol
|
|
6341
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
6342
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
6343
|
+
* @param {object} [params] exchange specific parameters for the gate api endpoint
|
|
6344
|
+
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
6345
|
+
* @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
|
|
6346
|
+
*/
|
|
6347
|
+
await this.loadMarkets();
|
|
6348
|
+
const market = this.market(symbol);
|
|
6349
|
+
if (!market['swap']) {
|
|
6350
|
+
throw new NotSupported(this.id + ' fetchLiquidations() supports swap markets only');
|
|
6351
|
+
}
|
|
6352
|
+
let request = {
|
|
6353
|
+
'settle': market['settleId'],
|
|
6354
|
+
'contract': market['id'],
|
|
6355
|
+
};
|
|
6356
|
+
if (since !== undefined) {
|
|
6357
|
+
request['from'] = since;
|
|
6358
|
+
}
|
|
6359
|
+
if (limit !== undefined) {
|
|
6360
|
+
request['limit'] = limit;
|
|
6361
|
+
}
|
|
6362
|
+
[request, params] = this.handleUntilOption('to', request, params);
|
|
6363
|
+
const response = await this.publicFuturesGetSettleLiqOrders(this.extend(request, params));
|
|
6364
|
+
//
|
|
6365
|
+
// [
|
|
6366
|
+
// {
|
|
6367
|
+
// "contract": "BTC_USDT",
|
|
6368
|
+
// "left": 0,
|
|
6369
|
+
// "size": -165,
|
|
6370
|
+
// "fill_price": "28070",
|
|
6371
|
+
// "order_price": "28225",
|
|
6372
|
+
// "time": 1696736132
|
|
6373
|
+
// },
|
|
6374
|
+
// ]
|
|
6375
|
+
//
|
|
6376
|
+
return this.parseLiquidations(response, market, since, limit);
|
|
6377
|
+
}
|
|
6378
|
+
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6379
|
+
/**
|
|
6380
|
+
* @method
|
|
6381
|
+
* @name gate#fetchMyLiquidations
|
|
6382
|
+
* @description retrieves the users liquidated positions
|
|
6383
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
|
|
6384
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
|
|
6385
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
|
|
6386
|
+
* @param {string} symbol unified CCXT market symbol
|
|
6387
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
6388
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
6389
|
+
* @param {object} [params] exchange specific parameters for the gate api endpoint
|
|
6390
|
+
* @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
|
|
6391
|
+
*/
|
|
6392
|
+
this.checkRequiredSymbol('fetchMyLiquidations', symbol);
|
|
6393
|
+
await this.loadMarkets();
|
|
6394
|
+
const market = this.market(symbol);
|
|
6395
|
+
const request = {
|
|
6396
|
+
'contract': market['id'],
|
|
6397
|
+
};
|
|
6398
|
+
let response = undefined;
|
|
6399
|
+
if ((market['swap']) || (market['future'])) {
|
|
6400
|
+
if (limit !== undefined) {
|
|
6401
|
+
request['limit'] = limit;
|
|
6402
|
+
}
|
|
6403
|
+
request['settle'] = market['settleId'];
|
|
6404
|
+
}
|
|
6405
|
+
else if (market['option']) {
|
|
6406
|
+
const marketId = market['id'];
|
|
6407
|
+
const optionParts = marketId.split('-');
|
|
6408
|
+
request['underlying'] = this.safeString(optionParts, 0);
|
|
6409
|
+
}
|
|
6410
|
+
if (market['swap']) {
|
|
6411
|
+
response = await this.privateFuturesGetSettleLiquidates(this.extend(request, params));
|
|
6412
|
+
}
|
|
6413
|
+
else if (market['future']) {
|
|
6414
|
+
response = await this.privateDeliveryGetSettleLiquidates(this.extend(request, params));
|
|
6415
|
+
}
|
|
6416
|
+
else if (market['option']) {
|
|
6417
|
+
response = await this.privateOptionsGetPositionClose(this.extend(request, params));
|
|
6418
|
+
}
|
|
6419
|
+
else {
|
|
6420
|
+
throw new NotSupported(this.id + ' fetchMyLiquidations() does not support ' + market['type'] + ' orders');
|
|
6421
|
+
}
|
|
6422
|
+
//
|
|
6423
|
+
// swap and future
|
|
6424
|
+
//
|
|
6425
|
+
// [
|
|
6426
|
+
// {
|
|
6427
|
+
// "time": 1548654951,
|
|
6428
|
+
// "contract": "BTC_USDT",
|
|
6429
|
+
// "size": 600,
|
|
6430
|
+
// "leverage": "25",
|
|
6431
|
+
// "margin": "0.006705256878",
|
|
6432
|
+
// "entry_price": "3536.123",
|
|
6433
|
+
// "liq_price": "3421.54",
|
|
6434
|
+
// "mark_price": "3420.27",
|
|
6435
|
+
// "order_id": 317393847,
|
|
6436
|
+
// "order_price": "3405",
|
|
6437
|
+
// "fill_price": "3424",
|
|
6438
|
+
// "left": 0
|
|
6439
|
+
// }
|
|
6440
|
+
// ]
|
|
6441
|
+
//
|
|
6442
|
+
// option
|
|
6443
|
+
//
|
|
6444
|
+
// [
|
|
6445
|
+
// {
|
|
6446
|
+
// "time": 1631764800,
|
|
6447
|
+
// "pnl": "-42914.291",
|
|
6448
|
+
// "settle_size": "-10001",
|
|
6449
|
+
// "side": "short",
|
|
6450
|
+
// "contract": "BTC_USDT-20210916-5000-C",
|
|
6451
|
+
// "text": "settled"
|
|
6452
|
+
// }
|
|
6453
|
+
// ]
|
|
6454
|
+
//
|
|
6455
|
+
return this.parseLiquidations(response, market, since, limit);
|
|
6456
|
+
}
|
|
6457
|
+
parseLiquidation(liquidation, market = undefined) {
|
|
6458
|
+
//
|
|
6459
|
+
// fetchLiquidations
|
|
6460
|
+
//
|
|
6461
|
+
// {
|
|
6462
|
+
// "contract": "BTC_USDT",
|
|
6463
|
+
// "left": 0,
|
|
6464
|
+
// "size": -165,
|
|
6465
|
+
// "fill_price": "28070",
|
|
6466
|
+
// "order_price": "28225",
|
|
6467
|
+
// "time": 1696736132
|
|
6468
|
+
// }
|
|
6469
|
+
//
|
|
6470
|
+
// swap and future: fetchMyLiquidations
|
|
6471
|
+
//
|
|
6472
|
+
// {
|
|
6473
|
+
// "time": 1548654951,
|
|
6474
|
+
// "contract": "BTC_USDT",
|
|
6475
|
+
// "size": 600,
|
|
6476
|
+
// "leverage": "25",
|
|
6477
|
+
// "margin": "0.006705256878",
|
|
6478
|
+
// "entry_price": "3536.123",
|
|
6479
|
+
// "liq_price": "3421.54",
|
|
6480
|
+
// "mark_price": "3420.27",
|
|
6481
|
+
// "order_id": 317393847,
|
|
6482
|
+
// "order_price": "3405",
|
|
6483
|
+
// "fill_price": "3424",
|
|
6484
|
+
// "left": 0
|
|
6485
|
+
// }
|
|
6486
|
+
//
|
|
6487
|
+
// option: fetchMyLiquidations
|
|
6488
|
+
//
|
|
6489
|
+
// {
|
|
6490
|
+
// "time": 1631764800,
|
|
6491
|
+
// "pnl": "-42914.291",
|
|
6492
|
+
// "settle_size": "-10001",
|
|
6493
|
+
// "side": "short",
|
|
6494
|
+
// "contract": "BTC_USDT-20210916-5000-C",
|
|
6495
|
+
// "text": "settled"
|
|
6496
|
+
// }
|
|
6497
|
+
//
|
|
6498
|
+
const marketId = this.safeString(liquidation, 'contract');
|
|
6499
|
+
const timestamp = this.safeTimestamp(liquidation, 'time');
|
|
6500
|
+
const contractsStringRaw = this.safeString2(liquidation, 'size', 'settle_size');
|
|
6501
|
+
const contractsString = Precise.stringAbs(contractsStringRaw);
|
|
6502
|
+
const contractSizeString = this.safeString(market, 'contractSize');
|
|
6503
|
+
const priceString = this.safeString2(liquidation, 'liq_price', 'fill_price');
|
|
6504
|
+
const baseValueString = Precise.stringMul(contractsString, contractSizeString);
|
|
6505
|
+
let quoteValueString = this.safeString(liquidation, 'pnl');
|
|
6506
|
+
if (quoteValueString === undefined) {
|
|
6507
|
+
quoteValueString = Precise.stringMul(baseValueString, priceString);
|
|
6508
|
+
}
|
|
6509
|
+
return {
|
|
6510
|
+
'info': liquidation,
|
|
6511
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
6512
|
+
'contracts': this.parseNumber(contractsString),
|
|
6513
|
+
'contractSize': this.parseNumber(contractSizeString),
|
|
6514
|
+
'price': this.parseNumber(priceString),
|
|
6515
|
+
'baseValue': this.parseNumber(baseValueString),
|
|
6516
|
+
'quoteValue': this.parseNumber(Precise.stringAbs(quoteValueString)),
|
|
6517
|
+
'timestamp': timestamp,
|
|
6518
|
+
'datetime': this.iso8601(timestamp),
|
|
6519
|
+
};
|
|
6520
|
+
}
|
|
6332
6521
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
6333
6522
|
if (response === undefined) {
|
|
6334
6523
|
return undefined;
|
package/js/src/huobi.d.ts
CHANGED
|
@@ -317,4 +317,16 @@ export default class huobi extends Exchange {
|
|
|
317
317
|
timestamp: number;
|
|
318
318
|
datetime: string;
|
|
319
319
|
};
|
|
320
|
+
fetchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Liquidation[]>;
|
|
321
|
+
parseLiquidation(liquidation: any, market?: any): {
|
|
322
|
+
info: any;
|
|
323
|
+
symbol: any;
|
|
324
|
+
contracts: number;
|
|
325
|
+
contractSize: number;
|
|
326
|
+
price: number;
|
|
327
|
+
baseValue: number;
|
|
328
|
+
quoteValue: number;
|
|
329
|
+
timestamp: number;
|
|
330
|
+
datetime: string;
|
|
331
|
+
};
|
|
320
332
|
}
|
package/js/src/huobi.js
CHANGED
|
@@ -75,9 +75,11 @@ export default class huobi extends Exchange {
|
|
|
75
75
|
'fetchLedgerEntry': undefined,
|
|
76
76
|
'fetchLeverage': false,
|
|
77
77
|
'fetchLeverageTiers': true,
|
|
78
|
+
'fetchLiquidations': true,
|
|
78
79
|
'fetchMarketLeverageTiers': true,
|
|
79
80
|
'fetchMarkets': true,
|
|
80
81
|
'fetchMarkOHLCV': true,
|
|
82
|
+
'fetchMyLiquidations': false,
|
|
81
83
|
'fetchMyTrades': true,
|
|
82
84
|
'fetchOHLCV': true,
|
|
83
85
|
'fetchOpenInterest': true,
|
|
@@ -8230,4 +8232,104 @@ export default class huobi extends Exchange {
|
|
|
8230
8232
|
'datetime': this.iso8601(timestamp),
|
|
8231
8233
|
};
|
|
8232
8234
|
}
|
|
8235
|
+
async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
|
|
8236
|
+
/**
|
|
8237
|
+
* @method
|
|
8238
|
+
* @name huobi#fetchLiquidations
|
|
8239
|
+
* @description retrieves the public liquidations of a trading pair
|
|
8240
|
+
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-liquidation-orders-new
|
|
8241
|
+
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-liquidation-orders-new
|
|
8242
|
+
* @see https://huobiapi.github.io/docs/dm/v1/en/#query-liquidation-order-information-new
|
|
8243
|
+
* @param {string} symbol unified CCXT market symbol
|
|
8244
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
8245
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
8246
|
+
* @param {object} [params] exchange specific parameters for the huobi api endpoint
|
|
8247
|
+
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
8248
|
+
* @param {int} [params.tradeType] default 0, linear swap 0: all liquidated orders, 5: liquidated longs; 6: liquidated shorts, inverse swap and future 0: filled liquidated orders, 5: liquidated close orders, 6: liquidated open orders
|
|
8249
|
+
* @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
|
|
8250
|
+
*/
|
|
8251
|
+
await this.loadMarkets();
|
|
8252
|
+
const market = this.market(symbol);
|
|
8253
|
+
const tradeType = this.safeInteger(params, 'trade_type', 0);
|
|
8254
|
+
let request = {
|
|
8255
|
+
'trade_type': tradeType,
|
|
8256
|
+
};
|
|
8257
|
+
if (since !== undefined) {
|
|
8258
|
+
request['start_time'] = since;
|
|
8259
|
+
}
|
|
8260
|
+
[request, params] = this.handleUntilOption('end_time', request, params);
|
|
8261
|
+
let response = undefined;
|
|
8262
|
+
if (market['swap']) {
|
|
8263
|
+
request['contract'] = market['id'];
|
|
8264
|
+
if (market['linear']) {
|
|
8265
|
+
response = await this.contractPublicGetLinearSwapApiV3SwapLiquidationOrders(this.extend(request, params));
|
|
8266
|
+
}
|
|
8267
|
+
else {
|
|
8268
|
+
response = await this.contractPublicGetSwapApiV3SwapLiquidationOrders(this.extend(request, params));
|
|
8269
|
+
}
|
|
8270
|
+
}
|
|
8271
|
+
else if (market['future']) {
|
|
8272
|
+
request['symbol'] = market['id'];
|
|
8273
|
+
response = await this.contractPublicGetApiV3ContractLiquidationOrders(this.extend(request, params));
|
|
8274
|
+
}
|
|
8275
|
+
else {
|
|
8276
|
+
throw new NotSupported(this.id + ' fetchLiquidations() does not support ' + market['type'] + ' orders');
|
|
8277
|
+
}
|
|
8278
|
+
//
|
|
8279
|
+
// {
|
|
8280
|
+
// "code": 200,
|
|
8281
|
+
// "msg": "",
|
|
8282
|
+
// "data": [
|
|
8283
|
+
// {
|
|
8284
|
+
// "query_id": 452057,
|
|
8285
|
+
// "contract_code": "BTC-USDT-211210",
|
|
8286
|
+
// "symbol": "USDT",
|
|
8287
|
+
// "direction": "sell",
|
|
8288
|
+
// "offset": "close",
|
|
8289
|
+
// "volume": 479.000000000000000000,
|
|
8290
|
+
// "price": 51441.700000000000000000,
|
|
8291
|
+
// "created_at": 1638593647864,
|
|
8292
|
+
// "amount": 0.479000000000000000,
|
|
8293
|
+
// "trade_turnover": 24640.574300000000000000,
|
|
8294
|
+
// "business_type": "futures",
|
|
8295
|
+
// "pair": "BTC-USDT"
|
|
8296
|
+
// }
|
|
8297
|
+
// ],
|
|
8298
|
+
// "ts": 1604312615051
|
|
8299
|
+
// }
|
|
8300
|
+
//
|
|
8301
|
+
const data = this.safeValue(response, 'data', []);
|
|
8302
|
+
return this.parseLiquidations(data, market, since, limit);
|
|
8303
|
+
}
|
|
8304
|
+
parseLiquidation(liquidation, market = undefined) {
|
|
8305
|
+
//
|
|
8306
|
+
// {
|
|
8307
|
+
// "query_id": 452057,
|
|
8308
|
+
// "contract_code": "BTC-USDT-211210",
|
|
8309
|
+
// "symbol": "USDT",
|
|
8310
|
+
// "direction": "sell",
|
|
8311
|
+
// "offset": "close",
|
|
8312
|
+
// "volume": 479.000000000000000000,
|
|
8313
|
+
// "price": 51441.700000000000000000,
|
|
8314
|
+
// "created_at": 1638593647864,
|
|
8315
|
+
// "amount": 0.479000000000000000,
|
|
8316
|
+
// "trade_turnover": 24640.574300000000000000,
|
|
8317
|
+
// "business_type": "futures",
|
|
8318
|
+
// "pair": "BTC-USDT"
|
|
8319
|
+
// }
|
|
8320
|
+
//
|
|
8321
|
+
const marketId = this.safeString(liquidation, 'contract_code');
|
|
8322
|
+
const timestamp = this.safeInteger(liquidation, 'created_at');
|
|
8323
|
+
return {
|
|
8324
|
+
'info': liquidation,
|
|
8325
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
8326
|
+
'contracts': this.safeNumber(liquidation, 'volume'),
|
|
8327
|
+
'contractSize': this.safeNumber(market, 'contractSize'),
|
|
8328
|
+
'price': this.safeNumber(liquidation, 'price'),
|
|
8329
|
+
'baseValue': this.safeNumber(liquidation, 'amount'),
|
|
8330
|
+
'quoteValue': this.safeNumber(liquidation, 'trade_turnover'),
|
|
8331
|
+
'timestamp': timestamp,
|
|
8332
|
+
'datetime': this.iso8601(timestamp),
|
|
8333
|
+
};
|
|
8334
|
+
}
|
|
8233
8335
|
}
|
package/js/src/kucoin.js
CHANGED
package/js/src/kucoinfutures.js
CHANGED
|
@@ -1036,7 +1036,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
1036
1036
|
//
|
|
1037
1037
|
const symbol = this.safeString(position, 'symbol');
|
|
1038
1038
|
market = this.safeMarket(symbol, market);
|
|
1039
|
-
const timestamp = this.
|
|
1039
|
+
const timestamp = this.safeInteger(position, 'currentTimestamp');
|
|
1040
1040
|
const size = this.safeString(position, 'currentQty');
|
|
1041
1041
|
let side = undefined;
|
|
1042
1042
|
if (Precise.stringGt(size, '0')) {
|
package/js/src/okx.js
CHANGED
package/js/src/poloniex.js
CHANGED
|
@@ -107,39 +107,51 @@ export default class poloniex extends Exchange {
|
|
|
107
107
|
'markets/{symbol}': 1,
|
|
108
108
|
'currencies': 20,
|
|
109
109
|
'currencies/{currency}': 20,
|
|
110
|
+
'v2/currencies': 20,
|
|
111
|
+
'v2/currencies/{currency}': 20,
|
|
110
112
|
'timestamp': 1,
|
|
111
113
|
'markets/price': 1,
|
|
112
114
|
'markets/{symbol}/price': 1,
|
|
115
|
+
'markets/markPrice': 1,
|
|
116
|
+
'markets/{symbol}/markPrice': 1,
|
|
117
|
+
'markets/{symbol}/markPriceComponents': 1,
|
|
113
118
|
'markets/{symbol}/orderBook': 1,
|
|
114
119
|
'markets/{symbol}/candles': 1,
|
|
115
120
|
'markets/{symbol}/trades': 20,
|
|
116
121
|
'markets/ticker24h': 20,
|
|
117
122
|
'markets/{symbol}/ticker24h': 20,
|
|
123
|
+
'markets/collateralInfo': 1,
|
|
124
|
+
'markets/{currency}/collateralInfo': 1,
|
|
125
|
+
'markets/borrowRatesInfo': 1,
|
|
118
126
|
},
|
|
119
127
|
},
|
|
120
128
|
'private': {
|
|
121
129
|
'get': {
|
|
122
130
|
'accounts': 4,
|
|
123
|
-
'accounts/activity': 4,
|
|
124
131
|
'accounts/balances': 4,
|
|
125
132
|
'accounts/{id}/balances': 4,
|
|
133
|
+
'accounts/activity': 20,
|
|
126
134
|
'accounts/transfer': 20,
|
|
127
135
|
'accounts/transfer/{id}': 4,
|
|
136
|
+
'feeinfo': 20,
|
|
137
|
+
'accounts/interest/history': 1,
|
|
128
138
|
'subaccounts': 4,
|
|
129
139
|
'subaccounts/balances': 20,
|
|
130
140
|
'subaccounts/{id}/balances': 4,
|
|
131
141
|
'subaccounts/transfer': 20,
|
|
132
142
|
'subaccounts/transfer/{id}': 4,
|
|
133
|
-
'feeinfo': 20,
|
|
134
143
|
'wallets/addresses': 20,
|
|
135
|
-
'wallets/activity': 20,
|
|
136
144
|
'wallets/addresses/{currency}': 20,
|
|
145
|
+
'wallets/activity': 20,
|
|
146
|
+
'margin/accountMargin': 4,
|
|
147
|
+
'margin/borrowStatus': 4,
|
|
148
|
+
'margin/maxSize': 4,
|
|
137
149
|
'orders': 20,
|
|
138
150
|
'orders/{id}': 4,
|
|
139
|
-
'orders/history': 20,
|
|
140
151
|
'orders/killSwitchStatus': 4,
|
|
141
152
|
'smartorders': 20,
|
|
142
153
|
'smartorders/{id}': 4,
|
|
154
|
+
'orders/history': 20,
|
|
143
155
|
'smartorders/history': 20,
|
|
144
156
|
'trades': 20,
|
|
145
157
|
'orders/{id}/trades': 4,
|
|
@@ -149,9 +161,10 @@ export default class poloniex extends Exchange {
|
|
|
149
161
|
'subaccounts/transfer': 20,
|
|
150
162
|
'wallets/address': 20,
|
|
151
163
|
'wallets/withdraw': 20,
|
|
164
|
+
'v2/wallets/withdraw': 20,
|
|
152
165
|
'orders': 4,
|
|
153
|
-
'orders/killSwitch': 4,
|
|
154
166
|
'orders/batch': 20,
|
|
167
|
+
'orders/killSwitch': 4,
|
|
155
168
|
'smartorders': 4,
|
|
156
169
|
},
|
|
157
170
|
'delete': {
|
|
@@ -163,8 +176,8 @@ export default class poloniex extends Exchange {
|
|
|
163
176
|
'smartorders': 20,
|
|
164
177
|
},
|
|
165
178
|
'put': {
|
|
166
|
-
'orders/{id}':
|
|
167
|
-
'smartorders/{id}':
|
|
179
|
+
'orders/{id}': 20,
|
|
180
|
+
'smartorders/{id}': 20,
|
|
168
181
|
},
|
|
169
182
|
},
|
|
170
183
|
},
|
package/package.json
CHANGED
package/skip-tests.json
CHANGED
|
@@ -109,7 +109,18 @@
|
|
|
109
109
|
"fetchTicker": {
|
|
110
110
|
"quoteVolume": "quoteVolume >= baseVolume * low is failing",
|
|
111
111
|
"baseVolume": "quoteVolume >= baseVolume * low is failing"
|
|
112
|
-
}
|
|
112
|
+
},
|
|
113
|
+
"fetchPositions": "currently returns a lot of default/non open positions",
|
|
114
|
+
"fetchLedger": {
|
|
115
|
+
"account": "empty",
|
|
116
|
+
"status": "not provided",
|
|
117
|
+
"before": "not provided",
|
|
118
|
+
"after": "not provided",
|
|
119
|
+
"fee": "not provided",
|
|
120
|
+
"code": "not provided",
|
|
121
|
+
"referenceId": "not provided"
|
|
122
|
+
},
|
|
123
|
+
"fetchBalance": "tmp skip"
|
|
113
124
|
}
|
|
114
125
|
},
|
|
115
126
|
"bit2c": {
|
|
@@ -504,7 +515,23 @@
|
|
|
504
515
|
"fetchTicker": {
|
|
505
516
|
"symbol" :"same"
|
|
506
517
|
},
|
|
507
|
-
"fetchTrades": "endpoint return Internal System Error"
|
|
518
|
+
"fetchTrades": "endpoint return Internal System Error",
|
|
519
|
+
"fetchCurrencies": {
|
|
520
|
+
"currencyIdAndCode": "temp skip"
|
|
521
|
+
},
|
|
522
|
+
"loadMarkets": {
|
|
523
|
+
"currencyIdAndCode": "temp skip"
|
|
524
|
+
},
|
|
525
|
+
"fetchPositions": "currently returns a lot of default/non open positions",
|
|
526
|
+
"fetchLedger": {
|
|
527
|
+
"account": "account is not provided",
|
|
528
|
+
"status": "status is not provided",
|
|
529
|
+
"fee": "undefined"
|
|
530
|
+
},
|
|
531
|
+
"fetchOpenInterestHistory": {
|
|
532
|
+
"openInterestAmount": "openInterestAmount is not provided"
|
|
533
|
+
},
|
|
534
|
+
"fetchBorrowRate": "does not work with unified account"
|
|
508
535
|
}
|
|
509
536
|
},
|
|
510
537
|
"buda": {
|
|
@@ -778,7 +805,19 @@
|
|
|
778
805
|
"ask":"same",
|
|
779
806
|
"quoteVolume": "same",
|
|
780
807
|
"baseVolume": "same"
|
|
781
|
-
}
|
|
808
|
+
},
|
|
809
|
+
"fetchPositions": "currently returns a lot of default/non open positions",
|
|
810
|
+
"fetchLedger": {
|
|
811
|
+
"currency": "undefined",
|
|
812
|
+
"status": "undefined",
|
|
813
|
+
"fee": "undefined",
|
|
814
|
+
"account": "undefined",
|
|
815
|
+
"referenceAccount": "undefined",
|
|
816
|
+
"referenceId": "undefined"
|
|
817
|
+
},
|
|
818
|
+
"fetchTradingFees": "sandbox does not have this endpoint",
|
|
819
|
+
"fetchDeposits": "sandbox does not have this endpoint",
|
|
820
|
+
"fetchWithdrawals": "sandbox does not have this endpoint"
|
|
782
821
|
}
|
|
783
822
|
},
|
|
784
823
|
"hollaex": {
|
|
@@ -943,6 +982,9 @@
|
|
|
943
982
|
"skipMethods":{
|
|
944
983
|
"loadMarkets": {
|
|
945
984
|
"currencyIdAndCode": "messed"
|
|
985
|
+
},
|
|
986
|
+
"fetchPositions": {
|
|
987
|
+
"percentage": "percentage is not provided"
|
|
946
988
|
}
|
|
947
989
|
}
|
|
948
990
|
},
|
|
@@ -1182,7 +1224,9 @@
|
|
|
1182
1224
|
"skipMethods": {
|
|
1183
1225
|
"loadMarkets": "linear & inverse must not be same",
|
|
1184
1226
|
"fetchCurrencies": {
|
|
1185
|
-
"info": "null"
|
|
1227
|
+
"info": "null",
|
|
1228
|
+
"currencyIdAndCode": "temp skip"
|
|
1229
|
+
|
|
1186
1230
|
},
|
|
1187
1231
|
"fetchTickers": {
|
|
1188
1232
|
"quoteVolume": "quoteVolume <= baseVolume * high : https://app.travis-ci.com/github/ccxt/ccxt/builds/263319874#L2132",
|
|
@@ -1190,7 +1234,9 @@
|
|
|
1190
1234
|
},
|
|
1191
1235
|
"fetchTicker": {
|
|
1192
1236
|
"quoteVolume": "quoteVolume <= baseVolume * high <<< okx fetchTicker"
|
|
1193
|
-
}
|
|
1237
|
+
},
|
|
1238
|
+
"fetchBorrowRate": "some fields that we can't skip missing",
|
|
1239
|
+
"fetchBorrowRates": "same"
|
|
1194
1240
|
}
|
|
1195
1241
|
},
|
|
1196
1242
|
"tidex": {
|
|
@@ -1296,6 +1342,16 @@
|
|
|
1296
1342
|
"fetchCurrencies":{
|
|
1297
1343
|
"withdraw": "undefined",
|
|
1298
1344
|
"deposit": "undefined"
|
|
1345
|
+
},
|
|
1346
|
+
"fetchPositions": {
|
|
1347
|
+
"leverage": "undefined",
|
|
1348
|
+
"percentage": "undefined",
|
|
1349
|
+
"hedged": "undefined",
|
|
1350
|
+
"stopLossPrice": "undefined",
|
|
1351
|
+
"takeProfitPrice": "undefined",
|
|
1352
|
+
"id": "undefined",
|
|
1353
|
+
"marginRatio": "undefined",
|
|
1354
|
+
"collateral": "undefined"
|
|
1299
1355
|
}
|
|
1300
1356
|
}
|
|
1301
1357
|
},
|