ccxt 4.1.3 → 4.1.5

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.
package/js/src/kraken.js CHANGED
@@ -358,6 +358,7 @@ export default class kraken extends Exchange {
358
358
  * @method
359
359
  * @name kraken#fetchMarkets
360
360
  * @description retrieves data on all markets for kraken
361
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTradableAssetPairs
361
362
  * @param {object} [params] extra parameters specific to the exchange api endpoint
362
363
  * @returns {object[]} an array of objects representing market data
363
364
  */
@@ -543,6 +544,7 @@ export default class kraken extends Exchange {
543
544
  * @method
544
545
  * @name kraken#fetchCurrencies
545
546
  * @description fetches all available currencies on an exchange
547
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getAssetInfo
546
548
  * @param {object} [params] extra parameters specific to the kraken api endpoint
547
549
  * @returns {object} an associative dictionary of currencies
548
550
  */
@@ -601,6 +603,7 @@ export default class kraken extends Exchange {
601
603
  * @method
602
604
  * @name kraken#fetchTradingFee
603
605
  * @description fetch the trading fees for a market
606
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeVolume
604
607
  * @param {string} symbol unified market symbol
605
608
  * @param {object} [params] extra parameters specific to the kraken api endpoint
606
609
  * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
@@ -669,6 +672,7 @@ export default class kraken extends Exchange {
669
672
  * @method
670
673
  * @name kraken#fetchOrderBook
671
674
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
675
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getOrderBook
672
676
  * @param {string} symbol unified symbol of the market to fetch the order book for
673
677
  * @param {int} [limit] the maximum amount of order book entries to return
674
678
  * @param {object} [params] extra parameters specific to the kraken api endpoint
@@ -771,6 +775,7 @@ export default class kraken extends Exchange {
771
775
  * @method
772
776
  * @name kraken#fetchTickers
773
777
  * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
778
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTickerInformation
774
779
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
775
780
  * @param {object} [params] extra parameters specific to the kraken api endpoint
776
781
  * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -807,6 +812,7 @@ export default class kraken extends Exchange {
807
812
  * @method
808
813
  * @name kraken#fetchTicker
809
814
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
815
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getTickerInformation
810
816
  * @param {string} symbol unified symbol of the market to fetch the ticker for
811
817
  * @param {object} [params] extra parameters specific to the kraken api endpoint
812
818
  * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -851,6 +857,7 @@ export default class kraken extends Exchange {
851
857
  * @method
852
858
  * @name kraken#fetchOHLCV
853
859
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
860
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getOHLCData
854
861
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
855
862
  * @param {string} timeframe the length of time each candle represents
856
863
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -932,11 +939,7 @@ export default class kraken extends Exchange {
932
939
  else {
933
940
  direction = 'in';
934
941
  }
935
- const time = this.safeNumber(item, 'time');
936
- let timestamp = undefined;
937
- if (time !== undefined) {
938
- timestamp = this.parseToInt(time * 1000);
939
- }
942
+ const timestamp = this.safeIntegerProduct(item, 'time', 1000);
940
943
  return {
941
944
  'info': item,
942
945
  'id': id,
@@ -963,6 +966,7 @@ export default class kraken extends Exchange {
963
966
  * @method
964
967
  * @name kraken#fetchLedger
965
968
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
969
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers
966
970
  * @param {string} code unified currency code, default is undefined
967
971
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
968
972
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
@@ -1141,6 +1145,7 @@ export default class kraken extends Exchange {
1141
1145
  * @method
1142
1146
  * @name kraken#fetchTrades
1143
1147
  * @description get the list of most recent trades for a particular symbol
1148
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getRecentTrades
1144
1149
  * @param {string} symbol unified symbol of the market to fetch trades for
1145
1150
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1146
1151
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -1214,6 +1219,7 @@ export default class kraken extends Exchange {
1214
1219
  * @method
1215
1220
  * @name kraken#fetchBalance
1216
1221
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1222
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getAccountBalance
1217
1223
  * @param {object} [params] extra parameters specific to the kraken api endpoint
1218
1224
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1219
1225
  */
@@ -1457,6 +1463,16 @@ export default class kraken extends Exchange {
1457
1463
  }
1458
1464
  const clientOrderId = this.safeString(order, 'userref');
1459
1465
  const rawTrades = this.safeValue(order, 'trades');
1466
+ const trades = [];
1467
+ for (let i = 0; i < rawTrades.length; i++) {
1468
+ const rawTrade = rawTrades[i];
1469
+ if (typeof rawTrade === 'string') {
1470
+ trades.push(this.safeTrade({ 'id': rawTrade, 'orderId': id, 'symbol': symbol, 'info': {} }));
1471
+ }
1472
+ else {
1473
+ trades.push(rawTrade);
1474
+ }
1475
+ }
1460
1476
  stopPrice = this.safeNumber(order, 'stopprice', stopPrice);
1461
1477
  return this.safeOrder({
1462
1478
  'id': id,
@@ -1480,7 +1496,7 @@ export default class kraken extends Exchange {
1480
1496
  'average': average,
1481
1497
  'remaining': undefined,
1482
1498
  'fee': fee,
1483
- 'trades': rawTrades,
1499
+ 'trades': trades,
1484
1500
  }, market);
1485
1501
  }
1486
1502
  orderRequest(method, symbol, type, request, price = undefined, params = {}) {
@@ -1616,6 +1632,7 @@ export default class kraken extends Exchange {
1616
1632
  * @method
1617
1633
  * @name kraken#fetchOrder
1618
1634
  * @description fetches information on an order made by the user
1635
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo
1619
1636
  * @param {string} symbol not used by kraken fetchOrder
1620
1637
  * @param {object} [params] extra parameters specific to the kraken api endpoint
1621
1638
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
@@ -1685,6 +1702,7 @@ export default class kraken extends Exchange {
1685
1702
  * @method
1686
1703
  * @name kraken#fetchOrderTrades
1687
1704
  * @description fetch all the trades made from a single order
1705
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradesInfo
1688
1706
  * @param {string} id order id
1689
1707
  * @param {string} symbol unified market symbol
1690
1708
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -1784,6 +1802,7 @@ export default class kraken extends Exchange {
1784
1802
  * @method
1785
1803
  * @name kraken#fetchMyTrades
1786
1804
  * @description fetch all trades made by the user
1805
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeHistory
1787
1806
  * @param {string} symbol unified market symbol
1788
1807
  * @param {int} [since] the earliest time in ms to fetch trades for
1789
1808
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1843,6 +1862,7 @@ export default class kraken extends Exchange {
1843
1862
  * @method
1844
1863
  * @name kraken#cancelOrder
1845
1864
  * @description cancels an open order
1865
+ * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
1846
1866
  * @param {string} id order id
1847
1867
  * @param {string} symbol unified symbol of the market the order was made in
1848
1868
  * @param {object} [params] extra parameters specific to the kraken api endpoint
@@ -1873,6 +1893,7 @@ export default class kraken extends Exchange {
1873
1893
  * @method
1874
1894
  * @name kraken#cancelOrders
1875
1895
  * @description cancel multiple orders
1896
+ * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
1876
1897
  * @param {string[]} ids open orders transaction ID (txid) or user reference (userref)
1877
1898
  * @param {string} symbol unified market symbol
1878
1899
  * @param {object} [params] extra parameters specific to the kraken api endpoint
@@ -1897,6 +1918,7 @@ export default class kraken extends Exchange {
1897
1918
  * @method
1898
1919
  * @name kraken#cancelAllOrders
1899
1920
  * @description cancel all open orders
1921
+ * @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
1900
1922
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1901
1923
  * @param {object} [params] extra parameters specific to the kraken api endpoint
1902
1924
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
@@ -1909,6 +1931,7 @@ export default class kraken extends Exchange {
1909
1931
  * @method
1910
1932
  * @name kraken#fetchOpenOrders
1911
1933
  * @description fetch all unfilled currently open orders
1934
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenOrders
1912
1935
  * @param {string} symbol unified market symbol
1913
1936
  * @param {int} [since] the earliest time in ms to fetch open orders for
1914
1937
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -1940,6 +1963,7 @@ export default class kraken extends Exchange {
1940
1963
  * @method
1941
1964
  * @name kraken#fetchClosedOrders
1942
1965
  * @description fetches information on multiple closed orders made by the user
1966
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
1943
1967
  * @param {string} symbol unified market symbol of the market orders were made in
1944
1968
  * @param {int} [since] the earliest time in ms to fetch orders for
1945
1969
  * @param {int} [limit] the maximum number of orde structures to retrieve
@@ -2137,6 +2161,7 @@ export default class kraken extends Exchange {
2137
2161
  * @method
2138
2162
  * @name kraken#fetchDeposits
2139
2163
  * @description fetch all deposits made to an account
2164
+ * @see https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentDeposits
2140
2165
  * @param {string} code unified currency code
2141
2166
  * @param {int} [since] the earliest time in ms to fetch deposits for
2142
2167
  * @param {int} [limit] the maximum number of deposits structures to retrieve
@@ -2173,6 +2198,7 @@ export default class kraken extends Exchange {
2173
2198
  * @method
2174
2199
  * @name kraken#fetchTime
2175
2200
  * @description fetches the current integer timestamp in milliseconds from the exchange server
2201
+ * @see https://docs.kraken.com/rest/#tag/Market-Data/operation/getServerTime
2176
2202
  * @param {object} [params] extra parameters specific to the kraken api endpoint
2177
2203
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
2178
2204
  */
@@ -2195,6 +2221,7 @@ export default class kraken extends Exchange {
2195
2221
  * @method
2196
2222
  * @name kraken#fetchWithdrawals
2197
2223
  * @description fetch all withdrawals made from an account
2224
+ * @see https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentWithdrawals
2198
2225
  * @param {string} code unified currency code
2199
2226
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
2200
2227
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
@@ -2231,6 +2258,7 @@ export default class kraken extends Exchange {
2231
2258
  * @method
2232
2259
  * @name kraken#createDepositAddress
2233
2260
  * @description create a currency deposit address
2261
+ * @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses
2234
2262
  * @param {string} code unified currency code of the currency for the deposit address
2235
2263
  * @param {object} [params] extra parameters specific to the kraken api endpoint
2236
2264
  * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
@@ -2277,6 +2305,7 @@ export default class kraken extends Exchange {
2277
2305
  * @method
2278
2306
  * @name kraken#fetchDepositAddress
2279
2307
  * @description fetch the deposit address for a currency associated with this account
2308
+ * @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositAddresses
2280
2309
  * @param {string} code unified currency code
2281
2310
  * @param {object} [params] extra parameters specific to the kraken api endpoint
2282
2311
  * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
@@ -2358,6 +2387,7 @@ export default class kraken extends Exchange {
2358
2387
  * @method
2359
2388
  * @name kraken#withdraw
2360
2389
  * @description make a withdrawal
2390
+ * @see https://docs.kraken.com/rest/#tag/Funding/operation/withdrawFunds
2361
2391
  * @param {string} code unified currency code
2362
2392
  * @param {float} amount the amount to withdraw
2363
2393
  * @param {string} address the address to withdraw to
@@ -2394,6 +2424,7 @@ export default class kraken extends Exchange {
2394
2424
  * @method
2395
2425
  * @name kraken#fetchPositions
2396
2426
  * @description fetch all open positions
2427
+ * @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenPositions
2397
2428
  * @param {string[]|undefined} symbols not used by kraken fetchPositions ()
2398
2429
  * @param {object} [params] extra parameters specific to the kraken api endpoint
2399
2430
  * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
@@ -2465,6 +2496,7 @@ export default class kraken extends Exchange {
2465
2496
  async transferOut(code, amount, params = {}) {
2466
2497
  /**
2467
2498
  * @description transfer from spot wallet to futures wallet
2499
+ * @see https://docs.kraken.com/rest/#tag/User-Funding/operation/walletTransfer
2468
2500
  * @param {str} code Unified currency code
2469
2501
  * @param {float} amount Size of the transfer
2470
2502
  * @param {dict} [params] Exchange specific parameters
@@ -528,7 +528,7 @@ export default class kucoinfutures extends kucoin {
528
528
  // data: 1637385119302,
529
529
  // }
530
530
  //
531
- return this.safeNumber(response, 'data');
531
+ return this.safeInteger(response, 'data');
532
532
  }
533
533
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
534
534
  /**
package/js/src/kuna.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Int, OrderSide, OrderType } from './base/types.js';
3
3
  /**
4
4
  * @class kuna
5
5
  * @extends Exchange
6
+ * @description Use the public-key as your apiKey
6
7
  */
7
8
  export default class kuna extends Exchange {
8
9
  describe(): any;
package/js/src/kuna.js CHANGED
@@ -9,10 +9,12 @@ import Exchange from './abstract/kuna.js';
9
9
  import { ArgumentsRequired, InsufficientFunds, OrderNotFound, NotSupported } from './base/errors.js';
10
10
  import { TICK_SIZE } from './base/functions/number.js';
11
11
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
12
+ import { sha384 } from './static_dependencies/noble-hashes/sha512.js';
12
13
  // ---------------------------------------------------------------------------
13
14
  /**
14
15
  * @class kuna
15
16
  * @extends Exchange
17
+ * @description Use the public-key as your apiKey
16
18
  */
17
19
  export default class kuna extends Exchange {
18
20
  describe() {
@@ -70,6 +72,7 @@ export default class kuna extends Exchange {
70
72
  'api': {
71
73
  'xreserve': 'https://api.xreserve.fund',
72
74
  'v3': 'https://api.kuna.io',
75
+ 'v4': 'https://api.kuna.io',
73
76
  'public': 'https://kuna.io',
74
77
  'private': 'https://kuna.io', // v2
75
78
  },
@@ -88,6 +91,54 @@ export default class kuna extends Exchange {
88
91
  'delegate-transfer': 1,
89
92
  },
90
93
  },
94
+ 'v4': {
95
+ 'private': {
96
+ 'get': {
97
+ 'me': 1,
98
+ 'getBalance': 1,
99
+ 'active': 1,
100
+ 'order/history': 1,
101
+ 'order/private/{id}/trades': 1,
102
+ 'order/details/{id}?withTrades={withTrades}': 1,
103
+ 'trade/history': 1,
104
+ 'transaction/{hash}': 1,
105
+ 'deposit/preRequest': 1,
106
+ 'deposit/crypto/address': 1,
107
+ 'deposit/crypto/getMerchantAddress': 1,
108
+ 'deposit/history': 1,
109
+ 'deposit/details/{depositId}': 1,
110
+ 'withdraw/preRequest': 1,
111
+ 'withdraw/history': 1,
112
+ 'withdraw/details/{withdrawId}': 1,
113
+ 'kuna-code/{id}': 1,
114
+ 'kuna-code/{code}/check': 1,
115
+ 'kuna-code/issued-by-me': 1,
116
+ 'kuna-code/redeemed-by-me': 1,
117
+ },
118
+ 'post': {
119
+ 'order/create': 1,
120
+ 'order/cancel': 1,
121
+ 'order/cancel/multi': 1,
122
+ 'deposit/crypto/generateAddress': 1,
123
+ 'deposit/crypto/generateMerchantAddress': 1,
124
+ 'withdraw/create': 1,
125
+ 'kuna-code': 1,
126
+ },
127
+ 'put': {
128
+ 'kuna-code/redeem': 1,
129
+ },
130
+ },
131
+ 'public': {
132
+ 'get': {
133
+ 'timestamp': 1,
134
+ 'fees': 1,
135
+ 'currencies?type={type}': 1,
136
+ 'markets/getAll': 1,
137
+ 'markets/tickers?pairs={pairs}': 1,
138
+ 'order/book/{pairs}': 1,
139
+ },
140
+ },
141
+ },
91
142
  'v3': {
92
143
  'public': {
93
144
  'get': {
@@ -295,6 +346,9 @@ export default class kuna extends Exchange {
295
346
  '2002': InsufficientFunds,
296
347
  '2003': OrderNotFound,
297
348
  },
349
+ 'options': {
350
+ // 'account': 'pro' // Only for pro accounts
351
+ },
298
352
  });
299
353
  }
300
354
  async fetchTime(params = {}) {
@@ -851,20 +905,53 @@ export default class kuna extends Exchange {
851
905
  let url = undefined;
852
906
  if (Array.isArray(api)) {
853
907
  const [version, access] = api;
854
- url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
855
- if (access === 'public') {
856
- if (method === 'GET') {
857
- if (Object.keys(params).length) {
858
- url += '?' + this.urlencode(params);
908
+ if (version === 'v3') {
909
+ url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
910
+ if (access === 'public') {
911
+ if (method === 'GET') {
912
+ if (Object.keys(params).length) {
913
+ url += '?' + this.urlencode(params);
914
+ }
915
+ }
916
+ else if ((method === 'POST') || (method === 'PUT')) {
917
+ headers = { 'Content-Type': 'application/json' };
918
+ body = this.json(params);
859
919
  }
860
920
  }
861
- else if ((method === 'POST') || (method === 'PUT')) {
862
- headers = { 'Content-Type': 'application/json' };
863
- body = this.json(params);
921
+ else if (access === 'private') {
922
+ throw new NotSupported(this.id + ' private v3 API is not supported yet');
864
923
  }
865
924
  }
866
- else if (access === 'private') {
867
- throw new NotSupported(this.id + ' private v3 API is not supported yet');
925
+ else if (version === 'v4') {
926
+ const splitPath = path.split('/');
927
+ const splitPathLength = splitPath.length;
928
+ let urlPath = '';
929
+ if ((splitPathLength > 1) && (splitPath[0] !== 'kuna-code')) {
930
+ let pathTail = '';
931
+ for (let i = 1; i < splitPathLength; i++) {
932
+ pathTail += splitPath[i];
933
+ }
934
+ urlPath = '/' + version + '/' + splitPath[0] + '/' + access + '/' + this.implodeParams(pathTail, params);
935
+ }
936
+ else {
937
+ urlPath = '/' + version + '/' + access + '/' + this.implodeParams(path, params);
938
+ }
939
+ url = this.urls['api'][version] + urlPath;
940
+ if (access === 'private') {
941
+ const nonce = this.nonce();
942
+ const auth = urlPath + nonce + this.json(params);
943
+ headers = {
944
+ 'content-type': 'application/json',
945
+ 'accept': 'application/json',
946
+ 'nonce': nonce,
947
+ 'public-key': this.apiKey,
948
+ 'signature': this.hmac(this.encode(auth), this.encode(this.secret), sha384, 'hex'),
949
+ };
950
+ const account = this.safeString(this.options, 'account');
951
+ if (account === 'pro') {
952
+ headers['account'] = 'pro';
953
+ }
954
+ }
868
955
  }
869
956
  }
870
957
  else {
package/js/src/okx.js CHANGED
@@ -1134,6 +1134,7 @@ export default class okx extends Exchange {
1134
1134
  * @method
1135
1135
  * @name okx#fetchStatus
1136
1136
  * @description the latest known information on the availability of the exchange API
1137
+ * @see https://www.okx.com/docs-v5/en/#status-get-status
1137
1138
  * @param {object} [params] extra parameters specific to the okx api endpoint
1138
1139
  * @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
1139
1140
  */
@@ -1182,6 +1183,7 @@ export default class okx extends Exchange {
1182
1183
  * @method
1183
1184
  * @name okx#fetchTime
1184
1185
  * @description fetches the current integer timestamp in milliseconds from the exchange server
1186
+ * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-system-time
1185
1187
  * @param {object} [params] extra parameters specific to the okx api endpoint
1186
1188
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
1187
1189
  */
@@ -1204,6 +1206,7 @@ export default class okx extends Exchange {
1204
1206
  * @method
1205
1207
  * @name okx#fetchAccounts
1206
1208
  * @description fetch all the accounts associated with a profile
1209
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
1207
1210
  * @param {object} [params] extra parameters specific to the okx api endpoint
1208
1211
  * @returns {object} a dictionary of [account structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#account-structure} indexed by the account type
1209
1212
  */
@@ -1628,6 +1631,7 @@ export default class okx extends Exchange {
1628
1631
  * @method
1629
1632
  * @name okx#fetchOrderBook
1630
1633
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
1634
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-order-book
1631
1635
  * @param {string} symbol unified symbol of the market to fetch the order book for
1632
1636
  * @param {int} [limit] the maximum amount of order book entries to return
1633
1637
  * @param {object} [params] extra parameters specific to the okx api endpoint
@@ -1729,6 +1733,7 @@ export default class okx extends Exchange {
1729
1733
  * @method
1730
1734
  * @name okx#fetchTicker
1731
1735
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1736
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
1732
1737
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1733
1738
  * @param {object} [params] extra parameters specific to the okx api endpoint
1734
1739
  * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -1819,6 +1824,7 @@ export default class okx extends Exchange {
1819
1824
  * @method
1820
1825
  * @name okx#fetchTickers
1821
1826
  * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1827
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
1822
1828
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1823
1829
  * @param {object} [params] extra parameters specific to the okx api endpoint
1824
1830
  * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
@@ -2131,6 +2137,7 @@ export default class okx extends Exchange {
2131
2137
  * @method
2132
2138
  * @name okx#fetchFundingRateHistory
2133
2139
  * @description fetches historical funding rate prices
2140
+ * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
2134
2141
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
2135
2142
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
2136
2143
  * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
@@ -2269,6 +2276,7 @@ export default class okx extends Exchange {
2269
2276
  * @method
2270
2277
  * @name okx#fetchTradingFee
2271
2278
  * @description fetch the trading fees for a market
2279
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-fee-rates
2272
2280
  * @param {string} symbol unified market symbol
2273
2281
  * @param {object} [params] extra parameters specific to the okx api endpoint
2274
2282
  * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
@@ -2318,6 +2326,8 @@ export default class okx extends Exchange {
2318
2326
  * @method
2319
2327
  * @name okx#fetchBalance
2320
2328
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
2329
+ * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2330
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2321
2331
  * @param {object} [params] extra parameters specific to the okx api endpoint
2322
2332
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
2323
2333
  */
@@ -2853,6 +2863,7 @@ export default class okx extends Exchange {
2853
2863
  * @method
2854
2864
  * @name okx#cancelOrder
2855
2865
  * @description cancels an open order
2866
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-order
2856
2867
  * @param {string} id order id
2857
2868
  * @param {string} symbol unified symbol of the market the order was made in
2858
2869
  * @param {object} [params] extra parameters specific to the okx api endpoint
@@ -2907,6 +2918,8 @@ export default class okx extends Exchange {
2907
2918
  * @method
2908
2919
  * @name okx#cancelOrders
2909
2920
  * @description cancel multiple orders
2921
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
2922
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-post-cancel-algo-order
2910
2923
  * @param {string[]} ids order ids
2911
2924
  * @param {string} symbol unified market symbol
2912
2925
  * @param {object} [params] extra parameters specific to the okx api endpoint
@@ -3209,6 +3222,8 @@ export default class okx extends Exchange {
3209
3222
  * @method
3210
3223
  * @name okx#fetchOrder
3211
3224
  * @description fetch an order by the id
3225
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-details
3226
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-details
3212
3227
  * @param {string} id the order id
3213
3228
  * @param {string} symbol unified market symbol
3214
3229
  * @param {object} [params] extra and exchange specific parameters
@@ -3355,6 +3370,8 @@ export default class okx extends Exchange {
3355
3370
  * @name okx#fetchOpenOrders
3356
3371
  * @description Fetch orders that are still open
3357
3372
  * @description fetch all unfilled currently open orders
3373
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-list
3374
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-list
3358
3375
  * @param {string} symbol unified market symbol
3359
3376
  * @param {int} [since] the earliest time in ms to fetch open orders for
3360
3377
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -3503,6 +3520,8 @@ export default class okx extends Exchange {
3503
3520
  * @method
3504
3521
  * @name okx#fetchCanceledOrders
3505
3522
  * @description fetches information on multiple canceled orders made by the user
3523
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
3524
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
3506
3525
  * @param {string} symbol unified market symbol of the market orders were made in
3507
3526
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
3508
3527
  * @param {int} [limit] max number of orders to return, default is undefined
@@ -3677,6 +3696,8 @@ export default class okx extends Exchange {
3677
3696
  * @method
3678
3697
  * @name okx#fetchClosedOrders
3679
3698
  * @description fetches information on multiple closed orders made by the user
3699
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
3700
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-algo-trading-get-algo-order-history
3680
3701
  * @param {string} symbol unified market symbol of the market orders were made in
3681
3702
  * @param {int} [since] the earliest time in ms to fetch orders for
3682
3703
  * @param {int} [limit] the maximum number of orde structures to retrieve
@@ -3842,6 +3863,7 @@ export default class okx extends Exchange {
3842
3863
  * @method
3843
3864
  * @name okx#fetchMyTrades
3844
3865
  * @description fetch all trades made by the user
3866
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
3845
3867
  * @param {string} symbol unified market symbol
3846
3868
  * @param {int} [since] the earliest time in ms to fetch trades for
3847
3869
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -3902,6 +3924,7 @@ export default class okx extends Exchange {
3902
3924
  * @method
3903
3925
  * @name okx#fetchOrderTrades
3904
3926
  * @description fetch all the trades made from a single order
3927
+ * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
3905
3928
  * @param {string} id order id
3906
3929
  * @param {string} symbol unified market symbol
3907
3930
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -4220,6 +4243,7 @@ export default class okx extends Exchange {
4220
4243
  * @method
4221
4244
  * @name okx#fetchDepositAddressesByNetwork
4222
4245
  * @description fetch a dictionary of addresses for a currency, indexed by network
4246
+ * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
4223
4247
  * @param {string} code unified currency code of the currency for the deposit address
4224
4248
  * @param {object} [params] extra parameters specific to the okx api endpoint
4225
4249
  * @returns {object} a dictionary of [address structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure} indexed by the network
@@ -4261,6 +4285,7 @@ export default class okx extends Exchange {
4261
4285
  * @method
4262
4286
  * @name okx#fetchDepositAddress
4263
4287
  * @description fetch the deposit address for a currency associated with this account
4288
+ * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
4264
4289
  * @param {string} code unified currency code
4265
4290
  * @param {object} [params] extra parameters specific to the okx api endpoint
4266
4291
  * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
@@ -4301,6 +4326,7 @@ export default class okx extends Exchange {
4301
4326
  * @method
4302
4327
  * @name okx#withdraw
4303
4328
  * @description make a withdrawal
4329
+ * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-withdrawal
4304
4330
  * @param {string} code unified currency code
4305
4331
  * @param {float} amount the amount to withdraw
4306
4332
  * @param {string} address the address to withdraw to
@@ -5245,6 +5271,7 @@ export default class okx extends Exchange {
5245
5271
  * @method
5246
5272
  * @name okx#fetchTransfers
5247
5273
  * @description fetch a history of internal transfers made on an account
5274
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
5248
5275
  * @param {string} code unified currency code of the currency transferred
5249
5276
  * @param {int} [since] the earliest time in ms to fetch transfers for
5250
5277
  * @param {int} [limit] the maximum number of transfers structures to retrieve
@@ -5411,6 +5438,7 @@ export default class okx extends Exchange {
5411
5438
  * @method
5412
5439
  * @name okx#fetchFundingRate
5413
5440
  * @description fetch the current funding rate
5441
+ * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
5414
5442
  * @param {string} symbol unified market symbol
5415
5443
  * @param {object} [params] extra parameters specific to the okx api endpoint
5416
5444
  * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
@@ -5449,6 +5477,7 @@ export default class okx extends Exchange {
5449
5477
  * @method
5450
5478
  * @name okx#fetchFundingHistory
5451
5479
  * @description fetch the history of funding payments paid and received on this account
5480
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
5452
5481
  * @param {string} symbol unified market symbol
5453
5482
  * @param {int} [since] the earliest time in ms to fetch funding history for
5454
5483
  * @param {int} [limit] the maximum number of funding history structures to retrieve
@@ -5669,6 +5698,7 @@ export default class okx extends Exchange {
5669
5698
  * @method
5670
5699
  * @name okx#setPositionMode
5671
5700
  * @description set hedged to true or false for a market
5701
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-position-mode
5672
5702
  * @param {bool} hedged set to true to use long_short_mode, false for net_mode
5673
5703
  * @param {string} symbol not used by okx setPositionMode
5674
5704
  * @param {object} [params] extra parameters specific to the okx api endpoint
@@ -5703,6 +5733,7 @@ export default class okx extends Exchange {
5703
5733
  * @method
5704
5734
  * @name okx#setMarginMode
5705
5735
  * @description set margin mode to 'cross' or 'isolated'
5736
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-leverage
5706
5737
  * @param {string} marginMode 'cross' or 'isolated'
5707
5738
  * @param {string} symbol unified market symbol
5708
5739
  * @param {object} [params] extra parameters specific to the okx api endpoint
@@ -5751,6 +5782,7 @@ export default class okx extends Exchange {
5751
5782
  * @method
5752
5783
  * @name okx#fetchBorrowRates
5753
5784
  * @description fetch the borrow interest rates of all currencies
5785
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
5754
5786
  * @param {object} [params] extra parameters specific to the okx api endpoint
5755
5787
  * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
5756
5788
  */
@@ -5790,6 +5822,7 @@ export default class okx extends Exchange {
5790
5822
  * @method
5791
5823
  * @name okx#fetchBorrowRate
5792
5824
  * @description fetch the rate of interest to borrow a currency for margin trading
5825
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
5793
5826
  * @param {string} code unified currency code
5794
5827
  * @param {object} [params] extra parameters specific to the okx api endpoint
5795
5828
  * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
@@ -5883,6 +5916,7 @@ export default class okx extends Exchange {
5883
5916
  * @method
5884
5917
  * @name okx#fetchBorrowRateHistories
5885
5918
  * @description retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is undefined
5919
+ * @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
5886
5920
  * @param {string[]|undefined} codes list of unified currency codes, default is undefined
5887
5921
  * @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
5888
5922
  * @param {int} [limit] max number of borrow rate prices to return, default is undefined
@@ -5925,6 +5959,7 @@ export default class okx extends Exchange {
5925
5959
  * @method
5926
5960
  * @name okx#fetchBorrowRateHistory
5927
5961
  * @description retrieves a history of a currencies borrow interest rate at specific time slots
5962
+ * @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
5928
5963
  * @param {string} code unified currency code
5929
5964
  * @param {int} [since] timestamp for the earliest borrow rate
5930
5965
  * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} to retrieve
@@ -6016,6 +6051,7 @@ export default class okx extends Exchange {
6016
6051
  * @method
6017
6052
  * @name okx#reduceMargin
6018
6053
  * @description remove margin from a position
6054
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
6019
6055
  * @param {string} symbol unified market symbol
6020
6056
  * @param {float} amount the amount of margin to remove
6021
6057
  * @param {object} [params] extra parameters specific to the okx api endpoint
@@ -6028,6 +6064,7 @@ export default class okx extends Exchange {
6028
6064
  * @method
6029
6065
  * @name okx#addMargin
6030
6066
  * @description add margin
6067
+ * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-increase-decrease-margin
6031
6068
  * @param {string} symbol unified market symbol
6032
6069
  * @param {float} amount amount of margin to add
6033
6070
  * @param {object} [params] extra parameters specific to the okx api endpoint