ccxt 4.3.32 → 4.3.34

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 (128) 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/base/Exchange.js +26 -0
  5. package/dist/cjs/src/binance.js +1 -0
  6. package/dist/cjs/src/bitget.js +1 -1
  7. package/dist/cjs/src/coinbase.js +106 -53
  8. package/dist/cjs/src/pro/binance.js +352 -0
  9. package/dist/cjs/src/pro/bitmex.js +108 -0
  10. package/dist/cjs/src/pro/bybit.js +85 -0
  11. package/dist/cjs/src/pro/gate.js +183 -0
  12. package/dist/cjs/src/pro/kucoinfutures.js +4 -0
  13. package/dist/cjs/src/pro/okx.js +259 -1
  14. package/dist/cjs/src/whitebit.js +2 -2
  15. package/js/ccxt.d.ts +1 -1
  16. package/js/ccxt.js +1 -1
  17. package/js/src/abstract/binance.d.ts +1 -0
  18. package/js/src/abstract/binancecoinm.d.ts +1 -0
  19. package/js/src/abstract/binanceus.d.ts +1 -0
  20. package/js/src/abstract/binanceusdm.d.ts +1 -0
  21. package/js/src/ace.d.ts +3 -3
  22. package/js/src/alpaca.d.ts +2 -2
  23. package/js/src/ascendex.d.ts +3 -3
  24. package/js/src/base/Exchange.d.ts +13 -3
  25. package/js/src/base/Exchange.js +26 -0
  26. package/js/src/base/types.d.ts +1 -0
  27. package/js/src/bigone.d.ts +3 -3
  28. package/js/src/binance.d.ts +4 -4
  29. package/js/src/binance.js +1 -0
  30. package/js/src/bingx.d.ts +3 -3
  31. package/js/src/bit2c.d.ts +2 -2
  32. package/js/src/bitbank.d.ts +2 -2
  33. package/js/src/bitbns.d.ts +2 -2
  34. package/js/src/bitfinex.d.ts +3 -3
  35. package/js/src/bitfinex2.d.ts +1 -1
  36. package/js/src/bitflyer.d.ts +2 -2
  37. package/js/src/bitget.d.ts +4 -4
  38. package/js/src/bitget.js +1 -1
  39. package/js/src/bithumb.d.ts +2 -2
  40. package/js/src/bitmart.d.ts +3 -3
  41. package/js/src/bitmex.d.ts +4 -4
  42. package/js/src/bitopro.d.ts +4 -4
  43. package/js/src/bitrue.d.ts +3 -3
  44. package/js/src/bitso.d.ts +3 -3
  45. package/js/src/bitstamp.d.ts +3 -3
  46. package/js/src/bitteam.d.ts +4 -4
  47. package/js/src/bitvavo.d.ts +3 -3
  48. package/js/src/blockchaincom.d.ts +2 -2
  49. package/js/src/blofin.d.ts +4 -4
  50. package/js/src/btcalpha.d.ts +4 -4
  51. package/js/src/btcbox.d.ts +2 -2
  52. package/js/src/btcmarkets.d.ts +4 -4
  53. package/js/src/btcturk.d.ts +2 -2
  54. package/js/src/bybit.d.ts +3 -3
  55. package/js/src/cex.d.ts +2 -2
  56. package/js/src/coinbase.d.ts +3 -3
  57. package/js/src/coinbase.js +106 -53
  58. package/js/src/coinbaseexchange.d.ts +2 -2
  59. package/js/src/coinbaseinternational.d.ts +4 -4
  60. package/js/src/coincheck.d.ts +3 -3
  61. package/js/src/coinex.d.ts +3 -3
  62. package/js/src/coinlist.d.ts +3 -3
  63. package/js/src/coinmate.d.ts +3 -3
  64. package/js/src/coinmetro.d.ts +3 -3
  65. package/js/src/coinone.d.ts +2 -2
  66. package/js/src/coinsph.d.ts +3 -3
  67. package/js/src/cryptocom.d.ts +2 -2
  68. package/js/src/currencycom.d.ts +3 -3
  69. package/js/src/delta.d.ts +2 -2
  70. package/js/src/deribit.d.ts +3 -3
  71. package/js/src/digifinex.d.ts +3 -3
  72. package/js/src/exmo.d.ts +3 -3
  73. package/js/src/gate.d.ts +3 -3
  74. package/js/src/gemini.d.ts +3 -3
  75. package/js/src/hitbtc.d.ts +3 -3
  76. package/js/src/hollaex.d.ts +2 -2
  77. package/js/src/htx.d.ts +3 -3
  78. package/js/src/huobijp.d.ts +3 -3
  79. package/js/src/hyperliquid.d.ts +3 -3
  80. package/js/src/idex.d.ts +3 -3
  81. package/js/src/indodax.d.ts +3 -3
  82. package/js/src/kraken.d.ts +3 -3
  83. package/js/src/krakenfutures.d.ts +2 -2
  84. package/js/src/kucoin.d.ts +3 -3
  85. package/js/src/kuna.d.ts +3 -3
  86. package/js/src/latoken.d.ts +3 -3
  87. package/js/src/lbank.d.ts +2 -2
  88. package/js/src/luno.d.ts +2 -2
  89. package/js/src/lykke.d.ts +2 -2
  90. package/js/src/mercado.d.ts +2 -2
  91. package/js/src/mexc.d.ts +2 -2
  92. package/js/src/ndax.d.ts +3 -3
  93. package/js/src/novadax.d.ts +4 -4
  94. package/js/src/oceanex.d.ts +3 -3
  95. package/js/src/okcoin.d.ts +4 -4
  96. package/js/src/okx.d.ts +4 -4
  97. package/js/src/onetrading.d.ts +3 -3
  98. package/js/src/p2b.d.ts +3 -3
  99. package/js/src/paymium.d.ts +2 -2
  100. package/js/src/phemex.d.ts +5 -5
  101. package/js/src/poloniex.d.ts +4 -4
  102. package/js/src/poloniexfutures.d.ts +3 -3
  103. package/js/src/pro/binance.d.ts +9 -2
  104. package/js/src/pro/binance.js +352 -0
  105. package/js/src/pro/bitmex.d.ts +4 -1
  106. package/js/src/pro/bitmex.js +108 -0
  107. package/js/src/pro/bybit.d.ts +4 -1
  108. package/js/src/pro/bybit.js +85 -0
  109. package/js/src/pro/gate.d.ts +5 -1
  110. package/js/src/pro/gate.js +183 -0
  111. package/js/src/pro/kucoinfutures.js +4 -0
  112. package/js/src/pro/okx.d.ts +8 -1
  113. package/js/src/pro/okx.js +259 -1
  114. package/js/src/probit.d.ts +4 -4
  115. package/js/src/timex.d.ts +3 -3
  116. package/js/src/tokocrypto.d.ts +2 -2
  117. package/js/src/tradeogre.d.ts +2 -2
  118. package/js/src/upbit.d.ts +4 -4
  119. package/js/src/wavesexchange.d.ts +2 -2
  120. package/js/src/wazirx.d.ts +4 -4
  121. package/js/src/whitebit.d.ts +4 -4
  122. package/js/src/whitebit.js +2 -2
  123. package/js/src/woo.d.ts +4 -4
  124. package/js/src/woofipro.d.ts +4 -4
  125. package/js/src/yobit.d.ts +2 -2
  126. package/js/src/zaif.d.ts +3 -3
  127. package/js/src/zonda.d.ts +2 -2
  128. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -185,7 +185,7 @@ var woofipro$1 = require('./src/pro/woofipro.js');
