ccxt 4.4.26 → 4.4.28

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.
Files changed (105) hide show
  1. package/README.md +133 -132
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +1 -1
  5. package/dist/cjs/src/alpaca.js +198 -5
  6. package/dist/cjs/src/ascendex.js +1 -1
  7. package/dist/cjs/src/base/Exchange.js +18 -0
  8. package/dist/cjs/src/bequant.js +1 -1
  9. package/dist/cjs/src/bigone.js +1 -1
  10. package/dist/cjs/src/binance.js +8 -1
  11. package/dist/cjs/src/binancecoinm.js +1 -1
  12. package/dist/cjs/src/binanceus.js +1 -1
  13. package/dist/cjs/src/binanceusdm.js +1 -1
  14. package/dist/cjs/src/bingx.js +25 -36
  15. package/dist/cjs/src/bit2c.js +1 -1
  16. package/dist/cjs/src/bitbank.js +1 -1
  17. package/dist/cjs/src/bitbns.js +1 -1
  18. package/dist/cjs/src/bitfinex.js +1 -1
  19. package/dist/cjs/src/bitfinex2.js +1 -1
  20. package/dist/cjs/src/bitflyer.js +1 -1
  21. package/dist/cjs/src/bitget.js +1 -1
  22. package/dist/cjs/src/bithumb.js +1 -1
  23. package/dist/cjs/src/bitmart.js +1 -1
  24. package/dist/cjs/src/bitmex.js +1 -1
  25. package/dist/cjs/src/bitopro.js +1 -1
  26. package/dist/cjs/src/bitrue.js +1 -1
  27. package/dist/cjs/src/bitso.js +1 -1
  28. package/dist/cjs/src/bitstamp.js +1 -1
  29. package/dist/cjs/src/bitteam.js +1 -1
  30. package/dist/cjs/src/bitvavo.js +1 -1
  31. package/dist/cjs/src/bl3p.js +1 -1
  32. package/dist/cjs/src/blockchaincom.js +1 -1
  33. package/dist/cjs/src/blofin.js +1 -1
  34. package/dist/cjs/src/btcalpha.js +1 -1
  35. package/dist/cjs/src/btcbox.js +1 -1
  36. package/dist/cjs/src/btcmarkets.js +1 -1
  37. package/dist/cjs/src/btcturk.js +1 -1
  38. package/dist/cjs/src/bybit.js +5 -1
  39. package/dist/cjs/src/coinbase.js +97 -11
  40. package/dist/cjs/src/coinex.js +1 -1
  41. package/dist/cjs/src/gate.js +22 -16
  42. package/dist/cjs/src/hyperliquid.js +21 -1
  43. package/dist/cjs/src/kraken.js +48 -35
  44. package/dist/cjs/src/lbank.js +100 -1
  45. package/dist/cjs/src/pro/binance.js +5 -7
  46. package/dist/cjs/src/pro/lbank.js +9 -4
  47. package/dist/cjs/src/wavesexchange.js +14 -2
  48. package/examples/js/cli.js +23 -3
  49. package/js/ccxt.d.ts +1 -1
  50. package/js/ccxt.js +1 -1
  51. package/js/src/abstract/alpaca.d.ts +2 -0
  52. package/js/src/abstract/binance.d.ts +7 -0
  53. package/js/src/abstract/binancecoinm.d.ts +7 -0
  54. package/js/src/abstract/binanceus.d.ts +7 -0
  55. package/js/src/abstract/binanceusdm.d.ts +7 -0
  56. package/js/src/ace.js +1 -1
  57. package/js/src/alpaca.d.ts +9 -1
  58. package/js/src/alpaca.js +198 -5
  59. package/js/src/ascendex.js +1 -1
  60. package/js/src/base/Exchange.d.ts +6 -0
  61. package/js/src/base/Exchange.js +18 -0
  62. package/js/src/bequant.js +1 -1
  63. package/js/src/bigone.js +1 -1
  64. package/js/src/binance.js +8 -1
  65. package/js/src/binancecoinm.js +1 -1
  66. package/js/src/binanceus.js +1 -1
  67. package/js/src/binanceusdm.js +1 -1
  68. package/js/src/bingx.js +25 -36
  69. package/js/src/bit2c.js +1 -1
  70. package/js/src/bitbank.js +1 -1
  71. package/js/src/bitbns.js +1 -1
  72. package/js/src/bitfinex.js +1 -1
  73. package/js/src/bitfinex2.js +1 -1
  74. package/js/src/bitflyer.js +1 -1
  75. package/js/src/bitget.js +1 -1
  76. package/js/src/bithumb.js +1 -1
  77. package/js/src/bitmart.js +1 -1
  78. package/js/src/bitmex.js +1 -1
  79. package/js/src/bitopro.js +1 -1
  80. package/js/src/bitrue.js +1 -1
  81. package/js/src/bitso.js +1 -1
  82. package/js/src/bitstamp.js +1 -1
  83. package/js/src/bitteam.js +1 -1
  84. package/js/src/bitvavo.js +1 -1
  85. package/js/src/bl3p.js +1 -1
  86. package/js/src/blockchaincom.js +1 -1
  87. package/js/src/blofin.js +1 -1
  88. package/js/src/btcalpha.js +1 -1
  89. package/js/src/btcbox.js +1 -1
  90. package/js/src/btcmarkets.js +1 -1
  91. package/js/src/btcturk.js +1 -1
  92. package/js/src/bybit.js +5 -1
  93. package/js/src/coinbase.d.ts +1 -0
  94. package/js/src/coinbase.js +97 -11
  95. package/js/src/coinex.js +1 -1
  96. package/js/src/gate.js +22 -16
  97. package/js/src/hyperliquid.d.ts +1 -0
  98. package/js/src/hyperliquid.js +21 -1
  99. package/js/src/kraken.js +48 -35
  100. package/js/src/lbank.d.ts +4 -1
  101. package/js/src/lbank.js +100 -1
  102. package/js/src/pro/binance.js +5 -7
  103. package/js/src/pro/lbank.js +9 -4
  104. package/js/src/wavesexchange.js +14 -2
  105. package/package.json +1 -1
