ccxt 4.4.32 → 4.4.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 (118) hide show
  1. package/README.md +8 -7
  2. package/dist/ccxt.browser.min.js +6 -6
  3. package/dist/cjs/ccxt.js +4 -1
  4. package/dist/cjs/src/abstract/ellipx.js +9 -0
  5. package/dist/cjs/src/alpaca.js +2 -0
  6. package/dist/cjs/src/base/Exchange.js +116 -1
  7. package/dist/cjs/src/binance.js +164 -6
  8. package/dist/cjs/src/bingx.js +156 -9
  9. package/dist/cjs/src/bitbank.js +5 -0
  10. package/dist/cjs/src/bitbns.js +2 -0
  11. package/dist/cjs/src/bitfinex2.js +2 -1
  12. package/dist/cjs/src/bitget.js +177 -44
  13. package/dist/cjs/src/bitmex.js +2 -0
  14. package/dist/cjs/src/bitopro.js +3 -0
  15. package/dist/cjs/src/bitrue.js +1 -0
  16. package/dist/cjs/src/btcmarkets.js +2 -0
  17. package/dist/cjs/src/bybit.js +148 -13
  18. package/dist/cjs/src/cex.js +16 -6
  19. package/dist/cjs/src/coinbase.js +5 -24
  20. package/dist/cjs/src/coinbaseexchange.js +2 -1
  21. package/dist/cjs/src/coinex.js +2 -0
  22. package/dist/cjs/src/coinone.js +7 -7
  23. package/dist/cjs/src/coinsph.js +7 -7
  24. package/dist/cjs/src/coinspot.js +39 -39
  25. package/dist/cjs/src/cryptocom.js +36 -34
  26. package/dist/cjs/src/ellipx.js +1871 -0
  27. package/dist/cjs/src/gate.js +2 -1
  28. package/dist/cjs/src/hyperliquid.js +16 -2
  29. package/dist/cjs/src/kraken.js +1 -0
  30. package/dist/cjs/src/krakenfutures.js +3 -1
  31. package/dist/cjs/src/kucoinfutures.js +1 -1
  32. package/dist/cjs/src/lbank.js +1 -0
  33. package/dist/cjs/src/okcoin.js +2 -0
  34. package/dist/cjs/src/okx.js +104 -9
  35. package/dist/cjs/src/onetrading.js +14 -1
  36. package/dist/cjs/src/paradex.js +2 -0
  37. package/dist/cjs/src/phemex.js +35 -7
  38. package/dist/cjs/src/poloniex.js +3 -1
  39. package/dist/cjs/src/poloniexfutures.js +3 -1
  40. package/dist/cjs/src/pro/idex.js +5 -0
  41. package/dist/cjs/src/pro/okx.js +11 -1
  42. package/dist/cjs/src/pro/probit.js +4 -2
  43. package/dist/cjs/src/pro/woo.js +15 -15
  44. package/dist/cjs/src/vertex.js +2 -0
  45. package/dist/cjs/src/woo.js +69 -69
  46. package/examples/js/cli.js +1 -1
  47. package/js/ccxt.d.ts +5 -2
  48. package/js/ccxt.js +4 -2
  49. package/js/src/abstract/bingx.d.ts +16 -0
  50. package/js/src/abstract/bitbank.d.ts +5 -0
  51. package/js/src/abstract/bitfinex2.d.ts +1 -0
  52. package/js/src/abstract/coinbaseexchange.d.ts +1 -0
  53. package/js/src/abstract/ellipx.d.ts +28 -0
  54. package/js/src/abstract/ellipx.js +11 -0
  55. package/js/src/abstract/kraken.d.ts +1 -0
  56. package/js/src/alpaca.js +2 -0
  57. package/js/src/base/Exchange.d.ts +11 -0
  58. package/js/src/base/Exchange.js +116 -1
  59. package/js/src/binance.js +164 -6
  60. package/js/src/bingx.d.ts +3 -1
  61. package/js/src/bingx.js +156 -9
  62. package/js/src/bitbank.js +5 -0
  63. package/js/src/bitbns.js +2 -0
  64. package/js/src/bitfinex2.js +2 -1
  65. package/js/src/bitget.d.ts +4 -4
  66. package/js/src/bitget.js +177 -44
  67. package/js/src/bitmex.js +2 -0
  68. package/js/src/bitopro.d.ts +1 -0
  69. package/js/src/bitopro.js +3 -0
  70. package/js/src/bitrue.js +1 -0
  71. package/js/src/btcmarkets.d.ts +1 -0
  72. package/js/src/btcmarkets.js +2 -0
  73. package/js/src/bybit.d.ts +3 -2
  74. package/js/src/bybit.js +149 -14
  75. package/js/src/cex.d.ts +1 -0
  76. package/js/src/cex.js +17 -7
  77. package/js/src/coinbase.d.ts +2 -1
  78. package/js/src/coinbase.js +5 -24
  79. package/js/src/coinbaseexchange.js +2 -1
  80. package/js/src/coinex.js +2 -0
  81. package/js/src/coinone.js +7 -7
  82. package/js/src/coinsph.js +7 -7
  83. package/js/src/coinspot.js +39 -39
  84. package/js/src/cryptocom.d.ts +1 -1
  85. package/js/src/cryptocom.js +36 -34
  86. package/js/src/ellipx.d.ts +236 -0
  87. package/js/src/ellipx.js +1874 -0
  88. package/js/src/gate.d.ts +2 -2
  89. package/js/src/gate.js +2 -1
  90. package/js/src/hyperliquid.d.ts +2 -1
  91. package/js/src/hyperliquid.js +16 -2
  92. package/js/src/kraken.js +1 -0
  93. package/js/src/krakenfutures.js +3 -1
  94. package/js/src/kucoinfutures.d.ts +1 -1
  95. package/js/src/kucoinfutures.js +1 -1
  96. package/js/src/lbank.js +1 -0
  97. package/js/src/okcoin.js +2 -0
  98. package/js/src/okx.d.ts +1 -1
  99. package/js/src/okx.js +104 -9
  100. package/js/src/onetrading.d.ts +5 -0
  101. package/js/src/onetrading.js +15 -2
  102. package/js/src/paradex.js +2 -0
  103. package/js/src/phemex.d.ts +4 -0
  104. package/js/src/phemex.js +35 -7
  105. package/js/src/poloniex.d.ts +1 -1
  106. package/js/src/poloniex.js +3 -1
  107. package/js/src/poloniexfutures.d.ts +1 -1
  108. package/js/src/poloniexfutures.js +3 -1
  109. package/js/src/pro/idex.d.ts +5 -0
  110. package/js/src/pro/idex.js +5 -0
  111. package/js/src/pro/okx.js +11 -1
  112. package/js/src/pro/probit.js +4 -2
  113. package/js/src/pro/woo.d.ts +11 -11
  114. package/js/src/pro/woo.js +15 -15
  115. package/js/src/vertex.js +2 -0
  116. package/js/src/woo.d.ts +60 -60
  117. package/js/src/woo.js +69 -69
  118. package/package.json +3 -3
