ccxt 4.4.49 → 4.4.50
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.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +64 -1
- package/dist/cjs/src/base/Exchange.js +75 -0
- package/dist/cjs/src/binance.js +8 -4
- package/dist/cjs/src/bitfinex1.js +22 -22
- package/dist/cjs/src/blofin.js +2 -2
- package/dist/cjs/src/bybit.js +2 -2
- package/dist/cjs/src/coinex.js +4 -4
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/defx.js +1 -1
- package/dist/cjs/src/ellipx.js +1 -0
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/hollaex.js +13 -19
- package/dist/cjs/src/hyperliquid.js +4 -4
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +49 -71
- package/dist/cjs/src/kuna.js +1 -1
- package/dist/cjs/src/mexc.js +3 -2
- package/dist/cjs/src/okcoin.js +13 -5
- package/dist/cjs/src/okx.js +1 -1
- package/dist/cjs/src/paradex.js +1 -1
- package/dist/cjs/src/paymium.js +42 -0
- package/dist/cjs/src/pro/bitfinex1.js +4 -4
- package/dist/cjs/src/pro/bitvavo.js +1 -1
- package/dist/cjs/src/pro/blofin.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/coincatch.js +2 -2
- package/dist/cjs/src/pro/cryptocom.js +2 -2
- package/dist/cjs/src/pro/defx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/gemini.js +1 -1
- package/dist/cjs/src/pro/hashkey.js +2 -2
- package/dist/cjs/src/pro/hyperliquid.js +2 -2
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/okx.js +1 -1
- package/dist/cjs/src/pro/oxfun.js +1 -1
- package/dist/cjs/src/probit.js +68 -1
- package/dist/cjs/src/timex.js +67 -0
- package/dist/cjs/src/tokocrypto.js +82 -5
- package/dist/cjs/src/tradeogre.js +55 -2
- package/dist/cjs/src/whitebit.js +11 -4
- package/examples/README.md +6 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- 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.d.ts +35 -0
- package/js/src/alpaca.js +64 -1
- package/js/src/base/Exchange.js +75 -0
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +8 -4
- package/js/src/bitfinex1.d.ts +22 -22
- package/js/src/bitfinex1.js +22 -22
- package/js/src/blofin.d.ts +1 -1
- package/js/src/blofin.js +2 -2
- package/js/src/bybit.d.ts +2 -2
- package/js/src/bybit.js +2 -2
- package/js/src/coinex.js +4 -4
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/defx.d.ts +1 -1
- package/js/src/defx.js +1 -1
- package/js/src/ellipx.d.ts +1 -0
- package/js/src/ellipx.js +1 -0
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +1 -1
- package/js/src/hollaex.d.ts +2 -1
- package/js/src/hollaex.js +13 -19
- package/js/src/hyperliquid.d.ts +3 -3
- package/js/src/hyperliquid.js +4 -4
- package/js/src/krakenfutures.d.ts +1 -1
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +49 -71
- package/js/src/kuna.d.ts +1 -1
- package/js/src/kuna.js +1 -1
- package/js/src/mexc.js +3 -2
- package/js/src/okcoin.js +13 -5
- package/js/src/okx.d.ts +1 -1
- package/js/src/okx.js +1 -1
- package/js/src/paradex.d.ts +1 -1
- package/js/src/paradex.js +1 -1
- package/js/src/paymium.js +42 -0
- package/js/src/pro/bitfinex1.d.ts +4 -4
- package/js/src/pro/bitfinex1.js +4 -4
- package/js/src/pro/bitvavo.d.ts +1 -1
- package/js/src/pro/bitvavo.js +1 -1
- package/js/src/pro/blofin.d.ts +1 -1
- package/js/src/pro/blofin.js +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/coincatch.d.ts +2 -2
- package/js/src/pro/coincatch.js +2 -2
- package/js/src/pro/cryptocom.d.ts +2 -2
- package/js/src/pro/cryptocom.js +2 -2
- package/js/src/pro/defx.d.ts +1 -1
- package/js/src/pro/defx.js +1 -1
- package/js/src/pro/exmo.d.ts +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/gemini.d.ts +1 -1
- package/js/src/pro/gemini.js +1 -1
- package/js/src/pro/hashkey.d.ts +2 -2
- package/js/src/pro/hashkey.js +2 -2
- package/js/src/pro/hyperliquid.d.ts +2 -2
- package/js/src/pro/hyperliquid.js +2 -2
- package/js/src/pro/kucoin.d.ts +1 -1
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/okx.d.ts +1 -1
- package/js/src/pro/okx.js +1 -1
- package/js/src/pro/oxfun.d.ts +1 -1
- package/js/src/pro/oxfun.js +1 -1
- package/js/src/probit.js +68 -1
- package/js/src/timex.js +67 -0
- package/js/src/tokocrypto.d.ts +2 -3
- package/js/src/tokocrypto.js +82 -5
- package/js/src/tradeogre.d.ts +4 -2
- package/js/src/tradeogre.js +55 -2
- package/js/src/whitebit.js +11 -4
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -202,7 +202,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
202
202
|
|
|
203
203
|
//-----------------------------------------------------------------------------
|
|
204
204
|
// this is updated by vss.js when building
|
|
205
|
-
const version = '4.4.
|
|
205
|
+
const version = '4.4.50';
|
|
206
206
|
Exchange["default"].ccxtVersion = version;
|
|
207
207
|
const exchanges = {
|
|
208
208
|
'ace': ace,
|
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -50,6 +50,9 @@ class alpaca extends alpaca$1 {
|
|
|
50
50
|
'cancelOrder': true,
|
|
51
51
|
'closeAllPositions': false,
|
|
52
52
|
'closePosition': false,
|
|
53
|
+
'createMarketBuyOrder': true,
|
|
54
|
+
'createMarketBuyOrderWithCost': true,
|
|
55
|
+
'createMarketOrderWithCost': true,
|
|
53
56
|
'createOrder': true,
|
|
54
57
|
'createStopOrder': true,
|
|
55
58
|
'createTriggerOrder': true,
|
|
@@ -909,6 +912,58 @@ class alpaca extends alpaca$1 {
|
|
|
909
912
|
const clientOrderId = this.safeString(params, 'clientOrderId', defaultClientId);
|
|
910
913
|
return clientOrderId;
|
|
911
914
|
}
|
|
915
|
+
/**
|
|
916
|
+
* @method
|
|
917
|
+
* @name alpaca#createMarketOrderWithCost
|
|
918
|
+
* @description create a market order by providing the symbol, side and cost
|
|
919
|
+
* @see https://docs.alpaca.markets/reference/postorder
|
|
920
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
921
|
+
* @param {string} side 'buy' or 'sell'
|
|
922
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
923
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
924
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
925
|
+
*/
|
|
926
|
+
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
927
|
+
await this.loadMarkets();
|
|
928
|
+
const req = {
|
|
929
|
+
'cost': cost,
|
|
930
|
+
};
|
|
931
|
+
return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* @method
|
|
935
|
+
* @name alpaca#createMarketBuyOrderWithCost
|
|
936
|
+
* @description create a market buy order by providing the symbol and cost
|
|
937
|
+
* @see https://docs.alpaca.markets/reference/postorder
|
|
938
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
939
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
940
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
941
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
942
|
+
*/
|
|
943
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
944
|
+
await this.loadMarkets();
|
|
945
|
+
const req = {
|
|
946
|
+
'cost': cost,
|
|
947
|
+
};
|
|
948
|
+
return await this.createOrder(symbol, 'market', 'buy', 0, undefined, this.extend(req, params));
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* @method
|
|
952
|
+
* @name alpaca#createMarketSellOrderWithCost
|
|
953
|
+
* @description create a market sell order by providing the symbol and cost
|
|
954
|
+
* @see https://docs.alpaca.markets/reference/postorder
|
|
955
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
956
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
957
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
958
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
959
|
+
*/
|
|
960
|
+
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
961
|
+
await this.loadMarkets();
|
|
962
|
+
const req = {
|
|
963
|
+
'cost': cost,
|
|
964
|
+
};
|
|
965
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, this.extend(req, params));
|
|
966
|
+
}
|
|
912
967
|
/**
|
|
913
968
|
* @method
|
|
914
969
|
* @name alpaca#createOrder
|
|
@@ -921,6 +976,7 @@ class alpaca extends alpaca$1 {
|
|
|
921
976
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
922
977
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
923
978
|
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
979
|
+
* @param {float} [params.cost] *market orders only* the cost of the order in units of the quote currency
|
|
924
980
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
925
981
|
*/
|
|
926
982
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
@@ -929,7 +985,6 @@ class alpaca extends alpaca$1 {
|
|
|
929
985
|
const id = market['id'];
|
|
930
986
|
const request = {
|
|
931
987
|
'symbol': id,
|
|
932
|
-
'qty': this.amountToPrecision(symbol, amount),
|
|
933
988
|
'side': side,
|
|
934
989
|
'type': type, // market, limit, stop_limit
|
|
935
990
|
};
|
|
@@ -948,6 +1003,14 @@ class alpaca extends alpaca$1 {
|
|
|
948
1003
|
if (type.indexOf('limit') >= 0) {
|
|
949
1004
|
request['limit_price'] = this.priceToPrecision(symbol, price);
|
|
950
1005
|
}
|
|
1006
|
+
const cost = this.safeString(params, 'cost');
|
|
1007
|
+
if (cost !== undefined) {
|
|
1008
|
+
params = this.omit(params, 'cost');
|
|
1009
|
+
request['notional'] = this.costToPrecision(symbol, cost);
|
|
1010
|
+
}
|
|
1011
|
+
else {
|
|
1012
|
+
request['qty'] = this.amountToPrecision(symbol, amount);
|
|
1013
|
+
}
|
|
951
1014
|
const defaultTIF = this.safeString(this.options, 'defaultTimeInForce');
|
|
952
1015
|
request['time_in_force'] = this.safeString(params, 'timeInForce', defaultTIF);
|
|
953
1016
|
params = this.omit(params, ['timeInForce', 'triggerPrice']);
|
|
@@ -2486,6 +2486,81 @@ class Exchange {
|
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
2488
|
safeCurrencyStructure(currency) {
|
|
2489
|
+
// derive data from networks: deposit, withdraw, active, fee, limits, precision
|
|
2490
|
+
const networks = this.safeDict(currency, 'networks', {});
|
|
2491
|
+
const keys = Object.keys(networks);
|
|
2492
|
+
const length = keys.length;
|
|
2493
|
+
if (length !== 0) {
|
|
2494
|
+
for (let i = 0; i < length; i++) {
|
|
2495
|
+
const network = networks[keys[i]];
|
|
2496
|
+
const deposit = this.safeBool(network, 'deposit');
|
|
2497
|
+
if (currency['deposit'] === undefined || deposit) {
|
|
2498
|
+
currency['deposit'] = deposit;
|
|
2499
|
+
}
|
|
2500
|
+
const withdraw = this.safeBool(network, 'withdraw');
|
|
2501
|
+
if (currency['withdraw'] === undefined || withdraw) {
|
|
2502
|
+
currency['withdraw'] = withdraw;
|
|
2503
|
+
}
|
|
2504
|
+
const active = this.safeBool(network, 'active');
|
|
2505
|
+
if (currency['active'] === undefined || active) {
|
|
2506
|
+
currency['active'] = active;
|
|
2507
|
+
}
|
|
2508
|
+
// find lowest fee (which is more desired)
|
|
2509
|
+
const fee = this.safeString(network, 'fee');
|
|
2510
|
+
const feeMain = this.safeString(currency, 'fee');
|
|
2511
|
+
if (feeMain === undefined || Precise["default"].stringLt(fee, feeMain)) {
|
|
2512
|
+
currency['fee'] = this.parseNumber(fee);
|
|
2513
|
+
}
|
|
2514
|
+
// find lowest precision (which is more desired)
|
|
2515
|
+
const precision = this.safeString(network, 'precision');
|
|
2516
|
+
const precisionMain = this.safeString(currency, 'precision');
|
|
2517
|
+
if (precisionMain === undefined || Precise["default"].stringLt(precision, precisionMain)) {
|
|
2518
|
+
currency['precision'] = this.parseNumber(precision);
|
|
2519
|
+
}
|
|
2520
|
+
// limits
|
|
2521
|
+
const limits = this.safeDict(network, 'limits');
|
|
2522
|
+
const limitsMain = this.safeDict(currency, 'limits');
|
|
2523
|
+
if (limitsMain === undefined) {
|
|
2524
|
+
currency['limits'] = {};
|
|
2525
|
+
}
|
|
2526
|
+
// deposits
|
|
2527
|
+
const limitsDeposit = this.safeDict(limits, 'deposit');
|
|
2528
|
+
const limitsDepositMain = this.safeDict(limitsMain, 'deposit');
|
|
2529
|
+
if (limitsDepositMain === undefined) {
|
|
2530
|
+
currency['limits']['deposit'] = {};
|
|
2531
|
+
}
|
|
2532
|
+
const limitsDepositMin = this.safeString(limitsDeposit, 'min');
|
|
2533
|
+
const limitsDepositMax = this.safeString(limitsDeposit, 'max');
|
|
2534
|
+
const limitsDepositMinMain = this.safeString(limitsDepositMain, 'min');
|
|
2535
|
+
const limitsDepositMaxMain = this.safeString(limitsDepositMain, 'max');
|
|
2536
|
+
// find min
|
|
2537
|
+
if (limitsDepositMinMain === undefined || Precise["default"].stringLt(limitsDepositMin, limitsDepositMinMain)) {
|
|
2538
|
+
currency['limits']['deposit']['min'] = this.parseNumber(limitsDepositMin);
|
|
2539
|
+
}
|
|
2540
|
+
// find max
|
|
2541
|
+
if (limitsDepositMaxMain === undefined || Precise["default"].stringGt(limitsDepositMax, limitsDepositMaxMain)) {
|
|
2542
|
+
currency['limits']['deposit']['max'] = this.parseNumber(limitsDepositMax);
|
|
2543
|
+
}
|
|
2544
|
+
// withdrawals
|
|
2545
|
+
const limitsWithdraw = this.safeDict(limits, 'withdraw');
|
|
2546
|
+
const limitsWithdrawMain = this.safeDict(limitsMain, 'withdraw');
|
|
2547
|
+
if (limitsWithdrawMain === undefined) {
|
|
2548
|
+
currency['limits']['withdraw'] = {};
|
|
2549
|
+
}
|
|
2550
|
+
const limitsWithdrawMin = this.safeString(limitsWithdraw, 'min');
|
|
2551
|
+
const limitsWithdrawMax = this.safeString(limitsWithdraw, 'max');
|
|
2552
|
+
const limitsWithdrawMinMain = this.safeString(limitsWithdrawMain, 'min');
|
|
2553
|
+
const limitsWithdrawMaxMain = this.safeString(limitsWithdrawMain, 'max');
|
|
2554
|
+
// find min
|
|
2555
|
+
if (limitsWithdrawMinMain === undefined || Precise["default"].stringLt(limitsWithdrawMin, limitsWithdrawMinMain)) {
|
|
2556
|
+
currency['limits']['withdraw']['min'] = this.parseNumber(limitsWithdrawMin);
|
|
2557
|
+
}
|
|
2558
|
+
// find max
|
|
2559
|
+
if (limitsWithdrawMaxMain === undefined || Precise["default"].stringGt(limitsWithdrawMax, limitsWithdrawMaxMain)) {
|
|
2560
|
+
currency['limits']['withdraw']['max'] = this.parseNumber(limitsWithdrawMax);
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2489
2564
|
return this.extend({
|
|
2490
2565
|
'info': undefined,
|
|
2491
2566
|
'id': undefined,
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -479,6 +479,7 @@ class binance extends binance$1 {
|
|
|
479
479
|
'portfolio/repay-futures-switch': 3,
|
|
480
480
|
'portfolio/margin-asset-leverage': 5,
|
|
481
481
|
'portfolio/balance': 2,
|
|
482
|
+
'portfolio/negative-balance-exchange-record': 2,
|
|
482
483
|
// staking
|
|
483
484
|
'staking/productList': 0.1,
|
|
484
485
|
'staking/position': 0.1,
|
|
@@ -5158,12 +5159,14 @@ class binance extends binance$1 {
|
|
|
5158
5159
|
request['endTime'] = until;
|
|
5159
5160
|
}
|
|
5160
5161
|
}
|
|
5162
|
+
let method = this.safeString(this.options, 'fetchTradesMethod');
|
|
5163
|
+
method = this.safeString2(params, 'fetchTradesMethod', 'method', method);
|
|
5161
5164
|
if (limit !== undefined) {
|
|
5162
5165
|
const isFutureOrSwap = (market['swap'] || market['future']);
|
|
5163
|
-
|
|
5166
|
+
const isHistoricalEndpoint = (method !== undefined) && (method.indexOf('GetHistoricalTrades') >= 0);
|
|
5167
|
+
const maxLimitForContractHistorical = isHistoricalEndpoint ? 500 : 1000;
|
|
5168
|
+
request['limit'] = isFutureOrSwap ? Math.min(limit, maxLimitForContractHistorical) : limit; // default = 500, maximum = 1000
|
|
5164
5169
|
}
|
|
5165
|
-
let method = this.safeString(this.options, 'fetchTradesMethod');
|
|
5166
|
-
method = this.safeString2(params, 'fetchTradesMethod', 'method', method);
|
|
5167
5170
|
params = this.omit(params, ['until', 'fetchTradesMethod']);
|
|
5168
5171
|
let response = undefined;
|
|
5169
5172
|
if (market['option'] || method === 'eapiPublicGetTrades') {
|
|
@@ -7217,6 +7220,7 @@ class binance extends binance$1 {
|
|
|
7217
7220
|
* @param {string} symbol unified market symbol
|
|
7218
7221
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7219
7222
|
* @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7223
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch for a portfolio margin account
|
|
7220
7224
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7221
7225
|
*/
|
|
7222
7226
|
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
@@ -10817,7 +10821,7 @@ class binance extends binance$1 {
|
|
|
10817
10821
|
// }
|
|
10818
10822
|
//
|
|
10819
10823
|
const marketId = this.safeString(position, 'symbol');
|
|
10820
|
-
market = this.safeMarket(marketId, market);
|
|
10824
|
+
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
10821
10825
|
const symbol = market['symbol'];
|
|
10822
10826
|
const side = this.safeStringLower(position, 'side');
|
|
10823
10827
|
let quantity = this.safeString(position, 'quantity');
|
|
@@ -401,7 +401,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
401
401
|
}
|
|
402
402
|
/**
|
|
403
403
|
* @method
|
|
404
|
-
* @name
|
|
404
|
+
* @name bitfinex1#fetchTransactionFees
|
|
405
405
|
* @deprecated
|
|
406
406
|
* @description please use fetchDepositWithdrawFees instead
|
|
407
407
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-fees
|
|
@@ -438,7 +438,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
438
438
|
}
|
|
439
439
|
/**
|
|
440
440
|
* @method
|
|
441
|
-
* @name
|
|
441
|
+
* @name bitfinex1#fetchDepositWithdrawFees
|
|
442
442
|
* @description fetch deposit and withdraw fees
|
|
443
443
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-fees
|
|
444
444
|
* @param {string[]|undefined} codes list of unified currency codes
|
|
@@ -478,7 +478,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
480
|
* @method
|
|
481
|
-
* @name
|
|
481
|
+
* @name bitfinex1#fetchTradingFees
|
|
482
482
|
* @description fetch the trading fees for multiple markets
|
|
483
483
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-summary
|
|
484
484
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -561,7 +561,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
563
563
|
* @method
|
|
564
|
-
* @name
|
|
564
|
+
* @name bitfinex1#fetchMarkets
|
|
565
565
|
* @description retrieves data on all markets for bitfinex
|
|
566
566
|
* @see https://docs.bitfinex.com/v1/reference/rest-public-symbols
|
|
567
567
|
* @see https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
|
|
@@ -688,7 +688,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
688
688
|
}
|
|
689
689
|
/**
|
|
690
690
|
* @method
|
|
691
|
-
* @name
|
|
691
|
+
* @name bitfinex1#fetchBalance
|
|
692
692
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
693
693
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
|
|
694
694
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -746,7 +746,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
746
746
|
}
|
|
747
747
|
/**
|
|
748
748
|
* @method
|
|
749
|
-
* @name
|
|
749
|
+
* @name bitfinex1#transfer
|
|
750
750
|
* @description transfer currency internally between wallets on the same account
|
|
751
751
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
|
|
752
752
|
* @param {string} code unified currency code
|
|
@@ -832,7 +832,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
832
832
|
}
|
|
833
833
|
/**
|
|
834
834
|
* @method
|
|
835
|
-
* @name
|
|
835
|
+
* @name bitfinex1#fetchOrderBook
|
|
836
836
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
837
837
|
* @see https://docs.bitfinex.com/v1/reference/rest-public-orderbook
|
|
838
838
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
@@ -855,7 +855,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
855
855
|
}
|
|
856
856
|
/**
|
|
857
857
|
* @method
|
|
858
|
-
* @name
|
|
858
|
+
* @name bitfinex1#fetchTickers
|
|
859
859
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
860
860
|
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
861
861
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -875,7 +875,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
875
875
|
}
|
|
876
876
|
/**
|
|
877
877
|
* @method
|
|
878
|
-
* @name
|
|
878
|
+
* @name bitfinex1#fetchTicker
|
|
879
879
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
880
880
|
* @see https://docs.bitfinex.com/v1/reference/rest-public-ticker
|
|
881
881
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
@@ -1016,7 +1016,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
/**
|
|
1018
1018
|
* @method
|
|
1019
|
-
* @name
|
|
1019
|
+
* @name bitfinex1#fetchTrades
|
|
1020
1020
|
* @description get the list of most recent trades for a particular symbol
|
|
1021
1021
|
* @see https://docs.bitfinex.com/v1/reference/rest-public-trades
|
|
1022
1022
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -1052,7 +1052,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
/**
|
|
1054
1054
|
* @method
|
|
1055
|
-
* @name
|
|
1055
|
+
* @name bitfinex1#fetchMyTrades
|
|
1056
1056
|
* @description fetch all trades made by the user
|
|
1057
1057
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
|
|
1058
1058
|
* @param {string} symbol unified market symbol
|
|
@@ -1081,7 +1081,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
/**
|
|
1083
1083
|
* @method
|
|
1084
|
-
* @name
|
|
1084
|
+
* @name bitfinex1#createOrder
|
|
1085
1085
|
* @description create a trade order
|
|
1086
1086
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-new-order
|
|
1087
1087
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
@@ -1149,7 +1149,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
/**
|
|
1151
1151
|
* @method
|
|
1152
|
-
* @name
|
|
1152
|
+
* @name bitfinex1#cancelOrder
|
|
1153
1153
|
* @description cancels an open order
|
|
1154
1154
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
|
|
1155
1155
|
* @param {string} id order id
|
|
@@ -1192,7 +1192,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1192
1192
|
}
|
|
1193
1193
|
/**
|
|
1194
1194
|
* @method
|
|
1195
|
-
* @name
|
|
1195
|
+
* @name bitfinex1#cancelAllOrders
|
|
1196
1196
|
* @description cancel all open orders
|
|
1197
1197
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
|
|
1198
1198
|
* @param {string} symbol not used by bitfinex cancelAllOrders
|
|
@@ -1284,7 +1284,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
/**
|
|
1286
1286
|
* @method
|
|
1287
|
-
* @name
|
|
1287
|
+
* @name bitfinex1#fetchOpenOrders
|
|
1288
1288
|
* @description fetch all unfilled currently open orders
|
|
1289
1289
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
|
|
1290
1290
|
* @param {string} symbol unified market symbol
|
|
@@ -1309,7 +1309,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1309
1309
|
}
|
|
1310
1310
|
/**
|
|
1311
1311
|
* @method
|
|
1312
|
-
* @name
|
|
1312
|
+
* @name bitfinex1#fetchClosedOrders
|
|
1313
1313
|
* @description fetches information on multiple closed orders made by the user
|
|
1314
1314
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
|
|
1315
1315
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
@@ -1335,7 +1335,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
/**
|
|
1337
1337
|
* @method
|
|
1338
|
-
* @name
|
|
1338
|
+
* @name bitfinex1#fetchOrder
|
|
1339
1339
|
* @description fetches information on an order made by the user
|
|
1340
1340
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-order-status
|
|
1341
1341
|
* @param {string} id the order id
|
|
@@ -1431,7 +1431,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
/**
|
|
1433
1433
|
* @method
|
|
1434
|
-
* @name
|
|
1434
|
+
* @name bitfinex1#createDepositAddress
|
|
1435
1435
|
* @description create a currency deposit address
|
|
1436
1436
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
|
|
1437
1437
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
@@ -1447,7 +1447,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1447
1447
|
}
|
|
1448
1448
|
/**
|
|
1449
1449
|
* @method
|
|
1450
|
-
* @name
|
|
1450
|
+
* @name bitfinex1#fetchDepositAddress
|
|
1451
1451
|
* @description fetch the deposit address for a currency associated with this account
|
|
1452
1452
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
|
|
1453
1453
|
* @param {string} code unified currency code
|
|
@@ -1481,7 +1481,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
/**
|
|
1483
1483
|
* @method
|
|
1484
|
-
* @name
|
|
1484
|
+
* @name bitfinex1#fetchDepositsWithdrawals
|
|
1485
1485
|
* @description fetch history of deposits and withdrawals
|
|
1486
1486
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
|
|
1487
1487
|
* @param {string} code unified currency code for the currency of the deposit/withdrawals
|
|
@@ -1618,7 +1618,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1618
1618
|
}
|
|
1619
1619
|
/**
|
|
1620
1620
|
* @method
|
|
1621
|
-
* @name
|
|
1621
|
+
* @name bitfinex1#withdraw
|
|
1622
1622
|
* @description make a withdrawal
|
|
1623
1623
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
|
|
1624
1624
|
* @param {string} code unified currency code
|
|
@@ -1669,7 +1669,7 @@ class bitfinex1 extends bitfinex1$1 {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
/**
|
|
1671
1671
|
* @method
|
|
1672
|
-
* @name
|
|
1672
|
+
* @name bitfinex1#fetchPositions
|
|
1673
1673
|
* @description fetch all open positions
|
|
1674
1674
|
* @see https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
|
|
1675
1675
|
* @param {string[]|undefined} symbols list of unified market symbols
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -286,7 +286,7 @@ class blofin extends blofin$1 {
|
|
|
286
286
|
'trailing': false,
|
|
287
287
|
},
|
|
288
288
|
'fetchOHLCV': {
|
|
289
|
-
'
|
|
289
|
+
'limit': 1440,
|
|
290
290
|
},
|
|
291
291
|
},
|
|
292
292
|
'spot': {
|
|
@@ -1955,7 +1955,7 @@ class blofin extends blofin$1 {
|
|
|
1955
1955
|
}
|
|
1956
1956
|
/**
|
|
1957
1957
|
* @method
|
|
1958
|
-
* @name blofin#
|
|
1958
|
+
* @name blofin#fetchPositions
|
|
1959
1959
|
* @description fetch data on a single open contract trade position
|
|
1960
1960
|
* @see https://blofin.com/docs#get-positions
|
|
1961
1961
|
* @param {string[]} [symbols] list of unified market symbols
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -4766,7 +4766,7 @@ class bybit extends bybit$1 {
|
|
|
4766
4766
|
}
|
|
4767
4767
|
/**
|
|
4768
4768
|
* @method
|
|
4769
|
-
* @name bybit#
|
|
4769
|
+
* @name bybit#fetchOrder
|
|
4770
4770
|
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4771
4771
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4772
4772
|
* @param {string} id the order id
|
|
@@ -4887,7 +4887,7 @@ class bybit extends bybit$1 {
|
|
|
4887
4887
|
}
|
|
4888
4888
|
/**
|
|
4889
4889
|
* @method
|
|
4890
|
-
* @name bybit#
|
|
4890
|
+
* @name bybit#fetchOrdersClassic
|
|
4891
4891
|
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4892
4892
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4893
4893
|
* @param {string} symbol unified market symbol of the market orders were made in
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -467,7 +467,7 @@ class coinex extends coinex$1 {
|
|
|
467
467
|
'ERC20': 'ERC20',
|
|
468
468
|
'BRC20': 'BRC20',
|
|
469
469
|
'SOL': 'SOL',
|
|
470
|
-
'TON': '
|
|
470
|
+
'TON': 'TON',
|
|
471
471
|
'BSV': 'BSV',
|
|
472
472
|
'AVAXC': 'AVA_C',
|
|
473
473
|
'AVAXX': 'AVA',
|
|
@@ -4802,14 +4802,14 @@ class coinex extends coinex$1 {
|
|
|
4802
4802
|
this.checkAddress(address);
|
|
4803
4803
|
await this.loadMarkets();
|
|
4804
4804
|
const currency = this.currency(code);
|
|
4805
|
-
if (tag) {
|
|
4806
|
-
address = address + ':' + tag;
|
|
4807
|
-
}
|
|
4808
4805
|
const request = {
|
|
4809
4806
|
'ccy': currency['id'],
|
|
4810
4807
|
'to_address': address,
|
|
4811
4808
|
'amount': this.numberToString(amount), // the actual amount without fees, https://www.coinex.com/fees
|
|
4812
4809
|
};
|
|
4810
|
+
if (tag !== undefined) {
|
|
4811
|
+
request['memo'] = tag;
|
|
4812
|
+
}
|
|
4813
4813
|
let networkCode = undefined;
|
|
4814
4814
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
4815
4815
|
if (networkCode !== undefined) {
|
|
@@ -1429,7 +1429,7 @@ class coinmetro extends coinmetro$1 {
|
|
|
1429
1429
|
}
|
|
1430
1430
|
/**
|
|
1431
1431
|
* @method
|
|
1432
|
-
* @name coinmetro#
|
|
1432
|
+
* @name coinmetro#closePosition
|
|
1433
1433
|
* @description closes an open position
|
|
1434
1434
|
* @see https://documenter.getpostman.com/view/3653795/SVfWN6KS#47f913fb-8cab-49f4-bc78-d980e6ced316
|
|
1435
1435
|
* @param {string} symbol not used by coinmetro closePosition ()
|
package/dist/cjs/src/defx.js
CHANGED
|
@@ -937,7 +937,7 @@ class defx extends defx$1 {
|
|
|
937
937
|
}
|
|
938
938
|
/**
|
|
939
939
|
* @method
|
|
940
|
-
* @name defx#
|
|
940
|
+
* @name defx#fetchMyTrades
|
|
941
941
|
* @description fetch all trades made by the user
|
|
942
942
|
* @see https://api-docs.defx.com/#06b5b33c-2fc6-48de-896c-fc316f5871a7
|
|
943
943
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
package/dist/cjs/src/ellipx.js
CHANGED
|
@@ -1707,6 +1707,7 @@ class ellipx extends ellipx$1 {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
/**
|
|
1709
1709
|
* @method
|
|
1710
|
+
* @name ellipx#withdraw
|
|
1710
1711
|
* @description Make a withdrawal request
|
|
1711
1712
|
* @see https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM/edit?tab=t.0#heading=h.zegupoa8g4t9
|
|
1712
1713
|
* @param {string} code Currency code
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -6453,7 +6453,7 @@ class gate extends gate$1 {
|
|
|
6453
6453
|
}
|
|
6454
6454
|
/**
|
|
6455
6455
|
* @method
|
|
6456
|
-
* @name gate#
|
|
6456
|
+
* @name gate#borrowIsolatedMargin
|
|
6457
6457
|
* @description create a loan to borrow margin
|
|
6458
6458
|
* @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
|
|
6459
6459
|
* @param {string} symbol unified market symbol, required for isolated margin
|
package/dist/cjs/src/hollaex.js
CHANGED
|
@@ -828,13 +828,14 @@ class hollaex extends hollaex$1 {
|
|
|
828
828
|
/**
|
|
829
829
|
* @method
|
|
830
830
|
* @name hollaex#fetchOHLCV
|
|
831
|
-
* @description
|
|
831
|
+
* @description hollaex has large gaps between candles, so it's recommended to specify since
|
|
832
832
|
* @see https://apidocs.hollaex.com/#chart
|
|
833
833
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
834
834
|
* @param {string} timeframe the length of time each candle represents
|
|
835
835
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
836
836
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
837
837
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
838
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
838
839
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
839
840
|
*/
|
|
840
841
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
@@ -844,27 +845,20 @@ class hollaex extends hollaex$1 {
|
|
|
844
845
|
'symbol': market['id'],
|
|
845
846
|
'resolution': this.safeString(this.timeframes, timeframe, timeframe),
|
|
846
847
|
};
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
request['
|
|
855
|
-
request['from'] = start;
|
|
848
|
+
const until = this.safeInteger(params, 'until');
|
|
849
|
+
let end = this.seconds();
|
|
850
|
+
if (until !== undefined) {
|
|
851
|
+
end = this.parseToInt(until / 1000);
|
|
852
|
+
}
|
|
853
|
+
const defaultSpan = 2592000; // 30 days
|
|
854
|
+
if (since !== undefined) {
|
|
855
|
+
request['from'] = this.parseToInt(since / 1000);
|
|
856
856
|
}
|
|
857
857
|
else {
|
|
858
|
-
|
|
859
|
-
request['from'] = this.parseToInt(since / 1000);
|
|
860
|
-
request['to'] = this.seconds();
|
|
861
|
-
}
|
|
862
|
-
else {
|
|
863
|
-
const start = this.parseToInt(since / 1000);
|
|
864
|
-
request['from'] = start;
|
|
865
|
-
request['to'] = this.sum(start, duration * limit);
|
|
866
|
-
}
|
|
858
|
+
request['from'] = end - defaultSpan;
|
|
867
859
|
}
|
|
860
|
+
request['to'] = end;
|
|
861
|
+
params = this.omit(params, 'until');
|
|
868
862
|
const response = await this.publicGetChart(this.extend(request, params));
|
|
869
863
|
//
|
|
870
864
|
// [
|
|
@@ -397,7 +397,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
397
397
|
}
|
|
398
398
|
/**
|
|
399
399
|
* @method
|
|
400
|
-
* @name hyperliquid#
|
|
400
|
+
* @name hyperliquid#fetchSwapMarkets
|
|
401
401
|
* @description retrieves data on all swap markets for hyperliquid
|
|
402
402
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
403
403
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -452,7 +452,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
452
452
|
}
|
|
453
453
|
/**
|
|
454
454
|
* @method
|
|
455
|
-
* @name calculatePricePrecision
|
|
455
|
+
* @name hyperliquid#calculatePricePrecision
|
|
456
456
|
* @description Helper function to calculate the Hyperliquid DECIMAL_PLACES price precision
|
|
457
457
|
* @param {float} price the price to use in the calculation
|
|
458
458
|
* @param {int} amountPrecision the amountPrecision to use in the calculation
|
|
@@ -501,7 +501,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* @method
|
|
504
|
-
* @name hyperliquid#
|
|
504
|
+
* @name hyperliquid#fetchSpotMarkets
|
|
505
505
|
* @description retrieves data on all spot markets for hyperliquid
|
|
506
506
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
507
507
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1399,7 +1399,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1399
1399
|
createOrdersRequest(orders, params = {}) {
|
|
1400
1400
|
/**
|
|
1401
1401
|
* @method
|
|
1402
|
-
* @name hyperliquid#
|
|
1402
|
+
* @name hyperliquid#createOrdersRequest
|
|
1403
1403
|
* @description create a list of trade orders
|
|
1404
1404
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
1405
1405
|
* @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
@@ -699,7 +699,7 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
699
699
|
}
|
|
700
700
|
/**
|
|
701
701
|
* @method
|
|
702
|
-
* @name
|
|
702
|
+
* @name krakenfutures#fetchOHLCV
|
|
703
703
|
* @see https://docs.futures.kraken.com/#http-api-charts-candles
|
|
704
704
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
705
705
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|