ccxt 4.1.60 → 4.1.61
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 +3 -3
- package/dist/ccxt.browser.js +330 -107
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +204 -84
- package/dist/cjs/src/base/Exchange.js +1 -1
- package/dist/cjs/src/binance.js +1 -0
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/coinbase.js +94 -2
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/htx.js +7 -1
- package/dist/cjs/src/kuna.js +4 -3
- package/dist/cjs/src/okx.js +13 -10
- package/dist/cjs/src/p2b.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/alpaca.d.ts +66 -16
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/alpaca.js +204 -84
- package/js/src/base/Exchange.js +1 -1
- package/js/src/binance.js +1 -0
- package/js/src/bitrue.js +1 -1
- package/js/src/bybit.js +1 -1
- package/js/src/coinbase.js +94 -2
- package/js/src/gate.js +1 -1
- package/js/src/htx.js +7 -1
- package/js/src/kuna.js +4 -3
- package/js/src/okx.js +13 -10
- package/js/src/p2b.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/package.json +1 -1
- package/skip-tests.json +2 -0
package/dist/ccxt.browser.js
CHANGED
|
@@ -2526,16 +2526,14 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2526
2526
|
'logo': 'https://user-images.githubusercontent.com/1294454/187234005-b864db3d-f1e3-447a-aaf9-a9fc7b955d07.jpg',
|
|
2527
2527
|
'www': 'https://alpaca.markets',
|
|
2528
2528
|
'api': {
|
|
2529
|
-
'
|
|
2530
|
-
'
|
|
2531
|
-
'
|
|
2532
|
-
'markets': 'https://api.{hostname}/{version}',
|
|
2529
|
+
'broker': 'https://broker-api.{hostname}',
|
|
2530
|
+
'trader': 'https://api.{hostname}',
|
|
2531
|
+
'market': 'https://data.{hostname}',
|
|
2533
2532
|
},
|
|
2534
2533
|
'test': {
|
|
2535
|
-
'
|
|
2536
|
-
'
|
|
2537
|
-
'
|
|
2538
|
-
'markets': 'https://api.{hostname}/{version}',
|
|
2534
|
+
'broker': 'https://broker-api.sandbox.{hostname}',
|
|
2535
|
+
'trader': 'https://paper-api.{hostname}',
|
|
2536
|
+
'market': 'https://data.sandbox.{hostname}',
|
|
2539
2537
|
},
|
|
2540
2538
|
'doc': 'https://alpaca.markets/docs/',
|
|
2541
2539
|
'fees': 'https://alpaca.markets/support/what-are-the-fees-associated-with-crypto-trading/',
|
|
@@ -2589,37 +2587,96 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2589
2587
|
'withdraw': false,
|
|
2590
2588
|
},
|
|
2591
2589
|
'api': {
|
|
2592
|
-
'
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2590
|
+
'broker': {},
|
|
2591
|
+
'trader': {
|
|
2592
|
+
'private': {
|
|
2593
|
+
'get': [
|
|
2594
|
+
'v2/account',
|
|
2595
|
+
'v2/orders',
|
|
2596
|
+
'v2/orders/{order_id}',
|
|
2597
|
+
'v2/positions',
|
|
2598
|
+
'v2/positions/{symbol_or_asset_id}',
|
|
2599
|
+
'v2/account/portfolio/history',
|
|
2600
|
+
'v2/watchlists',
|
|
2601
|
+
'v2/watchlists/{watchlist_id}',
|
|
2602
|
+
'v2/watchlists:by_name',
|
|
2603
|
+
'v2/account/configurations',
|
|
2604
|
+
'v2/account/activities',
|
|
2605
|
+
'v2/account/activities/{activity_type}',
|
|
2606
|
+
'v2/calendar',
|
|
2607
|
+
'v2/clock',
|
|
2608
|
+
'v2/assets',
|
|
2609
|
+
'v2/assets/{symbol_or_asset_id}',
|
|
2610
|
+
'v2/corporate_actions/announcements/{id}',
|
|
2611
|
+
'v2/corporate_actions/announcements',
|
|
2612
|
+
],
|
|
2613
|
+
'post': [
|
|
2614
|
+
'v2/orders',
|
|
2615
|
+
'v2/watchlists',
|
|
2616
|
+
'v2/watchlists/{watchlist_id}',
|
|
2617
|
+
'v2/watchlists:by_name',
|
|
2618
|
+
],
|
|
2619
|
+
'put': [
|
|
2620
|
+
'v2/watchlists/{watchlist_id}',
|
|
2621
|
+
'v2/watchlists:by_name',
|
|
2622
|
+
],
|
|
2623
|
+
'patch': [
|
|
2624
|
+
'v2/orders/{order_id}',
|
|
2625
|
+
'v2/account/configurations',
|
|
2626
|
+
],
|
|
2627
|
+
'delete': [
|
|
2628
|
+
'v2/orders',
|
|
2629
|
+
'v2/orders/{order_id}',
|
|
2630
|
+
'v2/positions',
|
|
2631
|
+
'v2/positions/{symbol_or_asset_id}',
|
|
2632
|
+
'v2/watchlists/{watchlist_id}',
|
|
2633
|
+
'v2/watchlists:by_name',
|
|
2634
|
+
'v2/watchlists/{watchlist_id}/{symbol}',
|
|
2635
|
+
],
|
|
2636
|
+
},
|
|
2613
2637
|
},
|
|
2614
|
-
'
|
|
2615
|
-
'
|
|
2616
|
-
'
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2638
|
+
'market': {
|
|
2639
|
+
'public': {
|
|
2640
|
+
'get': [
|
|
2641
|
+
'v1beta3/crypto/{loc}/bars',
|
|
2642
|
+
'v1beta3/crypto/{loc}/latest/bars',
|
|
2643
|
+
'v1beta3/crypto/{loc}/latest/orderbooks',
|
|
2644
|
+
'v1beta3/crypto/{loc}/latest/quotes',
|
|
2645
|
+
'v1beta3/crypto/{loc}/latest/trades',
|
|
2646
|
+
'v1beta3/crypto/{loc}/quotes',
|
|
2647
|
+
'v1beta3/crypto/{loc}/snapshots',
|
|
2648
|
+
'v1beta3/crypto/{loc}/trades',
|
|
2649
|
+
],
|
|
2650
|
+
},
|
|
2651
|
+
'private': {
|
|
2652
|
+
'get': [
|
|
2653
|
+
'v1beta1/corporate-actions',
|
|
2654
|
+
'v1beta1/forex/latest/rates',
|
|
2655
|
+
'v1beta1/forex/rates',
|
|
2656
|
+
'v1beta1/logos/{symbol}',
|
|
2657
|
+
'v1beta1/news',
|
|
2658
|
+
'v1beta1/screener/stocks/most-actives',
|
|
2659
|
+
'v1beta1/screener/{market_type}/movers',
|
|
2660
|
+
'v2/stocks/auctions',
|
|
2661
|
+
'v2/stocks/bars',
|
|
2662
|
+
'v2/stocks/bars/latest',
|
|
2663
|
+
'v2/stocks/meta/conditions/{ticktype}',
|
|
2664
|
+
'v2/stocks/meta/exchanges',
|
|
2665
|
+
'v2/stocks/quotes',
|
|
2666
|
+
'v2/stocks/quotes/latest',
|
|
2667
|
+
'v2/stocks/snapshots',
|
|
2668
|
+
'v2/stocks/trades',
|
|
2669
|
+
'v2/stocks/trades/latest',
|
|
2670
|
+
'v2/stocks/{symbol}/auctions',
|
|
2671
|
+
'v2/stocks/{symbol}/bars',
|
|
2672
|
+
'v2/stocks/{symbol}/bars/latest',
|
|
2673
|
+
'v2/stocks/{symbol}/quotes',
|
|
2674
|
+
'v2/stocks/{symbol}/quotes/latest',
|
|
2675
|
+
'v2/stocks/{symbol}/snapshot',
|
|
2676
|
+
'v2/stocks/{symbol}/trades',
|
|
2677
|
+
'v2/stocks/{symbol}/trades/latest',
|
|
2678
|
+
],
|
|
2679
|
+
},
|
|
2623
2680
|
},
|
|
2624
2681
|
},
|
|
2625
2682
|
'timeframes': {
|
|
@@ -2678,14 +2735,6 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2678
2735
|
'APCA-PARTNER-ID': 'ccxt',
|
|
2679
2736
|
},
|
|
2680
2737
|
'options': {
|
|
2681
|
-
'fetchTradesMethod': 'cryptoPublicGetCryptoTrades',
|
|
2682
|
-
'fetchOHLCVMethod': 'cryptoPublicGetCryptoBars',
|
|
2683
|
-
'versions': {
|
|
2684
|
-
'public': 'v2',
|
|
2685
|
-
'private': 'v2',
|
|
2686
|
-
'cryptoPublic': 'v1beta2',
|
|
2687
|
-
'markets': 'v2', // crypto beta
|
|
2688
|
-
},
|
|
2689
2738
|
'defaultExchange': 'CBSE',
|
|
2690
2739
|
'exchanges': [
|
|
2691
2740
|
'CBSE',
|
|
@@ -2724,7 +2773,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2724
2773
|
'asset_class': 'crypto',
|
|
2725
2774
|
'tradeable': true,
|
|
2726
2775
|
};
|
|
2727
|
-
const assets = await this.
|
|
2776
|
+
const assets = await this.traderPrivateGetV2Assets(this.extend(request, params));
|
|
2728
2777
|
//
|
|
2729
2778
|
// [
|
|
2730
2779
|
// {
|
|
@@ -2815,26 +2864,42 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2815
2864
|
* @method
|
|
2816
2865
|
* @name alpaca#fetchTrades
|
|
2817
2866
|
* @description get the list of most recent trades for a particular symbol
|
|
2867
|
+
* @see https://docs.alpaca.markets/reference/cryptotrades
|
|
2868
|
+
* @see https://docs.alpaca.markets/reference/cryptolatesttrades
|
|
2818
2869
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
2819
2870
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2820
2871
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2821
2872
|
* @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
2873
|
+
* @param {string} [params.loc] crypto location, default: us
|
|
2874
|
+
* @param {string} [params.method] method, default: marketPublicGetV1beta3CryptoLocTrades
|
|
2822
2875
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2823
2876
|
*/
|
|
2824
2877
|
await this.loadMarkets();
|
|
2825
2878
|
const market = this.market(symbol);
|
|
2826
|
-
const
|
|
2879
|
+
const marketId = market['id'];
|
|
2880
|
+
const loc = this.safeString(params, 'loc', 'us');
|
|
2881
|
+
const method = this.safeString(params, 'method', 'marketPublicGetV1beta3CryptoLocTrades');
|
|
2827
2882
|
const request = {
|
|
2828
|
-
'symbols':
|
|
2883
|
+
'symbols': marketId,
|
|
2884
|
+
'loc': loc,
|
|
2829
2885
|
};
|
|
2830
|
-
|
|
2831
|
-
|
|
2886
|
+
params = this.omit(params, ['loc', 'method']);
|
|
2887
|
+
let response = undefined;
|
|
2888
|
+
if (method === 'marketPublicGetV1beta3CryptoLocTrades') {
|
|
2889
|
+
if (since !== undefined) {
|
|
2890
|
+
request['start'] = this.iso8601(since);
|
|
2891
|
+
}
|
|
2892
|
+
if (limit !== undefined) {
|
|
2893
|
+
request['limit'] = limit;
|
|
2894
|
+
}
|
|
2895
|
+
response = await this.marketPublicGetV1beta3CryptoLocTrades(this.extend(request, params));
|
|
2832
2896
|
}
|
|
2833
|
-
if (
|
|
2834
|
-
|
|
2897
|
+
else if (method === 'marketPublicGetV1beta3CryptoLocLatestTrades') {
|
|
2898
|
+
response = await this.marketPublicGetV1beta3CryptoLocLatestTrades(this.extend(request, params));
|
|
2899
|
+
}
|
|
2900
|
+
else {
|
|
2901
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchTrades() does not support ' + method + ', marketPublicGetV1beta3CryptoLocTrades and marketPublicGetV1beta3CryptoLocLatestTrades are supported');
|
|
2835
2902
|
}
|
|
2836
|
-
const method = this.safeString(this.options, 'fetchTradesMethod', 'cryptoPublicGetCryptoTrades');
|
|
2837
|
-
const response = await this[method](this.extend(request, params));
|
|
2838
2903
|
//
|
|
2839
2904
|
// {
|
|
2840
2905
|
// "next_page_token":null,
|
|
@@ -2851,27 +2916,50 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2851
2916
|
// }
|
|
2852
2917
|
// }
|
|
2853
2918
|
//
|
|
2919
|
+
// {
|
|
2920
|
+
// "trades":{
|
|
2921
|
+
// "BTC/USD":{
|
|
2922
|
+
// "i":36440704,
|
|
2923
|
+
// "p":22625,
|
|
2924
|
+
// "s":0.0001,
|
|
2925
|
+
// "t":"2022-07-21T11:47:31.073391Z",
|
|
2926
|
+
// "tks":"B"
|
|
2927
|
+
// }
|
|
2928
|
+
// }
|
|
2929
|
+
// }
|
|
2930
|
+
//
|
|
2854
2931
|
const trades = this.safeValue(response, 'trades', {});
|
|
2855
|
-
|
|
2932
|
+
let symbolTrades = this.safeValue(trades, marketId, {});
|
|
2933
|
+
if (!Array.isArray(symbolTrades)) {
|
|
2934
|
+
symbolTrades = [symbolTrades];
|
|
2935
|
+
}
|
|
2856
2936
|
return this.parseTrades(symbolTrades, market, since, limit);
|
|
2857
2937
|
}
|
|
2858
2938
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2939
|
+
//
|
|
2940
|
+
// @method
|
|
2941
|
+
// @name alpaca#fetchOrderBook
|
|
2942
|
+
// @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2943
|
+
// @see https://docs.alpaca.markets/reference/cryptolatestorderbooks
|
|
2944
|
+
// @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2945
|
+
// @param {int} [limit] the maximum amount of order book entries to return
|
|
2946
|
+
// @param {object} [params] extra parameters specific to the alpaca api endpoint
|
|
2947
|
+
// <<<<<<< HEAD
|
|
2948
|
+
// @param {string} [params.loc] crypto location, default: us
|
|
2949
|
+
// @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
|
|
2950
|
+
// =======
|
|
2951
|
+
// @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2952
|
+
// >>>>>>> f68b1b599ee41469fefa424f0efc9b6891549278
|
|
2953
|
+
//
|
|
2868
2954
|
await this.loadMarkets();
|
|
2869
2955
|
const market = this.market(symbol);
|
|
2870
2956
|
const id = market['id'];
|
|
2957
|
+
const loc = this.safeString(params, 'loc', 'us');
|
|
2871
2958
|
const request = {
|
|
2872
2959
|
'symbols': id,
|
|
2960
|
+
'loc': loc,
|
|
2873
2961
|
};
|
|
2874
|
-
const response = await this.
|
|
2962
|
+
const response = await this.marketPublicGetV1beta3CryptoLocLatestOrderbooks(this.extend(request, params));
|
|
2875
2963
|
//
|
|
2876
2964
|
// {
|
|
2877
2965
|
// "orderbooks":{
|
|
@@ -2919,27 +3007,44 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2919
3007
|
* @method
|
|
2920
3008
|
* @name alpaca#fetchOHLCV
|
|
2921
3009
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
3010
|
+
* @see https://docs.alpaca.markets/reference/cryptobars
|
|
3011
|
+
* @see https://docs.alpaca.markets/reference/cryptolatestbars
|
|
2922
3012
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
2923
3013
|
* @param {string} timeframe the length of time each candle represents
|
|
2924
3014
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
2925
3015
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
2926
3016
|
* @param {object} [params] extra parameters specific to the alpha api endpoint
|
|
3017
|
+
* @param {string} [params.loc] crypto location, default: us
|
|
3018
|
+
* @param {string} [params.method] method, default: marketPublicGetV1beta3CryptoLocBars
|
|
2927
3019
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2928
3020
|
*/
|
|
2929
3021
|
await this.loadMarkets();
|
|
2930
3022
|
const market = this.market(symbol);
|
|
3023
|
+
const marketId = market['id'];
|
|
3024
|
+
const loc = this.safeString(params, 'loc', 'us');
|
|
3025
|
+
const method = this.safeString(params, 'method', 'marketPublicGetV1beta3CryptoLocBars');
|
|
2931
3026
|
const request = {
|
|
2932
|
-
'symbols':
|
|
2933
|
-
'
|
|
3027
|
+
'symbols': marketId,
|
|
3028
|
+
'loc': loc,
|
|
2934
3029
|
};
|
|
2935
|
-
|
|
2936
|
-
|
|
3030
|
+
params = this.omit(params, ['loc', 'method']);
|
|
3031
|
+
let response = undefined;
|
|
3032
|
+
if (method === 'marketPublicGetV1beta3CryptoLocBars') {
|
|
3033
|
+
if (limit !== undefined) {
|
|
3034
|
+
request['limit'] = limit;
|
|
3035
|
+
}
|
|
3036
|
+
if (since !== undefined) {
|
|
3037
|
+
request['start'] = this.yyyymmdd(since);
|
|
3038
|
+
}
|
|
3039
|
+
request['timeframe'] = this.safeString(this.timeframes, timeframe, timeframe);
|
|
3040
|
+
response = await this.marketPublicGetV1beta3CryptoLocBars(this.extend(request, params));
|
|
2937
3041
|
}
|
|
2938
|
-
if (
|
|
2939
|
-
|
|
3042
|
+
else if (method === 'marketPublicGetV1beta3CryptoLocLatestBars') {
|
|
3043
|
+
response = await this.marketPublicGetV1beta3CryptoLocLatestBars(this.extend(request, params));
|
|
3044
|
+
}
|
|
3045
|
+
else {
|
|
3046
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchOHLCV() does not support ' + method + ', marketPublicGetV1beta3CryptoLocBars and marketPublicGetV1beta3CryptoLocLatestBars are supported');
|
|
2940
3047
|
}
|
|
2941
|
-
const method = this.safeString(this.options, 'fetchOHLCVMethod', 'cryptoPublicGetCryptoBars');
|
|
2942
|
-
const response = await this[method](this.extend(request, params));
|
|
2943
3048
|
//
|
|
2944
3049
|
// {
|
|
2945
3050
|
// "bars":{
|
|
@@ -2969,8 +3074,26 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2969
3074
|
// "next_page_token":"QlRDL1VTRHxNfDIwMjItMDctMjFUMDU6MDE6MDAuMDAwMDAwMDAwWg=="
|
|
2970
3075
|
// }
|
|
2971
3076
|
//
|
|
3077
|
+
// {
|
|
3078
|
+
// "bars":{
|
|
3079
|
+
// "BTC/USD":{
|
|
3080
|
+
// "c":22887,
|
|
3081
|
+
// "h":22888,
|
|
3082
|
+
// "l":22873,
|
|
3083
|
+
// "n":11,
|
|
3084
|
+
// "o":22883,
|
|
3085
|
+
// "t":"2022-07-21T05:00:00Z",
|
|
3086
|
+
// "v":1.1138,
|
|
3087
|
+
// "vw":22883.0155324116
|
|
3088
|
+
// }
|
|
3089
|
+
// }
|
|
3090
|
+
// }
|
|
3091
|
+
//
|
|
2972
3092
|
const bars = this.safeValue(response, 'bars', {});
|
|
2973
|
-
|
|
3093
|
+
let ohlcvs = this.safeValue(bars, marketId, {});
|
|
3094
|
+
if (!Array.isArray(ohlcvs)) {
|
|
3095
|
+
ohlcvs = [ohlcvs];
|
|
3096
|
+
}
|
|
2974
3097
|
return this.parseOHLCVs(ohlcvs, market, timeframe, since, limit);
|
|
2975
3098
|
}
|
|
2976
3099
|
parseOHLCV(ohlcv, market = undefined) {
|
|
@@ -3046,7 +3169,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
3046
3169
|
const clientOrderId = this.safeString(params, 'clientOrderId', defaultClientId);
|
|
3047
3170
|
request['client_order_id'] = clientOrderId;
|
|
3048
3171
|
params = this.omit(params, ['clientOrderId']);
|
|
3049
|
-
const order = await this.
|
|
3172
|
+
const order = await this.traderPrivatePostV2Orders(this.extend(request, params));
|
|
3050
3173
|
//
|
|
3051
3174
|
// {
|
|
3052
3175
|
// "id": "61e69015-8549-4bfd-b9c3-01e75843f47d",
|
|
@@ -3098,7 +3221,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
3098
3221
|
const request = {
|
|
3099
3222
|
'order_id': id,
|
|
3100
3223
|
};
|
|
3101
|
-
const response = await this.
|
|
3224
|
+
const response = await this.traderPrivateDeleteV2OrdersOrderId(this.extend(request, params));
|
|
3102
3225
|
//
|
|
3103
3226
|
// {
|
|
3104
3227
|
// "code": 40410000,
|
|
@@ -3120,7 +3243,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
3120
3243
|
const request = {
|
|
3121
3244
|
'order_id': id,
|
|
3122
3245
|
};
|
|
3123
|
-
const order = await this.
|
|
3246
|
+
const order = await this.traderPrivateGetV2OrdersOrderId(this.extend(request, params));
|
|
3124
3247
|
const marketId = this.safeString(order, 'symbol');
|
|
3125
3248
|
const market = this.safeMarket(marketId);
|
|
3126
3249
|
return this.parseOrder(order, market);
|
|
@@ -3141,7 +3264,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
3141
3264
|
if (symbol !== undefined) {
|
|
3142
3265
|
market = this.market(symbol);
|
|
3143
3266
|
}
|
|
3144
|
-
const orders = await this.
|
|
3267
|
+
const orders = await this.traderPrivateGetV2Orders(params);
|
|
3145
3268
|
return this.parseOrders(orders, market, since, limit);
|
|
3146
3269
|
}
|
|
3147
3270
|
parseOrder(order, market = undefined) {
|
|
@@ -3287,13 +3410,10 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
3287
3410
|
}, market);
|
|
3288
3411
|
}
|
|
3289
3412
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
3290
|
-
const versions = this.safeValue(this.options, 'versions');
|
|
3291
|
-
const version = this.safeString(versions, api);
|
|
3292
3413
|
let endpoint = '/' + this.implodeParams(path, params);
|
|
3293
|
-
let url = this.
|
|
3294
|
-
url = this.implodeHostname(url);
|
|
3414
|
+
let url = this.implodeHostname(this.urls['api'][api[0]]);
|
|
3295
3415
|
headers = (headers !== undefined) ? headers : {};
|
|
3296
|
-
if (api === 'private') {
|
|
3416
|
+
if (api[1] === 'private') {
|
|
3297
3417
|
headers['APCA-API-KEY-ID'] = this.apiKey;
|
|
3298
3418
|
headers['APCA-API-SECRET-KEY'] = this.secret;
|
|
3299
3419
|
}
|
|
@@ -9733,7 +9853,7 @@ class Exchange {
|
|
|
9733
9853
|
/**
|
|
9734
9854
|
* @method
|
|
9735
9855
|
* @name exchange#fetchPositionsForSymbol
|
|
9736
|
-
* @description fetches all open positions for specific symbol, unlike fetchPositions (which is designed to work with multiple symbols) so this method might be preffered for
|
|
9856
|
+
* @description fetches all open positions for specific symbol, unlike fetchPositions (which is designed to work with multiple symbols) so this method might be preffered for one-market position, because of less rate-limit consumption and speed
|
|
9737
9857
|
* @param {string} symbol unified market symbol
|
|
9738
9858
|
* @param {object} params extra parameters specific to the endpoint
|
|
9739
9859
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure} with maximum 3 items - possible one position for "one-way" mode, and possible two positions (long & short) for "two-way" (a.k.a. hedge) mode
|
|
@@ -16739,6 +16859,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
16739
16859
|
// https://binance-docs.github.io/apidocs/spot/en/#withdraw-sapi
|
|
16740
16860
|
'capital/config/getall': 1,
|
|
16741
16861
|
'capital/deposit/address': 1,
|
|
16862
|
+
'capital/deposit/address/list': 1,
|
|
16742
16863
|
'capital/deposit/hisrec': 0.1,
|
|
16743
16864
|
'capital/deposit/subAddress': 0.1,
|
|
16744
16865
|
'capital/deposit/subHisrec': 0.1,
|
|
@@ -60439,7 +60560,7 @@ class bitrue extends _abstract_bitrue_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
60439
60560
|
this.checkAddress(address);
|
|
60440
60561
|
await this.loadMarkets();
|
|
60441
60562
|
const currency = this.currency(code);
|
|
60442
|
-
let chainName = this.
|
|
60563
|
+
let chainName = this.safeString2(params, 'network', 'chainName');
|
|
60443
60564
|
if (chainName === undefined) {
|
|
60444
60565
|
const networks = this.safeValue(currency, 'networks', {});
|
|
60445
60566
|
const optionsNetworks = this.safeValue(this.options, 'networks', {});
|
|
@@ -79914,7 +80035,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
79914
80035
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
79915
80036
|
*/
|
|
79916
80037
|
let symbol = undefined;
|
|
79917
|
-
if (Array.isArray(symbols)) {
|
|
80038
|
+
if ((symbols !== undefined) && Array.isArray(symbols)) {
|
|
79918
80039
|
const symbolsLength = symbols.length;
|
|
79919
80040
|
if (symbolsLength > 1) {
|
|
79920
80041
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchPositions() does not accept an array with more than one symbol');
|
|
@@ -83713,12 +83834,17 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
83713
83834
|
'fiat',
|
|
83714
83835
|
// 'vault',
|
|
83715
83836
|
],
|
|
83837
|
+
'v3Accounts': [
|
|
83838
|
+
'ACCOUNT_TYPE_CRYPTO',
|
|
83839
|
+
'ACCOUNT_TYPE_FIAT',
|
|
83840
|
+
],
|
|
83716
83841
|
'createMarketBuyOrderRequiresPrice': true,
|
|
83717
83842
|
'advanced': true,
|
|
83718
83843
|
'fetchMarkets': 'fetchMarketsV3',
|
|
83719
83844
|
'fetchTicker': 'fetchTickerV3',
|
|
83720
83845
|
'fetchTickers': 'fetchTickersV3',
|
|
83721
83846
|
'fetchAccounts': 'fetchAccountsV3',
|
|
83847
|
+
'fetchBalance': 'v2PrivateGetAccounts',
|
|
83722
83848
|
'user_native_currency': 'USD', // needed to get fees for v3
|
|
83723
83849
|
},
|
|
83724
83850
|
});
|
|
@@ -83728,6 +83854,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
83728
83854
|
* @method
|
|
83729
83855
|
* @name coinbase#fetchTime
|
|
83730
83856
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
83857
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-time#http-request
|
|
83731
83858
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
83732
83859
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
83733
83860
|
*/
|
|
@@ -83748,6 +83875,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
83748
83875
|
* @method
|
|
83749
83876
|
* @name coinbase#fetchAccounts
|
|
83750
83877
|
* @description fetch all the accounts associated with a profile
|
|
83878
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getaccounts
|
|
83879
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-accounts#list-accounts
|
|
83751
83880
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
83752
83881
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
83753
83882
|
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
@@ -83951,6 +84080,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
83951
84080
|
* @method
|
|
83952
84081
|
* @name coinbase#createDepositAddress
|
|
83953
84082
|
* @description create a currency deposit address
|
|
84083
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-addresses#create-address
|
|
83954
84084
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
83955
84085
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
83956
84086
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -84025,6 +84155,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84025
84155
|
* @method
|
|
84026
84156
|
* @name coinbase#fetchMySells
|
|
84027
84157
|
* @description fetch sells
|
|
84158
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-sells#list-sells
|
|
84028
84159
|
* @param {string} symbol not used by coinbase fetchMySells ()
|
|
84029
84160
|
* @param {int} [since] timestamp in ms of the earliest sell, default is undefined
|
|
84030
84161
|
* @param {int} [limit] max number of sells to return, default is undefined
|
|
@@ -84043,6 +84174,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84043
84174
|
* @method
|
|
84044
84175
|
* @name coinbase#fetchMyBuys
|
|
84045
84176
|
* @description fetch buys
|
|
84177
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-buys#list-buys
|
|
84046
84178
|
* @param {string} symbol not used by coinbase fetchMyBuys ()
|
|
84047
84179
|
* @param {int} [since] timestamp in ms of the earliest buy, default is undefined
|
|
84048
84180
|
* @param {int} [limit] max number of buys to return, default is undefined
|
|
@@ -84068,6 +84200,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84068
84200
|
* @method
|
|
84069
84201
|
* @name coinbase#fetchWithdrawals
|
|
84070
84202
|
* @description fetch all withdrawals made from an account
|
|
84203
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-withdrawals#list-withdrawals
|
|
84071
84204
|
* @param {string} code unified currency code
|
|
84072
84205
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
84073
84206
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -84082,6 +84215,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84082
84215
|
* @method
|
|
84083
84216
|
* @name coinbase#fetchDeposits
|
|
84084
84217
|
* @description fetch all deposits made to an account
|
|
84218
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-deposits#list-deposits
|
|
84085
84219
|
* @param {string} code unified currency code
|
|
84086
84220
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
84087
84221
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -84340,6 +84474,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84340
84474
|
* @method
|
|
84341
84475
|
* @name coinbase#fetchMarkets
|
|
84342
84476
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getproducts
|
|
84477
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-fiat-currencies
|
|
84478
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
|
|
84343
84479
|
* @description retrieves data on all markets for coinbase
|
|
84344
84480
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
84345
84481
|
* @returns {object[]} an array of objects representing market data
|
|
@@ -84563,6 +84699,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84563
84699
|
* @method
|
|
84564
84700
|
* @name coinbase#fetchCurrencies
|
|
84565
84701
|
* @description fetches all available currencies on an exchange
|
|
84702
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-currencies#get-fiat-currencies
|
|
84703
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
|
|
84566
84704
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
84567
84705
|
* @returns {object} an associative dictionary of currencies
|
|
84568
84706
|
*/
|
|
@@ -84638,6 +84776,8 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84638
84776
|
* @method
|
|
84639
84777
|
* @name coinbase#fetchTickers
|
|
84640
84778
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
84779
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getproducts
|
|
84780
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-exchange-rates#get-exchange-rates
|
|
84641
84781
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
84642
84782
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
84643
84783
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -84739,6 +84879,10 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84739
84879
|
* @method
|
|
84740
84880
|
* @name coinbase#fetchTicker
|
|
84741
84881
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
84882
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getmarkettrades
|
|
84883
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-spot-price
|
|
84884
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-buy-price
|
|
84885
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-sell-price
|
|
84742
84886
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
84743
84887
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
84744
84888
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -84929,8 +85073,9 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84929
85073
|
}, market);
|
|
84930
85074
|
}
|
|
84931
85075
|
parseBalance(response, params = {}) {
|
|
84932
|
-
const balances = this.
|
|
85076
|
+
const balances = this.safeValue2(response, 'data', 'accounts', []);
|
|
84933
85077
|
const accounts = this.safeValue(params, 'type', this.options['accounts']);
|
|
85078
|
+
const v3Accounts = this.safeValue(params, 'type', this.options['v3Accounts']);
|
|
84934
85079
|
const result = { 'info': response };
|
|
84935
85080
|
for (let b = 0; b < balances.length; b++) {
|
|
84936
85081
|
const balance = balances[b];
|
|
@@ -84955,6 +85100,30 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84955
85100
|
result[code] = account;
|
|
84956
85101
|
}
|
|
84957
85102
|
}
|
|
85103
|
+
else if (this.inArray(type, v3Accounts)) {
|
|
85104
|
+
const available = this.safeValue(balance, 'available_balance');
|
|
85105
|
+
const hold = this.safeValue(balance, 'hold');
|
|
85106
|
+
if (available !== undefined && hold !== undefined) {
|
|
85107
|
+
const currencyId = this.safeString(available, 'currency');
|
|
85108
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
85109
|
+
const used = this.safeString(hold, 'value');
|
|
85110
|
+
const free = this.safeString(available, 'value');
|
|
85111
|
+
const total = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(used, free);
|
|
85112
|
+
let account = this.safeValue(result, code);
|
|
85113
|
+
if (account === undefined) {
|
|
85114
|
+
account = this.account();
|
|
85115
|
+
account['free'] = free;
|
|
85116
|
+
account['used'] = used;
|
|
85117
|
+
account['total'] = total;
|
|
85118
|
+
}
|
|
85119
|
+
else {
|
|
85120
|
+
account['free'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(account['free'], free);
|
|
85121
|
+
account['used'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(account['used'], used);
|
|
85122
|
+
account['total'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(account['total'], total);
|
|
85123
|
+
}
|
|
85124
|
+
result[code] = account;
|
|
85125
|
+
}
|
|
85126
|
+
}
|
|
84958
85127
|
}
|
|
84959
85128
|
return this.safeBalance(result);
|
|
84960
85129
|
}
|
|
@@ -84963,15 +85132,28 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
84963
85132
|
* @method
|
|
84964
85133
|
* @name coinbase#fetchBalance
|
|
84965
85134
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
85135
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/reference/retailbrokerageapi_getaccounts
|
|
85136
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-accounts#list-accounts
|
|
84966
85137
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
85138
|
+
* @param {boolean} [params.v3] default false, set true to use v3 api endpoint
|
|
84967
85139
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
84968
85140
|
*/
|
|
84969
85141
|
await this.loadMarkets();
|
|
84970
85142
|
const request = {
|
|
84971
85143
|
'limit': 100,
|
|
84972
85144
|
};
|
|
84973
|
-
|
|
85145
|
+
let response = undefined;
|
|
85146
|
+
const isV3 = this.safeValue(params, 'v3', false);
|
|
85147
|
+
params = this.omit(params, 'v3');
|
|
85148
|
+
const method = this.safeString(this.options, 'fetchBalance', 'v3PrivateGetBrokerageAccounts');
|
|
85149
|
+
if ((isV3) || (method === 'v3PrivateGetBrokerageAccounts')) {
|
|
85150
|
+
response = await this.v3PrivateGetBrokerageAccounts(this.extend(request, params));
|
|
85151
|
+
}
|
|
85152
|
+
else {
|
|
85153
|
+
response = await this.v2PrivateGetAccounts(this.extend(request, params));
|
|
85154
|
+
}
|
|
84974
85155
|
//
|
|
85156
|
+
// v2PrivateGetAccounts
|
|
84975
85157
|
// {
|
|
84976
85158
|
// "pagination":{
|
|
84977
85159
|
// "ending_before":null,
|
|
@@ -85011,6 +85193,36 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
85011
85193
|
// ]
|
|
85012
85194
|
// }
|
|
85013
85195
|
//
|
|
85196
|
+
// v3PrivateGetBrokerageAccounts
|
|
85197
|
+
// {
|
|
85198
|
+
// "accounts": [
|
|
85199
|
+
// {
|
|
85200
|
+
// "uuid": "11111111-1111-1111-1111-111111111111",
|
|
85201
|
+
// "name": "USDC Wallet",
|
|
85202
|
+
// "currency": "USDC",
|
|
85203
|
+
// "available_balance": {
|
|
85204
|
+
// "value": "0.0000000000000000",
|
|
85205
|
+
// "currency": "USDC"
|
|
85206
|
+
// },
|
|
85207
|
+
// "default": true,
|
|
85208
|
+
// "active": true,
|
|
85209
|
+
// "created_at": "2023-01-04T06:20:06.456Z",
|
|
85210
|
+
// "updated_at": "2023-01-04T06:20:07.181Z",
|
|
85211
|
+
// "deleted_at": null,
|
|
85212
|
+
// "type": "ACCOUNT_TYPE_CRYPTO",
|
|
85213
|
+
// "ready": false,
|
|
85214
|
+
// "hold": {
|
|
85215
|
+
// "value": "0.0000000000000000",
|
|
85216
|
+
// "currency": "USDC"
|
|
85217
|
+
// }
|
|
85218
|
+
// },
|
|
85219
|
+
// ...
|
|
85220
|
+
// ],
|
|
85221
|
+
// "has_next": false,
|
|
85222
|
+
// "cursor": "",
|
|
85223
|
+
// "size": 9
|
|
85224
|
+
// }
|
|
85225
|
+
//
|
|
85014
85226
|
return this.parseBalance(response, params);
|
|
85015
85227
|
}
|
|
85016
85228
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -85018,6 +85230,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
85018
85230
|
* @method
|
|
85019
85231
|
* @name coinbase#fetchLedger
|
|
85020
85232
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
85233
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#list-transactions
|
|
85021
85234
|
* @param {string} code unified currency code, default is undefined
|
|
85022
85235
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
85023
85236
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -124577,7 +124790,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
124577
124790
|
params = this.omit(params, 'symbol');
|
|
124578
124791
|
}
|
|
124579
124792
|
if ((toId === 'futures') || (toId === 'delivery') || (fromId === 'futures') || (fromId === 'delivery')) {
|
|
124580
|
-
request['settle'] = currency['
|
|
124793
|
+
request['settle'] = currency['id'];
|
|
124581
124794
|
}
|
|
124582
124795
|
const response = await this.privateWalletPostTransfers(this.extend(request, params));
|
|
124583
124796
|
//
|
|
@@ -137411,7 +137624,13 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
137411
137624
|
if (limit !== undefined) {
|
|
137412
137625
|
request['size'] = limit;
|
|
137413
137626
|
}
|
|
137414
|
-
|
|
137627
|
+
let response = undefined;
|
|
137628
|
+
if (method === 'spot_private_get_v1_order_orders') {
|
|
137629
|
+
response = await this.spotPrivateGetV1OrderOrders(this.extend(request, params));
|
|
137630
|
+
}
|
|
137631
|
+
else {
|
|
137632
|
+
response = await this.spotPrivateGetV1OrderHistory(this.extend(request, params));
|
|
137633
|
+
}
|
|
137415
137634
|
//
|
|
137416
137635
|
// spot_private_get_v1_order_orders GET /v1/order/orders
|
|
137417
137636
|
//
|
|
@@ -159891,7 +160110,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
159891
160110
|
'fetchPosition': false,
|
|
159892
160111
|
'fetchPositionMode': false,
|
|
159893
160112
|
'fetchPositions': false,
|
|
159894
|
-
'
|
|
160113
|
+
'fetchPositionsForSymbol': false,
|
|
159895
160114
|
'fetchPositionsRisk': false,
|
|
159896
160115
|
'fetchPremiumIndexOHLCV': false,
|
|
159897
160116
|
'fetchTicker': true,
|
|
@@ -160769,7 +160988,7 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
160769
160988
|
const request = {
|
|
160770
160989
|
'pair': market['id'],
|
|
160771
160990
|
'orderSide': (side === 'buy') ? 'Bid' : 'Ask',
|
|
160772
|
-
'quantity':
|
|
160991
|
+
'quantity': this.numberToString(amount),
|
|
160773
160992
|
'type': capitalizedType,
|
|
160774
160993
|
};
|
|
160775
160994
|
if (capitalizedType === 'Limit') {
|
|
@@ -161635,7 +161854,8 @@ class kuna extends _abstract_kuna_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
161635
161854
|
let url = undefined;
|
|
161636
161855
|
if (Array.isArray(api)) {
|
|
161637
161856
|
const isGet = method === 'GET';
|
|
161638
|
-
const
|
|
161857
|
+
const version = this.safeString(api, 0);
|
|
161858
|
+
const access = this.safeString(api, 1);
|
|
161639
161859
|
if (version === 'v3') {
|
|
161640
161860
|
url = this.urls['api'][version] + '/' + version + '/' + this.implodeParams(path, params);
|
|
161641
161861
|
if (access === 'public') {
|
|
@@ -189365,7 +189585,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189365
189585
|
* @method
|
|
189366
189586
|
* @name okx#borrowCrossMargin
|
|
189367
189587
|
* @description create a loan to borrow margin (need to be VIP 5 and above)
|
|
189368
|
-
* @see https://www.okx.com/docs-v5/en/#rest-api-
|
|
189588
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-vip-loans-borrow-and-repay
|
|
189369
189589
|
* @param {string} code unified currency code of the currency to borrow
|
|
189370
189590
|
* @param {float} amount the amount to borrow
|
|
189371
189591
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
@@ -189385,12 +189605,10 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189385
189605
|
// "data": [
|
|
189386
189606
|
// {
|
|
189387
189607
|
// "amt": "102",
|
|
189388
|
-
// "availLoan": "97",
|
|
189389
189608
|
// "ccy": "USDT",
|
|
189390
|
-
// "
|
|
189391
|
-
// "posLoan": "0",
|
|
189609
|
+
// "ordId": "544199684697214976",
|
|
189392
189610
|
// "side": "borrow",
|
|
189393
|
-
// "
|
|
189611
|
+
// "state": "1"
|
|
189394
189612
|
// }
|
|
189395
189613
|
// ],
|
|
189396
189614
|
// "msg": ""
|
|
@@ -189405,18 +189623,25 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189405
189623
|
* @method
|
|
189406
189624
|
* @name okx#repayCrossMargin
|
|
189407
189625
|
* @description repay borrowed margin and interest
|
|
189408
|
-
* @see https://www.okx.com/docs-v5/en/#rest-api-
|
|
189626
|
+
* @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-vip-loans-borrow-and-repay
|
|
189409
189627
|
* @param {string} code unified currency code of the currency to repay
|
|
189410
189628
|
* @param {float} amount the amount to repay
|
|
189411
189629
|
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
189630
|
+
* @param {string} [params.id] the order ID of borrowing, it is necessary while repaying
|
|
189412
189631
|
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
189413
189632
|
*/
|
|
189414
189633
|
await this.loadMarkets();
|
|
189634
|
+
const id = this.safeString2(params, 'id', 'ordId');
|
|
189635
|
+
params = this.omit(params, 'id');
|
|
189636
|
+
if (id === undefined) {
|
|
189637
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' repayCrossMargin() requires an id parameter');
|
|
189638
|
+
}
|
|
189415
189639
|
const currency = this.currency(code);
|
|
189416
189640
|
const request = {
|
|
189417
189641
|
'ccy': currency['id'],
|
|
189418
189642
|
'amt': this.currencyToPrecision(code, amount),
|
|
189419
189643
|
'side': 'repay',
|
|
189644
|
+
'ordId': id,
|
|
189420
189645
|
};
|
|
189421
189646
|
const response = await this.privatePostAccountBorrowRepay(this.extend(request, params));
|
|
189422
189647
|
//
|
|
@@ -189425,12 +189650,10 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189425
189650
|
// "data": [
|
|
189426
189651
|
// {
|
|
189427
189652
|
// "amt": "102",
|
|
189428
|
-
// "availLoan": "97",
|
|
189429
189653
|
// "ccy": "USDT",
|
|
189430
|
-
// "
|
|
189431
|
-
// "posLoan": "0",
|
|
189654
|
+
// "ordId": "544199684697214976",
|
|
189432
189655
|
// "side": "repay",
|
|
189433
|
-
// "
|
|
189656
|
+
// "state": "1"
|
|
189434
189657
|
// }
|
|
189435
189658
|
// ],
|
|
189436
189659
|
// "msg": ""
|
|
@@ -190136,7 +190359,7 @@ class p2b extends _abstract_p2b_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
190136
190359
|
'fetchPermissions': false,
|
|
190137
190360
|
'fetchPosition': false,
|
|
190138
190361
|
'fetchPositions': false,
|
|
190139
|
-
'
|
|
190362
|
+
'fetchPositionsForSymbol': false,
|
|
190140
190363
|
'fetchPositionsRisk': false,
|
|
190141
190364
|
'fetchPremiumIndexOHLCV': false,
|
|
190142
190365
|
'fetchTicker': true,
|
|
@@ -218715,7 +218938,7 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
218715
218938
|
'args': topics,
|
|
218716
218939
|
};
|
|
218717
218940
|
const message = this.extend(request, params);
|
|
218718
|
-
return await this.watch(url, messageHash, message, subscriptionHash);
|
|
218941
|
+
return await this.watch(url, messageHash, message, messageHash, subscriptionHash);
|
|
218719
218942
|
}
|
|
218720
218943
|
async authenticate(url, params = {}) {
|
|
218721
218944
|
this.checkRequiredCredentials();
|
|
@@ -285910,7 +286133,7 @@ SOFTWARE.
|
|
|
285910
286133
|
|
|
285911
286134
|
//-----------------------------------------------------------------------------
|
|
285912
286135
|
// this is updated by vss.js when building
|
|
285913
|
-
const version = '4.1.
|
|
286136
|
+
const version = '4.1.61';
|
|
285914
286137
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
285915
286138
|
//-----------------------------------------------------------------------------
|
|
285916
286139
|
|