@@ -551,7 +551,7 @@ class bybit extends bybit$1 {
551
551
  '10005': errors.PermissionDenied,
552
552
  '10006': errors.RateLimitExceeded,
553
553
  '10007': errors.AuthenticationError,
554
- '10008': errors.AuthenticationError,
554
+ '10008': errors.AccountSuspended,
555
555
  '10009': errors.AuthenticationError,
556
556
  '10010': errors.PermissionDenied,
557
557
  '10014': errors.BadRequest,
@@ -995,7 +995,7 @@ class bybit extends bybit$1 {
995
995
  'enableUnifiedMargin': undefined,
996
996
  'enableUnifiedAccount': undefined,
997
997
  'unifiedMarginStatus': undefined,
998
- 'createMarketBuyOrderRequiresPrice': true,
998
+ 'createMarketBuyOrderRequiresPrice': false,
999
999
  'createUnifiedMarginAccount': false,
1000
1000
  'defaultType': 'swap',
1001
1001
  'defaultSubType': 'linear',
@@ -1055,6 +1055,123 @@ class bybit extends bybit$1 {
1055
1055
  '1d': '1d',
1056
1056
  },
1057
1057
  },
1058
+ 'features': {
1059
+ 'default': {
1060
+ 'sandbox': true,
1061
+ 'createOrder': {
1062
+ 'marginMode': false,
1063
+ 'triggerPrice': true,
1064
+ 'triggerPriceType': {
1065
+ 'last': true,
1066
+ 'mark': true,
1067
+ 'index': true,
1068
+ },
1069
+ 'triggerDirection': true,
1070
+ 'stopLossPrice': true,
1071
+ 'takeProfitPrice': true,
1072
+ 'attachedStopLossTakeProfit': {
1073
+ 'triggerPriceType': {
1074
+ 'last': true,
1075
+ 'mark': true,
1076
+ 'index': true,
1077
+ },
1078
+ 'limitPrice': true,
1079
+ },
1080
+ 'timeInForce': {
1081
+ 'GTC': true,
1082
+ 'IOC': true,
1083
+ 'FOK': true,
1084
+ 'PO': true,
1085
+ 'GTD': false,
1086
+ },
1087
+ 'hedged': true,
1088
+ // exchange-supported features
1089
+ 'selfTradePrevention': true,
1090
+ 'trailing': true,
1091
+ 'twap': false,
1092
+ 'iceberg': false,
1093
+ 'oco': false,
1094
+ },
1095
+ 'createOrders': {
1096
+ 'max': 10,
1097
+ },
1098
+ 'fetchMyTrades': {
1099
+ 'marginMode': false,
1100
+ 'limit': 100,
1101
+ 'daysBack': 365 * 2,
1102
+ 'untilDays': 7, // days between start-end
1103
+ },
1104
+ 'fetchOrder': {
1105
+ 'marginMode': false,
1106
+ 'trigger': true,
1107
+ 'trailing': false,
1108
+ },
1109
+ 'fetchOpenOrders': {
1110
+ 'marginMode': false,
1111
+ 'limit': 50,
1112
+ 'trigger': true,
1113
+ 'trailing': false,
1114
+ },
1115
+ 'fetchOrders': undefined,
1116
+ 'fetchClosedOrders': {
1117
+ 'marginMode': false,
1118
+ 'limit': 50,
1119
+ 'daysBackClosed': 365 * 2,
1120
+ 'daysBackCanceled': 1,
1121
+ 'untilDays': 7,
1122
+ 'trigger': true,
1123
+ 'trailing': false,
1124
+ },
1125
+ 'fetchOHLCV': {
1126
+ 'limit': 1000,
1127
+ },
1128
+ },
1129
+ 'spot': {
1130
+ 'extends': 'default',
1131
+ 'createOrder': {
1132
+ 'marginMode': false,
1133
+ 'triggerPrice': true,
1134
+ 'triggerPriceType': undefined,
1135
+ 'triggerDirection': false,
1136
+ 'stopLossPrice': true,
1137
+ 'takeProfitPrice': true,
1138
+ 'attachedStopLossTakeProfit': {
1139
+ 'triggerPriceType': undefined,
1140
+ 'limitPrice': true,
1141
+ },
1142
+ 'timeInForce': {
1143
+ 'GTC': true,
1144
+ 'IOC': true,
1145
+ 'FOK': true,
1146
+ 'PO': true,
1147
+ 'GTD': false,
1148
+ },
1149
+ 'hedged': true,
1150
+ // exchange-supported features
1151
+ 'selfTradePrevention': true,
1152
+ 'trailing': true,
1153
+ 'twap': false,
1154
+ 'iceberg': false,
1155
+ 'oco': false,
1156
+ },
1157
+ },
1158
+ 'swap': {
1159
+ 'linear': {
1160
+ 'extends': 'default',
1161
+ },
1162
+ 'inverse': {
1163
+ 'extends': 'default',
1164
+ },
1165
+ },
1166
+ 'future': {
1167
+ 'linear': {
1168
+ 'extends': 'default',
1169
+ },
1170
+ 'inverse': {
1171
+ 'extends': 'default',
1172
+ },
1173
+ },
1174
+ },
1058
1175
  'fees': {
1059
1176
  'trading': {
1060
1177
  'feeSide': 'get',
@@ -1100,7 +1217,7 @@ class bybit extends bybit$1 {
1100
1217
  }
1101
1218
  addPaginationCursorToResult(response) {
1102
1219
  const result = this.safeDict(response, 'result', {});
1103
- const data = this.safeValueN(result, ['list', 'rows', 'data', 'dataList'], []);
1220
+ const data = this.safeListN(result, ['list', 'rows', 'data', 'dataList'], []);
1104
1221
  const paginationCursor = this.safeString2(result, 'nextPageCursor', 'cursor');
1105
1222
  const dataLength = data.length;
1106
1223
  if ((paginationCursor !== undefined) && (dataLength > 0)) {
@@ -1111,12 +1228,12 @@ class bybit extends bybit$1 {
1111
1228
  return data;
1112
1229
  }
1113
1230
  /**
1114
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1115
1231
  * @method
1116
1232
  * @name bybit#isUnifiedEnabled
1117
1233
  * @see https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
1118
1234
  * @see https://bybit-exchange.github.io/docs/v5/account/account-info
1119
1235
  * @description returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
1236
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1120
1237
  * @returns {any} [enableUnifiedMargin, enableUnifiedAccount]
1121
1238
  */
1122
1239
  async isUnifiedEnabled(params = {}) {
@@ -2210,6 +2327,7 @@ class bybit extends bybit$1 {
2210
2327
  * @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2211
2328
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2212
2329
  * @param {string} [params.subType] *contract only* 'linear', 'inverse'
2330
+ * @param {string} [params.baseCoin] *option only* base coin, default is 'BTC'
2213
2331
  * @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2214
2332
  */
2215
2333
  async fetchTickers(symbols = undefined, params = {}) {
@@ -2259,11 +2377,12 @@ class bybit extends bybit$1 {
2259
2377
  if (type === 'spot' && passedSubType === undefined) {
2260
2378
  request['category'] = 'spot';
2261
2379
  }
2262
- else if (type === 'swap' || type === 'future' || subType !== undefined) {
2263
- request['category'] = subType;
2264
- }
2265
2380
  else if (type === 'option') {
2266
2381
  request['category'] = 'option';
2382
+ request['baseCoin'] = this.safeString(params, 'baseCoin', 'BTC');
2383
+ }
2384
+ else if (type === 'swap' || type === 'future' || subType !== undefined) {
2385
+ request['category'] = subType;
2267
2386
  }
2268
2387
  const response = await this.publicGetV5MarketTickers(this.extend(request, params));
2269
2388
  //
@@ -3109,7 +3228,7 @@ class bybit extends bybit$1 {
3109
3228
  'datetime': this.iso8601(timestamp),
3110
3229
  };
3111
3230
  const responseResult = this.safeDict(response, 'result', {});
3112
- const currencyList = this.safeValueN(responseResult, ['loanAccountList', 'list', 'balance']);
3231
+ const currencyList = this.safeListN(responseResult, ['loanAccountList', 'list', 'balance']);
3113
3232
  if (currencyList === undefined) {
3114
3233
  // usdc wallet
3115
3234
  const code = 'USDC';
@@ -3486,11 +3605,19 @@ class bybit extends bybit$1 {
3486
3605
  market = this.safeMarket(marketId, market, undefined, marketType);
3487
3606
  const symbol = market['symbol'];
3488
3607
  const timestamp = this.safeInteger2(order, 'createdTime', 'createdAt');
3608
+ const marketUnit = this.safeString(order, 'marketUnit', 'baseCoin');
3489
3609
  const id = this.safeString(order, 'orderId');
3490
3610
  const type = this.safeStringLower(order, 'orderType');
3491
3611
  const price = this.safeString(order, 'price');
3492
- const amount = this.safeString(order, 'qty');
3493
- const cost = this.safeString(order, 'cumExecValue');
3612
+ let amount = undefined;
3613
+ let cost = undefined;
3614
+ if (marketUnit === 'baseCoin') {
3615
+ amount = this.safeString(order, 'qty');
3616
+ cost = this.safeString(order, 'cumExecValue');
3617
+ }
3618
+ else {
3619
+ cost = this.safeString(order, 'cumExecValue');
3620
+ }
3494
3621
  const filled = this.safeString(order, 'cumExecQty');
3495
3622
  const remaining = this.safeString(order, 'leavesQty');
3496
3623
  const lastTradeTimestamp = this.safeInteger2(order, 'updatedTime', 'updatedAt');
@@ -3855,7 +3982,7 @@ class bybit extends bybit$1 {
3855
3982
  // classic accounts
3856
3983
  // for market buy it requires the amount of quote currency to spend
3857
3984
  let createMarketBuyOrderRequiresPrice = true;
3858
- [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
3985
+ [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice');
3859
3986
  if (createMarketBuyOrderRequiresPrice) {
3860
3987
  if ((price === undefined) && (cost === undefined)) {
3861
3988
  throw new errors.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
@@ -3867,7 +3994,15 @@ class bybit extends bybit$1 {
3867
3994
  }
3868
3995
  }
3869
3996
  else {
3870
- request['qty'] = this.getCost(symbol, this.numberToString(amount));
3997
+ if (cost !== undefined) {
3998
+ request['qty'] = this.getCost(symbol, this.numberToString(cost));
3999
+ }
4000
+ else if (price !== undefined) {
4001
+ request['qty'] = this.getCost(symbol, Precise["default"].stringMul(amountString, priceString));
4002
+ }
4003
+ else {
4004
+ request['qty'] = this.getCost(symbol, this.numberToString(amount));
4005
+ }
3871
4006
  }
3872
4007
  }
3873
4008
  else {
@@ -3964,7 +4099,7 @@ class bybit extends bybit$1 {
3964
4099
  const side = this.safeString(rawOrder, 'side');
3965
4100
  const amount = this.safeValue(rawOrder, 'amount');
3966
4101
  const price = this.safeValue(rawOrder, 'price');
3967
- const orderParams = this.safeValue(rawOrder, 'params', {});
4102
+ const orderParams = this.safeDict(rawOrder, 'params', {});
3968
4103
  const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams, isUta);
3969
4104
  ordersRequests.push(orderRequest);
3970
4105
  }
@@ -18,7 +18,7 @@ class cex extends cex$1 {
18
18
  'id': 'cex',
19
19
  'name': 'CEX.IO',
20
20
  'countries': ['GB', 'EU', 'CY', 'RU'],
21
- 'rateLimit': 1667,
21
+ 'rateLimit': 300,
22
22
  'pro': true,
23
23
  'has': {
24
24
  'CORS': undefined,
@@ -30,6 +30,8 @@ class cex extends cex$1 {
30
30
  'cancelAllOrders': true,
31
31
  'cancelOrder': true,
32
32
  'createOrder': true,
33
+ 'createStopOrder': true,
34
+ 'createTriggerOrder': true,
33
35
  'fetchAccounts': true,
34
36
  'fetchBalance': true,
35
37
  'fetchClosedOrder': true,
@@ -118,7 +120,8 @@ class cex extends cex$1 {
118
120
  'check failed': errors.BadRequest,
119
121
  'Insufficient funds': errors.InsufficientFunds,
120
122
  'Get deposit address for main account is not allowed': errors.PermissionDenied,
121
- 'Market Trigger orders are not allowed': errors.BadRequest, // for some reason, triggerPrice does not work for market orders
123
+ 'Market Trigger orders are not allowed': errors.BadRequest,
124
+ 'key not passed or incorrect': errors.AuthenticationError,
122
125
  },
123
126
  },
124
127
  'timeframes': {
@@ -849,7 +852,7 @@ class cex extends cex$1 {
849
852
  const code = this.safeCurrencyCode(key);
850
853
  const account = {
851
854
  'used': this.safeString(balance, 'balanceOnHold'),
852
- 'free': this.safeString(balance, 'balance'),
855
+ 'total': this.safeString(balance, 'balance'),
853
856
  };
854
857
  result[code] = account;
855
858
  }
@@ -936,7 +939,7 @@ class cex extends cex$1 {
936
939
  // },
937
940
  // ...
938
941
  //
939
- const data = this.safeValue(response, 'data', []);
942
+ const data = this.safeList(response, 'data', []);
940
943
  return this.parseOrders(data, market, since, limit);
941
944
  }
942
945
  /**
@@ -1005,10 +1008,16 @@ class cex extends cex$1 {
1005
1008
  }
1006
1009
  parseOrderStatus(status) {
1007
1010
  const statuses = {
1011
+ 'PENDING_NEW': 'open',
1012
+ 'NEW': 'open',
1013
+ 'PARTIALLY_FILLED': 'open',
1008
1014
  'FILLED': 'closed',
1015
+ 'EXPIRED': 'expired',
1016
+ 'REJECTED': 'rejected',
1017
+ 'PENDING_CANCEL': 'canceling',
1009
1018
  'CANCELLED': 'canceled',
1010
1019
  };
1011
- return this.safeString(statuses, status, undefined);
1020
+ return this.safeString(statuses, status, status);
1012
1021
  }
1013
1022
  parseOrder(order, market = undefined) {
1014
1023
  //
@@ -1058,7 +1067,7 @@ class cex extends cex$1 {
1058
1067
  const currencyId = this.safeString(order, 'feeCurrency');
1059
1068
  const feeCode = this.safeCurrencyCode(currencyId);
1060
1069
  fee['currency'] = feeCode;
1061
- fee['fee'] = feeAmount;
1070
+ fee['cost'] = feeAmount;
1062
1071
  }
1063
1072
  const timestamp = this.safeInteger(order, 'serverCreateTimestamp');
1064
1073
  const requestedBase = this.safeNumber(order, 'requestedAmountCcy1');
@@ -1102,6 +1111,7 @@ class cex extends cex$1 {
1102
1111
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1103
1112
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1104
1113
  * @param {string} [params.accountId] account-id to use (default is empty string)
1114
+ * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
1105
1115
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1106
1116
  */
1107
1117
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -2240,7 +2240,8 @@ class coinbase extends coinbase$1 {
2240
2240
  * @see https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getfcmbalancesummary
2241
2241
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2242
2242
  * @param {boolean} [params.v3] default false, set true to use v3 api endpoint
2243
- * @param {object} [params.type] "spot" (default) or "swap" or "future"
2243
+ * @param {string} [params.type] "spot" (default) or "swap" or "future"
2244
+ * @param {int} [params.limit] default 250, maximum number of accounts to return
2244
2245
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2245
2246
  */
2246
2247
  async fetchBalance(params = {}) {
@@ -2260,7 +2261,7 @@ class coinbase extends coinbase$1 {
2260
2261
  response = await this.v3PrivateGetBrokerageAccounts(this.extend(request, params));
2261
2262
  }
2262
2263
  else {
2263
- request['limit'] = 100;
2264
+ request['limit'] = 250;
2264
2265
  response = await this.v2PrivateGetAccounts(this.extend(request, params));
2265
2266
  }
2266
2267
  //
@@ -2376,28 +2377,8 @@ class coinbase extends coinbase$1 {
2376
2377
  const pagination = this.safeDict(response, 'pagination', {});
2377
2378
  const cursor = this.safeString(pagination, 'next_starting_after');
2378
2379
  if ((cursor !== undefined) && (cursor !== '')) {
2379
- const lastFee = this.safeDict(last, 'fee');
2380
- last['next_starting_after'] = cursor;
2381
- ledger[lastIndex] = {
2382
- 'info': this.safeDict(last, 'info'),
2383
- 'id': this.safeString(last, 'id'),
2384
- 'timestamp': this.safeInteger(last, 'timestamp'),
2385
- 'datetime': this.safeString(last, 'datetime'),
2386
- 'direction': this.safeString(last, 'direction'),
2387
- 'account': this.safeString(last, 'account'),
2388
- 'referenceId': undefined,
2389
- 'referenceAccount': undefined,
2390
- 'type': this.safeString(last, 'type'),
2391
- 'currency': this.safeString(last, 'currency'),
2392
- 'amount': this.safeNumber(last, 'amount'),
2393
- 'before': undefined,
2394
- 'after': undefined,
2395
- 'status': this.safeString(last, 'status'),
2396
- 'fee': {
2397
- 'cost': this.safeNumber(lastFee, 'cost'),
2398
- 'currency': this.safeString(lastFee, 'currency'),
2399
- },
2400
- };
2380
+ last['info']['next_starting_after'] = cursor;
2381
+ ledger[lastIndex] = last;
2401
2382
  }
2402
2383
  return ledger;
2403
2384
  }
@@ -116,7 +116,8 @@ class coinbaseexchange extends coinbaseexchange$1 {
116
116
  'products/{id}/ticker',
117
117
  'products/{id}/trades',
118
118
  'time',
119
- 'products/spark-lines', // experimental
119
+ 'products/spark-lines',
120
+ 'products/volume-summary',
120
121
  ],
121
122
  },
122
123
  'private': {
@@ -55,6 +55,7 @@ class coinex extends coinex$1 {
55
55
  'createOrders': true,
56
56
  'createReduceOnlyOrder': true,
57
57
  'createStopLossOrder': true,
58
+ 'createStopOrder': true,
58
59
  'createTakeProfitOrder': true,
59
60
  'createTriggerOrder': true,
60
61
  'editOrder': true,
@@ -4770,6 +4771,7 @@ class coinex extends coinex$1 {
4770
4771
  'not_pass': 'failed',
4771
4772
  'cancel': 'canceled',
4772
4773
  'finish': 'ok',
4774
+ 'finished': 'ok',
4773
4775
  'fail': 'failed',
4774
4776
  };
4775
4777
  return this.safeString(statuses, status, status);
@@ -233,7 +233,7 @@ class coinone extends coinone$1 {
233
233
  // }
234
234
  //
235
235
  const result = {};
236
- const currencies = this.safeValue(response, 'currencies', []);
236
+ const currencies = this.safeList(response, 'currencies', []);
237
237
  for (let i = 0; i < currencies.length; i++) {
238
238
  const entry = currencies[i];
239
239
  const id = this.safeString(entry, 'symbol');
@@ -314,7 +314,7 @@ class coinone extends coinone$1 {
314
314
  // ]
315
315
  // }
316
316
  //
317
- const tickers = this.safeValue(response, 'tickers', []);
317
+ const tickers = this.safeList(response, 'tickers', []);
318
318
  const result = [];
319
319
  for (let i = 0; i < tickers.length; i++) {
320
320
  const entry = this.safeValue(tickers, i);
@@ -569,7 +569,7 @@ class coinone extends coinone$1 {
569
569
  // ]
570
570
  // }
571
571
  //
572
- const data = this.safeValue(response, 'tickers', []);
572
+ const data = this.safeList(response, 'tickers', []);
573
573
  const ticker = this.safeDict(data, 0, {});
574
574
  return this.parseTicker(ticker, market);
575
575
  }
@@ -602,8 +602,8 @@ class coinone extends coinone$1 {
602
602
  //
603
603
  const timestamp = this.safeInteger(ticker, 'timestamp');
604
604
  const last = this.safeString(ticker, 'last');
605
- const asks = this.safeValue(ticker, 'best_asks');
606
- const bids = this.safeValue(ticker, 'best_bids');
605
+ const asks = this.safeList(ticker, 'best_asks', []);
606
+ const bids = this.safeList(ticker, 'best_bids', []);
607
607
  const baseId = this.safeString(ticker, 'target_currency');
608
608
  const quoteId = this.safeString(ticker, 'quote_currency');
609
609
  const base = this.safeCurrencyCode(baseId);
@@ -657,7 +657,7 @@ class coinone extends coinone$1 {
657
657
  //
658
658
  const timestamp = this.safeInteger(trade, 'timestamp');
659
659
  market = this.safeMarket(undefined, market);
660
- const isSellerMaker = this.safeValue(trade, 'is_seller_maker');
660
+ const isSellerMaker = this.safeBool(trade, 'is_seller_maker');
661
661
  let side = undefined;
662
662
  if (isSellerMaker !== undefined) {
663
663
  side = isSellerMaker ? 'sell' : 'buy';
@@ -1090,7 +1090,7 @@ class coinone extends coinone$1 {
1090
1090
  // }
1091
1091
  // }
1092
1092
  //
1093
- const walletAddress = this.safeValue(response, 'walletAddress', {});
1093
+ const walletAddress = this.safeDict(response, 'walletAddress', {});
1094
1094
  const keys = Object.keys(walletAddress);
1095
1095
  const result = {};
1096
1096
  for (let i = 0; i < keys.length; i++) {
@@ -544,7 +544,7 @@ class coinsph extends coinsph$1 {
544
544
  // ]
545
545
  // }
546
546
  //
547
- const markets = this.safeValue(response, 'symbols');
547
+ const markets = this.safeList(response, 'symbols', []);
548
548
  const result = [];
549
549
  for (let i = 0; i < markets.length; i++) {
550
550
  const market = markets[i];
@@ -553,7 +553,7 @@ class coinsph extends coinsph$1 {
553
553
  const quoteId = this.safeString(market, 'quoteAsset');
554
554
  const base = this.safeCurrencyCode(baseId);
555
555
  const quote = this.safeCurrencyCode(quoteId);
556
- const limits = this.indexBy(this.safeValue(market, 'filters'), 'filterType');
556
+ const limits = this.indexBy(this.safeList(market, 'filters', []), 'filterType');
557
557
  const amountLimits = this.safeValue(limits, 'LOT_SIZE', {});
558
558
  const priceLimits = this.safeValue(limits, 'PRICE_FILTER', {});
559
559
  const costLimits = this.safeValue(limits, 'NOTIONAL', {});
@@ -636,7 +636,7 @@ class coinsph extends coinsph$1 {
636
636
  request['symbols'] = ids;
637
637
  }
638
638
  const defaultMethod = 'publicGetOpenapiQuoteV1Ticker24hr';
639
- const options = this.safeValue(this.options, 'fetchTickers', {});
639
+ const options = this.safeDict(this.options, 'fetchTickers', {});
640
640
  const method = this.safeString(options, 'method', defaultMethod);
641
641
  let tickers = undefined;
642
642
  if (method === 'publicGetOpenapiQuoteV1TickerPrice') {
@@ -668,7 +668,7 @@ class coinsph extends coinsph$1 {
668
668
  'symbol': market['id'],
669
669
  };
670
670
  const defaultMethod = 'publicGetOpenapiQuoteV1Ticker24hr';
671
- const options = this.safeValue(this.options, 'fetchTicker', {});
671
+ const options = this.safeDict(this.options, 'fetchTicker', {});
672
672
  const method = this.safeString(options, 'method', defaultMethod);
673
673
  let ticker = undefined;
674
674
  if (method === 'publicGetOpenapiQuoteV1TickerPrice') {
@@ -1014,7 +1014,7 @@ class coinsph extends coinsph$1 {
1014
1014
  'currency': this.safeCurrencyCode(feeCurrencyId),
1015
1015
  };
1016
1016
  }
1017
- const isBuyer = this.safeValue2(trade, 'isBuyer', 'isBuyerMaker', undefined);
1017
+ const isBuyer = this.safeBool2(trade, 'isBuyer', 'isBuyerMaker', undefined);
1018
1018
  let side = undefined;
1019
1019
  if (isBuyer !== undefined) {
1020
1020
  side = (isBuyer === true) ? 'buy' : 'sell';
@@ -1079,7 +1079,7 @@ class coinsph extends coinsph$1 {
1079
1079
  return this.parseBalance(response);
1080
1080
  }
1081
1081
  parseBalance(response) {
1082
- const balances = this.safeValue(response, 'balances', []);
1082
+ const balances = this.safeList(response, 'balances', []);
1083
1083
  const result = {
1084
1084
  'info': response,
1085
1085
  'timestamp': undefined,
@@ -1526,7 +1526,7 @@ class coinsph extends coinsph$1 {
1526
1526
  // }
1527
1527
  // ]
1528
1528
  //
1529
- const tradingFee = this.safeValue(response, 0, {});
1529
+ const tradingFee = this.safeDict(response, 0, {});
1530
1530
  return this.parseTradingFee(tradingFee, market);
1531
1531
  }
1532
1532
  /**
@@ -272,7 +272,7 @@ class coinspot extends coinspot$1 {
272
272
  const response = await this.publicGetLatest(params);
273
273
  let id = market['id'];
274
274
  id = id.toLowerCase();
275
- const prices = this.safeValue(response, 'prices');
275
+ const prices = this.safeDict(response, 'prices', {});
276
276
  //
277
277
  // {
278
278
  // "status":"ok",
@@ -303,22 +303,22 @@ class coinspot extends coinspot$1 {
303
303
  //
304
304
  // {
305
305
  // "status": "ok",
306
- // "prices": {
307
- // "btc": {
308
- // "bid": "25050",
309
- // "ask": "25370",
310
- // "last": "25234"
311
- // },
312
- // "ltc": {
313
- // "bid": "79.39192993",
314
- // "ask": "87.98",
315
- // "last": "87.95"
306
+ // "prices": {
307
+ // "btc": {
308
+ // "bid": "25050",
309
+ // "ask": "25370",
310
+ // "last": "25234"
311
+ // },
312
+ // "ltc": {
313
+ // "bid": "79.39192993",
314
+ // "ask": "87.98",
315
+ // "last": "87.95"
316
+ // }
316
317
  // }
317
- // }
318
318
  // }
319
319
  //
320
320
  const result = {};
321
- const prices = this.safeValue(response, 'prices');
321
+ const prices = this.safeDict(response, 'prices', {});
322
322
  const ids = Object.keys(prices);
323
323
  for (let i = 0; i < ids.length; i++) {
324
324
  const id = ids[i];
@@ -383,36 +383,36 @@ class coinspot extends coinspot$1 {
383
383
  }
384
384
  const response = await this.privatePostRoMyTransactions(this.extend(request, params));
385
385
  // {
386
- // "status": "ok",
387
- // "buyorders": [
388
- // {
389
- // "otc": false,
390
- // "market": "ALGO/AUD",
391
- // "amount": 386.95197925,
392
- // "created": "2022-10-20T09:56:44.502Z",
393
- // "audfeeExGst": 1.80018002,
394
- // "audGst": 0.180018,
395
- // "audtotal": 200
396
- // },
397
- // ],
398
- // "sellorders": [
399
- // {
400
- // "otc": false,
401
- // "market": "SOLO/ALGO",
402
- // "amount": 154.52345614,
403
- // "total": 115.78858204658796,
404
- // "created": "2022-04-16T09:36:43.698Z",
405
- // "audfeeExGst": 1.08995731,
406
- // "audGst": 0.10899573,
407
- // "audtotal": 118.7
408
- // },
409
- // ]
386
+ // "status": "ok",
387
+ // "buyorders": [
388
+ // {
389
+ // "otc": false,
390
+ // "market": "ALGO/AUD",
391
+ // "amount": 386.95197925,
392
+ // "created": "2022-10-20T09:56:44.502Z",
393
+ // "audfeeExGst": 1.80018002,
394
+ // "audGst": 0.180018,
395
+ // "audtotal": 200
396
+ // },
397
+ // ],
398
+ // "sellorders": [
399
+ // {
400
+ // "otc": false,
401
+ // "market": "SOLO/ALGO",
402
+ // "amount": 154.52345614,
403
+ // "total": 115.78858204658796,
404
+ // "created": "2022-04-16T09:36:43.698Z",
405
+ // "audfeeExGst": 1.08995731,
406
+ // "audGst": 0.10899573,
407
+ // "audtotal": 118.7
408
+ // },
409
+ // ]
410
410
  // }
411
- const buyTrades = this.safeValue(response, 'buyorders', []);
411
+ const buyTrades = this.safeList(response, 'buyorders', []);
412
412
  for (let i = 0; i < buyTrades.length; i++) {
413
413
  buyTrades[i]['side'] = 'buy';
414
414
  }
415
- const sellTrades = this.safeValue(response, 'sellorders', []);
415
+ const sellTrades = this.safeList(response, 'sellorders', []);
416
416
  for (let i = 0; i < sellTrades.length; i++) {
417
417
  sellTrades[i]['side'] = 'sell';
418
418
  }