ccxt 4.4.7 → 4.4.9

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 (61) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/bigone.js +35 -86
  5. package/dist/cjs/src/binance.js +51 -12
  6. package/dist/cjs/src/bingx.js +7 -2
  7. package/dist/cjs/src/bitget.js +3 -0
  8. package/dist/cjs/src/bybit.js +368 -1
  9. package/dist/cjs/src/gate.js +35 -1
  10. package/dist/cjs/src/htx.js +24 -0
  11. package/dist/cjs/src/kucoin.js +2 -1
  12. package/dist/cjs/src/kucoinfutures.js +162 -2
  13. package/dist/cjs/src/okx.js +4 -0
  14. package/dist/cjs/src/pro/binance.js +4 -4
  15. package/dist/cjs/src/pro/bitmart.js +81 -0
  16. package/dist/cjs/src/pro/bitvavo.js +92 -1
  17. package/dist/cjs/src/pro/blofin.js +64 -0
  18. package/dist/cjs/src/pro/hitbtc.js +122 -48
  19. package/dist/cjs/src/pro/hollaex.js +5 -0
  20. package/dist/cjs/src/pro/okx.js +19 -3
  21. package/dist/cjs/src/pro/p2b.js +35 -1
  22. package/dist/cjs/src/pro/whitebit.js +31 -0
  23. package/js/ccxt.d.ts +1 -1
  24. package/js/ccxt.js +1 -1
  25. package/js/src/abstract/bigone.d.ts +1 -1
  26. package/js/src/abstract/binance.d.ts +1 -0
  27. package/js/src/abstract/binancecoinm.d.ts +1 -0
  28. package/js/src/abstract/binanceus.d.ts +1 -0
  29. package/js/src/abstract/binanceusdm.d.ts +1 -0
  30. package/js/src/abstract/bybit.d.ts +5 -0
  31. package/js/src/abstract/kucoinfutures.d.ts +5 -0
  32. package/js/src/abstract/okx.d.ts +2 -0
  33. package/js/src/bigone.js +35 -86
  34. package/js/src/binance.d.ts +15 -15
  35. package/js/src/binance.js +51 -12
  36. package/js/src/bingx.js +7 -2
  37. package/js/src/bitget.js +3 -0
  38. package/js/src/bybit.d.ts +7 -1
  39. package/js/src/bybit.js +368 -1
  40. package/js/src/gate.js +35 -1
  41. package/js/src/htx.js +24 -0
  42. package/js/src/kucoin.js +2 -1
  43. package/js/src/kucoinfutures.d.ts +7 -1
  44. package/js/src/kucoinfutures.js +162 -2
  45. package/js/src/okx.js +4 -0
  46. package/js/src/pro/binance.js +4 -4
  47. package/js/src/pro/bitmart.d.ts +3 -0
  48. package/js/src/pro/bitmart.js +81 -0
  49. package/js/src/pro/bitvavo.d.ts +7 -2
  50. package/js/src/pro/bitvavo.js +92 -1
  51. package/js/src/pro/blofin.d.ts +3 -0
  52. package/js/src/pro/blofin.js +64 -0
  53. package/js/src/pro/hitbtc.d.ts +4 -1
  54. package/js/src/pro/hitbtc.js +122 -48
  55. package/js/src/pro/hollaex.js +5 -0
  56. package/js/src/pro/okx.js +19 -3
  57. package/js/src/pro/p2b.d.ts +2 -1
  58. package/js/src/pro/p2b.js +35 -1
  59. package/js/src/pro/whitebit.d.ts +2 -1
  60. package/js/src/pro/whitebit.js +31 -0
  61. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
194
194
 
195
195
  //-----------------------------------------------------------------------------
196
196
  // this is updated by vss.js when building
197
- const version = '4.4.7';
197
+ const version = '4.4.9';
198
198
  Exchange["default"].ccxtVersion = version;
199
199
  const exchanges = {
200
200
  'ace': ace,
@@ -158,7 +158,7 @@ class bigone extends bigone$1 {
158
158
  },
159
159
  'webExchange': {
160
160
  'get': [
161
- 'uc/v2/assets',
161
+ 'v3/assets',
162
162
  ],
163
163
  },
164
164
  },
