ccxt 4.4.34 → 4.4.35

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 (47) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/bingx.js +339 -144
  5. package/dist/cjs/src/bitmex.js +1 -1
  6. package/dist/cjs/src/bitrue.js +2 -2
  7. package/dist/cjs/src/btcmarkets.js +3 -3
  8. package/dist/cjs/src/btcturk.js +19 -19
  9. package/dist/cjs/src/gate.js +143 -40
  10. package/dist/cjs/src/hyperliquid.js +73 -11
  11. package/dist/cjs/src/idex.js +3 -3
  12. package/dist/cjs/src/kraken.js +71 -54
  13. package/dist/cjs/src/kucoin.js +1 -1
  14. package/dist/cjs/src/okx.js +1 -0
  15. package/dist/cjs/src/onetrading.js +20 -395
  16. package/dist/cjs/src/pro/bitrue.js +13 -11
  17. package/dist/cjs/src/pro/probit.js +58 -66
  18. package/dist/cjs/src/xt.js +5 -5
  19. package/js/ccxt.d.ts +1 -1
  20. package/js/ccxt.js +1 -1
  21. package/js/src/abstract/bingx.d.ts +1 -0
  22. package/js/src/abstract/bitpanda.d.ts +0 -12
  23. package/js/src/abstract/bitrue.d.ts +3 -3
  24. package/js/src/abstract/okx.d.ts +1 -0
  25. package/js/src/abstract/onetrading.d.ts +0 -12
  26. package/js/src/bingx.d.ts +8 -0
  27. package/js/src/bingx.js +339 -144
  28. package/js/src/bitmex.js +1 -1
  29. package/js/src/bitrue.js +2 -2
  30. package/js/src/btcmarkets.js +3 -3
  31. package/js/src/btcturk.js +19 -19
  32. package/js/src/gate.d.ts +5 -5
  33. package/js/src/gate.js +143 -40
  34. package/js/src/hyperliquid.d.ts +10 -0
  35. package/js/src/hyperliquid.js +75 -13
  36. package/js/src/idex.js +4 -4
  37. package/js/src/kraken.d.ts +11 -8
  38. package/js/src/kraken.js +71 -54
  39. package/js/src/kucoin.js +1 -1
  40. package/js/src/okx.js +1 -0
  41. package/js/src/onetrading.d.ts +15 -67
  42. package/js/src/onetrading.js +20 -395
  43. package/js/src/pro/bitrue.js +13 -11
  44. package/js/src/pro/probit.d.ts +2 -1
  45. package/js/src/pro/probit.js +58 -66
  46. package/js/src/xt.js +5 -5
  47. package/package.json +2 -1
