ccxt 4.4.43 → 4.4.45

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 (95) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +6 -6
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/binance.js +216 -82
  5. package/dist/cjs/src/bingx.js +20 -9
  6. package/dist/cjs/src/bitfinex.js +7 -3
  7. package/dist/cjs/src/bitget.js +6 -4
  8. package/dist/cjs/src/bitmart.js +7 -10
  9. package/dist/cjs/src/bitmex.js +4 -6
  10. package/dist/cjs/src/bitstamp.js +5 -0
  11. package/dist/cjs/src/blofin.js +22 -0
  12. package/dist/cjs/src/bybit.js +11 -26
  13. package/dist/cjs/src/coinbase.js +14 -10
  14. package/dist/cjs/src/coinbaseinternational.js +13 -9
  15. package/dist/cjs/src/coincatch.js +2 -2
  16. package/dist/cjs/src/coinex.js +6 -6
  17. package/dist/cjs/src/cryptocom.js +4 -2
  18. package/dist/cjs/src/defx.js +2 -2
  19. package/dist/cjs/src/delta.js +1 -1
  20. package/dist/cjs/src/exmo.js +18 -8
  21. package/dist/cjs/src/gate.js +8 -3
  22. package/dist/cjs/src/gemini.js +5 -0
  23. package/dist/cjs/src/hashkey.js +16 -10
  24. package/dist/cjs/src/htx.js +107 -4
  25. package/dist/cjs/src/hyperliquid.js +6 -1
  26. package/dist/cjs/src/kraken.js +10 -3
  27. package/dist/cjs/src/krakenfutures.js +6 -1
  28. package/dist/cjs/src/kucoin.js +10 -8
  29. package/dist/cjs/src/kucoinfutures.js +7 -8
  30. package/dist/cjs/src/lykke.js +1 -1
  31. package/dist/cjs/src/mexc.js +18 -12
  32. package/dist/cjs/src/myokx.js +8 -0
  33. package/dist/cjs/src/ndax.js +1 -1
  34. package/dist/cjs/src/oceanex.js +1 -1
  35. package/dist/cjs/src/okx.js +8 -9
  36. package/dist/cjs/src/onetrading.js +2 -1
  37. package/dist/cjs/src/pro/binance.js +2 -1
  38. package/dist/cjs/src/pro/bitcoincom.js +4 -1
  39. package/dist/cjs/src/pro/bitopro.js +1 -1
  40. package/dist/cjs/src/pro/myokx.js +5 -0
  41. package/dist/cjs/src/whitebit.js +38 -10
  42. package/dist/cjs/src/woo.js +6 -4
  43. package/dist/cjs/src/woofipro.js +7 -4
  44. package/js/ccxt.d.ts +1 -1
  45. package/js/ccxt.js +1 -1
  46. package/js/src/abstract/binance.d.ts +1 -0
  47. package/js/src/abstract/binancecoinm.d.ts +1 -0
  48. package/js/src/abstract/binanceus.d.ts +1 -0
  49. package/js/src/abstract/binanceusdm.d.ts +1 -0
  50. package/js/src/abstract/blofin.d.ts +22 -0
  51. package/js/src/binance.d.ts +37 -32
  52. package/js/src/binance.js +216 -82
  53. package/js/src/bingx.js +20 -9
  54. package/js/src/bitfinex.js +7 -3
  55. package/js/src/bitget.js +6 -4
  56. package/js/src/bitmart.js +7 -10
  57. package/js/src/bitmex.js +4 -6
  58. package/js/src/bitstamp.js +5 -0
  59. package/js/src/blofin.js +22 -0
  60. package/js/src/bybit.js +11 -26
  61. package/js/src/coinbase.js +14 -10
  62. package/js/src/coinbaseinternational.js +13 -9
  63. package/js/src/coincatch.js +2 -2
  64. package/js/src/coinex.js +6 -6
  65. package/js/src/cryptocom.js +4 -2
  66. package/js/src/defx.js +2 -2
  67. package/js/src/delta.js +1 -1
  68. package/js/src/exmo.d.ts +1 -0
  69. package/js/src/exmo.js +18 -8
  70. package/js/src/gate.js +8 -3
  71. package/js/src/gemini.js +5 -0
  72. package/js/src/hashkey.js +16 -10
  73. package/js/src/htx.d.ts +13 -1
  74. package/js/src/htx.js +107 -4
  75. package/js/src/hyperliquid.js +6 -1
  76. package/js/src/kraken.js +10 -3
  77. package/js/src/krakenfutures.js +6 -1
  78. package/js/src/kucoin.js +10 -8
  79. package/js/src/kucoinfutures.js +7 -8
  80. package/js/src/lykke.js +1 -1
  81. package/js/src/mexc.js +18 -12
  82. package/js/src/myokx.js +8 -0
  83. package/js/src/ndax.js +1 -1
  84. package/js/src/oceanex.js +1 -1
  85. package/js/src/okx.js +8 -9
  86. package/js/src/onetrading.js +2 -1
  87. package/js/src/pro/binance.js +2 -1
  88. package/js/src/pro/bitcoincom.js +4 -1
  89. package/js/src/pro/bitopro.js +1 -1
  90. package/js/src/pro/myokx.js +5 -0
  91. package/js/src/whitebit.d.ts +2 -1
  92. package/js/src/whitebit.js +38 -10
  93. package/js/src/woo.js +6 -4
  94. package/js/src/woofipro.js +7 -4
  95. package/package.json +1 -1