185
185
 
186
186
  //-----------------------------------------------------------------------------
187
187
  // this is updated by vss.js when building
188
- const version = '4.3.32';
188
+ const version = '4.3.34';
189
189
  Exchange["default"].ccxtVersion = version;
190
190
  const exchanges = {
191
191
  'ace': ace,
@@ -81,6 +81,7 @@ class Exchange {
81
81
  this.verbose = false;
82
82
  this.twofa = undefined; // two-factor authentication (2FA)
83
83
  this.balance = {};
84
+ this.liquidations = {};
84
85
  this.orderbooks = {};
85
86
  this.tickers = {};
86
87
  this.fundingRates = {};
@@ -88,6 +89,7 @@ class Exchange {
88
89
  this.orders = undefined;
89
90
  this.triggerOrders = undefined;
90
91
  this.transactions = {};
92
+ this.myLiquidations = {};
91
93
  this.requiresWeb3 = false;
92
94
  this.requiresEddsa = false;
93
95
  this.enableLastJsonResponse = true;
@@ -285,10 +287,12 @@ class Exchange {
285
287
  this.balance = {};
286
288
  this.orderbooks = {};
287
289
  this.tickers = {};
290
+ this.liquidations = {};
288
291
  this.orders = undefined;
289
292
  this.trades = {};
290
293
  this.transactions = {};
291
294
  this.ohlcvs = {};
295
+ this.myLiquidations = {};
292
296
  this.myTrades = undefined;
293
297
  this.positions = undefined;
294
298
  // web3 and cryptography flags
@@ -573,6 +577,10 @@ class Exchange {
573
577
  'watchTickers': undefined,
574
578
  'watchTrades': undefined,
575
579
  'watchTradesForSymbols': undefined,
580
+ 'watchLiquidations': undefined,
581
+ 'watchLiquidationsForSymbols': undefined,
582
+ 'watchMyLiquidations': undefined,
583
+ 'watchMyLiquidationsForSymbols': undefined,
576
584
  'withdraw': undefined,
577
585
  'ws': undefined,
578
586
  },
@@ -1927,6 +1935,24 @@ class Exchange {
1927
1935
  async fetchTradesWs(symbol, since = undefined, limit = undefined, params = {}) {
1928
1936
  throw new errors.NotSupported(this.id + ' fetchTradesWs() is not supported yet');
1929
1937
  }
1938
+ async watchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
1939
+ if (this.has['watchLiquidationsForSymbols']) {
1940
+ return this.watchLiquidationsForSymbols([symbol], since, limit, params);
1941
+ }
1942
+ throw new errors.NotSupported(this.id + ' watchLiquidations() is not supported yet');
1943
+ }
1944
+ async watchLiquidationsForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
1945
+ throw new errors.NotSupported(this.id + ' watchLiquidationsForSymbols() is not supported yet');
1946
+ }
1947
+ async watchMyLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
1948
+ if (this.has['watchMyLiquidationsForSymbols']) {
1949
+ return this.watchMyLiquidationsForSymbols([symbol], since, limit, params);
1950
+ }
1951
+ throw new errors.NotSupported(this.id + ' watchMyLiquidations() is not supported yet');
1952
+ }
1953
+ async watchMyLiquidationsForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
1954
+ throw new errors.NotSupported(this.id + ' watchMyLiquidationsForSymbols() is not supported yet');
1955
+ }
1930
1956
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
1931
1957
  throw new errors.NotSupported(this.id + ' watchTrades() is not supported yet');
1932
1958
  }
