ccxt 4.2.59 → 4.2.60
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/build.sh +1 -1
- package/dist/ccxt.browser.js +406 -165
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +10 -12
- package/dist/cjs/src/bingx.js +38 -0
- package/dist/cjs/src/bitfinex2.js +21 -4
- package/dist/cjs/src/bitget.js +9 -2
- package/dist/cjs/src/bitmart.js +41 -23
- package/dist/cjs/src/blofin.js +59 -1
- package/dist/cjs/src/hitbtc.js +1 -1
- package/dist/cjs/src/htx.js +4 -1
- package/dist/cjs/src/kraken.js +42 -39
- package/dist/cjs/src/kucoinfutures.js +1 -0
- package/dist/cjs/src/pro/binance.js +16 -3
- package/dist/cjs/src/wazirx.js +6 -1
- package/dist/cjs/src/woo.js +157 -77
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/blofin.d.ts +1 -0
- package/js/src/abstract/wazirx.d.ts +5 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +10 -12
- package/js/src/bingx.d.ts +3 -1
- package/js/src/bingx.js +38 -0
- package/js/src/bitfinex2.js +21 -4
- package/js/src/bitget.js +9 -2
- package/js/src/bitmart.d.ts +9 -2
- package/js/src/bitmart.js +41 -23
- package/js/src/blofin.d.ts +2 -1
- package/js/src/blofin.js +59 -1
- package/js/src/hitbtc.js +1 -1
- package/js/src/htx.js +4 -1
- package/js/src/kraken.js +42 -39
- package/js/src/kucoinfutures.js +1 -0
- package/js/src/pro/binance.js +16 -3
- package/js/src/pro/deribit.d.ts +1 -1
- package/js/src/wazirx.js +6 -1
- package/js/src/woo.d.ts +8 -0
- package/js/src/woo.js +157 -77
- package/package.json +1 -1
- package/skip-tests.json +42 -16
package/dist/ccxt.browser.js
CHANGED
|
@@ -4394,11 +4394,10 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
4394
4394
|
];
|
|
4395
4395
|
}
|
|
4396
4396
|
parseBalance(response) {
|
|
4397
|
-
const timestamp = this.milliseconds();
|
|
4398
4397
|
const result = {
|
|
4399
4398
|
'info': response,
|
|
4400
|
-
'timestamp':
|
|
4401
|
-
'datetime':
|
|
4399
|
+
'timestamp': undefined,
|
|
4400
|
+
'datetime': undefined,
|
|
4402
4401
|
};
|
|
4403
4402
|
const balances = this.safeValue(response, 'data', []);
|
|
4404
4403
|
for (let i = 0; i < balances.length; i++) {
|
|
@@ -4412,11 +4411,10 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
4412
4411
|
return this.safeBalance(result);
|
|
4413
4412
|
}
|
|
4414
4413
|
parseMarginBalance(response) {
|
|
4415
|
-
const timestamp = this.milliseconds();
|
|
4416
4414
|
const result = {
|
|
4417
4415
|
'info': response,
|
|
4418
|
-
'timestamp':
|
|
4419
|
-
'datetime':
|
|
4416
|
+
'timestamp': undefined,
|
|
4417
|
+
'datetime': undefined,
|
|
4420
4418
|
};
|
|
4421
4419
|
const balances = this.safeValue(response, 'data', []);
|
|
4422
4420
|
for (let i = 0; i < balances.length; i++) {
|
|
@@ -4433,11 +4431,10 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
4433
4431
|
return this.safeBalance(result);
|
|
4434
4432
|
}
|
|
4435
4433
|
parseSwapBalance(response) {
|
|
4436
|
-
const timestamp = this.milliseconds();
|
|
4437
4434
|
const result = {
|
|
4438
4435
|
'info': response,
|
|
4439
|
-
'timestamp':
|
|
4440
|
-
'datetime':
|
|
4436
|
+
'timestamp': undefined,
|
|
4437
|
+
'datetime': undefined,
|
|
4441
4438
|
};
|
|
4442
4439
|
const data = this.safeValue(response, 'data', {});
|
|
4443
4440
|
const collaterals = this.safeValue(data, 'collaterals', []);
|
|
@@ -4459,6 +4456,8 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
4459
4456
|
* @see https://ascendex.github.io/ascendex-pro-api/#margin-account-balance
|
|
4460
4457
|
* @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
|
4461
4458
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4459
|
+
* @param {string} [params.type] wallet type, 'spot', 'margin', or 'swap'
|
|
4460
|
+
* @param {string} [params.marginMode] 'cross' or undefined, for spot margin trading, value of 'isolated' is invalid
|
|
4462
4461
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
4463
4462
|
*/
|
|
4464
4463
|
await this.loadMarkets();
|
|
@@ -6821,12 +6820,11 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
6821
6820
|
//
|
|
6822
6821
|
const status = this.safeInteger(transfer, 'code');
|
|
6823
6822
|
const currencyCode = this.safeCurrencyCode(undefined, currency);
|
|
6824
|
-
const timestamp = this.milliseconds();
|
|
6825
6823
|
return {
|
|
6826
6824
|
'info': transfer,
|
|
6827
6825
|
'id': undefined,
|
|
6828
|
-
'timestamp':
|
|
6829
|
-
'datetime':
|
|
6826
|
+
'timestamp': undefined,
|
|
6827
|
+
'datetime': undefined,
|
|
6830
6828
|
'currency': currencyCode,
|
|
6831
6829
|
'amount': undefined,
|
|
6832
6830
|
'fromAccount': undefined,
|
|
@@ -30873,6 +30871,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30873
30871
|
'fetchFundingRates': true,
|
|
30874
30872
|
'fetchLeverage': true,
|
|
30875
30873
|
'fetchLiquidations': false,
|
|
30874
|
+
'fetchMarginMode': true,
|
|
30876
30875
|
'fetchMarkets': true,
|
|
30877
30876
|
'fetchMarkOHLCV': true,
|
|
30878
30877
|
'fetchMyLiquidations': true,
|
|
@@ -34980,6 +34979,43 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
34980
34979
|
const data = this.safeDict(response, 'data');
|
|
34981
34980
|
return this.parseOrder(data, market);
|
|
34982
34981
|
}
|
|
34982
|
+
async fetchMarginMode(symbol, params = {}) {
|
|
34983
|
+
/**
|
|
34984
|
+
* @method
|
|
34985
|
+
* @name bingx#fetchMarginMode
|
|
34986
|
+
* @description fetches the margin mode of the trading pair
|
|
34987
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Margin%20Mode
|
|
34988
|
+
* @param {string} symbol unified symbol of the market to fetch the margin mode for
|
|
34989
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
34990
|
+
* @returns {object} Struct of MarginMode
|
|
34991
|
+
*/
|
|
34992
|
+
await this.loadMarkets();
|
|
34993
|
+
const market = this.market(symbol);
|
|
34994
|
+
const request = {
|
|
34995
|
+
'symbol': market['id'],
|
|
34996
|
+
};
|
|
34997
|
+
const response = await this.swapV2PrivateGetTradeMarginType(this.extend(request, params));
|
|
34998
|
+
//
|
|
34999
|
+
// {
|
|
35000
|
+
// "code": 0,
|
|
35001
|
+
// "msg": "",
|
|
35002
|
+
// "data": {
|
|
35003
|
+
// "marginType": "CROSSED"
|
|
35004
|
+
// }
|
|
35005
|
+
// }
|
|
35006
|
+
//
|
|
35007
|
+
const data = this.safeDict(response, 'data', {});
|
|
35008
|
+
return this.parseMarginMode(data, market);
|
|
35009
|
+
}
|
|
35010
|
+
parseMarginMode(marginMode, market = undefined) {
|
|
35011
|
+
let marginType = this.safeStringLower(marginMode, 'marginType');
|
|
35012
|
+
marginType = (marginType === 'crossed') ? 'cross' : marginType;
|
|
35013
|
+
return {
|
|
35014
|
+
'info': marginMode,
|
|
35015
|
+
'symbol': market['symbol'],
|
|
35016
|
+
'marginMode': marginType,
|
|
35017
|
+
};
|
|
35018
|
+
}
|
|
34983
35019
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
34984
35020
|
const type = section[0];
|
|
34985
35021
|
const version = section[1];
|
|
@@ -40026,8 +40062,8 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40026
40062
|
'spot': true,
|
|
40027
40063
|
'margin': true,
|
|
40028
40064
|
'swap': true,
|
|
40029
|
-
'future':
|
|
40030
|
-
'option':
|
|
40065
|
+
'future': false,
|
|
40066
|
+
'option': false,
|
|
40031
40067
|
'addMargin': false,
|
|
40032
40068
|
'borrowCrossMargin': false,
|
|
40033
40069
|
'borrowIsolatedMargin': false,
|
|
@@ -40038,6 +40074,7 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40038
40074
|
'createLimitOrder': true,
|
|
40039
40075
|
'createMarketOrder': true,
|
|
40040
40076
|
'createOrder': true,
|
|
40077
|
+
'createPostOnlyOrder': true,
|
|
40041
40078
|
'createReduceOnlyOrder': true,
|
|
40042
40079
|
'createStopLimitOrder': true,
|
|
40043
40080
|
'createStopMarketOrder': true,
|
|
@@ -40048,8 +40085,11 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40048
40085
|
'editOrder': true,
|
|
40049
40086
|
'fetchBalance': true,
|
|
40050
40087
|
'fetchBorrowInterest': false,
|
|
40051
|
-
'
|
|
40088
|
+
'fetchBorrowRate': false,
|
|
40052
40089
|
'fetchBorrowRateHistory': false,
|
|
40090
|
+
'fetchBorrowRateHistories': false,
|
|
40091
|
+
'fetchBorrowRates': false,
|
|
40092
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
40053
40093
|
'fetchClosedOrder': true,
|
|
40054
40094
|
'fetchClosedOrders': true,
|
|
40055
40095
|
'fetchCrossBorrowRate': false,
|
|
@@ -40078,6 +40118,8 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40078
40118
|
'fetchOpenOrder': true,
|
|
40079
40119
|
'fetchOpenOrders': true,
|
|
40080
40120
|
'fetchOrder': true,
|
|
40121
|
+
'fetchOrderBook': true,
|
|
40122
|
+
'fetchOrderBooks': false,
|
|
40081
40123
|
'fetchOrderTrades': true,
|
|
40082
40124
|
'fetchPosition': false,
|
|
40083
40125
|
'fetchPositionMode': false,
|
|
@@ -40097,6 +40139,8 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
40097
40139
|
'setMargin': true,
|
|
40098
40140
|
'setMarginMode': false,
|
|
40099
40141
|
'setPositionMode': false,
|
|
40142
|
+
'signIn': false,
|
|
40143
|
+
'transfer': true,
|
|
40100
40144
|
'withdraw': true,
|
|
40101
40145
|
},
|
|
40102
40146
|
'timeframes': {
|
|
@@ -41529,7 +41573,16 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
41529
41573
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
41530
41574
|
* @param {float} [price] the price of the order, in units of the quote currency, ignored in market orders
|
|
41531
41575
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
41532
|
-
* @
|
|
41576
|
+
* @param {float} [params.stopPrice] The price at which a trigger order is triggered at
|
|
41577
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
41578
|
+
* @param {bool} [params.postOnly]
|
|
41579
|
+
* @param {bool} [params.reduceOnly] Ensures that the executed order does not flip the opened position.
|
|
41580
|
+
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
41581
|
+
* @param {int} [params.lev] leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
|
|
41582
|
+
* @param {string} [params.price_traling] The trailing price for a trailing stop order
|
|
41583
|
+
* @param {string} [params.price_aux_limit] Order price for stop limit orders
|
|
41584
|
+
* @param {string} [params.price_oco_stop] OCO stop price
|
|
41585
|
+
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
41533
41586
|
*/
|
|
41534
41587
|
const market = this.market(symbol);
|
|
41535
41588
|
let amountString = this.amountToPrecision(symbol, amount);
|
|
@@ -47684,8 +47737,15 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
47684
47737
|
const currencyCode = this.safeCurrencyCode(this.safeString(feeStructure, 'feeCoin'));
|
|
47685
47738
|
fee = {
|
|
47686
47739
|
'currency': currencyCode,
|
|
47687
|
-
'cost': _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(this.safeString(feeStructure, 'totalFee')),
|
|
47688
47740
|
};
|
|
47741
|
+
const feeCostString = this.safeString(feeStructure, 'totalFee');
|
|
47742
|
+
const deduction = this.safeString(feeStructure, 'deduction') === 'yes' ? true : false;
|
|
47743
|
+
if (deduction) {
|
|
47744
|
+
fee['cost'] = feeCostString;
|
|
47745
|
+
}
|
|
47746
|
+
else {
|
|
47747
|
+
fee['cost'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(feeCostString);
|
|
47748
|
+
}
|
|
47689
47749
|
}
|
|
47690
47750
|
return this.safeTrade({
|
|
47691
47751
|
'info': trade,
|
|
@@ -48784,7 +48844,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
48784
48844
|
* @see https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
|
|
48785
48845
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
48786
48846
|
* @param {string} type 'market' or 'limit'
|
|
48787
|
-
* @param {string} side 'buy' or 'sell'
|
|
48847
|
+
* @param {string} side 'buy' or 'sell'
|
|
48788
48848
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
48789
48849
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
48790
48850
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -54742,6 +54802,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54742
54802
|
},
|
|
54743
54803
|
'networks': {
|
|
54744
54804
|
'ERC20': 'ERC20',
|
|
54805
|
+
'SOL': 'SOL',
|
|
54745
54806
|
'BTC': 'BTC',
|
|
54746
54807
|
'TRC20': 'TRC20',
|
|
54747
54808
|
// todo: should be TRX after unification
|
|
@@ -54764,7 +54825,6 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
54764
54825
|
'FIO': 'FIO',
|
|
54765
54826
|
'SCRT': 'SCRT',
|
|
54766
54827
|
'IOTX': 'IOTX',
|
|
54767
|
-
'SOL': 'SOL',
|
|
54768
54828
|
'ALGO': 'ALGO',
|
|
54769
54829
|
'ATOM': 'ATOM',
|
|
54770
54830
|
'DOT': 'DOT',
|
|
@@ -57317,6 +57377,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
57317
57377
|
* @method
|
|
57318
57378
|
* @name bitmart#fetchDepositAddress
|
|
57319
57379
|
* @description fetch the deposit address for a currency associated with this account
|
|
57380
|
+
* @see https://developer-pro.bitmart.com/en/spot/#deposit-address-keyed
|
|
57320
57381
|
* @param {string} code unified currency code
|
|
57321
57382
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
57322
57383
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -57339,40 +57400,57 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
57339
57400
|
}
|
|
57340
57401
|
const response = await this.privateGetAccountV1DepositAddress(this.extend(request, params));
|
|
57341
57402
|
//
|
|
57342
|
-
//
|
|
57343
|
-
//
|
|
57344
|
-
//
|
|
57345
|
-
//
|
|
57346
|
-
//
|
|
57347
|
-
//
|
|
57348
|
-
//
|
|
57349
|
-
//
|
|
57350
|
-
//
|
|
57351
|
-
//
|
|
57352
|
-
//
|
|
57403
|
+
// {
|
|
57404
|
+
// "message": "OK",
|
|
57405
|
+
// "code": 1000,
|
|
57406
|
+
// "trace": "0e6edd79-f77f-4251-abe5-83ba75d06c1a",
|
|
57407
|
+
// "data": {
|
|
57408
|
+
// currency: 'ETH',
|
|
57409
|
+
// chain: 'Ethereum',
|
|
57410
|
+
// address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
|
|
57411
|
+
// address_memo: ''
|
|
57412
|
+
// }
|
|
57413
|
+
// }
|
|
57353
57414
|
//
|
|
57354
57415
|
const data = this.safeValue(response, 'data', {});
|
|
57355
|
-
|
|
57356
|
-
|
|
57357
|
-
|
|
57416
|
+
return this.parseDepositAddress(data, currency);
|
|
57417
|
+
}
|
|
57418
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
57419
|
+
//
|
|
57420
|
+
// {
|
|
57421
|
+
// currency: 'ETH',
|
|
57422
|
+
// chain: 'Ethereum',
|
|
57423
|
+
// address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
|
|
57424
|
+
// address_memo: ''
|
|
57425
|
+
// }
|
|
57426
|
+
//
|
|
57427
|
+
const currencyId = this.safeString(depositAddress, 'currency');
|
|
57428
|
+
const address = this.safeString(depositAddress, 'address');
|
|
57429
|
+
const chain = this.safeString(depositAddress, 'chain');
|
|
57358
57430
|
let network = undefined;
|
|
57431
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
57359
57432
|
if (chain !== undefined) {
|
|
57360
57433
|
const parts = chain.split('-');
|
|
57361
|
-
const
|
|
57362
|
-
|
|
57434
|
+
const partsLength = parts.length;
|
|
57435
|
+
const networkId = this.safeString(parts, partsLength - 1);
|
|
57436
|
+
network = this.safeNetworkCode(networkId, currency);
|
|
57363
57437
|
}
|
|
57364
57438
|
this.checkAddress(address);
|
|
57365
57439
|
return {
|
|
57366
|
-
'
|
|
57440
|
+
'info': depositAddress,
|
|
57441
|
+
'currency': this.safeString(currency, 'code'),
|
|
57367
57442
|
'address': address,
|
|
57368
|
-
'tag':
|
|
57443
|
+
'tag': this.safeString(depositAddress, 'address_memo'),
|
|
57369
57444
|
'network': network,
|
|
57370
|
-
'info': response,
|
|
57371
57445
|
};
|
|
57372
57446
|
}
|
|
57373
|
-
|
|
57374
|
-
|
|
57375
|
-
|
|
57447
|
+
safeNetworkCode(networkId, currency = undefined) {
|
|
57448
|
+
const name = this.safeString(currency, 'name');
|
|
57449
|
+
if (networkId === name) {
|
|
57450
|
+
const code = this.safeString(currency, 'code');
|
|
57451
|
+
return code;
|
|
57452
|
+
}
|
|
57453
|
+
return this.networkIdToCode(networkId);
|
|
57376
57454
|
}
|
|
57377
57455
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
57378
57456
|
/**
|
|
@@ -76870,6 +76948,7 @@ class blofin extends _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
76870
76948
|
'fetchLedger': true,
|
|
76871
76949
|
'fetchLedgerEntry': undefined,
|
|
76872
76950
|
'fetchLeverage': true,
|
|
76951
|
+
'fetchLeverages': true,
|
|
76873
76952
|
'fetchLeverageTiers': false,
|
|
76874
76953
|
'fetchMarketLeverageTiers': false,
|
|
76875
76954
|
'fetchMarkets': true,
|
|
@@ -76974,6 +77053,7 @@ class blofin extends _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
76974
77053
|
'account/balance': 1,
|
|
76975
77054
|
'account/positions': 1,
|
|
76976
77055
|
'account/leverage-info': 1,
|
|
77056
|
+
'account/batch-leverage-info': 1,
|
|
76977
77057
|
'trade/orders-tpsl-pending': 1,
|
|
76978
77058
|
'trade/orders-history': 1,
|
|
76979
77059
|
'trade/orders-tpsl-history': 1,
|
|
@@ -78671,12 +78751,68 @@ class blofin extends _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
78671
78751
|
'takeProfitPrice': undefined,
|
|
78672
78752
|
});
|
|
78673
78753
|
}
|
|
78754
|
+
async fetchLeverages(symbols = undefined, params = {}) {
|
|
78755
|
+
/**
|
|
78756
|
+
* @method
|
|
78757
|
+
* @name blofin#fetchLeverages
|
|
78758
|
+
* @description fetch the set leverage for all contract markets
|
|
78759
|
+
* @see https://docs.blofin.com/index.html#get-multiple-leverage
|
|
78760
|
+
* @param {string[]} symbols a list of unified market symbols, required on blofin
|
|
78761
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
78762
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
78763
|
+
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
78764
|
+
*/
|
|
78765
|
+
await this.loadMarkets();
|
|
78766
|
+
if (symbols === undefined) {
|
|
78767
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' fetchLeverages() requires a symbols argument');
|
|
78768
|
+
}
|
|
78769
|
+
let marginMode = undefined;
|
|
78770
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchLeverages', params);
|
|
78771
|
+
if (marginMode === undefined) {
|
|
78772
|
+
marginMode = this.safeString(params, 'marginMode', 'cross'); // cross as default marginMode
|
|
78773
|
+
}
|
|
78774
|
+
if ((marginMode !== 'cross') && (marginMode !== 'isolated')) {
|
|
78775
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchLeverages() requires a marginMode parameter that must be either cross or isolated');
|
|
78776
|
+
}
|
|
78777
|
+
symbols = this.marketSymbols(symbols);
|
|
78778
|
+
let instIds = '';
|
|
78779
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
78780
|
+
const entry = symbols[i];
|
|
78781
|
+
const entryMarket = this.market(entry);
|
|
78782
|
+
if (i > 0) {
|
|
78783
|
+
instIds = instIds + ',' + entryMarket['id'];
|
|
78784
|
+
}
|
|
78785
|
+
else {
|
|
78786
|
+
instIds = instIds + entryMarket['id'];
|
|
78787
|
+
}
|
|
78788
|
+
}
|
|
78789
|
+
const request = {
|
|
78790
|
+
'instId': instIds,
|
|
78791
|
+
'marginMode': marginMode,
|
|
78792
|
+
};
|
|
78793
|
+
const response = await this.privateGetAccountBatchLeverageInfo(this.extend(request, params));
|
|
78794
|
+
//
|
|
78795
|
+
// {
|
|
78796
|
+
// "code": "0",
|
|
78797
|
+
// "msg": "success",
|
|
78798
|
+
// "data": [
|
|
78799
|
+
// {
|
|
78800
|
+
// "leverage": "3",
|
|
78801
|
+
// "marginMode": "cross",
|
|
78802
|
+
// "instId": "BTC-USDT"
|
|
78803
|
+
// },
|
|
78804
|
+
// ]
|
|
78805
|
+
// }
|
|
78806
|
+
//
|
|
78807
|
+
const leverages = this.safeList(response, 'data', []);
|
|
78808
|
+
return this.parseLeverages(leverages, symbols, 'instId');
|
|
78809
|
+
}
|
|
78674
78810
|
async fetchLeverage(symbol, params = {}) {
|
|
78675
78811
|
/**
|
|
78676
78812
|
* @method
|
|
78677
78813
|
* @name blofin#fetchLeverage
|
|
78678
78814
|
* @description fetch the set leverage for a market
|
|
78679
|
-
* @see https://blofin.com/
|
|
78815
|
+
* @see https://docs.blofin.com/index.html#get-leverage
|
|
78680
78816
|
* @param {string} symbol unified market symbol
|
|
78681
78817
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
78682
78818
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
@@ -144173,7 +144309,7 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
144173
144309
|
if ((network !== undefined) && (code === 'USDT')) {
|
|
144174
144310
|
const parsedNetwork = this.safeString(networks, network);
|
|
144175
144311
|
if (parsedNetwork !== undefined) {
|
|
144176
|
-
request['
|
|
144312
|
+
request['network_code'] = parsedNetwork;
|
|
144177
144313
|
}
|
|
144178
144314
|
params = this.omit(params, 'network');
|
|
144179
144315
|
}
|
|
@@ -149682,7 +149818,10 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
149682
149818
|
amountString = this.safeString(trade, 'trade_volume', amountString);
|
|
149683
149819
|
const costString = this.safeString(trade, 'trade_turnover');
|
|
149684
149820
|
let fee = undefined;
|
|
149685
|
-
let feeCost = this.
|
|
149821
|
+
let feeCost = this.safeString(trade, 'filled-fees');
|
|
149822
|
+
if (feeCost === undefined) {
|
|
149823
|
+
feeCost = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString(trade, 'trade_fee'));
|
|
149824
|
+
}
|
|
149686
149825
|
const feeCurrencyId = this.safeString2(trade, 'fee-currency', 'fee_asset');
|
|
149687
149826
|
let feeCurrency = this.safeCurrencyCode(feeCurrencyId);
|
|
149688
149827
|
const filledPoints = this.safeString(trade, 'filled-points');
|
|
@@ -162251,7 +162390,10 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
162251
162390
|
'name': 'Kraken',
|
|
162252
162391
|
'countries': ['US'],
|
|
162253
162392
|
'version': '0',
|
|
162254
|
-
|
|
162393
|
+
// rate-limits: https://support.kraken.com/hc/en-us/articles/206548367-What-are-the-API-rate-limits-#1
|
|
162394
|
+
// for public: 1 req/s
|
|
162395
|
+
// for private: every second 0.33 weight added to your allowed capacity (some private endpoints need 1 weight, some need 2)
|
|
162396
|
+
'rateLimit': 1000,
|
|
162255
162397
|
'certified': false,
|
|
162256
162398
|
'pro': true,
|
|
162257
162399
|
'has': {
|
|
@@ -162381,7 +162523,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
162381
162523
|
},
|
|
162382
162524
|
'public': {
|
|
162383
162525
|
'get': {
|
|
162384
|
-
//
|
|
162526
|
+
// rate-limits explained in comment in the top of this file
|
|
162385
162527
|
'Assets': 1,
|
|
162386
162528
|
'AssetPairs': 1,
|
|
162387
162529
|
'Depth': 1,
|
|
@@ -162397,48 +162539,48 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
162397
162539
|
'post': {
|
|
162398
162540
|
'AddOrder': 0,
|
|
162399
162541
|
'AddOrderBatch': 0,
|
|
162400
|
-
'AddExport':
|
|
162401
|
-
'Balance':
|
|
162402
|
-
'CancelAll':
|
|
162403
|
-
'CancelAllOrdersAfter':
|
|
162542
|
+
'AddExport': 3,
|
|
162543
|
+
'Balance': 3,
|
|
162544
|
+
'CancelAll': 3,
|
|
162545
|
+
'CancelAllOrdersAfter': 3,
|
|
162404
162546
|
'CancelOrder': 0,
|
|
162405
162547
|
'CancelOrderBatch': 0,
|
|
162406
|
-
'ClosedOrders':
|
|
162407
|
-
'DepositAddresses':
|
|
162408
|
-
'DepositMethods':
|
|
162409
|
-
'DepositStatus':
|
|
162548
|
+
'ClosedOrders': 3,
|
|
162549
|
+
'DepositAddresses': 3,
|
|
162550
|
+
'DepositMethods': 3,
|
|
162551
|
+
'DepositStatus': 3,
|
|
162410
162552
|
'EditOrder': 0,
|
|
162411
|
-
'ExportStatus':
|
|
162412
|
-
'GetWebSocketsToken':
|
|
162413
|
-
'Ledgers':
|
|
162414
|
-
'OpenOrders':
|
|
162415
|
-
'OpenPositions':
|
|
162416
|
-
'QueryLedgers':
|
|
162417
|
-
'QueryOrders':
|
|
162418
|
-
'QueryTrades':
|
|
162419
|
-
'RetrieveExport':
|
|
162420
|
-
'RemoveExport':
|
|
162421
|
-
'BalanceEx':
|
|
162422
|
-
'TradeBalance':
|
|
162423
|
-
'TradesHistory':
|
|
162424
|
-
'TradeVolume':
|
|
162425
|
-
'Withdraw':
|
|
162426
|
-
'WithdrawCancel':
|
|
162427
|
-
'WithdrawInfo':
|
|
162428
|
-
'WithdrawMethods':
|
|
162429
|
-
'WithdrawAddresses':
|
|
162430
|
-
'WithdrawStatus':
|
|
162431
|
-
'WalletTransfer':
|
|
162553
|
+
'ExportStatus': 3,
|
|
162554
|
+
'GetWebSocketsToken': 3,
|
|
162555
|
+
'Ledgers': 6,
|
|
162556
|
+
'OpenOrders': 3,
|
|
162557
|
+
'OpenPositions': 3,
|
|
162558
|
+
'QueryLedgers': 3,
|
|
162559
|
+
'QueryOrders': 3,
|
|
162560
|
+
'QueryTrades': 3,
|
|
162561
|
+
'RetrieveExport': 3,
|
|
162562
|
+
'RemoveExport': 3,
|
|
162563
|
+
'BalanceEx': 3,
|
|
162564
|
+
'TradeBalance': 3,
|
|
162565
|
+
'TradesHistory': 6,
|
|
162566
|
+
'TradeVolume': 3,
|
|
162567
|
+
'Withdraw': 3,
|
|
162568
|
+
'WithdrawCancel': 3,
|
|
162569
|
+
'WithdrawInfo': 3,
|
|
162570
|
+
'WithdrawMethods': 3,
|
|
162571
|
+
'WithdrawAddresses': 3,
|
|
162572
|
+
'WithdrawStatus': 3,
|
|
162573
|
+
'WalletTransfer': 3,
|
|
162432
162574
|
// sub accounts
|
|
162433
|
-
'CreateSubaccount':
|
|
162434
|
-
'AccountTransfer':
|
|
162575
|
+
'CreateSubaccount': 3,
|
|
162576
|
+
'AccountTransfer': 3,
|
|
162435
162577
|
// earn
|
|
162436
|
-
'Earn/Allocate':
|
|
162437
|
-
'Earn/Deallocate':
|
|
162438
|
-
'Earn/AllocateStatus':
|
|
162439
|
-
'Earn/DeallocateStatus':
|
|
162440
|
-
'Earn/Strategies':
|
|
162441
|
-
'Earn/Allocations':
|
|
162578
|
+
'Earn/Allocate': 3,
|
|
162579
|
+
'Earn/Deallocate': 3,
|
|
162580
|
+
'Earn/AllocateStatus': 3,
|
|
162581
|
+
'Earn/DeallocateStatus': 3,
|
|
162582
|
+
'Earn/Strategies': 3,
|
|
162583
|
+
'Earn/Allocations': 3,
|
|
162442
162584
|
},
|
|
162443
162585
|
},
|
|
162444
162586
|
},
|
|
@@ -172289,6 +172431,7 @@ class kucoinfutures extends _abstract_kucoinfutures_js__WEBPACK_IMPORTED_MODULE_
|
|
|
172289
172431
|
'addMargin': true,
|
|
172290
172432
|
'cancelAllOrders': true,
|
|
172291
172433
|
'cancelOrder': true,
|
|
172434
|
+
'closeAllPositions': false,
|
|
172292
172435
|
'closePosition': true,
|
|
172293
172436
|
'closePositions': false,
|
|
172294
172437
|
'createDepositAddress': true,
|
|
@@ -223141,8 +223284,21 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223141
223284
|
// }
|
|
223142
223285
|
//
|
|
223143
223286
|
const marketId = this.safeString(position, 's');
|
|
223144
|
-
const
|
|
223145
|
-
const
|
|
223287
|
+
const contracts = this.safeString(position, 'pa');
|
|
223288
|
+
const contractsAbs = _base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringAbs(this.safeString(position, 'pa'));
|
|
223289
|
+
let positionSide = this.safeStringLower(position, 'ps');
|
|
223290
|
+
let hedged = true;
|
|
223291
|
+
if (positionSide === 'both') {
|
|
223292
|
+
hedged = false;
|
|
223293
|
+
if (!_base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringEq(contracts, '0')) {
|
|
223294
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_2__/* .Precise */ .O.stringLt(contracts, '0')) {
|
|
223295
|
+
positionSide = 'short';
|
|
223296
|
+
}
|
|
223297
|
+
else {
|
|
223298
|
+
positionSide = 'long';
|
|
223299
|
+
}
|
|
223300
|
+
}
|
|
223301
|
+
}
|
|
223146
223302
|
return this.safePosition({
|
|
223147
223303
|
'info': position,
|
|
223148
223304
|
'id': undefined,
|
|
@@ -223153,7 +223309,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
223153
223309
|
'entryPrice': this.safeNumber(position, 'ep'),
|
|
223154
223310
|
'unrealizedPnl': this.safeNumber(position, 'up'),
|
|
223155
223311
|
'percentage': undefined,
|
|
223156
|
-
'contracts': this.
|
|
223312
|
+
'contracts': this.parseNumber(contractsAbs),
|
|
223157
223313
|
'contractSize': undefined,
|
|
223158
223314
|
'markPrice': undefined,
|
|
223159
223315
|
'side': positionSide,
|
|
@@ -292670,7 +292826,7 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
292670
292826
|
'public': {
|
|
292671
292827
|
'get': {
|
|
292672
292828
|
'exchangeInfo': 1,
|
|
292673
|
-
'depth':
|
|
292829
|
+
'depth': 0.5,
|
|
292674
292830
|
'ping': 1,
|
|
292675
292831
|
'systemStatus': 1,
|
|
292676
292832
|
'tickers/24hr': 1,
|
|
@@ -292689,6 +292845,11 @@ class wazirx extends _abstract_wazirx_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
292689
292845
|
'openOrders': 1,
|
|
292690
292846
|
'order': 0.5,
|
|
292691
292847
|
'myTrades': 0.5,
|
|
292848
|
+
'coins': 12,
|
|
292849
|
+
'crypto/withdraws': 12,
|
|
292850
|
+
'crypto/deposits/address': 60,
|
|
292851
|
+
'sub_account/fund_transfer/history': 1,
|
|
292852
|
+
'sub_account/accounts': 1,
|
|
292692
292853
|
},
|
|
292693
292854
|
'post': {
|
|
292694
292855
|
'order': 0.1,
|
|
@@ -295928,10 +296089,10 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
295928
296089
|
'fetchPositionMode': false,
|
|
295929
296090
|
'fetchPositions': true,
|
|
295930
296091
|
'fetchPremiumIndexOHLCV': false,
|
|
295931
|
-
'fetchStatus':
|
|
296092
|
+
'fetchStatus': true,
|
|
295932
296093
|
'fetchTicker': false,
|
|
295933
296094
|
'fetchTickers': false,
|
|
295934
|
-
'fetchTime':
|
|
296095
|
+
'fetchTime': true,
|
|
295935
296096
|
'fetchTrades': true,
|
|
295936
296097
|
'fetchTradingFee': false,
|
|
295937
296098
|
'fetchTradingFees': true,
|
|
@@ -296168,6 +296329,67 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296168
296329
|
'precisionMode': _base_functions_number_js__WEBPACK_IMPORTED_MODULE_2__/* .TICK_SIZE */ .sh,
|
|
296169
296330
|
});
|
|
296170
296331
|
}
|
|
296332
|
+
async fetchStatus(params = {}) {
|
|
296333
|
+
/**
|
|
296334
|
+
* @method
|
|
296335
|
+
* @name woo#fetchStatus
|
|
296336
|
+
* @description the latest known information on the availability of the exchange API
|
|
296337
|
+
* @see https://docs.woo.org/#get-system-maintenance-status-public
|
|
296338
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
296339
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
296340
|
+
*/
|
|
296341
|
+
const response = await this.v1PublicGetSystemInfo(params);
|
|
296342
|
+
//
|
|
296343
|
+
// {
|
|
296344
|
+
// "success": true,
|
|
296345
|
+
// "data": {
|
|
296346
|
+
// "status": "0",
|
|
296347
|
+
// "msg": "System is functioning properly."
|
|
296348
|
+
// },
|
|
296349
|
+
// "timestamp": "1709274106602"
|
|
296350
|
+
// }
|
|
296351
|
+
//
|
|
296352
|
+
const data = this.safeDict(response, 'data', {});
|
|
296353
|
+
let status = this.safeString(data, 'status');
|
|
296354
|
+
if (status === undefined) {
|
|
296355
|
+
status = 'error';
|
|
296356
|
+
}
|
|
296357
|
+
else if (status === '0') {
|
|
296358
|
+
status = 'ok';
|
|
296359
|
+
}
|
|
296360
|
+
else {
|
|
296361
|
+
status = 'maintenance';
|
|
296362
|
+
}
|
|
296363
|
+
return {
|
|
296364
|
+
'status': status,
|
|
296365
|
+
'updated': undefined,
|
|
296366
|
+
'eta': undefined,
|
|
296367
|
+
'url': undefined,
|
|
296368
|
+
'info': response,
|
|
296369
|
+
};
|
|
296370
|
+
}
|
|
296371
|
+
async fetchTime(params = {}) {
|
|
296372
|
+
/**
|
|
296373
|
+
* @method
|
|
296374
|
+
* @name woo#fetchTime
|
|
296375
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
296376
|
+
* @see https://docs.woo.org/#get-system-maintenance-status-public
|
|
296377
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
296378
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
296379
|
+
*/
|
|
296380
|
+
const response = await this.v1PublicGetSystemInfo(params);
|
|
296381
|
+
//
|
|
296382
|
+
// {
|
|
296383
|
+
// "success": true,
|
|
296384
|
+
// "data": {
|
|
296385
|
+
// "status": "0",
|
|
296386
|
+
// "msg": "System is functioning properly."
|
|
296387
|
+
// },
|
|
296388
|
+
// "timestamp": "1709274106602"
|
|
296389
|
+
// }
|
|
296390
|
+
//
|
|
296391
|
+
return this.safeInteger(response, 'timestamp');
|
|
296392
|
+
}
|
|
296171
296393
|
async fetchMarkets(params = {}) {
|
|
296172
296394
|
/**
|
|
296173
296395
|
* @method
|
|
@@ -296198,7 +296420,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296198
296420
|
// "success": true
|
|
296199
296421
|
// }
|
|
296200
296422
|
//
|
|
296201
|
-
const data = this.
|
|
296423
|
+
const data = this.safeList(response, 'rows', []);
|
|
296202
296424
|
return this.parseMarkets(data);
|
|
296203
296425
|
}
|
|
296204
296426
|
parseMarket(market) {
|
|
@@ -296450,7 +296672,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296450
296672
|
// "timestamp": 1673323685109
|
|
296451
296673
|
// }
|
|
296452
296674
|
//
|
|
296453
|
-
const data = this.
|
|
296675
|
+
const data = this.safeDict(response, 'data', {});
|
|
296454
296676
|
const maker = this.safeString(data, 'makerFeeRate');
|
|
296455
296677
|
const taker = this.safeString(data, 'takerFeeRate');
|
|
296456
296678
|
const result = {};
|
|
@@ -296537,7 +296759,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296537
296759
|
// "success": true
|
|
296538
296760
|
// }
|
|
296539
296761
|
//
|
|
296540
|
-
const tokenRows = this.
|
|
296762
|
+
const tokenRows = this.safeList(tokenResponse, 'rows', []);
|
|
296541
296763
|
const networksByCurrencyId = this.groupBy(tokenRows, 'balance_token');
|
|
296542
296764
|
const currencyIds = Object.keys(networksByCurrencyId);
|
|
296543
296765
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
@@ -296697,7 +296919,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296697
296919
|
* @param {string} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
296698
296920
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
296699
296921
|
*/
|
|
296700
|
-
const reduceOnly = this.
|
|
296922
|
+
const reduceOnly = this.safeBool2(params, 'reduceOnly', 'reduce_only');
|
|
296701
296923
|
params = this.omit(params, ['reduceOnly', 'reduce_only']);
|
|
296702
296924
|
const orderType = type.toUpperCase();
|
|
296703
296925
|
await this.loadMarkets();
|
|
@@ -296868,9 +297090,9 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296868
297090
|
// },
|
|
296869
297091
|
// "timestamp": "1686149372216"
|
|
296870
297092
|
// }
|
|
296871
|
-
const data = this.
|
|
297093
|
+
const data = this.safeDict(response, 'data');
|
|
296872
297094
|
if (data !== undefined) {
|
|
296873
|
-
const rows = this.
|
|
297095
|
+
const rows = this.safeList(data, 'rows', []);
|
|
296874
297096
|
return this.parseOrder(rows[0], market);
|
|
296875
297097
|
}
|
|
296876
297098
|
const order = this.parseOrder(response, market);
|
|
@@ -296971,7 +297193,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
296971
297193
|
// "timestamp": 0
|
|
296972
297194
|
// }
|
|
296973
297195
|
//
|
|
296974
|
-
const data = this.
|
|
297196
|
+
const data = this.safeDict(response, 'data', {});
|
|
296975
297197
|
return this.parseOrder(data, market);
|
|
296976
297198
|
}
|
|
296977
297199
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -297045,8 +297267,8 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297045
297267
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
297046
297268
|
*/
|
|
297047
297269
|
await this.loadMarkets();
|
|
297048
|
-
const stop = this.
|
|
297049
|
-
params = this.omit(params, 'stop');
|
|
297270
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
297271
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
297050
297272
|
if (stop) {
|
|
297051
297273
|
return await this.v3PrivateDeleteAlgoOrdersPending(params);
|
|
297052
297274
|
}
|
|
@@ -297080,8 +297302,8 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297080
297302
|
*/
|
|
297081
297303
|
await this.loadMarkets();
|
|
297082
297304
|
const market = (symbol !== undefined) ? this.market(symbol) : undefined;
|
|
297083
|
-
const stop = this.
|
|
297084
|
-
params = this.omit(params, 'stop');
|
|
297305
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
297306
|
+
params = this.omit(params, ['stop', 'trigger']);
|
|
297085
297307
|
const request = {};
|
|
297086
297308
|
const clientOrderId = this.safeString2(params, 'clOrdID', 'clientOrderId');
|
|
297087
297309
|
let response = undefined;
|
|
@@ -297155,9 +297377,9 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297155
297377
|
await this.loadMarkets();
|
|
297156
297378
|
const request = {};
|
|
297157
297379
|
let market = undefined;
|
|
297158
|
-
const stop = this.
|
|
297380
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
297159
297381
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
297160
|
-
params = this.omit(params, ['stop', 'trailing']);
|
|
297382
|
+
params = this.omit(params, ['stop', 'trailing', 'trigger']);
|
|
297161
297383
|
if (symbol !== undefined) {
|
|
297162
297384
|
market = this.market(symbol);
|
|
297163
297385
|
request['symbol'] = market['id'];
|
|
@@ -297215,7 +297437,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297215
297437
|
// }
|
|
297216
297438
|
//
|
|
297217
297439
|
const data = this.safeValue(response, 'data', response);
|
|
297218
|
-
const orders = this.
|
|
297440
|
+
const orders = this.safeList(data, 'rows');
|
|
297219
297441
|
return this.parseOrders(orders, market, since, limit, params);
|
|
297220
297442
|
}
|
|
297221
297443
|
parseTimeInForce(timeInForce) {
|
|
@@ -297317,7 +297539,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297317
297539
|
'type': orderType,
|
|
297318
297540
|
'timeInForce': this.parseTimeInForce(orderType),
|
|
297319
297541
|
'postOnly': undefined,
|
|
297320
|
-
'reduceOnly': this.
|
|
297542
|
+
'reduceOnly': this.safeBool(order, 'reduce_only'),
|
|
297321
297543
|
'side': side,
|
|
297322
297544
|
'price': price,
|
|
297323
297545
|
'stopPrice': stopPrice,
|
|
@@ -297475,7 +297697,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297475
297697
|
// }
|
|
297476
297698
|
//
|
|
297477
297699
|
}
|
|
297478
|
-
const rows = this.
|
|
297700
|
+
const rows = this.safeList(response, 'rows', []);
|
|
297479
297701
|
return this.parseOHLCVs(rows, market, timeframe, since, limit);
|
|
297480
297702
|
}
|
|
297481
297703
|
parseOHLCV(ohlcv, market = undefined) {
|
|
@@ -297528,7 +297750,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297528
297750
|
// }
|
|
297529
297751
|
// ]
|
|
297530
297752
|
// }
|
|
297531
|
-
const trades = this.
|
|
297753
|
+
const trades = this.safeList(response, 'rows', []);
|
|
297532
297754
|
return this.parseTrades(trades, market, since, limit, params);
|
|
297533
297755
|
}
|
|
297534
297756
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -297576,7 +297798,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297576
297798
|
// ...
|
|
297577
297799
|
// ]
|
|
297578
297800
|
// }
|
|
297579
|
-
const trades = this.
|
|
297801
|
+
const trades = this.safeList(response, 'rows', []);
|
|
297580
297802
|
return this.parseTrades(trades, market, since, limit, params);
|
|
297581
297803
|
}
|
|
297582
297804
|
async fetchAccounts(params = {}) {
|
|
@@ -297604,7 +297826,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297604
297826
|
// "success": true
|
|
297605
297827
|
// }
|
|
297606
297828
|
//
|
|
297607
|
-
const rows = this.
|
|
297829
|
+
const rows = this.safeList(response, 'rows', []);
|
|
297608
297830
|
return this.parseAccounts(rows, params);
|
|
297609
297831
|
}
|
|
297610
297832
|
parseAccount(account) {
|
|
@@ -297658,14 +297880,14 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297658
297880
|
// "timestamp": 1673323746259
|
|
297659
297881
|
// }
|
|
297660
297882
|
//
|
|
297661
|
-
const data = this.
|
|
297883
|
+
const data = this.safeDict(response, 'data');
|
|
297662
297884
|
return this.parseBalance(data);
|
|
297663
297885
|
}
|
|
297664
297886
|
parseBalance(response) {
|
|
297665
297887
|
const result = {
|
|
297666
297888
|
'info': response,
|
|
297667
297889
|
};
|
|
297668
|
-
const balances = this.
|
|
297890
|
+
const balances = this.safeList(response, 'holding', []);
|
|
297669
297891
|
for (let i = 0; i < balances.length; i++) {
|
|
297670
297892
|
const balance = balances[i];
|
|
297671
297893
|
const code = this.safeCurrencyCode(this.safeString(balance, 'token'));
|
|
@@ -297942,6 +298164,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297942
298164
|
/**
|
|
297943
298165
|
* @method
|
|
297944
298166
|
* @name woo#transfer
|
|
298167
|
+
* @see https://docs.woo.org/#get-transfer-history
|
|
297945
298168
|
* @description transfer currency internally between wallets on the same account
|
|
297946
298169
|
* @param {string} code unified currency code
|
|
297947
298170
|
* @param {float} amount amount to transfer
|
|
@@ -297954,7 +298177,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297954
298177
|
const currency = this.currency(code);
|
|
297955
298178
|
const request = {
|
|
297956
298179
|
'token': currency['id'],
|
|
297957
|
-
'amount': this.
|
|
298180
|
+
'amount': this.parseToNumeric(amount),
|
|
297958
298181
|
'from_application_id': fromAccount,
|
|
297959
298182
|
'to_application_id': toAccount,
|
|
297960
298183
|
};
|
|
@@ -297966,7 +298189,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297966
298189
|
// }
|
|
297967
298190
|
//
|
|
297968
298191
|
const transfer = this.parseTransfer(response, currency);
|
|
297969
|
-
const transferOptions = this.
|
|
298192
|
+
const transferOptions = this.safeDict(this.options, 'transfer', {});
|
|
297970
298193
|
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
297971
298194
|
if (fillResponseFromRequest) {
|
|
297972
298195
|
transfer['amount'] = amount;
|
|
@@ -297980,41 +298203,71 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
297980
298203
|
* @method
|
|
297981
298204
|
* @name woo#fetchTransfers
|
|
297982
298205
|
* @description fetch a history of internal transfers made on an account
|
|
298206
|
+
* @see https://docs.woo.org/#get-transfer-history
|
|
297983
298207
|
* @param {string} code unified currency code of the currency transferred
|
|
297984
298208
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
297985
298209
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
297986
298210
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
298211
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
297987
298212
|
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
297988
298213
|
*/
|
|
297989
|
-
const request = {
|
|
297990
|
-
|
|
297991
|
-
|
|
297992
|
-
|
|
297993
|
-
|
|
298214
|
+
const request = {};
|
|
298215
|
+
if (limit !== undefined) {
|
|
298216
|
+
request['size'] = limit;
|
|
298217
|
+
}
|
|
298218
|
+
if (since !== undefined) {
|
|
298219
|
+
request['start_t'] = since;
|
|
298220
|
+
}
|
|
298221
|
+
const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
|
|
298222
|
+
params = this.omit(params, ['until', 'till']);
|
|
298223
|
+
if (until !== undefined) {
|
|
298224
|
+
request['end_t'] = until;
|
|
298225
|
+
}
|
|
298226
|
+
const response = await this.v1PrivateGetAssetMainSubTransferHistory(this.extend(request, params));
|
|
298227
|
+
//
|
|
298228
|
+
// {
|
|
298229
|
+
// "rows": [
|
|
298230
|
+
// {
|
|
298231
|
+
// "id": 46704,
|
|
298232
|
+
// "token": "USDT",
|
|
298233
|
+
// "amount": 30000.00000000,
|
|
298234
|
+
// "status": "COMPLETED",
|
|
298235
|
+
// "from_application_id": "0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3",
|
|
298236
|
+
// "to_application_id": "c01e6940-a735-4022-9b6c-9d3971cdfdfa",
|
|
298237
|
+
// "from_user": "LeverageLow",
|
|
298238
|
+
// "to_user": "dev",
|
|
298239
|
+
// "created_time": "1709022325.427",
|
|
298240
|
+
// "updated_time": "1709022325.542"
|
|
298241
|
+
// }
|
|
298242
|
+
// ],
|
|
298243
|
+
// "meta": {
|
|
298244
|
+
// "total": 50,
|
|
298245
|
+
// "records_per_page": 25,
|
|
298246
|
+
// "current_page": 1
|
|
298247
|
+
// },
|
|
298248
|
+
// "success": true
|
|
298249
|
+
// }
|
|
298250
|
+
//
|
|
298251
|
+
const data = this.safeList(response, 'rows', []);
|
|
298252
|
+
return this.parseTransfers(data, undefined, since, limit, params);
|
|
297994
298253
|
}
|
|
297995
298254
|
parseTransfer(transfer, currency = undefined) {
|
|
297996
298255
|
//
|
|
297997
|
-
//
|
|
297998
|
-
//
|
|
297999
|
-
//
|
|
298000
|
-
//
|
|
298001
|
-
//
|
|
298002
|
-
//
|
|
298003
|
-
//
|
|
298004
|
-
//
|
|
298005
|
-
//
|
|
298006
|
-
//
|
|
298007
|
-
//
|
|
298008
|
-
//
|
|
298009
|
-
//
|
|
298010
|
-
// "amount": 1000,
|
|
298011
|
-
// "tx_id": "0x8a74c517bc104c8ebad0c3c3f64b1f302ed5f8bca598ae4459c63419038106b6",
|
|
298012
|
-
// "fee_token": null,
|
|
298013
|
-
// "fee_amount": null,
|
|
298014
|
-
// "status": "CONFIRMING"
|
|
298015
|
-
// }
|
|
298256
|
+
// fetchTransfers
|
|
298257
|
+
// {
|
|
298258
|
+
// "id": 46704,
|
|
298259
|
+
// "token": "USDT",
|
|
298260
|
+
// "amount": 30000.00000000,
|
|
298261
|
+
// "status": "COMPLETED",
|
|
298262
|
+
// "from_application_id": "0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3",
|
|
298263
|
+
// "to_application_id": "c01e6940-a735-4022-9b6c-9d3971cdfdfa",
|
|
298264
|
+
// "from_user": "LeverageLow",
|
|
298265
|
+
// "to_user": "dev",
|
|
298266
|
+
// "created_time": "1709022325.427",
|
|
298267
|
+
// "updated_time": "1709022325.542"
|
|
298268
|
+
// }
|
|
298016
298269
|
//
|
|
298017
|
-
//
|
|
298270
|
+
// transfer
|
|
298018
298271
|
// {
|
|
298019
298272
|
// "success": true,
|
|
298020
298273
|
// "id": 200
|
|
@@ -298023,22 +298276,8 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298023
298276
|
const networkizedCode = this.safeString(transfer, 'token');
|
|
298024
298277
|
const currencyDefined = this.getCurrencyFromChaincode(networkizedCode, currency);
|
|
298025
298278
|
const code = currencyDefined['code'];
|
|
298026
|
-
let movementDirection = this.safeStringLower(transfer, 'token_side');
|
|
298027
|
-
if (movementDirection === 'withdraw') {
|
|
298028
|
-
movementDirection = 'withdrawal';
|
|
298029
|
-
}
|
|
298030
|
-
let fromAccount = undefined;
|
|
298031
|
-
let toAccount = undefined;
|
|
298032
|
-
if (movementDirection === 'withdraw') {
|
|
298033
|
-
fromAccount = undefined;
|
|
298034
|
-
toAccount = 'spot';
|
|
298035
|
-
}
|
|
298036
|
-
else if (movementDirection === 'deposit') {
|
|
298037
|
-
fromAccount = 'spot';
|
|
298038
|
-
toAccount = undefined;
|
|
298039
|
-
}
|
|
298040
298279
|
const timestamp = this.safeTimestamp(transfer, 'created_time');
|
|
298041
|
-
const success = this.
|
|
298280
|
+
const success = this.safeBool(transfer, 'success');
|
|
298042
298281
|
let status = undefined;
|
|
298043
298282
|
if (success !== undefined) {
|
|
298044
298283
|
status = success ? 'ok' : 'failed';
|
|
@@ -298049,8 +298288,8 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298049
298288
|
'datetime': this.iso8601(timestamp),
|
|
298050
298289
|
'currency': code,
|
|
298051
298290
|
'amount': this.safeNumber(transfer, 'amount'),
|
|
298052
|
-
'fromAccount':
|
|
298053
|
-
'toAccount':
|
|
298291
|
+
'fromAccount': this.safeString(transfer, 'from_application_id'),
|
|
298292
|
+
'toAccount': this.safeString(transfer, 'to_application_id'),
|
|
298054
298293
|
'status': this.parseTransferStatus(this.safeString(transfer, 'status', status)),
|
|
298055
298294
|
'info': transfer,
|
|
298056
298295
|
};
|
|
@@ -298088,11 +298327,11 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298088
298327
|
if (tag !== undefined) {
|
|
298089
298328
|
request['extra'] = tag;
|
|
298090
298329
|
}
|
|
298091
|
-
const networks = this.
|
|
298092
|
-
const currencyNetworks = this.
|
|
298330
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
298331
|
+
const currencyNetworks = this.safeDict(currency, 'networks', {});
|
|
298093
298332
|
const network = this.safeStringUpper(params, 'network');
|
|
298094
298333
|
const networkId = this.safeString(networks, network, network);
|
|
298095
|
-
const coinNetwork = this.
|
|
298334
|
+
const coinNetwork = this.safeDict(currencyNetworks, networkId, {});
|
|
298096
298335
|
const coinNetworkId = this.safeString(coinNetwork, 'id');
|
|
298097
298336
|
if (coinNetworkId === undefined) {
|
|
298098
298337
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' withdraw() require network parameter');
|
|
@@ -298220,7 +298459,9 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298220
298459
|
body = auth;
|
|
298221
298460
|
}
|
|
298222
298461
|
else {
|
|
298223
|
-
|
|
298462
|
+
if (Object.keys(params).length) {
|
|
298463
|
+
url += '?' + auth;
|
|
298464
|
+
}
|
|
298224
298465
|
}
|
|
298225
298466
|
auth += '|' + ts;
|
|
298226
298467
|
headers['content-type'] = 'application/x-www-form-urlencoded';
|
|
@@ -298237,7 +298478,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298237
298478
|
// 400 Bad Request {"success":false,"code":-1012,"message":"Amount is required for buy market orders when margin disabled."}
|
|
298238
298479
|
// {"code":"-1011","message":"The system is under maintenance.","success":false}
|
|
298239
298480
|
//
|
|
298240
|
-
const success = this.
|
|
298481
|
+
const success = this.safeBool(response, 'success');
|
|
298241
298482
|
const errorCode = this.safeString(response, 'code');
|
|
298242
298483
|
if (!success) {
|
|
298243
298484
|
const feedback = this.id + ' ' + this.json(response);
|
|
@@ -298313,7 +298554,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298313
298554
|
// "success":true
|
|
298314
298555
|
// }
|
|
298315
298556
|
//
|
|
298316
|
-
const result = this.
|
|
298557
|
+
const result = this.safeList(response, 'rows', []);
|
|
298317
298558
|
return this.parseIncomes(result, market, since, limit);
|
|
298318
298559
|
}
|
|
298319
298560
|
parseFundingRate(fundingRate, market = undefined) {
|
|
@@ -298394,7 +298635,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298394
298635
|
// "timestamp":1653633985646
|
|
298395
298636
|
// }
|
|
298396
298637
|
//
|
|
298397
|
-
const rows = this.
|
|
298638
|
+
const rows = this.safeList(response, 'rows', []);
|
|
298398
298639
|
const result = this.parseFundingRates(rows);
|
|
298399
298640
|
return this.filterByArray(result, 'symbol', symbols);
|
|
298400
298641
|
}
|
|
@@ -298448,7 +298689,7 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298448
298689
|
// "timestamp":1653640814885
|
|
298449
298690
|
// }
|
|
298450
298691
|
//
|
|
298451
|
-
const result = this.
|
|
298692
|
+
const result = this.safeList(response, 'rows');
|
|
298452
298693
|
const rates = [];
|
|
298453
298694
|
for (let i = 0; i < result.length; i++) {
|
|
298454
298695
|
const entry = result[i];
|
|
@@ -298610,8 +298851,8 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
298610
298851
|
// "timestamp": 1673323880342
|
|
298611
298852
|
// }
|
|
298612
298853
|
//
|
|
298613
|
-
const result = this.
|
|
298614
|
-
const positions = this.
|
|
298854
|
+
const result = this.safeDict(response, 'data', {});
|
|
298855
|
+
const positions = this.safeList(result, 'positions', []);
|
|
298615
298856
|
return this.parsePositions(positions, symbols);
|
|
298616
298857
|
}
|
|
298617
298858
|
parsePosition(position, market = undefined) {
|
|
@@ -308265,7 +308506,7 @@ SOFTWARE.
|
|
|
308265
308506
|
|
|
308266
308507
|
//-----------------------------------------------------------------------------
|
|
308267
308508
|
// this is updated by vss.js when building
|
|
308268
|
-
const version = '4.2.
|
|
308509
|
+
const version = '4.2.60';
|
|
308269
308510
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
308270
308511
|
//-----------------------------------------------------------------------------
|
|
308271
308512
|
|