@@ -225,6 +225,7 @@ class binance extends binance$1 {
225
225
  'private': 'https://api.binance.com/api/v3',
226
226
  'v1': 'https://api.binance.com/api/v1',
227
227
  'papi': 'https://papi.binance.com/papi/v1',
228
+ 'papiV2': 'https://papi.binance.com/papi/v2',
228
229
  },
229
230
  'www': 'https://www.binance.com',
230
231
  'referral': {
@@ -1167,6 +1168,11 @@ class binance extends binance$1 {
1167
1168
  'listenKey': 0.2,
1168
1169
  },
1169
1170
  },
1171
+ 'papiV2': {
1172
+ 'get': {
1173
+ 'um/account': 1,
1174
+ },
1175
+ },
1170
1176
  },
1171
1177
  'fees': {
1172
1178
  'trading': {
@@ -1559,7 +1565,6 @@ class binance extends binance$1 {
1559
1565
  },
1560
1566
  },
1561
1567
  'features': {
1562
- // https://developers.binance.com/docs/binance-spot-api-docs/rest-api#:~:text=quoteOrderQty
1563
1568
  'spot': {
1564
1569
  'sandbox': true,
1565
1570
  'createOrder': {
@@ -1577,12 +1582,13 @@ class binance extends binance$1 {
1577
1582
  'GTD': false,
1578
1583
  },
1579
1584
  'hedged': true,
1585
+ 'leverage': false,
1586
+ 'marketBuyRequiresPrice': false,
1587
+ 'marketBuyByCost': true,
1580
1588
  // exchange-supported features
1581
1589
  'selfTradePrevention': true,
1582
1590
  'trailing': true,
1583
- 'twap': false,
1584
- 'iceberg': true,
1585
- 'oco': false,
1591
+ 'iceberg': true, // todo implementation
1586
1592
  },
1587
1593
  'createOrders': undefined,
1588
1594
  'fetchMyTrades': {
@@ -1613,7 +1619,7 @@ class binance extends binance$1 {
1613
1619
  'fetchClosedOrders': {
1614
1620
  'marginMode': true,
1615
1621
  'limit': 1000,
1616
- 'daysBackClosed': undefined,
1622
+ 'daysBack': undefined,
1617
1623
  'daysBackCanceled': undefined,
1618
1624
  'untilDays': 10000,
1619
1625
  'trigger': false,
@@ -1647,9 +1653,10 @@ class binance extends binance$1 {
1647
1653
  // exchange-supported features
1648
1654
  'selfTradePrevention': true,
1649
1655
  'trailing': true,
1650
- 'twap': false,
1651
1656
  'iceberg': false,
1652
- 'oco': false,
1657
+ 'leverage': false,
1658
+ 'marketBuyRequiresPrice': false,
1659
+ 'marketBuyByCost': true,
1653
1660
  },
1654
1661
  'createOrders': {
1655
1662
  'max': 5,
@@ -1682,7 +1689,7 @@ class binance extends binance$1 {
1682
1689
  'fetchClosedOrders': {
1683
1690
  'marginMode': true,
1684
1691
  'limit': 1000,
1685
- 'daysBackClosed': 90,
1692
+ 'daysBack': 90,
1686
1693
  'daysBackCanceled': 3,
1687
1694
  'untilDays': 7,
1688
1695
  'trigger': false,
@@ -2405,22 +2412,72 @@ class binance extends binance$1 {
2405
2412
  'portfolioMargin': {
2406
2413
  'exact': {
2407
2414
  //
2408
- // 1xxx
2415
+ // 10xx General Server or Network Issues
2409
2416
  //
2417
+ '-1000': errors.OperationFailed,
2418
+ '-1001': errors.ExchangeError,
2419
+ '-1002': errors.PermissionDenied,
2420
+ '-1003': errors.RateLimitExceeded,
2421
+ '-1004': errors.BadRequest,
2410
2422
  '-1005': errors.PermissionDenied,
2423
+ '-1006': errors.BadResponse,
2424
+ '-1007': errors.BadResponse,
2425
+ '-1008': errors.OperationFailed,
2426
+ '-1010': errors.ExchangeError,
2411
2427
  '-1011': errors.PermissionDenied,
2428
+ '-1013': errors.ExchangeError,
2429
+ '-1014': errors.InvalidOrder,
2430
+ '-1015': errors.InvalidOrder,
2431
+ '-1016': errors.NotSupported,
2432
+ '-1020': errors.NotSupported,
2433
+ '-1021': errors.BadRequest,
2434
+ '-1022': errors.BadRequest,
2412
2435
  '-1023': errors.BadRequest,
2436
+ '-1099': errors.OperationFailed,
2437
+ //
2438
+ // 11xx Request Issues
2439
+ //
2440
+ '-1100': errors.BadRequest,
2441
+ '-1101': errors.BadRequest,
2442
+ '-1102': errors.BadRequest,
2443
+ '-1103': errors.BadRequest,
2444
+ '-1104': errors.BadRequest,
2445
+ '-1105': errors.BadRequest,
2446
+ '-1106': errors.BadRequest,
2447
+ '-1108': errors.BadRequest,
2413
2448
  '-1109': errors.BadRequest,
2414
2449
  '-1110': errors.BadSymbol,
2450
+ '-1111': errors.BadRequest,
2451
+ '-1112': errors.BadRequest,
2415
2452
  '-1113': errors.BadRequest,
2453
+ '-1114': errors.BadRequest,
2454
+ '-1115': errors.BadRequest,
2455
+ '-1116': errors.BadRequest,
2456
+ '-1117': errors.BadRequest,
2457
+ '-1118': errors.BadRequest,
2458
+ '-1119': errors.BadRequest,
2459
+ '-1120': errors.BadRequest,
2460
+ '-1121': errors.BadSymbol,
2461
+ '-1125': errors.BadRequest,
2462
+ '-1127': errors.BadRequest,
2416
2463
  '-1128': errors.BadRequest,
2464
+ '-1130': errors.BadRequest,
2465
+ '-1131': errors.BadRequest,
2466
+ '-1134': errors.BadRequest,
2417
2467
  '-1136': errors.BadRequest,
2468
+ '-1145': errors.BadRequest,
2469
+ '-1151': errors.BadRequest,
2418
2470
  //
2419
- // 2xxx
2471
+ // 20xx Processing Issues
2420
2472
  //
2421
- '-2016': errors.OperationRejected,
2422
- '-2018': errors.InsufficientFunds,
2423
- '-2019': errors.InsufficientFunds,
2473
+ '-2010': errors.InvalidOrder,
2474
+ '-2011': errors.OperationRejected,
2475
+ '-2013': errors.BadRequest,
2476
+ '-2014': errors.OperationRejected,
2477
+ '-2015': errors.OperationRejected,
2478
+ '-2016': errors.OperationFailed,
2479
+ '-2018': errors.OperationFailed,
2480
+ '-2019': errors.OperationFailed,
2424
2481
  '-2020': errors.OrderNotFillable,
2425
2482
  '-2021': errors.OrderImmediatelyFillable,
2426
2483
  '-2022': errors.InvalidOrder,
@@ -2431,12 +2488,67 @@ class binance extends binance$1 {
2431
2488
  '-2027': errors.OperationRejected,
2432
2489
  '-2028': errors.OperationRejected,
2433
2490
  //
2434
- // 4xxx
2491
+ // 4xxx Filters and other issues
2435
2492
  //
2493
+ '-4000': errors.BadRequest,
2494
+ '-4001': errors.BadRequest,
2495
+ '-4002': errors.BadRequest,
2496
+ '-4003': errors.BadRequest,
2497
+ '-4004': errors.BadRequest,
2498
+ '-4005': errors.BadRequest,
2499
+ '-4006': errors.BadRequest,
2500
+ '-4007': errors.BadRequest,
2501
+ '-4008': errors.BadRequest,
2502
+ '-4009': errors.BadRequest,
2503
+ '-4010': errors.BadRequest,
2504
+ '-4011': errors.BadRequest,
2505
+ '-4012': errors.BadRequest,
2506
+ '-4013': errors.BadRequest,
2507
+ '-4014': errors.BadRequest,
2508
+ '-4015': errors.BadRequest,
2509
+ '-4016': errors.BadRequest,
2510
+ '-4017': errors.BadRequest,
2511
+ '-4018': errors.BadRequest,
2512
+ '-4019': errors.BadRequest,
2513
+ '-4020': errors.BadRequest,
2514
+ '-4021': errors.BadRequest,
2515
+ '-4022': errors.BadRequest,
2516
+ '-4023': errors.BadRequest,
2517
+ '-4024': errors.BadRequest,
2518
+ '-4025': errors.BadRequest,
2519
+ '-4026': errors.BadRequest,
2520
+ '-4027': errors.BadRequest,
2521
+ '-4028': errors.BadRequest,
2522
+ '-4029': errors.BadRequest,
2523
+ '-4030': errors.BadRequest,
2524
+ '-4031': errors.BadRequest,
2525
+ '-4032': errors.BadRequest,
2526
+ '-4033': errors.BadRequest,
2527
+ '-4044': errors.BadRequest,
2528
+ '-4045': errors.BadRequest,
2529
+ '-4046': errors.BadRequest,
2530
+ '-4047': errors.BadRequest,
2531
+ '-4048': errors.BadRequest,
2532
+ '-4049': errors.BadRequest,
2533
+ '-4050': errors.BadRequest,
2534
+ '-4051': errors.BadRequest,
2535
+ '-4052': errors.BadRequest,
2536
+ '-4053': errors.BadRequest,
2537
+ '-4054': errors.BadRequest,
2538
+ '-4055': errors.BadRequest,
2539
+ '-4056': errors.PermissionDenied,
2540
+ '-4057': errors.PermissionDenied,
2541
+ '-4058': errors.BadRequest,
2542
+ '-4059': errors.BadRequest,
2543
+ '-4060': errors.BadRequest,
2544
+ '-4061': errors.InvalidOrder,
2545
+ '-4062': errors.BadRequest,
2436
2546
  '-4063': errors.BadRequest,
2437
2547
  '-4064': errors.BadRequest,
2438
2548
  '-4065': errors.BadRequest,
2439
2549
  '-4066': errors.BadRequest,
2550
+ '-4067': errors.BadRequest,
2551
+ '-4068': errors.BadRequest,
2440
2552
  '-4069': errors.BadRequest,
2441
2553
  '-4070': errors.BadRequest,
2442
2554
  '-4071': errors.BadRequest,
@@ -2450,47 +2562,39 @@ class binance extends binance$1 {
2450
2562
  '-4079': errors.BadRequest,
2451
2563
  '-4080': errors.PermissionDenied,
2452
2564
  '-4081': errors.BadRequest,
2565
+ '-4082': errors.BadRequest,
2566
+ '-4083': errors.BadRequest,
2567
+ '-4084': errors.NotSupported,
2453
2568
  '-4085': errors.BadRequest,
2454
2569
  '-4086': errors.BadRequest,
2455
2570
  '-4087': errors.PermissionDenied,
2456
2571
  '-4088': errors.PermissionDenied,
2572
+ '-4104': errors.BadRequest,
2457
2573
  '-4114': errors.BadRequest,
2458
2574
  '-4115': errors.BadRequest,
2459
2575
  '-4118': errors.OperationRejected,
2460
2576
  '-4131': errors.OperationRejected,
2461
- '-4140': errors.BadRequest,
2577
+ '-4135': errors.BadRequest,
2578
+ '-4137': errors.BadRequest,
2579
+ '-4138': errors.BadRequest,
2580
+ '-4139': errors.BadRequest,
2581
+ '-4140': errors.OrderImmediatelyFillable,
2462
2582
  '-4141': errors.BadRequest,
2583
+ '-4142': errors.OrderImmediatelyFillable,
2463
2584
  '-4144': errors.BadSymbol,
2464
2585
  '-4161': errors.OperationRejected,
2465
- '-4164': errors.OperationRejected,
2586
+ '-4164': errors.InvalidOrder,
2466
2587
  '-4165': errors.BadRequest,
2467
- '-4183': errors.BadRequest,
2468
- '-4184': errors.BadRequest,
2588
+ '-4183': errors.InvalidOrder,
2589
+ '-4184': errors.InvalidOrder,
2590
+ '-4408': errors.InvalidOrder,
2469
2591
  //
2470
- // 5xxx
2592
+ // 5xxx Order Execution Issues
2471
2593
  //
2472
2594
  '-5021': errors.OrderNotFillable,
2473
2595
  '-5022': errors.OrderNotFillable,
2474
- //
2475
- // 2xxxx
2476
- //
2477
- '-20121': errors.ExchangeError,
2478
- '-20124': errors.ExchangeError,
2479
- '-20130': errors.ExchangeError,
2480
- '-20132': errors.ExchangeError,
2481
- '-20194': errors.ExchangeError,
2482
- '-20195': errors.ExchangeError,
2483
- '-20196': errors.ExchangeError,
2484
- '-20198': errors.ExchangeError,
2485
- '-20204': errors.ExchangeError,
2486
- // 21xxx - PORTFOLIO MARGIN (documented in spot docs)
2487
- '-21001': errors.BadRequest,
2488
- '-21002': errors.BadRequest,
2489
- '-21003': errors.BadResponse,
2490
- '-21004': errors.OperationRejected,
2491
- '-21005': errors.InsufficientFunds,
2492
- '-21006': errors.OperationFailed,
2493
- '-21007': errors.OperationFailed, // User failed to repay portfolio margin bankruptcy loan since liquidation was in process
2596
+ '-5028': errors.OperationFailed,
2597
+ '-5041': errors.RateLimitExceeded, // Time out for too many requests from this account queueing at the same time.
2494
2598
  },
2495
2599
  },
2496
2600
  'exact': {
@@ -2826,7 +2930,7 @@ class binance extends binance$1 {
2826
2930
  * @method
2827
2931
  * @name binance#fetchTime
2828
2932
  * @description fetches the current integer timestamp in milliseconds from the exchange server
2829
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
2933
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#check-server-time // spot
2830
2934
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
2831
2935
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
2832
2936
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -3074,7 +3178,7 @@ class binance extends binance$1 {
3074
3178
  * @method
3075
3179
  * @name binance#fetchMarkets
3076
3180
  * @description retrieves data on all markets for binance
3077
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
3181
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#exchange-information // spot
3078
3182
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
3079
3183
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
3080
3184
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
@@ -3594,7 +3698,11 @@ class binance extends binance$1 {
3594
3698
  account['total'] = this.safeString(entry, 'crossMarginAsset');
3595
3699
  }
3596
3700
  else {
3597
- account['total'] = this.safeString(entry, 'totalWalletBalance');
3701
+ const usedLinear = this.safeString(entry, 'umUnrealizedPNL');
3702
+ const usedInverse = this.safeString(entry, 'cmUnrealizedPNL');
3703
+ const totalUsed = Precise["default"].stringAdd(usedLinear, usedInverse);
3704
+ const totalWalletBalance = this.safeString(entry, 'totalWalletBalance');
3705
+ account['total'] = Precise["default"].stringAdd(totalUsed, totalWalletBalance);
3598
3706
  }
3599
3707
  result[code] = account;
3600
3708
  }
@@ -3684,7 +3792,7 @@ class binance extends binance$1 {
3684
3792
  * @method
3685
3793
  * @name binance#fetchBalance
3686
3794
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
3687
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
3795
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-information-user_data // spot
3688
3796
  * @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
3689
3797
  * @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
3690
3798
  * @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
@@ -3958,7 +4066,7 @@ class binance extends binance$1 {
3958
4066
  * @method
3959
4067
  * @name binance#fetchOrderBook
3960
4068
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
3961
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
4069
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#order-book // spot
3962
4070
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
3963
4071
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
3964
4072
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
@@ -4224,8 +4332,8 @@ class binance extends binance$1 {
4224
4332
  * @method
4225
4333
  * @name binance#fetchTicker
4226
4334
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
4227
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
4228
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
4335
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics // spot
4336
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#rolling-window-price-change-statistics // spot
4229
4337
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
4230
4338
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
4231
4339
  * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
@@ -4270,7 +4378,7 @@ class binance extends binance$1 {
4270
4378
  * @method
4271
4379
  * @name binance#fetchBidsAsks
4272
4380
  * @description fetches the bid and ask price and volume for multiple markets
4273
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
4381
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker // spot
4274
4382
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
4275
4383
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
4276
4384
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
@@ -4309,7 +4417,7 @@ class binance extends binance$1 {
4309
4417
  * @method
4310
4418
  * @name binance#fetchLastPrices
4311
4419
  * @description fetches the last price for multiple markets
4312
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
4420
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-price-ticker // spot
4313
4421
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
4314
4422
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
4315
4423
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
@@ -4414,7 +4522,7 @@ class binance extends binance$1 {
4414
4522
  * @method
4415
4523
  * @name binance#fetchTickers
4416
4524
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
4417
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
4525
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics // spot
4418
4526
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
4419
4527
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
4420
4528
  * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
@@ -4588,7 +4696,7 @@ class binance extends binance$1 {
4588
4696
  * @method
4589
4697
  * @name binance#fetchOHLCV
4590
4698
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
4591
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
4699
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#klinecandlestick-data
4592
4700
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
4593
4701
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
4594
4702
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
@@ -4998,15 +5106,15 @@ class binance extends binance$1 {
4998
5106
  * @name binance#fetchTrades
4999
5107
  * @description get the list of most recent trades for a particular symbol
5000
5108
  * Default fetchTradesMethod
5001
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
5109
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#compressedaggregate-trades-list // publicGetAggTrades (spot)
5002
5110
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
5003
5111
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
5004
5112
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
5005
5113
  * Other fetchTradesMethod
5006
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
5114
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#recent-trades-list // publicGetTrades (spot)
5007
5115
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
5008
5116
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
5009
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
5117
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#old-trade-lookup // publicGetHistoricalTrades (spot)
5010
5118
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
5011
5119
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
5012
5120
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
@@ -5142,7 +5250,7 @@ class binance extends binance$1 {
5142
5250
  * @name binance#editSpotOrder
5143
5251
  * @ignore
5144
5252
  * @description edit a trade order
5145
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
5253
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
5146
5254
  * @param {string} id cancel order id
5147
5255
  * @param {string} symbol unified symbol of the market to create an order in
5148
5256
  * @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
@@ -5348,10 +5456,10 @@ class binance extends binance$1 {
5348
5456
  const request = {
5349
5457
  'symbol': market['id'],
5350
5458
  'side': side.toUpperCase(),
5459
+ 'orderId': id,
5460
+ 'quantity': this.amountToPrecision(symbol, amount),
5351
5461
  };
5352
5462
  const clientOrderId = this.safeStringN(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId']);
5353
- request['orderId'] = id;
5354
- request['quantity'] = this.amountToPrecision(symbol, amount);
5355
5463
  if (price !== undefined) {
5356
5464
  request['price'] = this.priceToPrecision(symbol, price);
5357
5465
  }
@@ -5367,6 +5475,8 @@ class binance extends binance$1 {
5367
5475
  * @description edit a trade order
5368
5476
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
5369
5477
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
5478
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
5479
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
5370
5480
  * @param {string} id cancel order id
5371
5481
  * @param {string} symbol unified symbol of the market to create an order in
5372
5482
  * @param {string} type 'market' or 'limit'
@@ -5374,18 +5484,36 @@ class binance extends binance$1 {
5374
5484
  * @param {float} amount how much of currency you want to trade in units of base currency
5375
5485
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5376
5486
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5487
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
5377
5488
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5378
5489
  */
5379
5490
  async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
5380
5491
  await this.loadMarkets();
5381
5492
  const market = this.market(symbol);
5493
+ let isPortfolioMargin = undefined;
5494
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'editContractOrder', 'papi', 'portfolioMargin', false);
5495
+ if (market['linear'] || isPortfolioMargin) {
5496
+ if (price === undefined) {
5497
+ throw new errors.ArgumentsRequired(this.id + ' editOrder() requires a price argument for portfolio margin and linear orders');
5498
+ }
5499
+ }
5382
5500
  const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
5383
5501
  let response = undefined;
5384
5502
  if (market['linear']) {
5385
- response = await this.fapiPrivatePutOrder(this.extend(request, params));
5503
+ if (isPortfolioMargin) {
5504
+ response = await this.papiPutUmOrder(this.extend(request, params));
5505
+ }
5506
+ else {
5507
+ response = await this.fapiPrivatePutOrder(this.extend(request, params));
5508
+ }
5386
5509
  }
5387
5510
  else if (market['inverse']) {
5388
- response = await this.dapiPrivatePutOrder(this.extend(request, params));
5511
+ if (isPortfolioMargin) {
5512
+ response = await this.papiPutCmOrder(this.extend(request, params));
5513
+ }
5514
+ else {
5515
+ response = await this.dapiPrivatePutOrder(this.extend(request, params));
5516
+ }
5389
5517
  }
5390
5518
  //
5391
5519
  // swap and future
@@ -5420,7 +5548,7 @@ class binance extends binance$1 {
5420
5548
  * @method
5421
5549
  * @name binance#editOrder
5422
5550
  * @description edit a trade order
5423
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
5551
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
5424
5552
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
5425
5553
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
5426
5554
  * @param {string} id cancel order id
@@ -5430,6 +5558,7 @@ class binance extends binance$1 {
5430
5558
  * @param {float} amount how much of currency you want to trade in units of base currency
5431
5559
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5432
5560
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5561
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
5433
5562
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5434
5563
  */
5435
5564
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
@@ -6111,13 +6240,13 @@ class binance extends binance$1 {
6111
6240
  * @method
6112
6241
  * @name binance#createOrder
6113
6242
  * @description create a trade order
6114
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6115
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
6243
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6244
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
6116
6245
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
6117
6246
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
6118
6247
  * @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
6119
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
6120
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
6248
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#sor
6249
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-using-sor-trade
6121
6250
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
6122
6251
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
6123
6252
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
@@ -6142,6 +6271,7 @@ class binance extends binance$1 {
6142
6271
  * @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
6143
6272
  * @param {string} [params.positionSide] *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
6144
6273
  * @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
6274
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
6145
6275
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
6146
6276
  */
6147
6277
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -6548,7 +6678,7 @@ class binance extends binance$1 {
6548
6678
  * @method
6549
6679
  * @name binance#createMarketOrderWithCost
6550
6680
  * @description create a market order by providing the symbol, side and cost
6551
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6681
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6552
6682
  * @param {string} symbol unified symbol of the market to create an order in
6553
6683
  * @param {string} side 'buy' or 'sell'
6554
6684
  * @param {float} cost how much you want to trade in units of the quote currency
@@ -6561,14 +6691,16 @@ class binance extends binance$1 {
6561
6691
  if (!market['spot']) {
6562
6692
  throw new errors.NotSupported(this.id + ' createMarketOrderWithCost() supports spot orders only');
6563
6693
  }
6564
- params['cost'] = cost;
6565
- return await this.createOrder(symbol, 'market', side, cost, undefined, params);
6694
+ const req = {
6695
+ 'cost': cost,
6696
+ };
6697
+ return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
6566
6698
  }
6567
6699
  /**
6568
6700
  * @method
6569
6701
  * @name binance#createMarketBuyOrderWithCost
6570
6702
  * @description create a market buy order by providing the symbol and cost
6571
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6703
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6572
6704
  * @param {string} symbol unified symbol of the market to create an order in
6573
6705
  * @param {float} cost how much you want to trade in units of the quote currency
6574
6706
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6580,14 +6712,16 @@ class binance extends binance$1 {
6580
6712
  if (!market['spot']) {
6581
6713
  throw new errors.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
6582
6714
  }
6583
- params['cost'] = cost;
6584
- return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
6715
+ const req = {
6716
+ 'cost': cost,
6717
+ };
6718
+ return await this.createOrder(symbol, 'market', 'buy', 0, undefined, this.extend(req, params));
6585
6719
  }
6586
6720
  /**
6587
6721
  * @method
6588
6722
  * @name binance#createMarketSellOrderWithCost
6589
6723
  * @description create a market sell order by providing the symbol and cost
6590
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6724
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6591
6725
  * @param {string} symbol unified symbol of the market to create an order in
6592
6726
  * @param {float} cost how much you want to trade in units of the quote currency
6593
6727
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6606,7 +6740,7 @@ class binance extends binance$1 {
6606
6740
  * @method
6607
6741
  * @name binance#fetchOrder
6608
6742
  * @description fetches information on an order made by the user
6609
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
6743
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-order-user_data
6610
6744
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
6611
6745
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
6612
6746
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
@@ -6688,7 +6822,7 @@ class binance extends binance$1 {
6688
6822
  * @method
6689
6823
  * @name binance#fetchOrders
6690
6824
  * @description fetches information on multiple orders made by the user
6691
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
6825
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
6692
6826
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
6693
6827
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
6694
6828
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -6967,7 +7101,7 @@ class binance extends binance$1 {
6967
7101
  * @method
6968
7102
  * @name binance#fetchOpenOrders
6969
7103
  * @description fetch all unfilled currently open orders
6970
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
7104
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-open-orders-user_data
6971
7105
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
6972
7106
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
6973
7107
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
@@ -7289,7 +7423,7 @@ class binance extends binance$1 {
7289
7423
  * @method
7290
7424
  * @name binance#fetchClosedOrders
7291
7425
  * @description fetches information on multiple closed orders made by the user
7292
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
7426
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
7293
7427
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
7294
7428
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
7295
7429
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -7319,7 +7453,7 @@ class binance extends binance$1 {
7319
7453
  * @method
7320
7454
  * @name binance#fetchCanceledOrders
7321
7455
  * @description fetches information on multiple canceled orders made by the user
7322
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
7456
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
7323
7457
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
7324
7458
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
7325
7459
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -7349,7 +7483,7 @@ class binance extends binance$1 {
7349
7483
  * @method
7350
7484
  * @name binance#fetchCanceledAndClosedOrders
7351
7485
  * @description fetches information on multiple canceled orders made by the user
7352
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
7486
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
7353
7487
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
7354
7488
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
7355
7489
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -7382,7 +7516,7 @@ class binance extends binance$1 {
7382
7516
  * @method
7383
7517
  * @name binance#cancelOrder
7384
7518
  * @description cancels an open order
7385
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
7519
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-order-trade
7386
7520
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
7387
7521
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
7388
7522
  * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
@@ -7488,7 +7622,7 @@ class binance extends binance$1 {
7488
7622
  * @method
7489
7623
  * @name binance#cancelAllOrders
7490
7624
  * @description cancel all open orders in a market
7491
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
7625
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-all-open-orders-on-a-symbol-trade
7492
7626
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
7493
7627
  * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
7494
7628
  * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
@@ -7736,7 +7870,7 @@ class binance extends binance$1 {
7736
7870
  * @method
7737
7871
  * @name binance#fetchOrderTrades
7738
7872
  * @description fetch all the trades made from a single order
7739
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
7873
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
7740
7874
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
7741
7875
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
7742
7876
  * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
@@ -7767,7 +7901,7 @@ class binance extends binance$1 {
7767
7901
  * @method
7768
7902
  * @name binance#fetchMyTrades
7769
7903
  * @description fetch all trades made by the user
7770
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
7904
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
7771
7905
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
7772
7906
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
7773
7907
  * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
@@ -11833,7 +11967,7 @@ class binance extends binance$1 {
11833
11967
  throw new errors.AuthenticationError(this.id + ' userDataStream endpoint requires `apiKey` credential');
11834
11968
  }
11835
11969
  }
11836
- else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'fapiPrivateV3') || (api === 'papi' && path !== 'ping')) {
11970
+ else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'fapiPrivateV3') || (api === 'papi' && path !== 'ping') || (api === 'papiV2')) {
11837
11971
  this.checkRequiredCredentials();
11838
11972
  if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
11839
11973
  // inject in implicit API calls
@@ -11937,7 +12071,7 @@ class binance extends binance$1 {
11937
12071
  marketType = 'option';
11938
12072
  }
11939
12073
  else if (url.startsWith('https://papi.' + hostname + '/')) {
11940
- marketType = 'portfoliomargin';
12074
+ marketType = 'portfolioMargin';
11941
12075
  }
11942
12076
  if (marketType !== undefined) {
11943
12077
  const exceptionsForMarketType = this.safeDict(this.exceptions, marketType, {});