ccxt 4.3.42 → 4.3.43

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.
@@ -900,7 +900,29 @@ export default class btcmarkets extends Exchange {
900
900
  const request = {
901
901
  'ids': ids,
902
902
  };
903
- return await this.privateDeleteBatchordersIds(this.extend(request, params));
903
+ const response = await this.privateDeleteBatchordersIds(this.extend(request, params));
904
+ //
905
+ // {
906
+ // "cancelOrders": [
907
+ // {
908
+ // "orderId": "414186",
909
+ // "clientOrderId": "6"
910
+ // },
911
+ // ...
912
+ // ],
913
+ // "unprocessedRequests": [
914
+ // {
915
+ // "code": "OrderAlreadyCancelled",
916
+ // "message": "order is already cancelled.",
917
+ // "requestId": "1"
918
+ // }
919
+ // ]
920
+ // }
921
+ //
922
+ const cancelOrders = this.safeList(response, 'cancelOrders', []);
923
+ const unprocessedRequests = this.safeList(response, 'unprocessedRequests', []);
924
+ const orders = this.arrayConcat(cancelOrders, unprocessedRequests);
925
+ return this.parseOrders(orders);
904
926
  }
905
927
  async cancelOrder(id, symbol = undefined, params = {}) {
906
928
  /**
@@ -917,7 +939,14 @@ export default class btcmarkets extends Exchange {
917
939
  const request = {
918
940
  'id': id,
919
941
  };
920
- return await this.privateDeleteOrdersId(this.extend(request, params));
942
+ const response = await this.privateDeleteOrdersId(this.extend(request, params));
943
+ //
944
+ // {
945
+ // "orderId": "7524",
946
+ // "clientOrderId": "123-456"
947
+ // }
948
+ //
949
+ return this.parseOrder(response);
921
950
  }
922
951
  calculateFee(symbol, type, side, amount, price, takerOrMaker = 'taker', params = {}) {
923
952
  /**
package/js/src/coinex.js CHANGED
@@ -21,7 +21,7 @@ export default class coinex extends Exchange {
21
21
  return this.deepExtend(super.describe(), {
22
22
  'id': 'coinex',
23
23
  'name': 'CoinEx',
24
- 'version': 'v1',
24
+ 'version': 'v2',
25
25
  'countries': ['CN'],
26
26
  // IP ratelimit is 400 requests per second
27
27
  // rateLimit = 1000ms / 400 = 2.5
@@ -318,6 +318,8 @@ export default class coinex extends Exchange {
318
318
  'futures/position-level': 1,
319
319
  'futures/liquidation-history': 1,
320
320
  'futures/basis-history': 1,
321
+ 'assets/deposit-withdraw-config': 1,
322
+ 'assets/all-deposit-withdraw-config': 1,
321
323
  },
322
324
  },
323
325
  'private': {
@@ -340,7 +342,6 @@ export default class coinex extends Exchange {
340
342
  'assets/deposit-address': 40,
341
343
  'assets/deposit-history': 40,
342
344
  'assets/withdraw': 40,
343
- 'assets/deposit-withdraw-config': 1,
344
345
  'assets/transfer-history': 40,
345
346
  'spot/order-status': 8,
346
347
  'spot/batch-order-status': 8,
@@ -534,131 +535,129 @@ export default class coinex extends Exchange {
534
535
  });
535
536
  }
536
537
  async fetchCurrencies(params = {}) {
537
- const response = await this.v1PublicGetCommonAssetConfig(params);
538
+ /**
539
+ * @method
540
+ * @name coinex#fetchCurrencies
541
+ * @description fetches all available currencies on an exchange
542
+ * @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
543
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
544
+ * @returns {object} an associative dictionary of currencies
545
+ */
546
+ const response = await this.v2PublicGetAssetsAllDepositWithdrawConfig(params);
547
+ //
538
548
  // {
539
549
  // "code": 0,
540
- // "data": {
541
- // "USDT-ERC20": {
542
- // "asset": "USDT",
543
- // "chain": "ERC20",
544
- // "withdrawal_precision": 6,
545
- // "can_deposit": true,
546
- // "can_withdraw": true,
547
- // "deposit_least_amount": "4.9",
548
- // "withdraw_least_amount": "4.9",
549
- // "withdraw_tx_fee": "4.9",
550
- // "explorer_asset_url": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7"
551
- // },
552
- // ...
553
- // },
554
- // "message": "Success",
550
+ // "data": [
551
+ // {
552
+ // "asset": {
553
+ // "ccy": "CET",
554
+ // "deposit_enabled": true,
555
+ // "withdraw_enabled": true,
556
+ // "inter_transfer_enabled": true,
557
+ // "is_st": false
558
+ // },
559
+ // "chains": [
560
+ // {
561
+ // "chain": "CSC",
562
+ // "min_deposit_amount": "0.8",
563
+ // "min_withdraw_amount": "8",
564
+ // "deposit_enabled": true,
565
+ // "withdraw_enabled": true,
566
+ // "deposit_delay_minutes": 0,
567
+ // "safe_confirmations": 10,
568
+ // "irreversible_confirmations": 20,
569
+ // "deflation_rate": "0",
570
+ // "withdrawal_fee": "0.026",
571
+ // "withdrawal_precision": 8,
572
+ // "memo": "",
573
+ // "is_memo_required_for_deposit": false,
574
+ // "explorer_asset_url": ""
575
+ // },
576
+ // ]
577
+ // }
578
+ // ],
579
+ // "message": "OK"
555
580
  // }
556
581
  //
557
- const data = this.safeValue(response, 'data', []);
558
- const coins = Object.keys(data);
582
+ const data = this.safeList(response, 'data', []);
559
583
  const result = {};
560
- for (let i = 0; i < coins.length; i++) {
561
- const coin = coins[i];
562
- const currency = data[coin];
563
- const currencyId = this.safeString(currency, 'asset');
564
- const networkId = this.safeString(currency, 'chain');
584
+ for (let i = 0; i < data.length; i++) {
585
+ const coin = data[i];
586
+ const asset = this.safeDict(coin, 'asset', {});
587
+ const chains = this.safeList(coin, 'chains', []);
588
+ const currencyId = this.safeString(asset, 'ccy');
589
+ if (currencyId === undefined) {
590
+ continue; // coinex returns empty structures for some reason
591
+ }
565
592
  const code = this.safeCurrencyCode(currencyId);
566
- const precisionString = this.parsePrecision(this.safeString(currency, 'withdrawal_precision'));
567
- const precision = this.parseNumber(precisionString);
568
- const canDeposit = this.safeValue(currency, 'can_deposit');
569
- const canWithdraw = this.safeValue(currency, 'can_withdraw');
570
- const feeString = this.safeString(currency, 'withdraw_tx_fee');
571
- const fee = this.parseNumber(feeString);
572
- const minNetworkDepositString = this.safeString(currency, 'deposit_least_amount');
573
- const minNetworkDeposit = this.parseNumber(minNetworkDepositString);
574
- const minNetworkWithdrawString = this.safeString(currency, 'withdraw_least_amount');
575
- const minNetworkWithdraw = this.parseNumber(minNetworkWithdrawString);
576
- if (this.safeValue(result, code) === undefined) {
577
- result[code] = {
578
- 'id': currencyId,
579
- 'numericId': undefined,
580
- 'code': code,
581
- 'info': undefined,
593
+ const canDeposit = this.safeBool(asset, 'deposit_enabled');
594
+ const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
595
+ const firstChain = this.safeDict(chains, 0, {});
596
+ const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
597
+ result[code] = {
598
+ 'id': currencyId,
599
+ 'code': code,
600
+ 'name': undefined,
601
+ 'active': canDeposit && canWithdraw,
602
+ 'deposit': canDeposit,
603
+ 'withdraw': canWithdraw,
604
+ 'fee': undefined,
605
+ 'precision': this.parseNumber(firstPrecisionString),
606
+ 'limits': {
607
+ 'amount': {
608
+ 'min': undefined,
609
+ 'max': undefined,
610
+ },
611
+ 'deposit': {
612
+ 'min': undefined,
613
+ 'max': undefined,
614
+ },
615
+ 'withdraw': {
616
+ 'min': undefined,
617
+ 'max': undefined,
618
+ },
619
+ },
620
+ 'networks': {},
621
+ 'info': coin,
622
+ };
623
+ for (let j = 0; j < chains.length; j++) {
624
+ const chain = chains[j];
625
+ const networkId = this.safeString(chain, 'chain');
626
+ const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
627
+ const feeString = this.safeString(chain, 'withdrawal_fee');
628
+ const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
629
+ const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
630
+ const canDepositChain = this.safeBool(chain, 'deposit_enabled');
631
+ const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
632
+ const network = {
633
+ 'id': networkId,
634
+ 'network': networkId,
582
635
  'name': undefined,
583
- 'active': canDeposit && canWithdraw,
584
- 'deposit': canDeposit,
585
- 'withdraw': canWithdraw,
586
- 'fee': fee,
587
- 'precision': precision,
636
+ 'active': canDepositChain && canWithdrawChain,
637
+ 'deposit': canDepositChain,
638
+ 'withdraw': canWithdrawChain,
639
+ 'fee': this.parseNumber(feeString),
640
+ 'precision': this.parseNumber(precisionString),
588
641
  'limits': {
589
642
  'amount': {
590
643
  'min': undefined,
591
644
  'max': undefined,
592
645
  },
593
646
  'deposit': {
594
- 'min': minNetworkDeposit,
647
+ 'min': this.parseNumber(minNetworkDepositString),
595
648
  'max': undefined,
596
649
  },
597
650
  'withdraw': {
598
- 'min': minNetworkWithdraw,
651
+ 'min': this.parseNumber(minNetworkWithdrawString),
599
652
  'max': undefined,
600
653
  },
601
654
  },
655
+ 'info': chain,
602
656
  };
657
+ const networks = this.safeDict(result[code], 'networks', {});
658
+ networks[networkId] = network;
659
+ result[code]['networks'] = networks;
603
660
  }
604
- let minFeeString = this.safeString(result[code], 'fee');
605
- if (feeString !== undefined) {
606
- minFeeString = (minFeeString === undefined) ? feeString : Precise.stringMin(feeString, minFeeString);
607
- }
608
- let depositAvailable = this.safeValue(result[code], 'deposit');
609
- depositAvailable = (canDeposit) ? canDeposit : depositAvailable;
610
- let withdrawAvailable = this.safeValue(result[code], 'withdraw');
611
- withdrawAvailable = (canWithdraw) ? canWithdraw : withdrawAvailable;
612
- let minDepositString = this.safeString(result[code]['limits']['deposit'], 'min');
613
- if (minNetworkDepositString !== undefined) {
614
- minDepositString = (minDepositString === undefined) ? minNetworkDepositString : Precise.stringMin(minNetworkDepositString, minDepositString);
615
- }
616
- let minWithdrawString = this.safeString(result[code]['limits']['withdraw'], 'min');
617
- if (minNetworkWithdrawString !== undefined) {
618
- minWithdrawString = (minWithdrawString === undefined) ? minNetworkWithdrawString : Precise.stringMin(minNetworkWithdrawString, minWithdrawString);
619
- }
620
- let minPrecisionString = this.safeString(result[code], 'precision');
621
- if (precisionString !== undefined) {
622
- minPrecisionString = (minPrecisionString === undefined) ? precisionString : Precise.stringMin(precisionString, minPrecisionString);
623
- }
624
- const networks = this.safeValue(result[code], 'networks', {});
625
- const network = {
626
- 'info': currency,
627
- 'id': networkId,
628
- 'network': networkId,
629
- 'name': undefined,
630
- 'limits': {
631
- 'amount': {
632
- 'min': undefined,
633
- 'max': undefined,
634
- },
635
- 'deposit': {
636
- 'min': this.safeNumber(currency, 'deposit_least_amount'),
637
- 'max': undefined,
638
- },
639
- 'withdraw': {
640
- 'min': this.safeNumber(currency, 'withdraw_least_amount'),
641
- 'max': undefined,
642
- },
643
- },
644
- 'active': canDeposit && canWithdraw,
645
- 'deposit': canDeposit,
646
- 'withdraw': canWithdraw,
647
- 'fee': fee,
648
- 'precision': precision,
649
- };
650
- networks[networkId] = network;
651
- result[code]['networks'] = networks;
652
- result[code]['active'] = depositAvailable && withdrawAvailable;
653
- result[code]['deposit'] = depositAvailable;
654
- result[code]['withdraw'] = withdrawAvailable;
655
- const info = this.safeValue(result[code], 'info', []);
656
- info.push(currency);
657
- result[code]['info'] = info;
658
- result[code]['fee'] = this.parseNumber(minFeeString);
659
- result[code]['precision'] = this.parseNumber(minPrecisionString);
660
- result[code]['limits']['deposit']['min'] = this.parseNumber(minDepositString);
661
- result[code]['limits']['withdraw']['min'] = this.parseNumber(minWithdrawString);
662
661
  }
663
662
  return result;
664
663
  }
@@ -5431,7 +5430,7 @@ export default class coinex extends Exchange {
5431
5430
  const request = {
5432
5431
  'ccy': currency['id'],
5433
5432
  };
5434
- const response = await this.v2PrivateGetAssetsDepositWithdrawConfig(this.extend(request, params));
5433
+ const response = await this.v2PublicGetAssetsDepositWithdrawConfig(this.extend(request, params));
5435
5434
  //
5436
5435
  // {
5437
5436
  // "code": 0,
package/js/src/phemex.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
8
  import Exchange from './abstract/phemex.js';
9
- import { ExchangeError, BadSymbol, AuthenticationError, InsufficientFunds, InvalidOrder, ArgumentsRequired, OrderNotFound, BadRequest, PermissionDenied, AccountSuspended, CancelPending, DDoSProtection, DuplicateOrderId, RateLimitExceeded, NotSupported } from './base/errors.js';
9
+ import { ExchangeError, BadSymbol, AuthenticationError, InsufficientFunds, InvalidOrder, ArgumentsRequired, OrderNotFound, BadRequest, PermissionDenied, AccountSuspended, CancelPending, DDoSProtection, DuplicateOrderId, RateLimitExceeded } from './base/errors.js';
10
10
  import { Precise } from './base/Precise.js';
11
11
  import { TICK_SIZE } from './base/functions/number.js';
12
12
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
@@ -2957,6 +2957,7 @@ export default class phemex extends Exchange {
2957
2957
  /**
2958
2958
  * @method
2959
2959
  * @name phemex#fetchOrder
2960
+ * @see https://phemex-docs.github.io/#query-orders-by-ids
2960
2961
  * @description fetches information on an order made by the user
2961
2962
  * @param {string} symbol unified symbol of the market the order was made in
2962
2963
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2967,9 +2968,6 @@ export default class phemex extends Exchange {
2967
2968
  }
2968
2969
  await this.loadMarkets();
2969
2970
  const market = this.market(symbol);
2970
- if (market['settle'] === 'USDT') {
2971
- throw new NotSupported(this.id + 'fetchOrder() is not supported yet for USDT settled swap markets'); // https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-user-order-by-orderid-or-query-user-order-by-client-order-id
2972
- }
2973
2971
  const request = {
2974
2972
  'symbol': market['id'],
2975
2973
  };
@@ -2982,7 +2980,10 @@ export default class phemex extends Exchange {
2982
2980
  request['orderID'] = id;
2983
2981
  }
2984
2982
  let response = undefined;
2985
- if (market['spot']) {
2983
+ if (market['settle'] === 'USDT') {
2984
+ response = await this.privateGetApiDataGFuturesOrdersByOrderId(this.extend(request, params));
2985
+ }
2986
+ else if (market['spot']) {
2986
2987
  response = await this.privateGetSpotOrdersActive(this.extend(request, params));
2987
2988
  }
2988
2989
  else {
@@ -1228,23 +1228,30 @@ export default class bitget extends bitgetRest {
1228
1228
  // isolated and cross margin
1229
1229
  //
1230
1230
  // {
1231
- // "enterPointSource": "web",
1232
- // "force": "gtc",
1233
- // "feeDetail": [],
1234
- // "orderType": "limit",
1235
- // "price": "35000.000000000",
1236
- // "quoteSize": "10.500000000",
1237
- // "side": "buy",
1238
- // "status": "live",
1239
- // "baseSize": "0.000300000",
1240
- // "cTime": "1701923982427",
1241
- // "clientOid": "4902047879864dc980c4840e9906db4e",
1242
- // "fillPrice": "0.000000000",
1243
- // "baseVolume": "0.000000000",
1244
- // "fillTotalAmount": "0.000000000",
1245
- // "loanType": "auto-loan-and-repay",
1246
- // "orderId": "1116515595178356737"
1247
- // }
1231
+ // enterPointSource: "web",
1232
+ // feeDetail: [
1233
+ // {
1234
+ // feeCoin: "AAVE",
1235
+ // deduction: "no",
1236
+ // totalDeductionFee: "0",
1237
+ // totalFee: "-0.00010740",
1238
+ // },
1239
+ // ],
1240
+ // force: "gtc",
1241
+ // orderType: "limit",
1242
+ // price: "93.170000000",
1243
+ // fillPrice: "93.170000000",
1244
+ // baseSize: "0.110600000", // total amount of order
1245
+ // quoteSize: "10.304602000", // total cost of order (independently if order is filled or pending)
1246
+ // baseVolume: "0.107400000", // filled amount of order (during order's lifecycle, and not for this specific incoming update)
1247
+ // fillTotalAmount: "10.006458000", // filled cost of order (during order's lifecycle, and not for this specific incoming update)
1248
+ // side: "buy",
1249
+ // status: "partially_filled",
1250
+ // cTime: "1717875017306",
1251
+ // clientOid: "b57afe789a06454e9c560a2aab7f7201",
1252
+ // loanType: "auto-loan",
1253
+ // orderId: "1183419084588060673",
1254
+ // }
1248
1255
  //
1249
1256
  const isSpot = !('posMode' in order);
1250
1257
  const isMargin = ('loanType' in order);
@@ -1285,12 +1292,12 @@ export default class bitget extends bitgetRest {
1285
1292
  let filledAmount = undefined;
1286
1293
  let cost = undefined;
1287
1294
  let remaining = undefined;
1288
- const totalFilled = this.safeString(order, 'accBaseVolume');
1295
+ let totalFilled = this.safeString(order, 'accBaseVolume');
1289
1296
  if (isSpot) {
1290
1297
  if (isMargin) {
1291
- filledAmount = this.omitZero(this.safeString(order, 'fillTotalAmount'));
1292
- totalAmount = this.omitZero(this.safeString(order, 'baseSize')); // for margin trading
1293
- cost = this.safeString(order, 'quoteSize');
1298
+ totalAmount = this.safeString(order, 'baseSize');
1299
+ totalFilled = this.safeString(order, 'baseVolume');
1300
+ cost = this.safeString(order, 'fillTotalAmount');
1294
1301
  }
1295
1302
  else {
1296
1303
  const partialFillAmount = this.safeString(order, 'baseVolume');
@@ -126,7 +126,7 @@ export default class bybit extends bybitRest {
126
126
  },
127
127
  'streaming': {
128
128
  'ping': this.ping,
129
- 'keepAlive': 19000,
129
+ 'keepAlive': 18000,
130
130
  },
131
131
  });
132
132
  }
@@ -64,7 +64,7 @@ export default class mexc extends mexcRest {
64
64
  },
65
65
  'streaming': {
66
66
  'ping': this.ping,
67
- 'keepAlive': 10000,
67
+ 'keepAlive': 8000,
68
68
  },
69
69
  'exceptions': {},
70
70
  });
@@ -18,7 +18,7 @@ export default class tradeogre extends Exchange {
18
18
  parseBalance(response: any): import("./base/types.js").Balances;
19
19
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
20
20
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
21
- cancelAllOrders(symbol?: Str, params?: {}): Promise<Order>;
21
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
22
22
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
23
23
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
24
24
  parseOrder(order: Dict, market?: Market): Order;
@@ -6,7 +6,7 @@
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/tradeogre.js';
9
- import { InsufficientFunds, AuthenticationError, BadRequest, ExchangeError } from './base/errors.js';
9
+ import { InsufficientFunds, AuthenticationError, BadRequest, ExchangeError, ArgumentsRequired } from './base/errors.js';
10
10
  import { TICK_SIZE } from './base/functions/number.js';
11
11
  // ---------------------------------------------------------------------------
12
12
  /**
@@ -452,7 +452,7 @@ export default class tradeogre extends Exchange {
452
452
  * @name tradeogre#createOrder
453
453
  * @description create a trade order
454
454
  * @param {string} symbol unified symbol of the market to create an order in
455
- * @param {string} type not used by tradeogre
455
+ * @param {string} type must be 'limit'
456
456
  * @param {string} side 'buy' or 'sell'
457
457
  * @param {float} amount how much of currency you want to trade in units of base currency
458
458
  * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
@@ -461,14 +461,17 @@ export default class tradeogre extends Exchange {
461
461
  */
462
462
  await this.loadMarkets();
463
463
  const market = this.market(symbol);
464
+ if (type === 'market') {
465
+ throw new BadRequest(this.id + ' createOrder does not support market orders');
466
+ }
467
+ if (price === undefined) {
468
+ throw new ArgumentsRequired(this.id + ' createOrder requires a limit parameter');
469
+ }
464
470
  const request = {
465
471
  'market': market['id'],
466
472
  'quantity': this.parseToNumeric(this.amountToPrecision(symbol, amount)),
467
473
  'price': this.parseToNumeric(this.priceToPrecision(symbol, price)),
468
474
  };
469
- if (type === 'market') {
470
- throw new BadRequest(this.id + ' createOrder does not support market orders');
471
- }
472
475
  let response = undefined;
473
476
  if (side === 'buy') {
474
477
  response = await this.privatePostOrderBuy(this.extend(request, params));
@@ -505,7 +508,10 @@ export default class tradeogre extends Exchange {
505
508
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
506
509
  */
507
510
  await this.loadMarkets();
508
- return await this.cancelOrder('all', symbol, params);
511
+ const response = await this.cancelOrder('all', symbol, params);
512
+ return [
513
+ response,
514
+ ];
509
515
  }
510
516
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
511
517
  /**
@@ -53,26 +53,7 @@ export default class wavesexchange extends Exchange {
53
53
  safeGetDynamic(settings: any): any;
54
54
  safeGetRates(dynamic: any): any;
55
55
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
56
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<{
57
- info: any;
58
- id: string;
59
- clientOrderId: any;
60
- timestamp: any;
61
- datetime: any;
62
- lastTradeTimestamp: any;
63
- symbol: string;
64
- type: any;
65
- side: any;
66
- price: any;
67
- amount: any;
68
- cost: any;
69
- average: any;
70
- filled: any;
71
- remaining: any;
72
- status: any;
73
- fee: any;
74
- trades: any;
75
- }>;
56
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
76
57
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
77
58
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
78
59
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -1502,7 +1502,7 @@ export default class wavesexchange extends Exchange {
1502
1502
  const firstMessage = this.safeValue(message, 0);
1503
1503
  const firstOrder = this.safeValue(firstMessage, 0);
1504
1504
  const returnedId = this.safeString(firstOrder, 'orderId');
1505
- return {
1505
+ return this.safeOrder({
1506
1506
  'info': response,
1507
1507
  'id': returnedId,
1508
1508
  'clientOrderId': undefined,
@@ -1521,7 +1521,7 @@ export default class wavesexchange extends Exchange {
1521
1521
  'status': undefined,
1522
1522
  'fee': undefined,
1523
1523
  'trades': undefined,
1524
- };
1524
+ });
1525
1525
  }
1526
1526
  async fetchOrder(id, symbol = undefined, params = {}) {
1527
1527
  /**
@@ -28,7 +28,7 @@ export default class wazirx extends Exchange {
28
28
  fetchBalance(params?: {}): Promise<Balances>;
29
29
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
30
30
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
31
- cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
31
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
32
32
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
33
33
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
34
34
  parseOrder(order: Dict, market?: Market): Order;
package/js/src/wazirx.js CHANGED
@@ -795,7 +795,26 @@ export default class wazirx extends Exchange {
795
795
  const request = {
796
796
  'symbol': market['id'],
797
797
  };
798
- return await this.privateDeleteOpenOrders(this.extend(request, params));
798
+ const response = await this.privateDeleteOpenOrders(this.extend(request, params));
799
+ //
800
+ // [
801
+ // {
802
+ // id: "4565421197",
803
+ // symbol: "adausdt",
804
+ // type: "limit",
805
+ // side: "buy",
806
+ // status: "wait",
807
+ // price: "0.41",
808
+ // origQty: "11.00",
809
+ // executedQty: "0.00",
810
+ // avgPrice: "0.00",
811
+ // createdTime: "1718089507000",
812
+ // updatedTime: "1718089507000",
813
+ // clientOrderId: "93d2a838-e272-405d-91e7-3a7bc6d3a003"
814
+ // }
815
+ // ]
816
+ //
817
+ return this.parseOrders(response);
799
818
  }
800
819
  async cancelOrder(id, symbol = undefined, params = {}) {
801
820
  /**
@@ -871,18 +890,22 @@ export default class wazirx extends Exchange {
871
890
  return this.parseOrder(response, market);
872
891
  }
873
892
  parseOrder(order, market = undefined) {
874
- // {
875
- // "id":1949417813,
876
- // "symbol":"ltcusdt",
877
- // "type":"limit",
878
- // "side":"sell",
879
- // "status":"done",
880
- // "price":"146.2",
881
- // "origQty":"0.05",
882
- // "executedQty":"0.05",
883
- // "createdTime":1641252564000,
884
- // "updatedTime":1641252564000
885
- // },
893
+ //
894
+ // {
895
+ // "id": 1949417813,
896
+ // "symbol": "ltcusdt",
897
+ // "type": "limit",
898
+ // "side": "sell",
899
+ // "status": "done",
900
+ // "price": "146.2",
901
+ // "origQty": "0.05",
902
+ // "executedQty": "0.05",
903
+ // "avgPrice": "0.00",
904
+ // "createdTime": 1641252564000,
905
+ // "updatedTime": 1641252564000
906
+ // "clientOrderId": "93d2a838-e272-405d-91e7-3a7bc6d3a003"
907
+ // }
908
+ //
886
909
  const created = this.safeInteger(order, 'createdTime');
887
910
  const updated = this.safeInteger(order, 'updatedTime');
888
911
  const marketId = this.safeString(order, 'symbol');
@@ -897,7 +920,7 @@ export default class wazirx extends Exchange {
897
920
  return this.safeOrder({
898
921
  'info': order,
899
922
  'id': id,
900
- 'clientOrderId': undefined,
923
+ 'clientOrderId': this.safeString(order, 'clientOrderId'),
901
924
  'timestamp': created,
902
925
  'datetime': this.iso8601(created),
903
926
  'lastTradeTimestamp': updated,
@@ -913,7 +936,7 @@ export default class wazirx extends Exchange {
913
936
  'remaining': undefined,
914
937
  'cost': undefined,
915
938
  'fee': undefined,
916
- 'average': undefined,
939
+ 'average': this.safeString(order, 'avgPrice'),
917
940
  'trades': [],
918
941
  }, market);
919
942
  }