ccxt 4.1.62 → 4.1.64
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/README.md +4 -4
- package/dist/ccxt.browser.js +678 -201
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +209 -48
- package/dist/cjs/src/binance.js +3 -3
- package/dist/cjs/src/binanceus.js +33 -4
- package/dist/cjs/src/kraken.js +20 -2
- package/dist/cjs/src/krakenfutures.js +7 -7
- package/dist/cjs/src/kucoinfutures.js +34 -13
- package/dist/cjs/src/luno.js +10 -11
- package/dist/cjs/src/phemex.js +130 -91
- package/dist/cjs/src/pro/krakenfutures.js +4 -1
- package/dist/cjs/src/pro/poloniex.js +205 -2
- package/dist/cjs/src/tokocrypto.js +1 -3
- package/dist/cjs/src/wazirx.js +7 -1
- package/doc/manual.rst +1 -1
- package/doc/readme.rst +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +3 -3
- package/js/src/abstract/binancecoinm.d.ts +3 -3
- package/js/src/abstract/binanceus.d.ts +3 -3
- package/js/src/abstract/binanceusdm.d.ts +3 -3
- package/js/src/alpaca.d.ts +4 -0
- package/js/src/alpaca.js +209 -48
- package/js/src/binance.js +3 -3
- package/js/src/binanceus.js +33 -4
- package/js/src/kraken.js +20 -2
- package/js/src/krakenfutures.js +7 -7
- package/js/src/kucoinfutures.js +34 -13
- package/js/src/luno.js +10 -11
- package/js/src/phemex.js +130 -91
- package/js/src/pro/krakenfutures.js +4 -1
- package/js/src/pro/poloniex.d.ts +8 -1
- package/js/src/pro/poloniex.js +206 -3
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/tokocrypto.js +1 -3
- package/js/src/wazirx.js +7 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -173,7 +173,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
173
173
|
|
|
174
174
|
//-----------------------------------------------------------------------------
|
|
175
175
|
// this is updated by vss.js when building
|
|
176
|
-
const version = '4.1.
|
|
176
|
+
const version = '4.1.64';
|
|
177
177
|
Exchange["default"].ccxtVersion = version;
|
|
178
178
|
const exchanges = {
|
|
179
179
|
'ace': ace,
|
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -50,7 +50,7 @@ class alpaca extends alpaca$1 {
|
|
|
50
50
|
'createOrder': true,
|
|
51
51
|
'fetchBalance': true,
|
|
52
52
|
'fetchBidsAsks': false,
|
|
53
|
-
'fetchClosedOrders':
|
|
53
|
+
'fetchClosedOrders': true,
|
|
54
54
|
'fetchCurrencies': false,
|
|
55
55
|
'fetchDepositAddress': false,
|
|
56
56
|
'fetchDepositAddressesByNetwork': false,
|
|
@@ -68,12 +68,12 @@ class alpaca extends alpaca$1 {
|
|
|
68
68
|
'fetchOpenOrders': true,
|
|
69
69
|
'fetchOrder': true,
|
|
70
70
|
'fetchOrderBook': true,
|
|
71
|
-
'fetchOrders':
|
|
71
|
+
'fetchOrders': true,
|
|
72
72
|
'fetchPositions': false,
|
|
73
73
|
'fetchStatus': false,
|
|
74
74
|
'fetchTicker': false,
|
|
75
75
|
'fetchTickers': false,
|
|
76
|
-
'fetchTime':
|
|
76
|
+
'fetchTime': true,
|
|
77
77
|
'fetchTrades': true,
|
|
78
78
|
'fetchTradingFee': false,
|
|
79
79
|
'fetchTradingFees': false,
|
|
@@ -261,42 +261,90 @@ class alpaca extends alpaca$1 {
|
|
|
261
261
|
},
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
+
async fetchTime(params = {}) {
|
|
265
|
+
/**
|
|
266
|
+
* @method
|
|
267
|
+
* @name alpaca#fetchTime
|
|
268
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
269
|
+
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
270
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
271
|
+
*/
|
|
272
|
+
const response = await this.traderPrivateGetV2Clock(params);
|
|
273
|
+
//
|
|
274
|
+
// {
|
|
275
|
+
// timestamp: '2023-11-22T08:07:57.654738097-05:00',
|
|
276
|
+
// is_open: false,
|
|
277
|
+
// next_open: '2023-11-22T09:30:00-05:00',
|
|
278
|
+
// next_close: '2023-11-22T16:00:00-05:00'
|
|
279
|
+
// }
|
|
280
|
+
//
|
|
281
|
+
const timestamp = this.safeString(response, 'timestamp');
|
|
282
|
+
const localTime = timestamp.slice(0, 23);
|
|
283
|
+
const jetlagStrStart = timestamp.length - 6;
|
|
284
|
+
const jetlagStrEnd = timestamp.length - 3;
|
|
285
|
+
const jetlag = timestamp.slice(jetlagStrStart, jetlagStrEnd);
|
|
286
|
+
const iso = this.parse8601(localTime) - this.parseToNumeric(jetlag) * 3600 * 1000;
|
|
287
|
+
return iso;
|
|
288
|
+
}
|
|
264
289
|
async fetchMarkets(params = {}) {
|
|
265
290
|
/**
|
|
266
291
|
* @method
|
|
267
292
|
* @name alpaca#fetchMarkets
|
|
268
293
|
* @description retrieves data on all markets for alpaca
|
|
294
|
+
* @see https://docs.alpaca.markets/reference/get-v2-assets
|
|
269
295
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
270
296
|
* @returns {object[]} an array of objects representing market data
|
|
271
297
|
*/
|
|
272
298
|
const request = {
|
|
273
299
|
'asset_class': 'crypto',
|
|
274
|
-
'
|
|
300
|
+
'status': 'active',
|
|
275
301
|
};
|
|
276
302
|
const assets = await this.traderPrivateGetV2Assets(this.extend(request, params));
|
|
277
303
|
//
|
|
278
|
-
//
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
//
|
|
286
|
-
//
|
|
287
|
-
//
|
|
288
|
-
//
|
|
289
|
-
//
|
|
290
|
-
//
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
//
|
|
304
|
+
// [
|
|
305
|
+
// {
|
|
306
|
+
// "id": "c150e086-1e75-44e6-9c2c-093bb1e93139",
|
|
307
|
+
// "class": "crypto",
|
|
308
|
+
// "exchange": "CRYPTO",
|
|
309
|
+
// "symbol": "BTC/USDT",
|
|
310
|
+
// "name": "Bitcoin / USD Tether",
|
|
311
|
+
// "status": "active",
|
|
312
|
+
// "tradable": true,
|
|
313
|
+
// "marginable": false,
|
|
314
|
+
// "maintenance_margin_requirement": 100,
|
|
315
|
+
// "shortable": false,
|
|
316
|
+
// "easy_to_borrow": false,
|
|
317
|
+
// "fractionable": true,
|
|
318
|
+
// "attributes": [],
|
|
319
|
+
// "min_order_size": "0.000026873",
|
|
320
|
+
// "min_trade_increment": "0.000000001",
|
|
321
|
+
// "price_increment": "1"
|
|
322
|
+
// }
|
|
323
|
+
// ]
|
|
296
324
|
//
|
|
297
325
|
return this.parseMarkets(assets);
|
|
298
326
|
}
|
|
299
327
|
parseMarket(asset) {
|
|
328
|
+
//
|
|
329
|
+
// {
|
|
330
|
+
// "id": "c150e086-1e75-44e6-9c2c-093bb1e93139",
|
|
331
|
+
// "class": "crypto",
|
|
332
|
+
// "exchange": "CRYPTO",
|
|
333
|
+
// "symbol": "BTC/USDT",
|
|
334
|
+
// "name": "Bitcoin / USD Tether",
|
|
335
|
+
// "status": "active",
|
|
336
|
+
// "tradable": true,
|
|
337
|
+
// "marginable": false,
|
|
338
|
+
// "maintenance_margin_requirement": 100,
|
|
339
|
+
// "shortable": false,
|
|
340
|
+
// "easy_to_borrow": false,
|
|
341
|
+
// "fractionable": true,
|
|
342
|
+
// "attributes": [],
|
|
343
|
+
// "min_order_size": "0.000026873",
|
|
344
|
+
// "min_trade_increment": "0.000000001",
|
|
345
|
+
// "price_increment": "1"
|
|
346
|
+
// }
|
|
347
|
+
//
|
|
300
348
|
const marketId = this.safeString(asset, 'symbol');
|
|
301
349
|
const parts = marketId.split('/');
|
|
302
350
|
const baseId = this.safeString(parts, 0);
|
|
@@ -436,21 +484,17 @@ class alpaca extends alpaca$1 {
|
|
|
436
484
|
return this.parseTrades(symbolTrades, market, since, limit);
|
|
437
485
|
}
|
|
438
486
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
// =======
|
|
451
|
-
// @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
452
|
-
// >>>>>>> f68b1b599ee41469fefa424f0efc9b6891549278
|
|
453
|
-
//
|
|
487
|
+
/**
|
|
488
|
+
* @method
|
|
489
|
+
* @name alpaca#fetchOrderBook
|
|
490
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
491
|
+
* @see https://docs.alpaca.markets/reference/cryptolatestorderbooks
|
|
492
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
493
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
494
|
+
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
495
|
+
* @param {string} [params.loc] crypto location, default: us
|
|
496
|
+
* @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
|
|
497
|
+
*/
|
|
454
498
|
await this.loadMarkets();
|
|
455
499
|
const market = this.market(symbol);
|
|
456
500
|
const id = market['id'];
|
|
@@ -625,6 +669,7 @@ class alpaca extends alpaca$1 {
|
|
|
625
669
|
* @method
|
|
626
670
|
* @name alpaca#createOrder
|
|
627
671
|
* @description create a trade order
|
|
672
|
+
* @see https://docs.alpaca.markets/reference/postorder
|
|
628
673
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
629
674
|
* @param {string} type 'market', 'limit' or 'stop_limit'
|
|
630
675
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -713,6 +758,7 @@ class alpaca extends alpaca$1 {
|
|
|
713
758
|
* @method
|
|
714
759
|
* @name alpaca#cancelOrder
|
|
715
760
|
* @description cancels an open order
|
|
761
|
+
* @see https://docs.alpaca.markets/reference/deleteorderbyorderid
|
|
716
762
|
* @param {string} id order id
|
|
717
763
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
718
764
|
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
@@ -730,11 +776,31 @@ class alpaca extends alpaca$1 {
|
|
|
730
776
|
//
|
|
731
777
|
return this.safeValue(response, 'message', {});
|
|
732
778
|
}
|
|
779
|
+
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
780
|
+
/**
|
|
781
|
+
* @method
|
|
782
|
+
* @name alpaca#cancelAllOrders
|
|
783
|
+
* @description cancel all open orders in a market
|
|
784
|
+
* @see https://docs.alpaca.markets/reference/deleteallorders
|
|
785
|
+
* @param {string} symbol alpaca cancelAllOrders cannot setting symbol, it will cancel all open orders
|
|
786
|
+
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
787
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
788
|
+
*/
|
|
789
|
+
await this.loadMarkets();
|
|
790
|
+
const response = await this.traderPrivateDeleteV2Orders(params);
|
|
791
|
+
if (Array.isArray(response)) {
|
|
792
|
+
return this.parseOrders(response, undefined);
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
return response;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
733
798
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
734
799
|
/**
|
|
735
800
|
* @method
|
|
736
801
|
* @name alpaca#fetchOrder
|
|
737
802
|
* @description fetches information on an order made by the user
|
|
803
|
+
* @see https://docs.alpaca.markets/reference/getorderbyorderid
|
|
738
804
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
739
805
|
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
740
806
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -748,24 +814,117 @@ class alpaca extends alpaca$1 {
|
|
|
748
814
|
const market = this.safeMarket(marketId);
|
|
749
815
|
return this.parseOrder(order, market);
|
|
750
816
|
}
|
|
751
|
-
async
|
|
817
|
+
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
752
818
|
/**
|
|
753
819
|
* @method
|
|
754
|
-
* @name alpaca#
|
|
755
|
-
* @description
|
|
756
|
-
* @
|
|
757
|
-
* @param {
|
|
758
|
-
* @param {int} [
|
|
820
|
+
* @name alpaca#fetchOrders
|
|
821
|
+
* @description fetches information on multiple orders made by the user
|
|
822
|
+
* @see https://docs.alpaca.markets/reference/getallorders
|
|
823
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
824
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
825
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
759
826
|
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
827
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
760
828
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
761
829
|
*/
|
|
762
830
|
await this.loadMarkets();
|
|
831
|
+
const request = {
|
|
832
|
+
'status': 'all',
|
|
833
|
+
};
|
|
763
834
|
let market = undefined;
|
|
764
835
|
if (symbol !== undefined) {
|
|
765
836
|
market = this.market(symbol);
|
|
837
|
+
request['symbols'] = market['id'];
|
|
766
838
|
}
|
|
767
|
-
const
|
|
768
|
-
|
|
839
|
+
const until = this.safeInteger(params, 'until');
|
|
840
|
+
if (until !== undefined) {
|
|
841
|
+
params = this.omit(params, 'until');
|
|
842
|
+
request['endTime'] = until;
|
|
843
|
+
}
|
|
844
|
+
if (since !== undefined) {
|
|
845
|
+
request['after'] = since;
|
|
846
|
+
}
|
|
847
|
+
if (limit !== undefined) {
|
|
848
|
+
request['limit'] = limit;
|
|
849
|
+
}
|
|
850
|
+
const response = await this.traderPrivateGetV2Orders(this.extend(request, params));
|
|
851
|
+
//
|
|
852
|
+
// [
|
|
853
|
+
// {
|
|
854
|
+
// "id": "cbaf12d7-69b8-49c0-a31b-b46af35c755c",
|
|
855
|
+
// "client_order_id": "ccxt_b36156ae6fd44d098ac9c179bab33efd",
|
|
856
|
+
// "created_at": "2023-11-17T04:21:42.234579Z",
|
|
857
|
+
// "updated_at": "2023-11-17T04:22:34.442765Z",
|
|
858
|
+
// "submitted_at": "2023-11-17T04:21:42.233357Z",
|
|
859
|
+
// "filled_at": null,
|
|
860
|
+
// "expired_at": null,
|
|
861
|
+
// "canceled_at": "2023-11-17T04:22:34.399019Z",
|
|
862
|
+
// "failed_at": null,
|
|
863
|
+
// "replaced_at": null,
|
|
864
|
+
// "replaced_by": null,
|
|
865
|
+
// "replaces": null,
|
|
866
|
+
// "asset_id": "77c6f47f-0939-4b23-b41e-47b4469c4bc8",
|
|
867
|
+
// "symbol": "LTC/USDT",
|
|
868
|
+
// "asset_class": "crypto",
|
|
869
|
+
// "notional": null,
|
|
870
|
+
// "qty": "0.001",
|
|
871
|
+
// "filled_qty": "0",
|
|
872
|
+
// "filled_avg_price": null,
|
|
873
|
+
// "order_class": "",
|
|
874
|
+
// "order_type": "limit",
|
|
875
|
+
// "type": "limit",
|
|
876
|
+
// "side": "sell",
|
|
877
|
+
// "time_in_force": "gtc",
|
|
878
|
+
// "limit_price": "1000",
|
|
879
|
+
// "stop_price": null,
|
|
880
|
+
// "status": "canceled",
|
|
881
|
+
// "extended_hours": false,
|
|
882
|
+
// "legs": null,
|
|
883
|
+
// "trail_percent": null,
|
|
884
|
+
// "trail_price": null,
|
|
885
|
+
// "hwm": null,
|
|
886
|
+
// "subtag": null,
|
|
887
|
+
// "source": "access_key"
|
|
888
|
+
// }
|
|
889
|
+
// ]
|
|
890
|
+
//
|
|
891
|
+
return this.parseOrders(response, market, since, limit);
|
|
892
|
+
}
|
|
893
|
+
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
894
|
+
/**
|
|
895
|
+
* @method
|
|
896
|
+
* @name alpaca#fetchOpenOrders
|
|
897
|
+
* @description fetch all unfilled currently open orders
|
|
898
|
+
* @see https://docs.alpaca.markets/reference/getallorders
|
|
899
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
900
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
901
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
902
|
+
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
903
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
904
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
905
|
+
*/
|
|
906
|
+
const request = {
|
|
907
|
+
'status': 'open',
|
|
908
|
+
};
|
|
909
|
+
return await this.fetchOrders(symbol, since, limit, this.extend(request, params));
|
|
910
|
+
}
|
|
911
|
+
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
912
|
+
/**
|
|
913
|
+
* @method
|
|
914
|
+
* @name alpaca#fetchClosedOrders
|
|
915
|
+
* @description fetches information on multiple closed orders made by the user
|
|
916
|
+
* @see https://docs.alpaca.markets/reference/getallorders
|
|
917
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
918
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
919
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
920
|
+
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
921
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
922
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
923
|
+
*/
|
|
924
|
+
const request = {
|
|
925
|
+
'status': 'closed',
|
|
926
|
+
};
|
|
927
|
+
return await this.fetchOrders(symbol, since, limit, this.extend(request, params));
|
|
769
928
|
}
|
|
770
929
|
parseOrder(order, market = undefined) {
|
|
771
930
|
//
|
|
@@ -820,9 +979,11 @@ class alpaca extends alpaca$1 {
|
|
|
820
979
|
};
|
|
821
980
|
}
|
|
822
981
|
let orderType = this.safeString(order, 'order_type');
|
|
823
|
-
if (orderType
|
|
824
|
-
|
|
825
|
-
|
|
982
|
+
if (orderType !== undefined) {
|
|
983
|
+
if (orderType.indexOf('limit') >= 0) {
|
|
984
|
+
// might be limit or stop-limit
|
|
985
|
+
orderType = 'limit';
|
|
986
|
+
}
|
|
826
987
|
}
|
|
827
988
|
const datetime = this.safeString(order, 'submitted_at');
|
|
828
989
|
const timestamp = this.parse8601(datetime);
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -967,7 +967,7 @@ class binance extends binance$1 {
|
|
|
967
967
|
'cm/income': 30,
|
|
968
968
|
'um/account': 5,
|
|
969
969
|
'cm/account': 5,
|
|
970
|
-
'
|
|
970
|
+
'repay-futures-switch': 3,
|
|
971
971
|
'um/adlQuantile': 5,
|
|
972
972
|
'cm/adlQuantile': 5,
|
|
973
973
|
},
|
|
@@ -986,8 +986,8 @@ class binance extends binance$1 {
|
|
|
986
986
|
'cm/positionSide/dual': 1,
|
|
987
987
|
'auto-collection': 0.6667,
|
|
988
988
|
'bnb-transfer': 0.6667,
|
|
989
|
-
'
|
|
990
|
-
'
|
|
989
|
+
'repay-futures-switch': 150,
|
|
990
|
+
'repay-futures-negative-balance': 150,
|
|
991
991
|
'listenKey': 1,
|
|
992
992
|
'asset-collection': 3,
|
|
993
993
|
},
|
|
@@ -42,10 +42,39 @@ class binanceus extends binance {
|
|
|
42
42
|
'has': {
|
|
43
43
|
'CORS': undefined,
|
|
44
44
|
'spot': true,
|
|
45
|
-
'margin':
|
|
46
|
-
'swap':
|
|
47
|
-
'
|
|
48
|
-
'
|
|
45
|
+
'margin': false,
|
|
46
|
+
'swap': false,
|
|
47
|
+
'option': false,
|
|
48
|
+
'addMargin': false,
|
|
49
|
+
'borrowMargin': false,
|
|
50
|
+
'createReduceOnlyOrder': false,
|
|
51
|
+
'fetchBorrowInterest': false,
|
|
52
|
+
'fetchBorrowRate': false,
|
|
53
|
+
'fetchBorrowRateHistories': false,
|
|
54
|
+
'fetchBorrowRateHistory': false,
|
|
55
|
+
'fetchBorrowRates': false,
|
|
56
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
57
|
+
'fetchFundingHistory': false,
|
|
58
|
+
'fetchFundingRate': false,
|
|
59
|
+
'fetchFundingRateHistory': false,
|
|
60
|
+
'fetchFundingRates': false,
|
|
61
|
+
'fetchIndexOHLCV': false,
|
|
62
|
+
'fetchIsolatedPositions': false,
|
|
63
|
+
'fetchLeverage': false,
|
|
64
|
+
'fetchLeverageTiers': false,
|
|
65
|
+
'fetchMarketLeverageTiers': false,
|
|
66
|
+
'fetchMarkOHLCV': false,
|
|
67
|
+
'fetchOpenInterestHistory': false,
|
|
68
|
+
'fetchPosition': false,
|
|
69
|
+
'fetchPositions': false,
|
|
70
|
+
'fetchPositionsRisk': false,
|
|
71
|
+
'fetchPremiumIndexOHLCV': false,
|
|
72
|
+
'reduceMargin': false,
|
|
73
|
+
'repayMargin': false,
|
|
74
|
+
'setLeverage': false,
|
|
75
|
+
'setMargin': false,
|
|
76
|
+
'setMarginMode': false,
|
|
77
|
+
'setPositionMode': false,
|
|
49
78
|
},
|
|
50
79
|
});
|
|
51
80
|
}
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -1526,8 +1526,8 @@ class kraken extends kraken$1 {
|
|
|
1526
1526
|
//
|
|
1527
1527
|
// market
|
|
1528
1528
|
// limit (price = limit price)
|
|
1529
|
-
// stop-loss (price = stop loss price)
|
|
1530
|
-
// take-profit (price = take profit price)
|
|
1529
|
+
// stop-loss (price = stop loss trigger price)
|
|
1530
|
+
// take-profit (price = take profit trigger price)
|
|
1531
1531
|
// stop-loss-limit (price = stop loss trigger price, price2 = triggered limit price)
|
|
1532
1532
|
// take-profit-limit (price = take profit trigger price, price2 = triggered limit price)
|
|
1533
1533
|
// settle-position
|
|
@@ -1798,6 +1798,15 @@ class kraken extends kraken$1 {
|
|
|
1798
1798
|
return result;
|
|
1799
1799
|
}
|
|
1800
1800
|
async fetchOrdersByIds(ids, symbol = undefined, params = {}) {
|
|
1801
|
+
/**
|
|
1802
|
+
* @method
|
|
1803
|
+
* @name kraken#fetchOrdersByIds
|
|
1804
|
+
* @description fetch orders by the list of order id
|
|
1805
|
+
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
|
|
1806
|
+
* @param {string[]|undefined} ids list of order id
|
|
1807
|
+
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
1808
|
+
* @returns {object[]} a list of [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1809
|
+
*/
|
|
1801
1810
|
await this.loadMarkets();
|
|
1802
1811
|
const response = await this.privatePostQueryOrders(this.extend({
|
|
1803
1812
|
'trades': true,
|
|
@@ -2293,6 +2302,15 @@ class kraken extends kraken$1 {
|
|
|
2293
2302
|
return await this.fetchDepositAddress(code, this.extend(request, params));
|
|
2294
2303
|
}
|
|
2295
2304
|
async fetchDepositMethods(code, params = {}) {
|
|
2305
|
+
/**
|
|
2306
|
+
* @method
|
|
2307
|
+
* @name kraken#fetchDepositMethods
|
|
2308
|
+
* @description fetch deposit methods for a currency associated with this account
|
|
2309
|
+
* @see https://docs.kraken.com/rest/#tag/Funding/operation/getDepositMethods
|
|
2310
|
+
* @param {string} code unified currency code
|
|
2311
|
+
* @param {object} [params] extra parameters specific to the kraken api endpoint
|
|
2312
|
+
* @returns {object} of deposit methods
|
|
2313
|
+
*/
|
|
2296
2314
|
await this.loadMarkets();
|
|
2297
2315
|
const currency = this.currency(code);
|
|
2298
2316
|
const request = {
|
|
@@ -86,7 +86,7 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
86
86
|
},
|
|
87
87
|
'www': 'https://futures.kraken.com/',
|
|
88
88
|
'doc': [
|
|
89
|
-
'https://
|
|
89
|
+
'https://docs.futures.kraken.com/#introduction',
|
|
90
90
|
],
|
|
91
91
|
'fees': 'https://support.kraken.com/hc/en-us/articles/360022835771-Transaction-fees-and-rebates-for-Kraken-Futures',
|
|
92
92
|
'referral': undefined,
|
|
@@ -2229,26 +2229,26 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
2229
2229
|
*/
|
|
2230
2230
|
await this.loadMarkets();
|
|
2231
2231
|
const currency = this.currency(code);
|
|
2232
|
-
let method = 'privatePostTransfer';
|
|
2233
|
-
const request = {
|
|
2234
|
-
'amount': amount,
|
|
2235
|
-
};
|
|
2236
2232
|
if (fromAccount === 'spot') {
|
|
2237
2233
|
throw new errors.BadRequest(this.id + ' transfer does not yet support transfers from spot');
|
|
2238
2234
|
}
|
|
2235
|
+
const request = {
|
|
2236
|
+
'amount': amount,
|
|
2237
|
+
};
|
|
2238
|
+
let response = undefined;
|
|
2239
2239
|
if (toAccount === 'spot') {
|
|
2240
2240
|
if (this.parseAccount(fromAccount) !== 'cash') {
|
|
2241
2241
|
throw new errors.BadRequest(this.id + ' transfer cannot transfer from ' + fromAccount + ' to ' + toAccount);
|
|
2242
2242
|
}
|
|
2243
|
-
method = 'privatePostWithdrawal';
|
|
2244
2243
|
request['currency'] = currency['id'];
|
|
2244
|
+
response = await this.privatePostWithdrawal(this.extend(request, params));
|
|
2245
2245
|
}
|
|
2246
2246
|
else {
|
|
2247
2247
|
request['fromAccount'] = this.parseAccount(fromAccount);
|
|
2248
2248
|
request['toAccount'] = this.parseAccount(toAccount);
|
|
2249
2249
|
request['unit'] = currency['id'];
|
|
2250
|
+
response = await this.privatePostTransfer(this.extend(request, params));
|
|
2250
2251
|
}
|
|
2251
|
-
const response = await this[method](this.extend(request, params));
|
|
2252
2252
|
//
|
|
2253
2253
|
// {
|
|
2254
2254
|
// "result": "success",
|