@@ -34,7 +34,7 @@ class onetrading extends onetrading$1 {
34
34
  'cancelOrders': true,
35
35
  'closeAllPositions': false,
36
36
  'closePosition': false,
37
- 'createDepositAddress': true,
37
+ 'createDepositAddress': false,
38
38
  'createOrder': true,
39
39
  'createReduceOnlyOrder': false,
40
40
  'createStopLimitOrder': true,
@@ -49,10 +49,10 @@ class onetrading extends onetrading$1 {
49
49
  'fetchCrossBorrowRates': false,
50
50
  'fetchCurrencies': true,
51
51
  'fetchDeposit': false,
52
- 'fetchDepositAddress': true,
52
+ 'fetchDepositAddress': false,
53
53
  'fetchDepositAddresses': false,
54
54
  'fetchDepositAddressesByNetwork': false,
55
- 'fetchDeposits': true,
55
+ 'fetchDeposits': false,
56
56
  'fetchDepositsWithdrawals': false,
57
57
  'fetchFundingHistory': false,
58
58
  'fetchFundingRate': false,
@@ -85,7 +85,7 @@ class onetrading extends onetrading$1 {
85
85
  'fetchTicker': true,
86
86
  'fetchTickers': true,
87
87
  'fetchTime': true,
88
- 'fetchTrades': true,
88
+ 'fetchTrades': false,
89
89
  'fetchTradingFee': false,
90
90
  'fetchTradingFees': true,
91
91
  'fetchTransactionFee': false,
@@ -94,14 +94,14 @@ class onetrading extends onetrading$1 {
94
94
  'fetchTransfer': false,
95
95
  'fetchTransfers': false,
96
96
  'fetchWithdrawal': false,
97
- 'fetchWithdrawals': true,
97
+ 'fetchWithdrawals': false,
98
98
  'reduceMargin': false,
99
99
  'setLeverage': false,
100
100
  'setMargin': false,
101
101
  'setMarginMode': false,
102
102
  'setPositionMode': false,
103
103
  'transfer': false,
104
- 'withdraw': true,
104
+ 'withdraw': false,
105
105
  },
106
106
  'timeframes': {
107
107
  '1m': '1/MINUTES',
@@ -136,32 +136,20 @@ class onetrading extends onetrading$1 {
136
136
  'order-book/{instrument_code}',
137
137
  'market-ticker',
138
138
  'market-ticker/{instrument_code}',
139
- 'price-ticks/{instrument_code}',
140
139
  'time',
141
140
  ],
142
141
  },
143
142
  'private': {
144
143
  'get': [
145
144
  'account/balances',
146
- 'account/deposit/crypto/{currency_code}',
147
- 'account/deposit/fiat/EUR',
148
- 'account/deposits',
149
- 'account/deposits/bitpanda',
150
- 'account/withdrawals',
151
- 'account/withdrawals/bitpanda',
152
145
  'account/fees',
153
146
  'account/orders',
154
147
  'account/orders/{order_id}',
155
148
  'account/orders/{order_id}/trades',
156
149
  'account/trades',
157
150
  'account/trades/{trade_id}',
158
- 'account/trading-volume',
159
151
  ],
160
152
  'post': [
161
- 'account/deposit/crypto',
162
- 'account/withdraw/crypto',
163
- 'account/withdraw/fiat',
164
- 'account/fees',
165
153
  'account/orders',
166
154
  ],
167
155
  'delete': [
@@ -631,6 +619,7 @@ class onetrading extends onetrading$1 {
631
619
  * @method
632
620
  * @name onetrading#fetchTicker
633
621
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
622
+ * @see https://docs.onetrading.com/#market-ticker-for-instrument
634
623
  * @param {string} symbol unified symbol of the market to fetch the ticker for
635
624
  * @param {object} [params] extra parameters specific to the exchange API endpoint
636
625
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -666,7 +655,8 @@ class onetrading extends onetrading$1 {
666
655
  * @method
667
656
  * @name onetrading#fetchTickers
668
657
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
669
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
658
+ * @see https://docs.onetrading.com/#market-ticker
659
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
670
660
  * @param {object} [params] extra parameters specific to the exchange API endpoint
671
661
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
672
662
  */
@@ -706,6 +696,7 @@ class onetrading extends onetrading$1 {
706
696
  * @method
707
697
  * @name onetrading#fetchOrderBook
708
698
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
699
+ * @see https://docs.onetrading.com/#order-book
709
700
  * @param {string} symbol unified symbol of the market to fetch the order book for
710
701
  * @param {int} [limit] the maximum amount of order book entries to return
711
702
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -831,6 +822,7 @@ class onetrading extends onetrading$1 {
831
822
  * @method
832
823
  * @name onetrading#fetchOHLCV
833
824
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
825
+ * @see https://docs.onetrading.com/#candlesticks
834
826
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
835
827
  * @param {string} timeframe the length of time each candle represents
836
828
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -955,47 +947,6 @@ class onetrading extends onetrading$1 {
955
947
  'info': trade,
956
948
  }, market);
957
949
  }
958
- /**
959
- * @method
960
- * @name onetrading#fetchTrades
961
- * @description get the list of most recent trades for a particular symbol
962
- * @param {string} symbol unified symbol of the market to fetch trades for
963
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
964
- * @param {int} [limit] the maximum amount of trades to fetch
965
- * @param {object} [params] extra parameters specific to the exchange API endpoint
966
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
967
- */
968
- async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
969
- await this.loadMarkets();
970
- const market = this.market(symbol);
971
- const request = {
972
- 'instrument_code': market['id'],
973
- // 'from': this.iso8601 (since),
974
- // 'to': this.iso8601 (this.milliseconds ()),
975
- };
976
- if (since !== undefined) {
977
- // returns price ticks for a specific market with an interval of maximum of 4 hours
978
- // sorted by latest first
979
- request['from'] = this.iso8601(since);
980
- request['to'] = this.iso8601(this.sum(since, 14400000));
981
- }
982
- const response = await this.publicGetPriceTicksInstrumentCode(this.extend(request, params));
983
- //
984
- // [
985
- // {
986
- // "instrument_code":"BTC_EUR",
987
- // "price":"8137.28",
988
- // "amount":"0.22269",
989
- // "taker_side":"BUY",
990
- // "volume":"1812.0908832",
991
- // "time":"2020-07-10T14:44:32.299Z",
992
- // "trade_timestamp":1594392272299,
993
- // "sequence":603047
994
- // }
995
- // ]
996
- //
997
- return this.parseTrades(response, market, since, limit);
998
- }
999
950
  parseBalance(response) {
1000
951
  const balances = this.safeValue(response, 'balances', []);
1001
952
  const result = { 'info': response };
@@ -1014,6 +965,7 @@ class onetrading extends onetrading$1 {
1014
965
  * @method
1015
966
  * @name onetrading#fetchBalance
1016
967
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
968
+ * @see https://docs.onetrading.com/#balances
1017
969
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1018
970
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1019
971
  */
@@ -1038,341 +990,6 @@ class onetrading extends onetrading$1 {
1038
990
  //
1039
991
  return this.parseBalance(response);
1040
992
  }
1041
- parseDepositAddress(depositAddress, currency = undefined) {
1042
- let code = undefined;
1043
- if (currency !== undefined) {
1044
- code = currency['code'];
1045
- }
1046
- const address = this.safeString(depositAddress, 'address');
1047
- const tag = this.safeString(depositAddress, 'destination_tag');
1048
- this.checkAddress(address);
1049
- return {
1050
- 'info': depositAddress,
1051
- 'currency': code,
1052
- 'network': undefined,
1053
- 'address': address,
1054
- 'tag': tag,
1055
- };
1056
- }
1057
- /**
1058
- * @method
1059
- * @name onetrading#createDepositAddress
1060
- * @description create a currency deposit address
1061
- * @param {string} code unified currency code of the currency for the deposit address
1062
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1063
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1064
- */
1065
- async createDepositAddress(code, params = {}) {
1066
- await this.loadMarkets();
1067
- const currency = this.currency(code);
1068
- const request = {
1069
- 'currency': currency['id'],
1070
- };
1071
- const response = await this.privatePostAccountDepositCrypto(this.extend(request, params));
1072
- //
1073
- // {
1074
- // "address":"rBnNhk95FrdNisZtXcStzriFS8vEzz53DM",
1075
- // "destination_tag":"865690307",
1076
- // "enabled":true,
1077
- // "is_smart_contract":false
1078
- // }
1079
- //
1080
- return this.parseDepositAddress(response, currency);
1081
- }
1082
- /**
1083
- * @method
1084
- * @name onetrading#fetchDepositAddress
1085
- * @description fetch the deposit address for a currency associated with this account
1086
- * @param {string} code unified currency code
1087
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1088
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1089
- */
1090
- async fetchDepositAddress(code, params = {}) {
1091
- await this.loadMarkets();
1092
- const currency = this.currency(code);
1093
- const request = {
1094
- 'currency_code': currency['id'],
1095
- };
1096
- const response = await this.privateGetAccountDepositCryptoCurrencyCode(this.extend(request, params));
1097
- //
1098
- // {
1099
- // "address":"rBnNhk95FrdNisZtXcStzriFS8vEzz53DM",
1100
- // "destination_tag":"865690307",
1101
- // "enabled":true,
1102
- // "is_smart_contract":false,
1103
- // "can_create_more":false
1104
- // }
1105
- //
1106
- return this.parseDepositAddress(response, currency);
1107
- }
1108
- /**
1109
- * @method
1110
- * @name onetrading#fetchDeposits
1111
- * @description fetch all deposits made to an account
1112
- * @param {string} code unified currency code
1113
- * @param {int} [since] the earliest time in ms to fetch deposits for
1114
- * @param {int} [limit] the maximum number of deposits structures to retrieve
1115
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1116
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1117
- */
1118
- async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
1119
- await this.loadMarkets();
1120
- const request = {
1121
- // 'cursor': 'string', // pointer specifying the position from which the next pages should be returned
1122
- };
1123
- let currency = undefined;
1124
- if (code !== undefined) {
1125
- currency = this.currency(code);
1126
- request['currency_code'] = currency['id'];
1127
- }
1128
- if (limit !== undefined) {
1129
- request['max_page_size'] = limit;
1130
- }
1131
- if (since !== undefined) {
1132
- const to = this.safeString(params, 'to');
1133
- if (to === undefined) {
1134
- throw new errors.ArgumentsRequired(this.id + ' fetchDeposits() requires a "to" iso8601 string param with the since argument is specified');
1135
- }
1136
- request['from'] = this.iso8601(since);
1137
- }
1138
- const response = await this.privateGetAccountDeposits(this.extend(request, params));
1139
- //
1140
- // {
1141
- // "deposit_history": [
1142
- // {
1143
- // "transaction_id": "e5342efcd-d5b7-4a56-8e12-b69ffd68c5ef",
1144
- // "account_id": "c2d0076a-c20d-41f8-9e9a-1a1d028b2b58",
1145
- // "amount": "100",
1146
- // "type": "CRYPTO",
1147
- // "funds_source": "INTERNAL",
1148
- // "time": "2020-04-22T09:57:47Z",
1149
- // "currency": "BTC",
1150
- // "fee_amount": "0.0",
1151
- // "fee_currency": "BTC"
1152
- // },
1153
- // {
1154
- // "transaction_id": "79793d00-2899-4a4d-95b7-73ae6b31384f",
1155
- // "account_id": "c2d0076a-c20d-41f8-9e9a-1a1d028b2b58",
1156
- // "time": "2020-05-05T11:22:07.925Z",
1157
- // "currency": "EUR",
1158
- // "funds_source": "EXTERNAL",
1159
- // "type": "FIAT",
1160
- // "amount": "50.0",
1161
- // "fee_amount": "0.01",
1162
- // "fee_currency": "EUR"
1163
- // }
1164
- // ],
1165
- // "max_page_size": 2,
1166
- // "cursor": "eyJhY2NvdW50X2lkIjp7InMiOiJlMzY5YWM4MC00NTc3LTExZTktYWUwOC05YmVkYzQ3OTBiODQiLCJzcyI6W10sIm5zIjpbXSwiYnMiOltdLCJtIjp7fSwibCI6W119LCJpdGVtX2tleSI6eyJzIjoiV0lUSERSQVdBTDo6MmFlMjYwY2ItOTk3MC00YmNiLTgxNmEtZGY4MDVmY2VhZTY1Iiwic3MiOltdLCJucyI6W10sImJzIjpbXSwibSI6e30sImwiOltdfSwiZ2xvYmFsX3dpdGhkcmF3YWxfaW5kZXhfaGFzaF9rZXkiOnsicyI6ImUzNjlhYzgwLTQ1NzctMTFlOS1hZTA4LTliZWRjNDc5MGI4NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX0sInRpbWVzdGFtcCI6eyJuIjoiMTU4ODA1ODc2Nzk0OCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX19"
1167
- // }
1168
- //
1169
- const depositHistory = this.safeList(response, 'deposit_history', []);
1170
- return this.parseTransactions(depositHistory, currency, since, limit, { 'type': 'deposit' });
1171
- }
1172
- /**
1173
- * @method
1174
- * @name onetrading#fetchWithdrawals
1175
- * @description fetch all withdrawals made from an account
1176
- * @param {string} code unified currency code
1177
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
1178
- * @param {int} [limit] the maximum number of withdrawals structures to retrieve
1179
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1180
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1181
- */
1182
- async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1183
- await this.loadMarkets();
1184
- const request = {
1185
- // 'cursor': 'string', // pointer specifying the position from which the next pages should be returned
1186
- };
1187
- let currency = undefined;
1188
- if (code !== undefined) {
1189
- currency = this.currency(code);
1190
- request['currency_code'] = currency['id'];
1191
- }
1192
- if (limit !== undefined) {
1193
- request['max_page_size'] = limit;
1194
- }
1195
- if (since !== undefined) {
1196
- const to = this.safeString(params, 'to');
1197
- if (to === undefined) {
1198
- throw new errors.ArgumentsRequired(this.id + ' fetchWithdrawals() requires a "to" iso8601 string param with the since argument is specified');
1199
- }
1200
- request['from'] = this.iso8601(since);
1201
- }
1202
- const response = await this.privateGetAccountWithdrawals(this.extend(request, params));
1203
- //
1204
- // {
1205
- // "withdrawal_history": [
1206
- // {
1207
- // "account_id": "e369ac80-4577-11e9-ae08-9bedc4790b84",
1208
- // "amount": "0.1",
1209
- // "currency": "BTC",
1210
- // "fee_amount": "0.00002",
1211
- // "fee_currency": "BTC",
1212
- // "funds_source": "EXTERNAL",
1213
- // "related_transaction_id": "e298341a-3855-405e-bce3-92db368a3157",
1214
- // "time": "2020-05-05T11:11:32.110Z",
1215
- // "transaction_id": "6693ff40-bb10-4dcf-ada7-3b287727c882",
1216
- // "type": "CRYPTO"
1217
- // },
1218
- // {
1219
- // "account_id": "e369ac80-4577-11e9-ae08-9bedc4790b84",
1220
- // "amount": "0.1",
1221
- // "currency": "BTC",
1222
- // "fee_amount": "0.0",
1223
- // "fee_currency": "BTC",
1224
- // "funds_source": "INTERNAL",
1225
- // "time": "2020-05-05T10:29:53.464Z",
1226
- // "transaction_id": "ec9703b1-954b-4f76-adea-faac66eabc0b",
1227
- // "type": "CRYPTO"
1228
- // }
1229
- // ],
1230
- // "cursor": "eyJhY2NvdW50X2lkIjp7InMiOiJlMzY5YWM4MC00NTc3LTExZTktYWUwOC05YmVkYzQ3OTBiODQiLCJzcyI6W10sIm5zIjpbXSwiYnMiOltdLCJtIjp7fSwibCI6W119LCJpdGVtX2tleSI6eyJzIjoiV0lUSERSQVdBTDo6ZWM5NzAzYjEtOTU0Yi00Zjc2LWFkZWEtZmFhYzY2ZWFiYzBiIiwic3MiOltdLCJucyI6W10sImJzIjpbXSwibSI6e30sImwiOltdfSwiZ2xvYmFsX3dpdGhkcmF3YWxfaW5kZXhfaGFzaF9rZXkiOnsicyI6ImUzNjlhYzgwLTQ1NzctMTFlOS1hZTA4LTliZWRjNDc5MGI4NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX0sInRpbWVzdGFtcCI6eyJuIjoiMTU4ODY3NDU5MzQ2NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX19",
1231
- // "max_page_size": 2
1232
- // }
1233
- //
1234
- const withdrawalHistory = this.safeList(response, 'withdrawal_history', []);
1235
- return this.parseTransactions(withdrawalHistory, currency, since, limit, { 'type': 'withdrawal' });
1236
- }
1237
- /**
1238
- * @method
1239
- * @name onetrading#withdraw
1240
- * @description make a withdrawal
1241
- * @param {string} code unified currency code
1242
- * @param {float} amount the amount to withdraw
1243
- * @param {string} address the address to withdraw to
1244
- * @param {string} tag
1245
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1246
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1247
- */
1248
- async withdraw(code, amount, address, tag = undefined, params = {}) {
1249
- [tag, params] = this.handleWithdrawTagAndParams(tag, params);
1250
- this.checkAddress(address);
1251
- await this.loadMarkets();
1252
- const currency = this.currency(code);
1253
- const request = {
1254
- 'currency': code,
1255
- 'amount': this.currencyToPrecision(code, amount),
1256
- // 'payout_account_id': '66756a10-3e86-48f4-9678-b634c4b135b2', // fiat only
1257
- // 'recipient': { // crypto only
1258
- // 'address': address,
1259
- // // 'destination_tag': '',
1260
- // },
1261
- };
1262
- const options = this.safeValue(this.options, 'fiat', []);
1263
- const isFiat = this.inArray(code, options);
1264
- const method = isFiat ? 'privatePostAccountWithdrawFiat' : 'privatePostAccountWithdrawCrypto';
1265
- if (isFiat) {
1266
- const payoutAccountId = this.safeString(params, 'payout_account_id');
1267
- if (payoutAccountId === undefined) {
1268
- throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a payout_account_id param for fiat ' + code + ' withdrawals');
1269
- }
1270
- }
1271
- else {
1272
- const recipient = { 'address': address };
1273
- if (tag !== undefined) {
1274
- recipient['destination_tag'] = tag;
1275
- }
1276
- request['recipient'] = recipient;
1277
- }
1278
- const response = await this[method](this.extend(request, params));
1279
- //
1280
- // crypto
1281
- //
1282
- // {
1283
- // "amount": "1234.5678",
1284
- // "fee": "1234.5678",
1285
- // "recipient": "3NacQ7rzZdhfyAtfJ5a11k8jFPdcMP2Bq7",
1286
- // "destination_tag": "",
1287
- // "transaction_id": "d0f8529f-f832-4e6a-9dc5-b8d5797badb2"
1288
- // }
1289
- //
1290
- // fiat
1291
- //
1292
- // {
1293
- // "transaction_id": "54236cd0-4413-11e9-93fb-5fea7e5b5df6"
1294
- // }
1295
- //
1296
- return this.parseTransaction(response, currency);
1297
- }
1298
- parseTransaction(transaction, currency = undefined) {
1299
- //
1300
- // fetchDeposits, fetchWithdrawals
1301
- //
1302
- // {
1303
- // "transaction_id": "C2b42efcd-d5b7-4a56-8e12-b69ffd68c5ef",
1304
- // "type": "FIAT",
1305
- // "account_id": "c2d0076a-c20d-41f8-9e9a-1a1d028b2b58",
1306
- // "amount": "1234.5678",
1307
- // "time": "2019-08-24T14:15:22Z",
1308
- // "funds_source": "INTERNAL",
1309
- // "currency": "BTC",
1310
- // "fee_amount": "1234.5678",
1311
- // "fee_currency": "BTC",
1312
- // "blockchain_transaction_id": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16",
1313
- // "related_transaction_id": "e298341a-3855-405e-bce3-92db368a3157"
1314
- // }
1315
- //
1316
- // withdraw
1317
- //
1318
- //
1319
- // crypto
1320
- //
1321
- // {
1322
- // "amount": "1234.5678",
1323
- // "fee": "1234.5678",
1324
- // "recipient": "3NacQ7rzZdhfyAtfJ5a11k8jFPdcMP2Bq7",
1325
- // "destination_tag": "",
1326
- // "transaction_id": "d0f8529f-f832-4e6a-9dc5-b8d5797badb2"
1327
- // }
1328
- //
1329
- // fiat
1330
- //
1331
- // {
1332
- // "transaction_id": "54236cd0-4413-11e9-93fb-5fea7e5b5df6"
1333
- // }
1334
- //
1335
- const id = this.safeString(transaction, 'transaction_id');
1336
- const amount = this.safeNumber(transaction, 'amount');
1337
- const timestamp = this.parse8601(this.safeString(transaction, 'time'));
1338
- const currencyId = this.safeString(transaction, 'currency');
1339
- currency = this.safeCurrency(currencyId, currency);
1340
- const status = 'ok'; // the exchange returns cleared transactions only
1341
- const feeCost = this.safeNumber2(transaction, 'fee_amount', 'fee');
1342
- let fee = undefined;
1343
- const addressTo = this.safeString(transaction, 'recipient');
1344
- const tagTo = this.safeString(transaction, 'destination_tag');
1345
- if (feeCost !== undefined) {
1346
- const feeCurrencyId = this.safeString(transaction, 'fee_currency', currencyId);
1347
- const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
1348
- fee = {
1349
- 'cost': feeCost,
1350
- 'currency': feeCurrencyCode,
1351
- };
1352
- }
1353
- return {
1354
- 'info': transaction,
1355
- 'id': id,
1356
- 'currency': currency['code'],
1357
- 'amount': amount,
1358
- 'network': undefined,
1359
- 'address': addressTo,
1360
- 'addressFrom': undefined,
1361
- 'addressTo': addressTo,
1362
- 'tag': tagTo,
1363
- 'tagFrom': undefined,
1364
- 'tagTo': tagTo,
1365
- 'status': status,
1366
- 'type': undefined,
1367
- 'updated': undefined,
1368
- 'txid': this.safeString(transaction, 'blockchain_transaction_id'),
1369
- 'comment': undefined,
1370
- 'internal': undefined,
1371
- 'timestamp': timestamp,
1372
- 'datetime': this.iso8601(timestamp),
1373
- 'fee': fee,
1374
- };
1375
- }
1376
993
  parseOrderStatus(status) {
1377
994
  const statuses = {
1378
995
  'FILLED': 'open',
@@ -1581,6 +1198,7 @@ class onetrading extends onetrading$1 {
1581
1198
  * @method
1582
1199
  * @name onetrading#cancelOrder
1583
1200
  * @description cancels an open order
1201
+ * @see https://docs.onetrading.com/#close-order-by-order-id
1584
1202
  * @param {string} id order id
1585
1203
  * @param {string} symbol not used by bitmex cancelOrder ()
1586
1204
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1609,6 +1227,7 @@ class onetrading extends onetrading$1 {
1609
1227
  * @method
1610
1228
  * @name onetrading#cancelAllOrders
1611
1229
  * @description cancel all open orders
1230
+ * @see https://docs.onetrading.com/#close-all-orders
1612
1231
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1613
1232
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1614
1233
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1632,6 +1251,7 @@ class onetrading extends onetrading$1 {
1632
1251
  * @method
1633
1252
  * @name onetrading#cancelOrders
1634
1253
  * @description cancel multiple orders
1254
+ * @see https://docs.onetrading.com/#close-all-orders
1635
1255
  * @param {string[]} ids order ids
1636
1256
  * @param {string} symbol unified market symbol, default is undefined
1637
1257
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1654,6 +1274,7 @@ class onetrading extends onetrading$1 {
1654
1274
  * @method
1655
1275
  * @name onetrading#fetchOrder
1656
1276
  * @description fetches information on an order made by the user
1277
+ * @see https://docs.onetrading.com/#get-order
1657
1278
  * @param {string} id the order id
1658
1279
  * @param {string} symbol not used by onetrading fetchOrder
1659
1280
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1712,6 +1333,7 @@ class onetrading extends onetrading$1 {
1712
1333
  * @method
1713
1334
  * @name onetrading#fetchOpenOrders
1714
1335
  * @description fetch all unfilled currently open orders
1336
+ * @see https://docs.onetrading.com/#get-orders
1715
1337
  * @param {string} symbol unified market symbol
1716
1338
  * @param {int} [since] the earliest time in ms to fetch open orders for
1717
1339
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -1832,6 +1454,7 @@ class onetrading extends onetrading$1 {
1832
1454
  * @method
1833
1455
  * @name onetrading#fetchClosedOrders
1834
1456
  * @description fetches information on multiple closed orders made by the user
1457
+ * @see https://docs.onetrading.com/#get-orders
1835
1458
  * @param {string} symbol unified market symbol of the market orders were made in
1836
1459
  * @param {int} [since] the earliest time in ms to fetch orders for
1837
1460
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1848,6 +1471,7 @@ class onetrading extends onetrading$1 {
1848
1471
  * @method
1849
1472
  * @name onetrading#fetchOrderTrades
1850
1473
  * @description fetch all the trades made from a single order
1474
+ * @see https://docs.onetrading.com/#trades-for-order
1851
1475
  * @param {string} id order id
1852
1476
  * @param {string} symbol unified market symbol
1853
1477
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -1907,6 +1531,7 @@ class onetrading extends onetrading$1 {
1907
1531
  * @method
1908
1532
  * @name onetrading#fetchMyTrades
1909
1533
  * @description fetch all trades made by the user
1534
+ * @see https://docs.onetrading.com/#all-trades
1910
1535
  * @param {string} symbol unified market symbol
1911
1536
  * @param {int} [since] the earliest time in ms to fetch trades for
1912
1537
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -30,15 +30,17 @@ class bitrue extends bitrue$1 {
30
30
  },
31
31
  'api': {
32
32
  'open': {
33
- 'private': {
34
- 'post': {
35
- 'poseidon/api/v1/listenKey': 1,
36
- },
37
- 'put': {
38
- 'poseidon/api/v1/listenKey/{listenKey}': 1,
39
- },
40
- 'delete': {
41
- 'poseidon/api/v1/listenKey/{listenKey}': 1,
33
+ 'v1': {
34
+ 'private': {
35
+ 'post': {
36
+ 'poseidon/api/v1/listenKey': 1,
37
+ },
38
+ 'put': {
39
+ 'poseidon/api/v1/listenKey/{listenKey}': 1,
40
+ },
41
+ 'delete': {
42
+ 'poseidon/api/v1/listenKey/{listenKey}': 1,
43
+ },
42
44
  },
43
45
  },
44
46
  },
@@ -411,7 +413,7 @@ class bitrue extends bitrue$1 {
411
413
  async authenticate(params = {}) {
412
414
  const listenKey = this.safeValue(this.options, 'listenKey');
413
415
  if (listenKey === undefined) {
414
- const response = await this.openPrivatePostPoseidonApiV1ListenKey(params);
416
+ const response = await this.openV1PrivatePostPoseidonApiV1ListenKey(params);
415
417
  //
416
418
  // {
417
419
  // "msg": "succ",
@@ -436,7 +438,7 @@ class bitrue extends bitrue$1 {
436
438
  'listenKey': listenKey,
437
439
  };
438
440
  try {
439
- await this.openPrivatePutPoseidonApiV1ListenKeyListenKey(this.extend(request, params));
441
+ await this.openV1PrivatePutPoseidonApiV1ListenKeyListenKey(this.extend(request, params));
440
442
  //
441
443
  // ಠ_ಠ
442
444
  // {