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
package/js/src/binance.js CHANGED
@@ -228,6 +228,7 @@ export default class binance extends Exchange {
228
228
  'private': 'https://api.binance.com/api/v3',
229
229
  'v1': 'https://api.binance.com/api/v1',
230
230
  'papi': 'https://papi.binance.com/papi/v1',
231
+ 'papiV2': 'https://papi.binance.com/papi/v2',
231
232
  },
232
233
  'www': 'https://www.binance.com',
233
234
  'referral': {
@@ -1170,6 +1171,11 @@ export default class binance extends Exchange {
1170
1171
  'listenKey': 0.2,
1171
1172
  },
1172
1173
  },
1174
+ 'papiV2': {
1175
+ 'get': {
1176
+ 'um/account': 1,
1177
+ },
1178
+ },
1173
1179
  },
1174
1180
  'fees': {
1175
1181
  'trading': {
@@ -1562,7 +1568,6 @@ export default class binance extends Exchange {
1562
1568
  },
1563
1569
  },
1564
1570
  'features': {
1565
- // https://developers.binance.com/docs/binance-spot-api-docs/rest-api#:~:text=quoteOrderQty
1566
1571
  'spot': {
1567
1572
  'sandbox': true,
1568
1573
  'createOrder': {
@@ -1580,12 +1585,13 @@ export default class binance extends Exchange {
1580
1585
  'GTD': false,
1581
1586
  },
1582
1587
  'hedged': true,
1588
+ 'leverage': false,
1589
+ 'marketBuyRequiresPrice': false,
1590
+ 'marketBuyByCost': true,
1583
1591
  // exchange-supported features
1584
1592
  'selfTradePrevention': true,
1585
1593
  'trailing': true,
1586
- 'twap': false,
1587
- 'iceberg': true,
1588
- 'oco': false,
1594
+ 'iceberg': true, // todo implementation
1589
1595
  },
1590
1596
  'createOrders': undefined,
1591
1597
  'fetchMyTrades': {
@@ -1616,7 +1622,7 @@ export default class binance extends Exchange {
1616
1622
  'fetchClosedOrders': {
1617
1623
  'marginMode': true,
1618
1624
  'limit': 1000,
1619
- 'daysBackClosed': undefined,
1625
+ 'daysBack': undefined,
1620
1626
  'daysBackCanceled': undefined,
1621
1627
  'untilDays': 10000,
1622
1628
  'trigger': false,
@@ -1650,9 +1656,10 @@ export default class binance extends Exchange {
1650
1656
  // exchange-supported features
1651
1657
  'selfTradePrevention': true,
1652
1658
  'trailing': true,
1653
- 'twap': false,
1654
1659
  'iceberg': false,
1655
- 'oco': false,
1660
+ 'leverage': false,
1661
+ 'marketBuyRequiresPrice': false,
1662
+ 'marketBuyByCost': true,
1656
1663
  },
1657
1664
  'createOrders': {
1658
1665
  'max': 5,
@@ -1685,7 +1692,7 @@ export default class binance extends Exchange {
1685
1692
  'fetchClosedOrders': {
1686
1693
  'marginMode': true,
1687
1694
  'limit': 1000,
1688
- 'daysBackClosed': 90,
1695
+ 'daysBack': 90,
1689
1696
  'daysBackCanceled': 3,
1690
1697
  'untilDays': 7,
1691
1698
  'trigger': false,
@@ -2408,22 +2415,72 @@ export default class binance extends Exchange {
2408
2415
  'portfolioMargin': {
2409
2416
  'exact': {
2410
2417
  //
2411
- // 1xxx
2418
+ // 10xx General Server or Network Issues
2412
2419
  //
2420
+ '-1000': OperationFailed,
2421
+ '-1001': ExchangeError,
2422
+ '-1002': PermissionDenied,
2423
+ '-1003': RateLimitExceeded,
2424
+ '-1004': BadRequest,
2413
2425
  '-1005': PermissionDenied,
2426
+ '-1006': BadResponse,
2427
+ '-1007': BadResponse,
2428
+ '-1008': OperationFailed,
2429
+ '-1010': ExchangeError,
2414
2430
  '-1011': PermissionDenied,
2431
+ '-1013': ExchangeError,
2432
+ '-1014': InvalidOrder,
2433
+ '-1015': InvalidOrder,
2434
+ '-1016': NotSupported,
2435
+ '-1020': NotSupported,
2436
+ '-1021': BadRequest,
2437
+ '-1022': BadRequest,
2415
2438
  '-1023': BadRequest,
2439
+ '-1099': OperationFailed,
2440
+ //
2441
+ // 11xx Request Issues
2442
+ //
2443
+ '-1100': BadRequest,
2444
+ '-1101': BadRequest,
2445
+ '-1102': BadRequest,
2446
+ '-1103': BadRequest,
2447
+ '-1104': BadRequest,
2448
+ '-1105': BadRequest,
2449
+ '-1106': BadRequest,
2450
+ '-1108': BadRequest,
2416
2451
  '-1109': BadRequest,
2417
2452
  '-1110': BadSymbol,
2453
+ '-1111': BadRequest,
2454
+ '-1112': BadRequest,
2418
2455
  '-1113': BadRequest,
2456
+ '-1114': BadRequest,
2457
+ '-1115': BadRequest,
2458
+ '-1116': BadRequest,
2459
+ '-1117': BadRequest,
2460
+ '-1118': BadRequest,
2461
+ '-1119': BadRequest,
2462
+ '-1120': BadRequest,
2463
+ '-1121': BadSymbol,
2464
+ '-1125': BadRequest,
2465
+ '-1127': BadRequest,
2419
2466
  '-1128': BadRequest,
2467
+ '-1130': BadRequest,
2468
+ '-1131': BadRequest,
2469
+ '-1134': BadRequest,
2420
2470
  '-1136': BadRequest,
2471
+ '-1145': BadRequest,
2472
+ '-1151': BadRequest,
2421
2473
  //
2422
- // 2xxx
2474
+ // 20xx Processing Issues
2423
2475
  //
2424
- '-2016': OperationRejected,
2425
- '-2018': InsufficientFunds,
2426
- '-2019': InsufficientFunds,
2476
+ '-2010': InvalidOrder,
2477
+ '-2011': OperationRejected,
2478
+ '-2013': BadRequest,
2479
+ '-2014': OperationRejected,
2480
+ '-2015': OperationRejected,
2481
+ '-2016': OperationFailed,
2482
+ '-2018': OperationFailed,
2483
+ '-2019': OperationFailed,
2427
2484
  '-2020': OrderNotFillable,
2428
2485
  '-2021': OrderImmediatelyFillable,
2429
2486
  '-2022': InvalidOrder,
@@ -2434,12 +2491,67 @@ export default class binance extends Exchange {
2434
2491
  '-2027': OperationRejected,
2435
2492
  '-2028': OperationRejected,
2436
2493
  //
2437
- // 4xxx
2494
+ // 4xxx Filters and other issues
2438
2495
  //
2496
+ '-4000': BadRequest,
2497
+ '-4001': BadRequest,
2498
+ '-4002': BadRequest,
2499
+ '-4003': BadRequest,
2500
+ '-4004': BadRequest,
2501
+ '-4005': BadRequest,
2502
+ '-4006': BadRequest,
2503
+ '-4007': BadRequest,
2504
+ '-4008': BadRequest,
2505
+ '-4009': BadRequest,
2506
+ '-4010': BadRequest,
2507
+ '-4011': BadRequest,
2508
+ '-4012': BadRequest,
2509
+ '-4013': BadRequest,
2510
+ '-4014': BadRequest,
2511
+ '-4015': BadRequest,
2512
+ '-4016': BadRequest,
2513
+ '-4017': BadRequest,
2514
+ '-4018': BadRequest,
2515
+ '-4019': BadRequest,
2516
+ '-4020': BadRequest,
2517
+ '-4021': BadRequest,
2518
+ '-4022': BadRequest,
2519
+ '-4023': BadRequest,
2520
+ '-4024': BadRequest,
2521
+ '-4025': BadRequest,
2522
+ '-4026': BadRequest,
2523
+ '-4027': BadRequest,
2524
+ '-4028': BadRequest,
2525
+ '-4029': BadRequest,
2526
+ '-4030': BadRequest,
2527
+ '-4031': BadRequest,
2528
+ '-4032': BadRequest,
2529
+ '-4033': BadRequest,
2530
+ '-4044': BadRequest,
2531
+ '-4045': BadRequest,
2532
+ '-4046': BadRequest,
2533
+ '-4047': BadRequest,
2534
+ '-4048': BadRequest,
2535
+ '-4049': BadRequest,
2536
+ '-4050': BadRequest,
2537
+ '-4051': BadRequest,
2538
+ '-4052': BadRequest,
2539
+ '-4053': BadRequest,
2540
+ '-4054': BadRequest,
2541
+ '-4055': BadRequest,
2542
+ '-4056': PermissionDenied,
2543
+ '-4057': PermissionDenied,
2544
+ '-4058': BadRequest,
2545
+ '-4059': BadRequest,
2546
+ '-4060': BadRequest,
2547
+ '-4061': InvalidOrder,
2548
+ '-4062': BadRequest,
2439
2549
  '-4063': BadRequest,
2440
2550
  '-4064': BadRequest,
2441
2551
  '-4065': BadRequest,
2442
2552
  '-4066': BadRequest,
2553
+ '-4067': BadRequest,
2554
+ '-4068': BadRequest,
2443
2555
  '-4069': BadRequest,
2444
2556
  '-4070': BadRequest,
2445
2557
  '-4071': BadRequest,
@@ -2453,47 +2565,39 @@ export default class binance extends Exchange {
2453
2565
  '-4079': BadRequest,
2454
2566
  '-4080': PermissionDenied,
2455
2567
  '-4081': BadRequest,
2568
+ '-4082': BadRequest,
2569
+ '-4083': BadRequest,
2570
+ '-4084': NotSupported,
2456
2571
  '-4085': BadRequest,
2457
2572
  '-4086': BadRequest,
2458
2573
  '-4087': PermissionDenied,
2459
2574
  '-4088': PermissionDenied,
2575
+ '-4104': BadRequest,
2460
2576
  '-4114': BadRequest,
2461
2577
  '-4115': BadRequest,
2462
2578
  '-4118': OperationRejected,
2463
2579
  '-4131': OperationRejected,
2464
- '-4140': BadRequest,
2580
+ '-4135': BadRequest,
2581
+ '-4137': BadRequest,
2582
+ '-4138': BadRequest,
2583
+ '-4139': BadRequest,
2584
+ '-4140': OrderImmediatelyFillable,
2465
2585
  '-4141': BadRequest,
2586
+ '-4142': OrderImmediatelyFillable,
2466
2587
  '-4144': BadSymbol,
2467
2588
  '-4161': OperationRejected,
2468
- '-4164': OperationRejected,
2589
+ '-4164': InvalidOrder,
2469
2590
  '-4165': BadRequest,
2470
- '-4183': BadRequest,
2471
- '-4184': BadRequest,
2591
+ '-4183': InvalidOrder,
2592
+ '-4184': InvalidOrder,
2593
+ '-4408': InvalidOrder,
2472
2594
  //
2473
- // 5xxx
2595
+ // 5xxx Order Execution Issues
2474
2596
  //
2475
2597
  '-5021': OrderNotFillable,
2476
2598
  '-5022': OrderNotFillable,
2477
- //
2478
- // 2xxxx
2479
- //
2480
- '-20121': ExchangeError,
2481
- '-20124': ExchangeError,
2482
- '-20130': ExchangeError,
2483
- '-20132': ExchangeError,
2484
- '-20194': ExchangeError,
2485
- '-20195': ExchangeError,
2486
- '-20196': ExchangeError,
2487
- '-20198': ExchangeError,
2488
- '-20204': ExchangeError,
2489
- // 21xxx - PORTFOLIO MARGIN (documented in spot docs)
2490
- '-21001': BadRequest,
2491
- '-21002': BadRequest,
2492
- '-21003': BadResponse,
2493
- '-21004': OperationRejected,
2494
- '-21005': InsufficientFunds,
2495
- '-21006': OperationFailed,
2496
- '-21007': OperationFailed, // User failed to repay portfolio margin bankruptcy loan since liquidation was in process
2599
+ '-5028': OperationFailed,
2600
+ '-5041': RateLimitExceeded, // Time out for too many requests from this account queueing at the same time.
2497
2601
  },
2498
2602
  },
2499
2603
  'exact': {
@@ -2829,7 +2933,7 @@ export default class binance extends Exchange {
2829
2933
  * @method
2830
2934
  * @name binance#fetchTime
2831
2935
  * @description fetches the current integer timestamp in milliseconds from the exchange server
2832
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
2936
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#check-server-time // spot
2833
2937
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
2834
2938
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
2835
2939
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -3077,7 +3181,7 @@ export default class binance extends Exchange {
3077
3181
  * @method
3078
3182
  * @name binance#fetchMarkets
3079
3183
  * @description retrieves data on all markets for binance
3080
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
3184
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#exchange-information // spot
3081
3185
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
3082
3186
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
3083
3187
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
@@ -3597,7 +3701,11 @@ export default class binance extends Exchange {
3597
3701
  account['total'] = this.safeString(entry, 'crossMarginAsset');
3598
3702
  }
3599
3703
  else {
3600
- account['total'] = this.safeString(entry, 'totalWalletBalance');
3704
+ const usedLinear = this.safeString(entry, 'umUnrealizedPNL');
3705
+ const usedInverse = this.safeString(entry, 'cmUnrealizedPNL');
3706
+ const totalUsed = Precise.stringAdd(usedLinear, usedInverse);
3707
+ const totalWalletBalance = this.safeString(entry, 'totalWalletBalance');
3708
+ account['total'] = Precise.stringAdd(totalUsed, totalWalletBalance);
3601
3709
  }
3602
3710
  result[code] = account;
3603
3711
  }
@@ -3687,7 +3795,7 @@ export default class binance extends Exchange {
3687
3795
  * @method
3688
3796
  * @name binance#fetchBalance
3689
3797
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
3690
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
3798
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-information-user_data // spot
3691
3799
  * @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
3692
3800
  * @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
3693
3801
  * @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
@@ -3961,7 +4069,7 @@ export default class binance extends Exchange {
3961
4069
  * @method
3962
4070
  * @name binance#fetchOrderBook
3963
4071
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
3964
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
4072
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#order-book // spot
3965
4073
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
3966
4074
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
3967
4075
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
@@ -4227,8 +4335,8 @@ export default class binance extends Exchange {
4227
4335
  * @method
4228
4336
  * @name binance#fetchTicker
4229
4337
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
4230
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
4231
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
4338
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics // spot
4339
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#rolling-window-price-change-statistics // spot
4232
4340
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
4233
4341
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
4234
4342
  * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
@@ -4273,7 +4381,7 @@ export default class binance extends Exchange {
4273
4381
  * @method
4274
4382
  * @name binance#fetchBidsAsks
4275
4383
  * @description fetches the bid and ask price and volume for multiple markets
4276
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
4384
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker // spot
4277
4385
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
4278
4386
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
4279
4387
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
@@ -4312,7 +4420,7 @@ export default class binance extends Exchange {
4312
4420
  * @method
4313
4421
  * @name binance#fetchLastPrices
4314
4422
  * @description fetches the last price for multiple markets
4315
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
4423
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-price-ticker // spot
4316
4424
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
4317
4425
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
4318
4426
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
@@ -4417,7 +4525,7 @@ export default class binance extends Exchange {
4417
4525
  * @method
4418
4526
  * @name binance#fetchTickers
4419
4527
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
4420
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
4528
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics // spot
4421
4529
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
4422
4530
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
4423
4531
  * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
@@ -4591,7 +4699,7 @@ export default class binance extends Exchange {
4591
4699
  * @method
4592
4700
  * @name binance#fetchOHLCV
4593
4701
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
4594
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
4702
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#klinecandlestick-data
4595
4703
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
4596
4704
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
4597
4705
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
@@ -5001,15 +5109,15 @@ export default class binance extends Exchange {
5001
5109
  * @name binance#fetchTrades
5002
5110
  * @description get the list of most recent trades for a particular symbol
5003
5111
  * Default fetchTradesMethod
5004
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
5112
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#compressedaggregate-trades-list // publicGetAggTrades (spot)
5005
5113
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
5006
5114
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
5007
5115
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
5008
5116
  * Other fetchTradesMethod
5009
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
5117
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#recent-trades-list // publicGetTrades (spot)
5010
5118
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
5011
5119
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
5012
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
5120
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#old-trade-lookup // publicGetHistoricalTrades (spot)
5013
5121
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
5014
5122
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
5015
5123
  * @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
@@ -5145,7 +5253,7 @@ export default class binance extends Exchange {
5145
5253
  * @name binance#editSpotOrder
5146
5254
  * @ignore
5147
5255
  * @description edit a trade order
5148
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
5256
+ * @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
5149
5257
  * @param {string} id cancel order id
5150
5258
  * @param {string} symbol unified symbol of the market to create an order in
5151
5259
  * @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
@@ -5351,10 +5459,10 @@ export default class binance extends Exchange {
5351
5459
  const request = {
5352
5460
  'symbol': market['id'],
5353
5461
  'side': side.toUpperCase(),
5462
+ 'orderId': id,
5463
+ 'quantity': this.amountToPrecision(symbol, amount),
5354
5464
  };
5355
5465
  const clientOrderId = this.safeStringN(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId']);
5356
- request['orderId'] = id;
5357
- request['quantity'] = this.amountToPrecision(symbol, amount);
5358
5466
  if (price !== undefined) {
5359
5467
  request['price'] = this.priceToPrecision(symbol, price);
5360
5468
  }
@@ -5370,6 +5478,8 @@ export default class binance extends Exchange {
5370
5478
  * @description edit a trade order
5371
5479
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
5372
5480
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
5481
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order
5482
+ * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order
5373
5483
  * @param {string} id cancel order id
5374
5484
  * @param {string} symbol unified symbol of the market to create an order in
5375
5485
  * @param {string} type 'market' or 'limit'
@@ -5377,18 +5487,36 @@ export default class binance extends Exchange {
5377
5487
  * @param {float} amount how much of currency you want to trade in units of base currency
5378
5488
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5379
5489
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5490
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
5380
5491
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5381
5492
  */
5382
5493
  async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
5383
5494
  await this.loadMarkets();
5384
5495
  const market = this.market(symbol);
5496
+ let isPortfolioMargin = undefined;
5497
+ [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'editContractOrder', 'papi', 'portfolioMargin', false);
5498
+ if (market['linear'] || isPortfolioMargin) {
5499
+ if (price === undefined) {
5500
+ throw new ArgumentsRequired(this.id + ' editOrder() requires a price argument for portfolio margin and linear orders');
5501
+ }
5502
+ }
5385
5503
  const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
5386
5504
  let response = undefined;
5387
5505
  if (market['linear']) {
5388
- response = await this.fapiPrivatePutOrder(this.extend(request, params));
5506
+ if (isPortfolioMargin) {
5507
+ response = await this.papiPutUmOrder(this.extend(request, params));
5508
+ }
5509
+ else {
5510
+ response = await this.fapiPrivatePutOrder(this.extend(request, params));
5511
+ }
5389
5512
  }
5390
5513
  else if (market['inverse']) {
5391
- response = await this.dapiPrivatePutOrder(this.extend(request, params));
5514
+ if (isPortfolioMargin) {
5515
+ response = await this.papiPutCmOrder(this.extend(request, params));
5516
+ }
5517
+ else {
5518
+ response = await this.dapiPrivatePutOrder(this.extend(request, params));
5519
+ }
5392
5520
  }
5393
5521
  //
5394
5522
  // swap and future
@@ -5423,7 +5551,7 @@ export default class binance extends Exchange {
5423
5551
  * @method
5424
5552
  * @name binance#editOrder
5425
5553
  * @description edit a trade order
5426
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
5554
+ * @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
5427
5555
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
5428
5556
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
5429
5557
  * @param {string} id cancel order id
@@ -5433,6 +5561,7 @@ export default class binance extends Exchange {
5433
5561
  * @param {float} amount how much of currency you want to trade in units of base currency
5434
5562
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
5435
5563
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5564
+ * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account
5436
5565
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5437
5566
  */
5438
5567
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
@@ -6114,13 +6243,13 @@ export default class binance extends Exchange {
6114
6243
  * @method
6115
6244
  * @name binance#createOrder
6116
6245
  * @description create a trade order
6117
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6118
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
6246
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6247
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
6119
6248
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
6120
6249
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
6121
6250
  * @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
6122
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
6123
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
6251
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#sor
6252
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-using-sor-trade
6124
6253
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
6125
6254
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
6126
6255
  * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
@@ -6145,6 +6274,7 @@ export default class binance extends Exchange {
6145
6274
  * @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
6146
6275
  * @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
6147
6276
  * @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
6277
+ * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
6148
6278
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
6149
6279
  */
6150
6280
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -6551,7 +6681,7 @@ export default class binance extends Exchange {
6551
6681
  * @method
6552
6682
  * @name binance#createMarketOrderWithCost
6553
6683
  * @description create a market order by providing the symbol, side and cost
6554
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6684
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6555
6685
  * @param {string} symbol unified symbol of the market to create an order in
6556
6686
  * @param {string} side 'buy' or 'sell'
6557
6687
  * @param {float} cost how much you want to trade in units of the quote currency
@@ -6564,14 +6694,16 @@ export default class binance extends Exchange {
6564
6694
  if (!market['spot']) {
6565
6695
  throw new NotSupported(this.id + ' createMarketOrderWithCost() supports spot orders only');
6566
6696
  }
6567
- params['cost'] = cost;
6568
- return await this.createOrder(symbol, 'market', side, cost, undefined, params);
6697
+ const req = {
6698
+ 'cost': cost,
6699
+ };
6700
+ return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
6569
6701
  }
6570
6702
  /**
6571
6703
  * @method
6572
6704
  * @name binance#createMarketBuyOrderWithCost
6573
6705
  * @description create a market buy order by providing the symbol and cost
6574
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6706
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6575
6707
  * @param {string} symbol unified symbol of the market to create an order in
6576
6708
  * @param {float} cost how much you want to trade in units of the quote currency
6577
6709
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6583,14 +6715,16 @@ export default class binance extends Exchange {
6583
6715
  if (!market['spot']) {
6584
6716
  throw new NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
6585
6717
  }
6586
- params['cost'] = cost;
6587
- return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
6718
+ const req = {
6719
+ 'cost': cost,
6720
+ };
6721
+ return await this.createOrder(symbol, 'market', 'buy', 0, undefined, this.extend(req, params));
6588
6722
  }
6589
6723
  /**
6590
6724
  * @method
6591
6725
  * @name binance#createMarketSellOrderWithCost
6592
6726
  * @description create a market sell order by providing the symbol and cost
6593
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
6727
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
6594
6728
  * @param {string} symbol unified symbol of the market to create an order in
6595
6729
  * @param {float} cost how much you want to trade in units of the quote currency
6596
6730
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -6609,7 +6743,7 @@ export default class binance extends Exchange {
6609
6743
  * @method
6610
6744
  * @name binance#fetchOrder
6611
6745
  * @description fetches information on an order made by the user
6612
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
6746
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-order-user_data
6613
6747
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
6614
6748
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
6615
6749
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
@@ -6691,7 +6825,7 @@ export default class binance extends Exchange {
6691
6825
  * @method
6692
6826
  * @name binance#fetchOrders
6693
6827
  * @description fetches information on multiple orders made by the user
6694
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
6828
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
6695
6829
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
6696
6830
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
6697
6831
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -6970,7 +7104,7 @@ export default class binance extends Exchange {
6970
7104
  * @method
6971
7105
  * @name binance#fetchOpenOrders
6972
7106
  * @description fetch all unfilled currently open orders
6973
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
7107
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-open-orders-user_data
6974
7108
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
6975
7109
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
6976
7110
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
@@ -7292,7 +7426,7 @@ export default class binance extends Exchange {
7292
7426
  * @method
7293
7427
  * @name binance#fetchClosedOrders
7294
7428
  * @description fetches information on multiple closed orders made by the user
7295
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
7429
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
7296
7430
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
7297
7431
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
7298
7432
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -7322,7 +7456,7 @@ export default class binance extends Exchange {
7322
7456
  * @method
7323
7457
  * @name binance#fetchCanceledOrders
7324
7458
  * @description fetches information on multiple canceled orders made by the user
7325
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
7459
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
7326
7460
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
7327
7461
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
7328
7462
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -7352,7 +7486,7 @@ export default class binance extends Exchange {
7352
7486
  * @method
7353
7487
  * @name binance#fetchCanceledAndClosedOrders
7354
7488
  * @description fetches information on multiple canceled orders made by the user
7355
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
7489
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
7356
7490
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
7357
7491
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
7358
7492
  * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
@@ -7385,7 +7519,7 @@ export default class binance extends Exchange {
7385
7519
  * @method
7386
7520
  * @name binance#cancelOrder
7387
7521
  * @description cancels an open order
7388
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
7522
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-order-trade
7389
7523
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
7390
7524
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
7391
7525
  * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
@@ -7491,7 +7625,7 @@ export default class binance extends Exchange {
7491
7625
  * @method
7492
7626
  * @name binance#cancelAllOrders
7493
7627
  * @description cancel all open orders in a market
7494
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
7628
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-all-open-orders-on-a-symbol-trade
7495
7629
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
7496
7630
  * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
7497
7631
  * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
@@ -7739,7 +7873,7 @@ export default class binance extends Exchange {
7739
7873
  * @method
7740
7874
  * @name binance#fetchOrderTrades
7741
7875
  * @description fetch all the trades made from a single order
7742
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
7876
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
7743
7877
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
7744
7878
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
7745
7879
  * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
@@ -7770,7 +7904,7 @@ export default class binance extends Exchange {
7770
7904
  * @method
7771
7905
  * @name binance#fetchMyTrades
7772
7906
  * @description fetch all trades made by the user
7773
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
7907
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
7774
7908
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
7775
7909
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
7776
7910
  * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
@@ -11836,7 +11970,7 @@ export default class binance extends Exchange {
11836
11970
  throw new AuthenticationError(this.id + ' userDataStream endpoint requires `apiKey` credential');
11837
11971
  }
11838
11972
  }
11839
- 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')) {
11973
+ 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')) {
11840
11974
  this.checkRequiredCredentials();
11841
11975
  if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
11842
11976
  // inject in implicit API calls
@@ -11940,7 +12074,7 @@ export default class binance extends Exchange {
11940
12074
  marketType = 'option';
11941
12075
  }
11942
12076
  else if (url.startsWith('https://papi.' + hostname + '/')) {
11943
- marketType = 'portfoliomargin';
12077
+ marketType = 'portfolioMargin';
11944
12078
  }
11945
12079
  if (marketType !== undefined) {
11946
12080
  const exceptionsForMarketType = this.safeDict(this.exceptions, marketType, {});