@@ -239,6 +239,7 @@ class binance extends binance$1 {
239
239
  'system/status': 0.1,
240
240
  // these endpoints require this.apiKey
241
241
  'accountSnapshot': 240,
242
+ 'account/info': 0.1,
242
243
  'margin/asset': 1,
243
244
  'margin/pair': 1,
244
245
  'margin/allAssets': 0.1,
@@ -483,7 +483,7 @@ class bitget extends bitget$1 {
483
483
  'v2/mix/account/set-margin': 4,
484
484
  'v2/mix/account/set-margin-mode': 4,
485
485
  'v2/mix/account/set-position-mode': 4,
486
- 'v2/mix/order/place-order': 20,
486
+ 'v2/mix/order/place-order': 2,
487
487
  'v2/mix/order/click-backhand': 20,
488
488
  'v2/mix/order/batch-place-order': 20,
489
489
  'v2/mix/order/modify-order': 2,
@@ -342,6 +342,7 @@ class coinbase extends coinbase$1 {
342
342
  'CGLD': 'CELO',
343
343
  },
344
344
  'options': {
345
+ 'usePrivate': false,
345
346
  'brokerId': 'ccxt',
346
347
  'stablePairs': ['BUSD-USD', 'CBETH-ETH', 'DAI-USD', 'GUSD-USD', 'GYEN-USD', 'PAX-USD', 'PAX-USDT', 'USDC-EUR', 'USDC-GBP', 'USDT-EUR', 'USDT-GBP', 'USDT-USD', 'USDT-USDC', 'WBTC-BTC'],
347
348
  'fetchCurrencies': {
@@ -1105,6 +1106,7 @@ class coinbase extends coinbase$1 {
1105
1106
  * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
1106
1107
  * @description retrieves data on all markets for coinbase
1107
1108
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1109
+ * @param {boolean} [params.usePrivate] use private endpoint for fetching markets
1108
1110
  * @returns {object[]} an array of objects representing market data
1109
1111
  */
1110
1112
  const method = this.safeString(this.options, 'fetchMarkets', 'fetchMarketsV3');
@@ -1186,54 +1188,60 @@ class coinbase extends coinbase$1 {
1186
1188
  return result;
1187
1189
  }
1188
1190
  async fetchMarketsV3(params = {}) {
1189
- const spotUnresolvedPromises = [
1190
- this.v3PublicGetBrokerageMarketProducts(params),
1191
- //
1192
- // {
1193
- // products: [
1194
- // {
1195
- // product_id: 'BTC-USD',
1196
- // price: '67060',
1197
- // price_percentage_change_24h: '3.30054960636883',
1198
- // volume_24h: '10967.87426597',
1199
- // volume_percentage_change_24h: '141.73048325503036',
1200
- // base_increment: '0.00000001',
1201
- // quote_increment: '0.01',
1202
- // quote_min_size: '1',
1203
- // quote_max_size: '150000000',
1204
- // base_min_size: '0.00000001',
1205
- // base_max_size: '3400',
1206
- // base_name: 'Bitcoin',
1207
- // quote_name: 'US Dollar',
1208
- // watched: false,
1209
- // is_disabled: false,
1210
- // new: false,
1211
- // status: 'online',
1212
- // cancel_only: false,
1213
- // limit_only: false,
1214
- // post_only: false,
1215
- // trading_disabled: false,
1216
- // auction_mode: false,
1217
- // product_type: 'SPOT',
1218
- // quote_currency_id: 'USD',
1219
- // base_currency_id: 'BTC',
1220
- // fcm_trading_session_details: null,
1221
- // mid_market_price: '',
1222
- // alias: '',
1223
- // alias_to: [ 'BTC-USDC' ],
1224
- // base_display_symbol: 'BTC',
1225
- // quote_display_symbol: 'USD',
1226
- // view_only: false,
1227
- // price_increment: '0.01',
1228
- // display_name: 'BTC-USD',
1229
- // product_venue: 'CBE'
1230
- // },
1231
- // ...
1232
- // ],
1233
- // num_products: '646'
1234
- // }
1235
- //
1236
- ];
1191
+ let usePrivate = false;
1192
+ [usePrivate, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'usePrivate', false);
1193
+ const spotUnresolvedPromises = [];
1194
+ if (usePrivate) {
1195
+ spotUnresolvedPromises.push(this.v3PrivateGetBrokerageProducts(params));
1196
+ }
1197
+ else {
1198
+ spotUnresolvedPromises.push(this.v3PublicGetBrokerageMarketProducts(params));
1199
+ }
1200
+ //
1201
+ // {
1202
+ // products: [
1203
+ // {
1204
+ // product_id: 'BTC-USD',
1205
+ // price: '67060',
1206
+ // price_percentage_change_24h: '3.30054960636883',
1207
+ // volume_24h: '10967.87426597',
1208
+ // volume_percentage_change_24h: '141.73048325503036',
1209
+ // base_increment: '0.00000001',
1210
+ // quote_increment: '0.01',
1211
+ // quote_min_size: '1',
1212
+ // quote_max_size: '150000000',
1213
+ // base_min_size: '0.00000001',
1214
+ // base_max_size: '3400',
1215
+ // base_name: 'Bitcoin',
1216
+ // quote_name: 'US Dollar',
1217
+ // watched: false,
1218
+ // is_disabled: false,
1219
+ // new: false,
1220
+ // status: 'online',
1221
+ // cancel_only: false,
1222
+ // limit_only: false,
1223
+ // post_only: false,
1224
+ // trading_disabled: false,
1225
+ // auction_mode: false,
1226
+ // product_type: 'SPOT',
1227
+ // quote_currency_id: 'USD',
1228
+ // base_currency_id: 'BTC',
1229
+ // fcm_trading_session_details: null,
1230
+ // mid_market_price: '',
1231
+ // alias: '',
1232
+ // alias_to: [ 'BTC-USDC' ],
1233
+ // base_display_symbol: 'BTC',
1234
+ // quote_display_symbol: 'USD',
1235
+ // view_only: false,
1236
+ // price_increment: '0.01',
1237
+ // display_name: 'BTC-USD',
1238
+ // product_venue: 'CBE'
1239
+ // },
1240
+ // ...
1241
+ // ],
1242
+ // num_products: '646'
1243
+ // }
1244
+ //
1237
1245
  if (this.checkRequiredCredentials(false)) {
1238
1246
  spotUnresolvedPromises.push(this.v3PrivateGetBrokerageTransactionSummary(params));
1239
1247
  }
@@ -1761,6 +1769,7 @@ class coinbase extends coinbase$1 {
1761
1769
  * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
1762
1770
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1763
1771
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1772
+ * @param {boolean} [params.usePrivate] use private endpoint for fetching tickers
1764
1773
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1765
1774
  */
1766
1775
  const method = this.safeString(this.options, 'fetchTickers', 'fetchTickersV3');
@@ -1815,7 +1824,15 @@ class coinbase extends coinbase$1 {
1815
1824
  if (marketType !== undefined && marketType !== 'default') {
1816
1825
  request['product_type'] = (marketType === 'swap') ? 'FUTURE' : 'SPOT';
1817
1826
  }
1818
- const response = await this.v3PublicGetBrokerageMarketProducts(this.extend(request, params));
1827
+ let response = undefined;
1828
+ let usePrivate = false;
1829
+ [usePrivate, params] = this.handleOptionAndParams(params, 'fetchTickers', 'usePrivate', false);
1830
+ if (usePrivate) {
1831
+ response = await this.v3PrivateGetBrokerageProducts(this.extend(request, params));
1832
+ }
1833
+ else {
1834
+ response = await this.v3PublicGetBrokerageMarketProducts(this.extend(request, params));
1835
+ }
1819
1836
  //
1820
1837
  // {
1821
1838
  // "products": [
@@ -1875,6 +1892,7 @@ class coinbase extends coinbase$1 {
1875
1892
  * @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-sell-price
1876
1893
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1877
1894
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1895
+ * @param {boolean} [params.usePrivate] whether to use the private endpoint for fetching the ticker
1878
1896
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1879
1897
  */
1880
1898
  const method = this.safeString(this.options, 'fetchTicker', 'fetchTickerV3');
@@ -1918,7 +1936,15 @@ class coinbase extends coinbase$1 {
1918
1936
  'product_id': market['id'],
1919
1937
  'limit': 1,
1920
1938
  };
1921
- const response = await this.v3PublicGetBrokerageMarketProductsProductIdTicker(this.extend(request, params));
1939
+ let usePrivate = false;
1940
+ [usePrivate, params] = this.handleOptionAndParams(params, 'fetchTicker', 'usePrivate', false);
1941
+ let response = undefined;
1942
+ if (usePrivate) {
1943
+ response = await this.v3PrivateGetBrokerageProductsProductIdTicker(this.extend(request, params));
1944
+ }
1945
+ else {
1946
+ response = await this.v3PublicGetBrokerageMarketProductsProductIdTicker(this.extend(request, params));
1947
+ }
1922
1948
  //
1923
1949
  // {
1924
1950
  // "trades": [
@@ -3487,6 +3513,7 @@ class coinbase extends coinbase$1 {
3487
3513
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3488
3514
  * @param {int} [params.until] the latest time in ms to fetch trades for
3489
3515
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3516
+ * @param {boolean} [params.usePrivate] default false, when true will use the private endpoint to fetch the candles
3490
3517
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
3491
3518
  */
3492
3519
  await this.loadMarkets();
@@ -3522,7 +3549,15 @@ class coinbase extends coinbase$1 {
3522
3549
  // 300 candles max
3523
3550
  request['end'] = Precise["default"].stringAdd(sinceString, requestedDuration.toString());
3524
3551
  }
3525
- const response = await this.v3PublicGetBrokerageMarketProductsProductIdCandles(this.extend(request, params));
3552
+ let response = undefined;
3553
+ let usePrivate = false;
3554
+ [usePrivate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'usePrivate', false);
3555
+ if (usePrivate) {
3556
+ response = await this.v3PrivateGetBrokerageProductsProductIdCandles(this.extend(request, params));
3557
+ }
3558
+ else {
3559
+ response = await this.v3PublicGetBrokerageMarketProductsProductIdCandles(this.extend(request, params));
3560
+ }
3526
3561
  //
3527
3562
  // {
3528
3563
  // "candles": [
@@ -3572,6 +3607,7 @@ class coinbase extends coinbase$1 {
3572
3607
  * @param {int} [since] not used by coinbase fetchTrades
3573
3608
  * @param {int} [limit] the maximum number of trade structures to fetch
3574
3609
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3610
+ * @param {boolean} [params.usePrivate] default false, when true will use the private endpoint to fetch the trades
3575
3611
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3576
3612
  */
3577
3613
  await this.loadMarkets();
@@ -3593,7 +3629,15 @@ class coinbase extends coinbase$1 {
3593
3629
  else if (since !== undefined) {
3594
3630
  throw new errors.ArgumentsRequired(this.id + ' fetchTrades() requires a `until` parameter when you use `since` argument');
3595
3631
  }
3596
- const response = await this.v3PublicGetBrokerageMarketProductsProductIdTicker(this.extend(request, params));
3632
+ let response = undefined;
3633
+ let usePrivate = false;
3634
+ [usePrivate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'usePrivate', false);
3635
+ if (usePrivate) {
3636
+ response = await this.v3PrivateGetBrokerageProductsProductIdTicker(this.extend(request, params));
3637
+ }
3638
+ else {
3639
+ response = await this.v3PublicGetBrokerageMarketProductsProductIdTicker(this.extend(request, params));
3640
+ }
3597
3641
  //
3598
3642
  // {
3599
3643
  // "trades": [
@@ -3694,6 +3738,7 @@ class coinbase extends coinbase$1 {
3694
3738
  * @param {string} symbol unified symbol of the market to fetch the order book for
3695
3739
  * @param {int} [limit] the maximum amount of order book entries to return
3696
3740
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3741
+ * @param {boolean} [params.usePrivate] default false, when true will use the private endpoint to fetch the order book
3697
3742
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
3698
3743
  */
3699
3744
  await this.loadMarkets();
@@ -3704,7 +3749,15 @@ class coinbase extends coinbase$1 {
3704
3749
  if (limit !== undefined) {
3705
3750
  request['limit'] = limit;
3706
3751
  }
3707
- const response = await this.v3PublicGetBrokerageMarketProductBook(this.extend(request, params));
3752
+ let response = undefined;
3753
+ let usePrivate = false;
3754
+ [usePrivate, params] = this.handleOptionAndParams(params, 'fetchOrderBook', 'usePrivate', false);
3755
+ if (usePrivate) {
3756
+ response = await this.v3PrivateGetBrokerageProductBook(this.extend(request, params));
3757
+ }
3758
+ else {
3759
+ response = await this.v3PublicGetBrokerageMarketProductBook(this.extend(request, params));
3760
+ }
3708
3761
  //
3709
3762
  // {
3710
3763
  // "pricebook": {