package/js/src/alpaca.js CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/alpaca.js';
9
+ import { Precise } from './base/Precise.js';
9
10
  import { ExchangeError, BadRequest, PermissionDenied, BadSymbol, NotSupported, InsufficientFunds, InvalidOrder, RateLimitExceeded, ArgumentsRequired } from './base/errors.js';
10
11
  import { TICK_SIZE } from './base/functions/number.js';
11
12
  // ---------------------------------------------------------------------------xs
@@ -26,7 +27,7 @@ export default class alpaca extends Exchange {
26
27
  'hostname': 'alpaca.markets',
27
28
  'pro': true,
28
29
  'urls': {
29
- 'logo': 'https://user-images.githubusercontent.com/1294454/187234005-b864db3d-f1e3-447a-aaf9-a9fc7b955d07.jpg',
30
+ 'logo': 'https://github.com/user-attachments/assets/e9476df8-a450-4c3e-ab9a-1a7794219e1b',
30
31
  'www': 'https://alpaca.markets',
31
32
  'api': {
32
33
  'broker': 'https://broker-api.{hostname}',
@@ -59,8 +60,8 @@ export default class alpaca extends Exchange {
59
60
  'fetchCurrencies': false,
60
61
  'fetchDepositAddress': true,
61
62
  'fetchDepositAddressesByNetwork': false,
62
- 'fetchDeposits': false,
63
- 'fetchDepositsWithdrawals': false,
63
+ 'fetchDeposits': true,
64
+ 'fetchDepositsWithdrawals': true,
64
65
  'fetchFundingHistory': false,
65
66
  'fetchFundingRate': false,
66
67
  'fetchFundingRateHistory': false,
@@ -92,12 +93,12 @@ export default class alpaca extends Exchange {
92
93
  'fetchTransactionFees': false,
93
94
  'fetchTransactions': false,
94
95
  'fetchTransfers': false,
95
- 'fetchWithdrawals': false,
96
+ 'fetchWithdrawals': true,
96
97
  'sandbox': true,
97
98
  'setLeverage': false,
98
99
  'setMarginMode': false,
99
100
  'transfer': false,
100
- 'withdraw': false,
101
+ 'withdraw': true,
101
102
  },
102
103
  'api': {
103
104
  'broker': {},
@@ -123,12 +124,14 @@ export default class alpaca extends Exchange {
123
124
  'v2/corporate_actions/announcements/{id}',
124
125
  'v2/corporate_actions/announcements',
125
126
  'v2/wallets',
127
+ 'v2/wallets/transfers',
126
128
  ],
127
129
  'post': [
128
130
  'v2/orders',
129
131
  'v2/watchlists',
130
132
  'v2/watchlists/{watchlist_id}',
131
133
  'v2/watchlists:by_name',
134
+ 'v2/wallets/transfers',
132
135
  ],
133
136
  'put': [
134
137
  'v2/watchlists/{watchlist_id}',
@@ -1342,6 +1345,196 @@ export default class alpaca extends Exchange {
1342
1345
  'tag': undefined,
1343
1346
  };
1344
1347
  }
1348
+ async withdraw(code, amount, address, tag = undefined, params = {}) {
1349
+ /**
1350
+ * @method
1351
+ * @name alpaca#withdraw
1352
+ * @description make a withdrawal
1353
+ * @see https://docs.alpaca.markets/reference/createcryptotransferforaccount
1354
+ * @param {string} code unified currency code
1355
+ * @param {float} amount the amount to withdraw
1356
+ * @param {string} address the address to withdraw to
1357
+ * @param {string} tag a memo for the transaction
1358
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1359
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1360
+ */
1361
+ [tag, params] = this.handleWithdrawTagAndParams(tag, params);
1362
+ this.checkAddress(address);
1363
+ await this.loadMarkets();
1364
+ const currency = this.currency(code);
1365
+ if (tag) {
1366
+ address = address + ':' + tag;
1367
+ }
1368
+ const request = {
1369
+ 'asset': currency['id'],
1370
+ 'address': address,
1371
+ 'amount': this.numberToString(amount),
1372
+ };
1373
+ const response = await this.traderPrivatePostV2WalletsTransfers(this.extend(request, params));
1374
+ //
1375
+ // {
1376
+ // "id": "e27b70a6-5610-40d7-8468-a516a284b776",
1377
+ // "tx_hash": null,
1378
+ // "direction": "OUTGOING",
1379
+ // "amount": "20",
1380
+ // "usd_value": "19.99856",
1381
+ // "chain": "ETH",
1382
+ // "asset": "USDT",
1383
+ // "from_address": "0x123930E4dCA196E070d39B60c644C8Aae02f23",
1384
+ // "to_address": "0x1232c0925196e4dcf05945f67f690153190fbaab",
1385
+ // "status": "PROCESSING",
1386
+ // "created_at": "2024-11-07T02:39:01.775495Z",
1387
+ // "network_fee": "4",
1388
+ // "fees": "0.1"
1389
+ // }
1390
+ //
1391
+ return this.parseTransaction(response, currency);
1392
+ }
1393
+ async fetchTransactionsHelper(type, code, since, limit, params) {
1394
+ await this.loadMarkets();
1395
+ let currency = undefined;
1396
+ if (code !== undefined) {
1397
+ currency = this.currency(code);
1398
+ }
1399
+ const response = await this.traderPrivateGetV2WalletsTransfers(params);
1400
+ //
1401
+ // {
1402
+ // "id": "e27b70a6-5610-40d7-8468-a516a284b776",
1403
+ // "tx_hash": null,
1404
+ // "direction": "OUTGOING",
1405
+ // "amount": "20",
1406
+ // "usd_value": "19.99856",
1407
+ // "chain": "ETH",
1408
+ // "asset": "USDT",
1409
+ // "from_address": "0x123930E4dCA196E070d39B60c644C8Aae02f23",
1410
+ // "to_address": "0x1232c0925196e4dcf05945f67f690153190fbaab",
1411
+ // "status": "PROCESSING",
1412
+ // "created_at": "2024-11-07T02:39:01.775495Z",
1413
+ // "network_fee": "4",
1414
+ // "fees": "0.1"
1415
+ // }
1416
+ //
1417
+ const results = [];
1418
+ for (let i = 0; i < response.length; i++) {
1419
+ const entry = response[i];
1420
+ const direction = this.safeString(entry, 'direction');
1421
+ if (direction === type) {
1422
+ results.push(entry);
1423
+ }
1424
+ else if (type === 'BOTH') {
1425
+ results.push(entry);
1426
+ }
1427
+ }
1428
+ return this.parseTransactions(results, currency, since, limit, params);
1429
+ }
1430
+ async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1431
+ /**
1432
+ * @method
1433
+ * @name alpaca#fetchDepositsWithdrawals
1434
+ * @description fetch history of deposits and withdrawals
1435
+ * @see https://docs.alpaca.markets/reference/listcryptofundingtransfers
1436
+ * @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
1437
+ * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
1438
+ * @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
1439
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1440
+ * @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1441
+ */
1442
+ return await this.fetchTransactionsHelper('BOTH', code, since, limit, params);
1443
+ }
1444
+ async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
1445
+ /**
1446
+ * @method
1447
+ * @name alpaca#fetchDeposits
1448
+ * @description fetch all deposits made to an account
1449
+ * @see https://docs.alpaca.markets/reference/listcryptofundingtransfers
1450
+ * @param {string} [code] unified currency code
1451
+ * @param {int} [since] the earliest time in ms to fetch deposits for
1452
+ * @param {int} [limit] the maximum number of deposit structures to retrieve
1453
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1454
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1455
+ */
1456
+ return await this.fetchTransactionsHelper('INCOMING', code, since, limit, params);
1457
+ }
1458
+ async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1459
+ /**
1460
+ * @method
1461
+ * @name alpaca#fetchWithdrawals
1462
+ * @description fetch all withdrawals made from an account
1463
+ * @see https://docs.alpaca.markets/reference/listcryptofundingtransfers
1464
+ * @param {string} [code] unified currency code
1465
+ * @param {int} [since] the earliest time in ms to fetch withdrawals for
1466
+ * @param {int} [limit] the maximum number of withdrawal structures to retrieve
1467
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1468
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1469
+ */
1470
+ return await this.fetchTransactionsHelper('OUTGOING', code, since, limit, params);
1471
+ }
1472
+ parseTransaction(transaction, currency = undefined) {
1473
+ //
1474
+ // {
1475
+ // "id": "e27b70a6-5610-40d7-8468-a516a284b776",
1476
+ // "tx_hash": null,
1477
+ // "direction": "OUTGOING",
1478
+ // "amount": "20",
1479
+ // "usd_value": "19.99856",
1480
+ // "chain": "ETH",
1481
+ // "asset": "USDT",
1482
+ // "from_address": "0x123930E4dCA196E070d39B60c644C8Aae02f23",
1483
+ // "to_address": "0x1232c0925196e4dcf05945f67f690153190fbaab",
1484
+ // "status": "PROCESSING",
1485
+ // "created_at": "2024-11-07T02:39:01.775495Z",
1486
+ // "network_fee": "4",
1487
+ // "fees": "0.1"
1488
+ // }
1489
+ //
1490
+ const datetime = this.safeString(transaction, 'created_at');
1491
+ const currencyId = this.safeString(transaction, 'asset');
1492
+ const code = this.safeCurrencyCode(currencyId, currency);
1493
+ const fees = this.safeString(transaction, 'fees');
1494
+ const networkFee = this.safeString(transaction, 'network_fee');
1495
+ const totalFee = Precise.stringAdd(fees, networkFee);
1496
+ const fee = {
1497
+ 'cost': this.parseNumber(totalFee),
1498
+ 'currency': code,
1499
+ };
1500
+ return {
1501
+ 'info': transaction,
1502
+ 'id': this.safeString(transaction, 'id'),
1503
+ 'txid': this.safeString(transaction, 'tx_hash'),
1504
+ 'timestamp': this.parse8601(datetime),
1505
+ 'datetime': datetime,
1506
+ 'network': this.safeString(transaction, 'chain'),
1507
+ 'address': this.safeString(transaction, 'to_address'),
1508
+ 'addressTo': this.safeString(transaction, 'to_address'),
1509
+ 'addressFrom': this.safeString(transaction, 'from_address'),
1510
+ 'tag': undefined,
1511
+ 'tagTo': undefined,
1512
+ 'tagFrom': undefined,
1513
+ 'type': this.parseTransactionType(this.safeString(transaction, 'direction')),
1514
+ 'amount': this.safeNumber(transaction, 'amount'),
1515
+ 'currency': code,
1516
+ 'status': this.parseTransactionStatus(this.safeString(transaction, 'status')),
1517
+ 'updated': undefined,
1518
+ 'fee': fee,
1519
+ 'comment': undefined,
1520
+ 'internal': undefined,
1521
+ };
1522
+ }
1523
+ parseTransactionStatus(status) {
1524
+ const statuses = {
1525
+ 'PROCESSING': 'pending',
1526
+ 'FAILED': 'failed',
1527
+ 'COMPLETE': 'ok',
1528
+ };
1529
+ return this.safeString(statuses, status, status);
1530
+ }
1531
+ parseTransactionType(type) {
1532
+ const types = {
1533
+ 'INCOMING': 'deposit',
1534
+ 'OUTGOING': 'withdrawal',
1535
+ };
1536
+ return this.safeString(types, type, type);
1537
+ }
1345
1538
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1346
1539
  let endpoint = '/' + this.implodeParams(path, params);
1347
1540
  let url = this.implodeHostname(this.urls['api'][api[0]]);
@@ -116,7 +116,7 @@ export default class ascendex extends Exchange {
116
116
  },
117
117
  'version': 'v2',
118
118
  'urls': {
119
- 'logo': 'https://user-images.githubusercontent.com/1294454/112027508-47984600-8b48-11eb-9e17-d26459cc36c6.jpg',
119
+ 'logo': 'https://github.com/user-attachments/assets/55bab6b9-d4ca-42a8-a0e6-fac81ae557f1',
120
120
  'api': {
121
121
  'rest': 'https://ascendex.com',
122
122
  },
@@ -743,17 +743,22 @@ export default class Exchange {
743
743
  watchMyLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
744
744
  watchMyLiquidationsForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
745
745
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
746
+ unWatchTrades(symbol: string, params?: {}): Promise<any>;
746
747
  watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
748
+ unWatchTradesForSymbols(symbols: string[], params?: {}): Promise<any>;
747
749
  watchMyTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
748
750
  watchOrdersForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
749
751
  watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<Dictionary<Dictionary<OHLCV[]>>>;
752
+ unWatchOHLCVForSymbols(symbolsAndTimeframes: string[][], params?: {}): Promise<any>;
750
753
  watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
754
+ unWatchOrderBookForSymbols(symbols: string[], params?: {}): Promise<any>;
751
755
  fetchDepositAddresses(codes?: Strings, params?: {}): Promise<DepositAddress[]>;
752
756
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
753
757
  fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
754
758
  fetchMarginModes(symbols?: Strings, params?: {}): Promise<MarginModes>;
755
759
  fetchRestOrderBookSafe(symbol: any, limit?: any, params?: {}): Promise<OrderBook>;
756
760
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
761
+ unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
757
762
  fetchTime(params?: {}): Promise<Int>;
758
763
  fetchTradingLimits(symbols?: Strings, params?: {}): Promise<{}>;
759
764
  parseCurrency(rawCurrency: Dict): Currency;
@@ -985,6 +990,7 @@ export default class Exchange {
985
990
  fetchOrderBooks(symbols?: Strings, limit?: Int, params?: {}): Promise<Dictionary<OrderBook>>;
986
991
  watchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
987
992
  watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
993
+ unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
988
994
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
989
995
  fetchOrderWs(id: string, symbol?: Str, params?: {}): Promise<Order>;
990
996
  fetchOrderStatus(id: string, symbol?: Str, params?: {}): Promise<string>;
@@ -2019,9 +2019,15 @@ export default class Exchange {
2019
2019
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
2020
2020
  throw new NotSupported(this.id + ' watchTrades() is not supported yet');
2021
2021
  }
2022
+ async unWatchTrades(symbol, params = {}) {
2023
+ throw new NotSupported(this.id + ' unWatchTrades() is not supported yet');
2024
+ }
2022
2025
  async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
2023
2026
  throw new NotSupported(this.id + ' watchTradesForSymbols() is not supported yet');
2024
2027
  }
2028
+ async unWatchTradesForSymbols(symbols, params = {}) {
2029
+ throw new NotSupported(this.id + ' unWatchTradesForSymbols() is not supported yet');
2030
+ }
2025
2031
  async watchMyTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
2026
2032
  throw new NotSupported(this.id + ' watchMyTradesForSymbols() is not supported yet');
2027
2033
  }
@@ -2031,9 +2037,15 @@ export default class Exchange {
2031
2037
  async watchOHLCVForSymbols(symbolsAndTimeframes, since = undefined, limit = undefined, params = {}) {
2032
2038
  throw new NotSupported(this.id + ' watchOHLCVForSymbols() is not supported yet');
2033
2039
  }
2040
+ async unWatchOHLCVForSymbols(symbolsAndTimeframes, params = {}) {
2041
+ throw new NotSupported(this.id + ' unWatchOHLCVForSymbols() is not supported yet');
2042
+ }
2034
2043
  async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
2035
2044
  throw new NotSupported(this.id + ' watchOrderBookForSymbols() is not supported yet');
2036
2045
  }
2046
+ async unWatchOrderBookForSymbols(symbols, params = {}) {
2047
+ throw new NotSupported(this.id + ' unWatchOrderBookForSymbols() is not supported yet');
2048
+ }
2037
2049
  async fetchDepositAddresses(codes = undefined, params = {}) {
2038
2050
  throw new NotSupported(this.id + ' fetchDepositAddresses() is not supported yet');
2039
2051
  }
@@ -2070,6 +2082,9 @@ export default class Exchange {
2070
2082
  async watchOrderBook(symbol, limit = undefined, params = {}) {
2071
2083
  throw new NotSupported(this.id + ' watchOrderBook() is not supported yet');
2072
2084
  }
2085
+ async unWatchOrderBook(symbol, params = {}) {
2086
+ throw new NotSupported(this.id + ' unWatchOrderBook() is not supported yet');
2087
+ }
2073
2088
  async fetchTime(params = {}) {
2074
2089
  throw new NotSupported(this.id + ' fetchTime() is not supported yet');
2075
2090
  }
@@ -4498,6 +4513,9 @@ export default class Exchange {
4498
4513
  async watchTickers(symbols = undefined, params = {}) {
4499
4514
  throw new NotSupported(this.id + ' watchTickers() is not supported yet');
4500
4515
  }
4516
+ async unWatchTickers(symbols = undefined, params = {}) {
4517
+ throw new NotSupported(this.id + ' unWatchTickers() is not supported yet');
4518
+ }
4501
4519
  async fetchOrder(id, symbol = undefined, params = {}) {
4502
4520
  throw new NotSupported(this.id + ' fetchOrder() is not supported yet');
4503
4521
  }
package/js/src/bequant.js CHANGED
@@ -15,7 +15,7 @@ export default class bequant extends hitbtc {
15
15
  'countries': ['MT'],
16
16
  'pro': true,
17
17
  'urls': {
18
- 'logo': 'https://user-images.githubusercontent.com/1294454/55248342-a75dfe00-525a-11e9-8aa2-05e9dca943c6.jpg',
18
+ 'logo': 'https://github.com/user-attachments/assets/0583ef1f-29fe-4b7c-8189-63565a0e2867',
19
19
  'api': {
20
20
  'public': 'https://api.bequant.io/api/3',
21
21
  'private': 'https://api.bequant.io/api/3',
package/js/src/bigone.js CHANGED
@@ -86,7 +86,7 @@ export default class bigone extends Exchange {
86
86
  },
87
87
  'hostname': 'big.one',
88
88
  'urls': {
89
- 'logo': 'https://user-images.githubusercontent.com/1294454/69354403-1d532180-0c91-11ea-88ed-44c06cefdf87.jpg',
89
+ 'logo': 'https://github.com/user-attachments/assets/4e5cfd53-98cc-4b90-92cd-0d7b512653d1',
90
90
  'api': {
91
91
  'public': 'https://{hostname}/api/v3',
92
92
  'private': 'https://{hostname}/api/v3/viewer',
package/js/src/binance.js CHANGED
@@ -191,7 +191,7 @@ export default class binance extends Exchange {
191
191
  '1M': '1M',
192
192
  },
193
193
  'urls': {
194
- 'logo': 'https://user-images.githubusercontent.com/1294454/29604020-d5483cdc-87ee-11e7-94c7-d1a8d9169293.jpg',
194
+ 'logo': 'https://github.com/user-attachments/assets/e9419b93-ccb0-46aa-9bff-c883f096274b',
195
195
  'test': {
196
196
  'dapiPublic': 'https://testnet.binancefuture.com/dapi/v1',
197
197
  'dapiPrivate': 'https://testnet.binancefuture.com/dapi/v1',
@@ -953,6 +953,9 @@ export default class binance extends Exchange {
953
953
  'mmp': 1,
954
954
  'countdownCancelAll': 1,
955
955
  'order': 1,
956
+ 'block/order/orders': 5,
957
+ 'block/order/execute': 5,
958
+ 'block/user-trades': 5,
956
959
  },
957
960
  'post': {
958
961
  'order': 1,
@@ -962,9 +965,12 @@ export default class binance extends Exchange {
962
965
  'mmpReset': 1,
963
966
  'countdownCancelAll': 1,
964
967
  'countdownCancelAllHeartBeat': 10,
968
+ 'block/order/create': 5,
969
+ 'block/order/execute': 5,
965
970
  },
966
971
  'put': {
967
972
  'listenKey': 1,
973
+ 'block/order/create': 5,
968
974
  },
969
975
  'delete': {
970
976
  'order': 1,
@@ -972,6 +978,7 @@ export default class binance extends Exchange {
972
978
  'allOpenOrders': 1,
973
979
  'allOpenOrdersByUnderlying': 1,
974
980
  'listenKey': 1,
981
+ 'block/order/create': 5,
975
982
  },
976
983
  },
977
984
  'public': {
@@ -13,7 +13,7 @@ export default class binancecoinm extends binance {
13
13
  'id': 'binancecoinm',
14
14
  'name': 'Binance COIN-M',
15
15
  'urls': {
16
- 'logo': 'https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg',
16
+ 'logo': 'https://github.com/user-attachments/assets/387cfc4e-5f33-48cd-8f5c-cd4854dabf0c',
17
17
  'doc': [
18
18
  'https://binance-docs.github.io/apidocs/delivery/en/',
19
19
  'https://binance-docs.github.io/apidocs/spot/en',
@@ -18,7 +18,7 @@ export default class binanceus extends binance {
18
18
  'certified': false,
19
19
  'pro': true,
20
20
  'urls': {
21
- 'logo': 'https://user-images.githubusercontent.com/1294454/65177307-217b7c80-da5f-11e9-876e-0b748ba0a358.jpg',
21
+ 'logo': 'https://github.com/user-attachments/assets/a9667919-b632-4d52-a832-df89f8a35e8c',
22
22
  'api': {
23
23
  'web': 'https://www.binance.us',
24
24
  'public': 'https://api.binance.us/api/v3',
@@ -14,7 +14,7 @@ export default class binanceusdm extends binance {
14
14
  'id': 'binanceusdm',
15
15
  'name': 'Binance USDⓈ-M',
16
16
  'urls': {
17
- 'logo': 'https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg',
17
+ 'logo': 'https://github.com/user-attachments/assets/871cbea7-eebb-4b28-b260-c1c91df0487a',
18
18
  'doc': [
19
19
  'https://binance-docs.github.io/apidocs/futures/en/',
20
20
  'https://binance-docs.github.io/apidocs/spot/en',
package/js/src/bingx.js CHANGED
@@ -2863,19 +2863,12 @@ export default class bingx extends Exchange {
2863
2863
  */
2864
2864
  await this.loadMarkets();
2865
2865
  const ordersRequests = [];
2866
- let symbol = undefined;
2866
+ const marketIds = [];
2867
2867
  for (let i = 0; i < orders.length; i++) {
2868
2868
  const rawOrder = orders[i];
2869
2869
  const marketId = this.safeString(rawOrder, 'symbol');
2870
- if (symbol === undefined) {
2871
- symbol = marketId;
2872
- }
2873
- else {
2874
- if (symbol !== marketId) {
2875
- throw new BadRequest(this.id + ' createOrders() requires all orders to have the same symbol');
2876
- }
2877
- }
2878
2870
  const type = this.safeString(rawOrder, 'type');
2871
+ marketIds.push(marketId);
2879
2872
  const side = this.safeString(rawOrder, 'side');
2880
2873
  const amount = this.safeNumber(rawOrder, 'amount');
2881
2874
  const price = this.safeNumber(rawOrder, 'price');
@@ -2883,10 +2876,15 @@ export default class bingx extends Exchange {
2883
2876
  const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams);
2884
2877
  ordersRequests.push(orderRequest);
2885
2878
  }
2886
- const market = this.market(symbol);
2879
+ const symbols = this.marketSymbols(marketIds, undefined, false, true, true);
2880
+ const symbolsLength = symbols.length;
2881
+ const market = this.market(symbols[0]);
2887
2882
  const request = {};
2888
2883
  let response = undefined;
2889
2884
  if (market['swap']) {
2885
+ if (symbolsLength > 5) {
2886
+ throw new InvalidOrder(this.id + ' createOrders() can not create more than 5 orders at once for swap markets');
2887
+ }
2890
2888
  request['batchOrders'] = this.json(ordersRequests);
2891
2889
  response = await this.swapV2PrivatePostTradeBatchOrders(request);
2892
2890
  }
@@ -2943,6 +2941,13 @@ export default class bingx extends Exchange {
2943
2941
  // }
2944
2942
  // }
2945
2943
  //
2944
+ if (typeof response === 'string') {
2945
+ // broken api engine : order-ids are too long numbers (i.e. 1742930526912864656)
2946
+ // and JSON.parse can not handle them in JS, so we have to use .parseJson
2947
+ // however, when order has an attached SL/TP, their value types need extra parsing
2948
+ response = this.fixStringifiedJsonMembers(response);
2949
+ response = this.parseJson(response);
2950
+ }
2946
2951
  const data = this.safeDict(response, 'data', {});
2947
2952
  const result = this.safeList(data, 'orders', []);
2948
2953
  return this.parseOrders(result, market);
@@ -4583,37 +4588,21 @@ export default class bingx extends Exchange {
4583
4588
  }
4584
4589
  parseDepositAddress(depositAddress, currency = undefined) {
4585
4590
  //
4586
- // {
4587
- // "coinId": "799",
4588
- // "coin": "USDT",
4589
- // "network": "BEP20",
4590
- // "address": "6a7eda2817462dabb6493277a2cfe0f5c3f2550b",
4591
- // "tag": ''
4592
- // }
4591
+ // {
4592
+ // "coinId":"4",
4593
+ // "coin":"USDT",
4594
+ // "network":"OMNI",
4595
+ // "address":"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN",
4596
+ // "addressWithPrefix":"1HXyx8HVQRY7Nhqz63nwnRB7SpS9xQPzLN"
4597
+ // }
4593
4598
  //
4594
- let address = this.safeString(depositAddress, 'address');
4595
4599
  const tag = this.safeString(depositAddress, 'tag');
4596
4600
  const currencyId = this.safeString(depositAddress, 'coin');
4597
4601
  currency = this.safeCurrency(currencyId, currency);
4598
4602
  const code = currency['code'];
4599
- // the exchange API returns deposit addresses without the leading '0x' prefix
4600
- // however, the exchange API does require the 0x prefix to withdraw
4601
- // so we append the prefix before returning the address to the user
4602
- // that is only if the underlying contract address has the 0x prefix as well
4603
- const networkCode = this.safeString(depositAddress, 'network');
4604
- if (networkCode !== undefined) {
4605
- if (networkCode in currency['networks']) {
4606
- const network = currency['networks'][networkCode];
4607
- const contractAddress = this.safeString(network['info'], 'contractAddress');
4608
- if (contractAddress !== undefined) {
4609
- if (contractAddress[0] === '0' && contractAddress[1] === 'x') {
4610
- if (address[0] !== '0' || address[1] !== 'x') {
4611
- address = '0x' + address;
4612
- }
4613
- }
4614
- }
4615
- }
4616
- }
4603
+ const address = this.safeString(depositAddress, 'addressWithPrefix');
4604
+ const networkdId = this.safeString(depositAddress, 'network');
4605
+ const networkCode = this.networkIdToCode(networkdId, code);
4617
4606
  this.checkAddress(address);
4618
4607
  return {
4619
4608
  'info': depositAddress,
package/js/src/bit2c.js CHANGED
@@ -80,7 +80,7 @@ export default class bit2c extends Exchange {
80
80
  'ws': false,
81
81
  },
82
82
  'urls': {
83
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766119-3593220e-5ece-11e7-8b3a-5a041f6bcc3f.jpg',
83
+ 'logo': 'https://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aa',
84
84
  'api': {
85
85
  'rest': 'https://bit2c.co.il',
86
86
  },
package/js/src/bitbank.js CHANGED
@@ -95,7 +95,7 @@ export default class bitbank extends Exchange {
95
95
  },
96
96
  'hostname': 'bitbank.cc',
97
97
  'urls': {
98
- 'logo': 'https://user-images.githubusercontent.com/1294454/37808081-b87f2d9c-2e59-11e8-894d-c1900b7584fe.jpg',
98
+ 'logo': 'https://github.com/user-attachments/assets/9d616de0-8a88-4468-8e38-d269acab0348',
99
99
  'api': {
100
100
  'public': 'https://public.{hostname}',
101
101
  'private': 'https://api.{hostname}',
package/js/src/bitbns.js CHANGED
@@ -70,7 +70,7 @@ export default class bitbns extends Exchange {
70
70
  },
71
71
  'hostname': 'bitbns.com',
72
72
  'urls': {
73
- 'logo': 'https://user-images.githubusercontent.com/1294454/117201933-e7a6e780-adf5-11eb-9d80-98fc2a21c3d6.jpg',
73
+ 'logo': 'https://github.com/user-attachments/assets/a5b9a562-cdd8-4bea-9fa7-fd24c1dad3d9',
74
74
  'api': {
75
75
  'www': 'https://{hostname}',
76
76
  'v1': 'https://api.{hostname}/api/trade/v1',
@@ -91,7 +91,7 @@ export default class bitfinex extends Exchange {
91
91
  '1M': '1M',
92
92
  },
93
93
  'urls': {
94
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766244-e328a50c-5ed2-11e7-947b-041416579bb3.jpg',
94
+ 'logo': 'https://github.com/user-attachments/assets/9147c6c5-7197-481e-827b-7483672bb0e9',
95
95
  'api': {
96
96
  'v2': 'https://api-pub.bitfinex.com',
97
97
  'public': 'https://api.bitfinex.com',
@@ -131,7 +131,7 @@ export default class bitfinex2 extends Exchange {
131
131
  // cheapest endpoint is 240 requests per minute => ~ 4 requests per second => ( 1000ms / 4 ) = 250ms between requests on average
132
132
  'rateLimit': 250,
133
133
  'urls': {
134
- 'logo': 'https://user-images.githubusercontent.com/1294454/27766244-e328a50c-5ed2-11e7-947b-041416579bb3.jpg',
134
+ 'logo': 'https://github.com/user-attachments/assets/4a8e947f-ab46-481a-a8ae-8b20e9b03178',
135
135
  'api': {
136
136
  'v1': 'https://api.bitfinex.com',
137
137
  'public': 'https://api-pub.bitfinex.com',
@@ -60,7 +60,7 @@ export default class bitflyer extends Exchange {
60
60
  'withdraw': true,
61
61
  },
62
62
  'urls': {
63
- 'logo': 'https://user-images.githubusercontent.com/1294454/28051642-56154182-660e-11e7-9b0d-6042d1e6edd8.jpg',
63
+ 'logo': 'https://github.com/user-attachments/assets/d0217747-e54d-4533-8416-0d553dca74bb',
64
64
  'api': {
65
65
  'rest': 'https://api.{hostname}',
66
66
  },
package/js/src/bitget.js CHANGED
@@ -163,7 +163,7 @@ export default class bitget extends Exchange {
163
163
  },
164
164
  'hostname': 'bitget.com',
165
165
  'urls': {
166
- 'logo': 'https://user-images.githubusercontent.com/1294454/195989417-4253ddb0-afbe-4a1c-9dea-9dbcd121fa5d.jpg',
166
+ 'logo': 'https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658',
167
167
  'api': {
168
168
  'spot': 'https://api.{hostname}',
169
169
  'mix': 'https://api.{hostname}',
package/js/src/bithumb.js CHANGED
@@ -79,7 +79,7 @@ export default class bithumb extends Exchange {
79
79
  },
80
80
  'hostname': 'bithumb.com',
81
81
  'urls': {
82
- 'logo': 'https://user-images.githubusercontent.com/1294454/30597177-ea800172-9d5e-11e7-804c-b9d4fa9b56b0.jpg',
82
+ 'logo': 'https://github.com/user-attachments/assets/c9e0eefb-4777-46b9-8f09-9d7f7c4af82d',
83
83
  'api': {
84
84
  'public': 'https://api.{hostname}/public',
85
85
  'private': 'https://api.{hostname}',
package/js/src/bitmart.js CHANGED
@@ -111,7 +111,7 @@ export default class bitmart extends Exchange {
111
111
  },
112
112
  'hostname': 'bitmart.com',
113
113
  'urls': {
114
- 'logo': 'https://user-images.githubusercontent.com/1294454/129991357-8f47464b-d0f4-41d6-8a82-34122f0d1398.jpg',
114
+ 'logo': 'https://github.com/user-attachments/assets/0623e9c4-f50e-48c9-82bd-65c3908c3a14',
115
115
  'api': {
116
116
  'spot': 'https://api-cloud.{hostname}',
117
117
  'swap': 'https://api-cloud-v2.{hostname}', // bitmart.info for Hong Kong users