@@ -338,7 +338,7 @@ class bigone extends bigone$1 {
338
338
  * @returns {dict} an associative dictionary of currencies
339
339
  */
340
340
  // we use undocumented link (possible, less informative alternative is : https://big.one/api/uc/v3/assets/accounts)
341
- const data = await this.fetchWebEndpoint('fetchCurrencies', 'webExchangeGetUcV2Assets', true);
341
+ const data = await this.fetchWebEndpoint('fetchCurrencies', 'webExchangeGetV3Assets', true);
342
342
  if (data === undefined) {
343
343
  return undefined;
344
344
  }
@@ -348,91 +348,40 @@ class bigone extends bigone$1 {
348
348
  // "message": "",
349
349
  // "data": [
350
350
  // {
351
- // "name": "TetherUS",
352
- // "symbol": "USDT",
353
- // "contract_address": "31",
354
- // "is_deposit_enabled": true,
355
- // "is_withdrawal_enabled": true,
356
- // "is_stub": false,
357
- // "withdrawal_fee": "5.0",
358
- // "is_fiat": false,
359
- // "is_memo_required": false,
360
- // "logo": {
361
- // "default": "https://assets.peatio.com/assets/v1/color/normal/usdt.png",
362
- // "white": "https://assets.peatio.com/assets/v1/white/normal/usdt.png",
351
+ // "uuid": "17082d1c-0195-4fb6-8779-2cdbcb9eeb3c",
352
+ // "symbol": "USDT",
353
+ // "name": "TetherUS",
354
+ // "scale": 12,
355
+ // "is_fiat": false,
356
+ // "is_transfer_enabled": true,
357
+ // "transfer_scale": 12,
358
+ // "binding_gateways": [
359
+ // {
360
+ // "guid": "07efc37f-d1ec-4bc9-8339-a745256ea2ba",
361
+ // "is_deposit_enabled": true,
362
+ // "gateway_name": "Ethereum",
363
+ // "min_withdrawal_amount": "0.000001",
364
+ // "withdrawal_fee": "5.71",
365
+ // "is_withdrawal_enabled": true,
366
+ // "min_deposit_amount": "0.000001",
367
+ // "is_memo_required": false,
368
+ // "withdrawal_scale": 6,
369
+ // "scale": 12
370
+ // },
371
+ // {
372
+ // "guid": "4e387a9a-a480-40a3-b4ae-ed1773c2db5a",
373
+ // "is_deposit_enabled": true,
374
+ // "gateway_name": "BinanceSmartChain",
375
+ // "min_withdrawal_amount": "10",
376
+ // "withdrawal_fee": "5",
377
+ // "is_withdrawal_enabled": false,
378
+ // "min_deposit_amount": "1",
379
+ // "is_memo_required": false,
380
+ // "withdrawal_scale": 8,
381
+ // "scale": 12
382
+ // }
383
+ // ]
363
384
  // },
364
- // "info_link": null,
365
- // "scale": "12",
366
- // "default_gateway": ..., // one object from "gateways"
367
- // "gateways": [
368
- // {
369
- // "uuid": "f0fa5a85-7f65-428a-b7b7-13aad55c2837",
370
- // "name": "Mixin",
371
- // "kind": "CHAIN",
372
- // "required_confirmations": "0",
373
- // },
374
- // {
375
- // "uuid": "b75446c6-1446-4c8d-b3d1-39f385b0a926",
376
- // "name": "Ethereum",
377
- // "kind": "CHAIN",
378
- // "required_confirmations": "18",
379
- // },
380
- // {
381
- // "uuid": "fe9b1b0b-e55c-4017-b5ce-16f524df5fc0",
382
- // "name": "Tron",
383
- // "kind": "CHAIN",
384
- // "required_confirmations": "1",
385
- // },
386
- // ...
387
- // ],
388
- // "payments": [],
389
- // "uuid": "17082d1c-0195-4fb6-8779-2cdbcb9eeb3c",
390
- // "binding_gateways": [
391
- // {
392
- // "guid": "07efc37f-d1ec-4bc9-8339-a745256ea2ba",
393
- // "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
394
- // "is_deposit_enabled": true,
395
- // "display_name": "Ethereum(ERC20)",
396
- // "gateway_name": "Ethereum",
397
- // "min_withdrawal_amount": "0.000001",
398
- // "min_internal_withdrawal_amount": "0.00000001",
399
- // "withdrawal_fee": "14",
400
- // "is_withdrawal_enabled": true,
401
- // "min_deposit_amount": "0.000001",
402
- // "is_memo_required": false,
403
- // "withdrawal_scale": "2",
404
- // "gateway": {
405
- // "uuid": "b75446c6-1446-4c8d-b3d1-39f385b0a926",
406
- // "name": "Ethereum",
407
- // "kind": "CHAIN",
408
- // "required_confirmations": "18",
409
- // },
410
- // "scale": "12",
411
- // },
412
- // {
413
- // "guid": "b80a4d13-cac7-4319-842d-b33c3bfab8ec",
414
- // "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
415
- // "is_deposit_enabled": true,
416
- // "display_name": "Tron(TRC20)",
417
- // "gateway_name": "Tron",
418
- // "min_withdrawal_amount": "0.000001",
419
- // "min_internal_withdrawal_amount": "0.00000001",
420
- // "withdrawal_fee": "1",
421
- // "is_withdrawal_enabled": true,
422
- // "min_deposit_amount": "0.000001",
423
- // "is_memo_required": false,
424
- // "withdrawal_scale": "6",
425
- // "gateway": {
426
- // "uuid": "fe9b1b0b-e55c-4017-b5ce-16f524df5fc0",
427
- // "name": "Tron",
428
- // "kind": "CHAIN",
429
- // "required_confirmations": "1",
430
- // },
431
- // "scale": "12",
432
- // },
433
- // ...
434
- // ],
435
- // },
436
385
  // ...
437
386
  // ],
438
387
  // }
@@ -1091,6 +1091,7 @@ class binance extends binance$1 {
1091
1091
  'repay-futures-negative-balance': 150,
1092
1092
  'listenKey': 1,
1093
1093
  'asset-collection': 3,
1094
+ 'margin/repay-debt': 0.4, // Weight(Order): 0.4 => (1000 / (50 * 0.4)) * 60 = 3000
1094
1095
  },
1095
1096
  'put': {
1096
1097
  'listenKey': 1, // 1
@@ -1208,6 +1209,7 @@ class binance extends binance$1 {
1208
1209
  ],
1209
1210
  'fetchCurrencies': true,
1210
1211
  // 'fetchTradesMethod': 'publicGetAggTrades', // publicGetTrades, publicGetHistoricalTrades, eapiPublicGetTrades
1212
+ // 'repayCrossMarginMethod': 'papiPostRepayLoan', // papiPostMarginRepayDebt
1211
1213
  'defaultTimeInForce': 'GTC',
1212
1214
  'defaultType': 'spot',
1213
1215
  'defaultSubType': undefined,
@@ -2904,7 +2906,7 @@ class binance extends binance$1 {
2904
2906
  const res = this.safeValue(results, i);
2905
2907
  if (fetchMargins && Array.isArray(res)) {
2906
2908
  const keysList = Object.keys(this.indexBy(res, 'symbol'));
2907
- const length = (Object.keys(this.options['crossMarginPairsData'])).length;
2909
+ const length = this.options['crossMarginPairsData'].length;
2908
2910
  // first one is the cross-margin promise
2909
2911
  if (length === 0) {
2910
2912
  this.options['crossMarginPairsData'] = keysList;
@@ -12217,10 +12219,13 @@ class binance extends binance$1 {
12217
12219
  * @description repay borrowed margin and interest
12218
12220
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
12219
12221
  * @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
12222
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
12220
12223
  * @param {string} code unified currency code of the currency to repay
12221
12224
  * @param {float} amount the amount to repay
12222
12225
  * @param {object} [params] extra parameters specific to the exchange API endpoint
12223
12226
  * @param {boolean} [params.portfolioMargin] set to true if you would like to repay margin in a portfolio margin account
12227
+ * @param {string} [params.repayCrossMarginMethod] *portfolio margin only* 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative)
12228
+ * @param {string} [params.specifyRepayAssets] *portfolio margin papiPostMarginRepayDebt only* specific asset list to repay debt
12224
12229
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
12225
12230
  */
12226
12231
  await this.loadMarkets();
@@ -12233,19 +12238,41 @@ class binance extends binance$1 {
12233
12238
  let isPortfolioMargin = undefined;
12234
12239
  [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'repayCrossMargin', 'papi', 'portfolioMargin', false);
12235
12240
  if (isPortfolioMargin) {
12236
- response = await this.papiPostRepayLoan(this.extend(request, params));
12241
+ let method = undefined;
12242
+ [method, params] = this.handleOptionAndParams2(params, 'repayCrossMargin', 'repayCrossMarginMethod', 'method');
12243
+ if (method === 'papiPostMarginRepayDebt') {
12244
+ response = await this.papiPostMarginRepayDebt(this.extend(request, params));
12245
+ //
12246
+ // {
12247
+ // "asset": "USDC",
12248
+ // "amount": 10,
12249
+ // "specifyRepayAssets": null,
12250
+ // "updateTime": 1727170761267,
12251
+ // "success": true
12252
+ // }
12253
+ //
12254
+ }
12255
+ else {
12256
+ response = await this.papiPostRepayLoan(this.extend(request, params));
12257
+ //
12258
+ // {
12259
+ // "tranId": 108988250265,
12260
+ // "clientTag":""
12261
+ // }
12262
+ //
12263
+ }
12237
12264
  }
12238
12265
  else {
12239
12266
  request['isIsolated'] = 'FALSE';
12240
12267
  request['type'] = 'REPAY';
12241
12268
  response = await this.sapiPostMarginBorrowRepay(this.extend(request, params));
12269
+ //
12270
+ // {
12271
+ // "tranId": 108988250265,
12272
+ // "clientTag":""
12273
+ // }
12274
+ //
12242
12275
  }
12243
- //
12244
- // {
12245
- // "tranId": 108988250265,
12246
- // "clientTag":""
12247
- // }
12248
- //
12249
12276
  return this.parseMarginLoan(response, currency);
12250
12277
  }
12251
12278
  async repayIsolatedMargin(symbol, code, amount, params = {}) {
@@ -12355,13 +12382,25 @@ class binance extends binance$1 {
12355
12382
  // "clientTag":""
12356
12383
  // }
12357
12384
  //
12385
+ // repayCrossMargin alternative endpoint
12386
+ //
12387
+ // {
12388
+ // "asset": "USDC",
12389
+ // "amount": 10,
12390
+ // "specifyRepayAssets": null,
12391
+ // "updateTime": 1727170761267,
12392
+ // "success": true
12393
+ // }
12394
+ //
12395
+ const currencyId = this.safeString(info, 'asset');
12396
+ const timestamp = this.safeInteger(info, 'updateTime');
12358
12397
  return {
12359
12398
  'id': this.safeInteger(info, 'tranId'),
12360
- 'currency': this.safeCurrencyCode(undefined, currency),
12361
- 'amount': undefined,
12399
+ 'currency': this.safeCurrencyCode(currencyId, currency),
12400
+ 'amount': this.safeNumber(info, 'amount'),
12362
12401
  'symbol': undefined,
12363
- 'timestamp': undefined,
12364
- 'datetime': undefined,
12402
+ 'timestamp': timestamp,
12403
+ 'datetime': this.iso8601(timestamp),
12365
12404
  'info': info,
12366
12405
  };
12367
12406
  }
@@ -648,7 +648,12 @@ class bingx extends bingx$1 {
648
648
  // "maxNotional": 20000,
649
649
  // "status": 1,
650
650
  // "tickSize": 0.000001,
651
- // "stepSize": 1
651
+ // "stepSize": 1,
652
+ // "apiStateSell": true,
653
+ // "apiStateBuy": true,
654
+ // "timeOnline": 0,
655
+ // "offTime": 0,
656
+ // "maintainTime": 0
652
657
  // },
653
658
  // ...
654
659
  // ]
@@ -757,7 +762,7 @@ class bingx extends bingx$1 {
757
762
  if ((this.safeString(market, 'apiStateOpen') === 'true') && (this.safeString(market, 'apiStateClose') === 'true')) {
758
763
  isActive = true; // swap active
759
764
  }
760
- else if (this.safeBool(market, 'apiStateSell') && this.safeBool(market, 'apiStateBuy')) {
765
+ else if (this.safeBool(market, 'apiStateSell') && this.safeBool(market, 'apiStateBuy') && (this.safeNumber(market, 'status') === 1)) {
761
766
  isActive = true; // spot active
762
767
  }
763
768
  const isInverse = (spot) ? undefined : checkIsInverse;
@@ -1420,6 +1420,9 @@ class bitget extends bitget$1 {
1420
1420
  'STARKNET': 'Starknet',
1421
1421
  'OPTIMISM': 'Optimism',
1422
1422
  'ARBITRUM': 'Arbitrum',
1423
+ 'APT': 'APTOS',
1424
+ 'MATIC': 'POLYGON',
1425
+ 'VIC': 'VICTION',
1423
1426
  },
1424
1427
  'networksById': {},
1425
1428
  'fetchPositions': {