ccxt 4.2.28 → 4.2.30
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/CONTRIBUTING.md +4 -1
- package/README.md +6 -6
- package/dist/ccxt.browser.js +1865 -558
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/ascendex.js +5 -5
- package/dist/cjs/src/base/Exchange.js +114 -21
- package/dist/cjs/src/base/errors.js +3 -3
- package/dist/cjs/src/base/functions/type.js +12 -0
- package/dist/cjs/src/bigone.js +2 -2
- package/dist/cjs/src/binance.js +896 -217
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitfinex2.js +52 -62
- package/dist/cjs/src/bitget.js +8 -4
- package/dist/cjs/src/bitmart.js +3 -3
- package/dist/cjs/src/bitmex.js +9 -6
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitteam.js +2 -2
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/bybit.js +28 -12
- package/dist/cjs/src/coinbase.js +12 -5
- package/dist/cjs/src/coincheck.js +1 -1
- package/dist/cjs/src/coinex.js +2 -2
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmate.js +1 -1
- package/dist/cjs/src/coinmetro.js +12 -6
- package/dist/cjs/src/coinsph.js +1 -1
- package/dist/cjs/src/cryptocom.js +3 -3
- package/dist/cjs/src/digifinex.js +6 -4
- package/dist/cjs/src/exmo.js +2 -2
- package/dist/cjs/src/gate.js +5 -5
- package/dist/cjs/src/gemini.js +3 -3
- package/dist/cjs/src/hitbtc.js +14 -20
- package/dist/cjs/src/hollaex.js +2 -2
- package/dist/cjs/src/htx.js +5 -5
- package/dist/cjs/src/huobijp.js +1 -1
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +17 -17
- package/dist/cjs/src/kucoinfutures.js +3 -3
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/mexc.js +7 -7
- package/dist/cjs/src/novadax.js +1 -1
- package/dist/cjs/src/okcoin.js +2 -2
- package/dist/cjs/src/okx.js +24 -10
- package/dist/cjs/src/p2b.js +1 -0
- package/dist/cjs/src/phemex.js +3 -3
- package/dist/cjs/src/poloniexfutures.js +3 -3
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/binance.js +4 -4
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +49 -6
- package/dist/cjs/src/pro/bitvavo.js +1 -1
- package/dist/cjs/src/pro/bybit.js +2 -2
- package/dist/cjs/src/pro/cex.js +2 -2
- package/dist/cjs/src/pro/coinbase.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/okx.js +1 -1
- package/dist/cjs/src/pro/onetrading.js +2 -2
- package/dist/cjs/src/pro/p2b.js +432 -0
- package/dist/cjs/src/pro/probit.js +5 -5
- package/dist/cjs/src/pro/whitebit.js +1 -1
- package/dist/cjs/src/probit.js +1 -1
- package/dist/cjs/src/timex.js +1 -1
- package/dist/cjs/src/tokocrypto.js +3 -3
- package/dist/cjs/src/wavesexchange.js +2 -2
- package/dist/cjs/src/whitebit.js +2 -2
- package/dist/cjs/src/woo.js +3 -3
- package/dist/cjs/src/yobit.js +1 -1
- package/dist/cjs/src/zaif.js +1 -1
- package/dist/cjs/src/zonda.js +3 -3
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/bybit.d.ts +2 -2
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/ascendex.js +5 -5
- package/js/src/base/Exchange.d.ts +10 -1
- package/js/src/base/Exchange.js +114 -21
- package/js/src/base/errorHierarchy.d.ts +7 -6
- package/js/src/base/errorHierarchy.js +7 -6
- package/js/src/base/errors.d.ts +3 -3
- package/js/src/base/errors.js +3 -3
- package/js/src/base/functions/type.js +12 -0
- package/js/src/bigone.js +2 -2
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +897 -218
- package/js/src/bingx.js +1 -1
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitfinex2.js +52 -62
- package/js/src/bitget.js +8 -4
- package/js/src/bitmart.js +3 -3
- package/js/src/bitmex.js +9 -6
- package/js/src/bitrue.js +1 -1
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitteam.js +2 -2
- package/js/src/btcalpha.js +1 -1
- package/js/src/bybit.js +28 -12
- package/js/src/coinbase.js +12 -5
- package/js/src/coincheck.js +1 -1
- package/js/src/coinex.js +2 -2
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmate.js +1 -1
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +12 -6
- package/js/src/coinsph.js +1 -1
- package/js/src/cryptocom.js +3 -3
- package/js/src/digifinex.js +6 -4
- package/js/src/exmo.js +2 -2
- package/js/src/gate.js +5 -5
- package/js/src/gemini.d.ts +1 -1
- package/js/src/gemini.js +3 -3
- package/js/src/hitbtc.js +14 -20
- package/js/src/hollaex.js +2 -2
- package/js/src/htx.js +5 -5
- package/js/src/huobijp.js +1 -1
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +17 -17
- package/js/src/kucoinfutures.js +3 -3
- package/js/src/lbank.js +1 -1
- package/js/src/mexc.js +7 -7
- package/js/src/novadax.js +1 -1
- package/js/src/okcoin.js +2 -2
- package/js/src/okx.js +24 -10
- package/js/src/p2b.js +1 -0
- package/js/src/phemex.js +3 -3
- package/js/src/poloniexfutures.js +3 -3
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/binance.js +4 -4
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitmart.js +1 -1
- package/js/src/pro/bitmex.d.ts +2 -1
- package/js/src/pro/bitmex.js +49 -6
- package/js/src/pro/bitvavo.js +1 -1
- package/js/src/pro/bybit.js +2 -2
- package/js/src/pro/cex.js +2 -2
- package/js/src/pro/coinbase.js +2 -2
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/okx.js +1 -1
- package/js/src/pro/onetrading.js +2 -2
- package/js/src/pro/p2b.d.ts +23 -0
- package/js/src/pro/p2b.js +433 -0
- package/js/src/pro/probit.js +5 -5
- package/js/src/pro/whitebit.js +1 -1
- package/js/src/probit.js +1 -1
- package/js/src/timex.js +1 -1
- package/js/src/tokocrypto.js +3 -3
- package/js/src/wavesexchange.js +2 -2
- package/js/src/whitebit.js +2 -2
- package/js/src/woo.js +3 -3
- package/js/src/yobit.js +1 -1
- package/js/src/zaif.js +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +3 -3
- package/package.json +1 -1
- package/skip-tests.json +3 -10
package/js/src/coinmetro.js
CHANGED
|
@@ -138,7 +138,7 @@ export default class coinmetro extends Exchange {
|
|
|
138
138
|
'private': 'https://api.coinmetro.com',
|
|
139
139
|
},
|
|
140
140
|
'test': {
|
|
141
|
-
'public': 'https://api.coinmetro.com',
|
|
141
|
+
'public': 'https://api.coinmetro.com/open',
|
|
142
142
|
'private': 'https://api.coinmetro.com/open',
|
|
143
143
|
},
|
|
144
144
|
'www': 'https://coinmetro.com/',
|
|
@@ -380,7 +380,7 @@ export default class coinmetro extends Exchange {
|
|
|
380
380
|
const quote = this.safeCurrencyCode(quoteId);
|
|
381
381
|
const basePrecisionAndLimits = this.parseMarketPrecisionAndLimits(baseId);
|
|
382
382
|
const quotePrecisionAndLimits = this.parseMarketPrecisionAndLimits(quoteId);
|
|
383
|
-
const margin = this.
|
|
383
|
+
const margin = this.safeBool(market, 'margin', false);
|
|
384
384
|
const tradingFees = this.safeValue(this.fees, 'trading', {});
|
|
385
385
|
return this.safeMarketStructure({
|
|
386
386
|
'id': id,
|
|
@@ -1339,7 +1339,7 @@ export default class coinmetro extends Exchange {
|
|
|
1339
1339
|
};
|
|
1340
1340
|
const marginMode = undefined;
|
|
1341
1341
|
[params, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
1342
|
-
const isMargin = this.
|
|
1342
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
1343
1343
|
params = this.omit(params, 'margin');
|
|
1344
1344
|
let response = undefined;
|
|
1345
1345
|
if (isMargin || (marginMode !== undefined)) {
|
|
@@ -1857,11 +1857,17 @@ export default class coinmetro extends Exchange {
|
|
|
1857
1857
|
const endpoint = '/' + this.implodeParams(path, params);
|
|
1858
1858
|
let url = this.urls['api'][api] + endpoint;
|
|
1859
1859
|
const query = this.urlencode(request);
|
|
1860
|
+
if (headers === undefined) {
|
|
1861
|
+
headers = {};
|
|
1862
|
+
}
|
|
1863
|
+
headers['CCXT'] = 'true';
|
|
1860
1864
|
if (api === 'private') {
|
|
1861
|
-
if (
|
|
1862
|
-
|
|
1865
|
+
if ((this.uid === undefined) && (this.apiKey !== undefined)) {
|
|
1866
|
+
this.uid = this.apiKey;
|
|
1867
|
+
}
|
|
1868
|
+
if ((this.token === undefined) && (this.secret !== undefined)) {
|
|
1869
|
+
this.token = this.secret;
|
|
1863
1870
|
}
|
|
1864
|
-
headers['CCXT'] = true;
|
|
1865
1871
|
if (url === 'https://api.coinmetro.com/jwt') { // handle with headers for login endpoint
|
|
1866
1872
|
headers['X-Device-Id'] = 'bypass';
|
|
1867
1873
|
if (this.twofa !== undefined) {
|
package/js/src/coinsph.js
CHANGED
|
@@ -1562,7 +1562,7 @@ export default class coinsph extends Exchange {
|
|
|
1562
1562
|
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1563
1563
|
*/
|
|
1564
1564
|
const options = this.safeValue(this.options, 'withdraw');
|
|
1565
|
-
const warning = this.
|
|
1565
|
+
const warning = this.safeBool(options, 'warning', true);
|
|
1566
1566
|
if (warning) {
|
|
1567
1567
|
throw new InvalidAddress(this.id + " withdraw() makes a withdrawals only to coins_ph account, add .options['withdraw']['warning'] = false to make a withdrawal to your coins_ph account");
|
|
1568
1568
|
}
|
package/js/src/cryptocom.js
CHANGED
|
@@ -1057,7 +1057,7 @@ export default class cryptocom extends Exchange {
|
|
|
1057
1057
|
request['time_in_force'] = timeInForce;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
const postOnly = this.
|
|
1060
|
+
const postOnly = this.safeBool(params, 'postOnly', false);
|
|
1061
1061
|
if ((postOnly) || (timeInForce === 'PO')) {
|
|
1062
1062
|
request['exec_inst'] = ['POST_ONLY'];
|
|
1063
1063
|
request['time_in_force'] = 'GOOD_TILL_CANCEL';
|
|
@@ -1278,7 +1278,7 @@ export default class cryptocom extends Exchange {
|
|
|
1278
1278
|
request['time_in_force'] = timeInForce;
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
|
-
const postOnly = this.
|
|
1281
|
+
const postOnly = this.safeBool(params, 'postOnly', false);
|
|
1282
1282
|
if ((postOnly) || (timeInForce === 'PO')) {
|
|
1283
1283
|
request['exec_inst'] = ['POST_ONLY'];
|
|
1284
1284
|
request['time_in_force'] = 'GOOD_TILL_CANCEL';
|
|
@@ -2249,7 +2249,7 @@ export default class cryptocom extends Exchange {
|
|
|
2249
2249
|
* @returns {Array} the marginMode in lowercase
|
|
2250
2250
|
*/
|
|
2251
2251
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
2252
|
-
const isMargin = this.
|
|
2252
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
2253
2253
|
params = this.omit(params, 'margin');
|
|
2254
2254
|
let marginMode = undefined;
|
|
2255
2255
|
[marginMode, params] = this.handleMarginModeAndParams(methodName, params);
|
package/js/src/digifinex.js
CHANGED
|
@@ -1162,9 +1162,11 @@ export default class digifinex extends Exchange {
|
|
|
1162
1162
|
// "timestamp": 1663221614998
|
|
1163
1163
|
// }
|
|
1164
1164
|
//
|
|
1165
|
+
const indexPrice = this.safeNumber(ticker, 'index_price');
|
|
1166
|
+
const marketType = (indexPrice !== undefined) ? 'contract' : 'spot';
|
|
1165
1167
|
const marketId = this.safeStringUpper2(ticker, 'symbol', 'instrument_id');
|
|
1166
|
-
const symbol = this.safeSymbol(marketId, market);
|
|
1167
|
-
market = this.safeMarket(marketId);
|
|
1168
|
+
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
1169
|
+
market = this.safeMarket(marketId, market, undefined, marketType);
|
|
1168
1170
|
let timestamp = this.safeTimestamp(ticker, 'date');
|
|
1169
1171
|
if (market['swap']) {
|
|
1170
1172
|
timestamp = this.safeInteger(ticker, 'timestamp');
|
|
@@ -1751,7 +1753,7 @@ export default class digifinex extends Exchange {
|
|
|
1751
1753
|
let postOnly = this.isPostOnly(isMarketOrder, false, params);
|
|
1752
1754
|
let postOnlyParsed = undefined;
|
|
1753
1755
|
if (swap) {
|
|
1754
|
-
const reduceOnly = this.
|
|
1756
|
+
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
1755
1757
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1756
1758
|
let orderType = undefined;
|
|
1757
1759
|
if (side === 'buy') {
|
|
@@ -3951,7 +3953,7 @@ export default class digifinex extends Exchange {
|
|
|
3951
3953
|
* @returns {Array} the marginMode in lowercase
|
|
3952
3954
|
*/
|
|
3953
3955
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
3954
|
-
const isMargin = this.
|
|
3956
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
3955
3957
|
let marginMode = undefined;
|
|
3956
3958
|
[marginMode, params] = super.handleMarginModeAndParams(methodName, params, defaultValue);
|
|
3957
3959
|
if (marginMode !== undefined) {
|
package/js/src/exmo.js
CHANGED
|
@@ -252,7 +252,7 @@ export default class exmo extends Exchange {
|
|
|
252
252
|
//
|
|
253
253
|
const margin = this.parseMarginModification(response, market);
|
|
254
254
|
const options = this.safeValue(this.options, 'margin', {});
|
|
255
|
-
const fillResponseFromRequest = this.
|
|
255
|
+
const fillResponseFromRequest = this.safeBool(options, 'fillResponseFromRequest', true);
|
|
256
256
|
if (fillResponseFromRequest) {
|
|
257
257
|
margin['type'] = type;
|
|
258
258
|
margin['amount'] = amount;
|
|
@@ -2616,7 +2616,7 @@ export default class exmo extends Exchange {
|
|
|
2616
2616
|
// {"result":false,"error":"Error 50052: Insufficient funds"}
|
|
2617
2617
|
// {"s":"error","errmsg":"strconv.ParseInt: parsing \"\": invalid syntax"}
|
|
2618
2618
|
//
|
|
2619
|
-
let success = this.
|
|
2619
|
+
let success = this.safeBool(response, 'result', false);
|
|
2620
2620
|
if (typeof success === 'string') {
|
|
2621
2621
|
if ((success === 'true') || (success === '1')) {
|
|
2622
2622
|
success = true;
|
package/js/src/gate.js
CHANGED
|
@@ -1592,9 +1592,9 @@ export default class gate extends Exchange {
|
|
|
1592
1592
|
const networkId = this.safeString(entry, 'chain');
|
|
1593
1593
|
const networkCode = this.networkIdToCode(networkId, code);
|
|
1594
1594
|
const delisted = this.safeValue(entry, 'delisted');
|
|
1595
|
-
const withdrawDisabled = this.
|
|
1596
|
-
const depositDisabled = this.
|
|
1597
|
-
const tradeDisabled = this.
|
|
1595
|
+
const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
|
|
1596
|
+
const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
|
|
1597
|
+
const tradeDisabled = this.safeBool(entry, 'trade_disabled', false);
|
|
1598
1598
|
const withdrawEnabled = !withdrawDisabled;
|
|
1599
1599
|
const depositEnabled = !depositDisabled;
|
|
1600
1600
|
const tradeEnabled = !tradeDisabled;
|
|
@@ -4051,7 +4051,7 @@ export default class gate extends Exchange {
|
|
|
4051
4051
|
}
|
|
4052
4052
|
}
|
|
4053
4053
|
let clientOrderId = this.safeString2(params, 'text', 'clientOrderId');
|
|
4054
|
-
const textIsRequired = this.
|
|
4054
|
+
const textIsRequired = this.safeBool(params, 'textIsRequired', false);
|
|
4055
4055
|
if (clientOrderId !== undefined) {
|
|
4056
4056
|
// user-defined, must follow the rules if not empty
|
|
4057
4057
|
// prefixed with t-
|
|
@@ -4423,7 +4423,7 @@ export default class gate extends Exchange {
|
|
|
4423
4423
|
// "message": "Not enough balance"
|
|
4424
4424
|
// }
|
|
4425
4425
|
//
|
|
4426
|
-
const succeeded = this.
|
|
4426
|
+
const succeeded = this.safeBool(order, 'succeeded', true);
|
|
4427
4427
|
if (!succeeded) {
|
|
4428
4428
|
// cancelOrders response
|
|
4429
4429
|
return this.safeOrder({
|
package/js/src/gemini.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class gemini extends Exchange {
|
|
|
10
10
|
fetchCurrenciesFromWeb(params?: {}): Promise<{}>;
|
|
11
11
|
fetchMarkets(params?: {}): Promise<any>;
|
|
12
12
|
fetchMarketsFromWeb(params?: {}): Promise<any[]>;
|
|
13
|
-
parseMarketActive(status: any):
|
|
13
|
+
parseMarketActive(status: any): boolean;
|
|
14
14
|
fetchUSDTMarkets(params?: {}): Promise<any[]>;
|
|
15
15
|
fetchMarketsFromAPI(params?: {}): Promise<unknown[]>;
|
|
16
16
|
parseMarket(response: any): Market;
|
package/js/src/gemini.js
CHANGED
|
@@ -515,7 +515,7 @@ export default class gemini extends Exchange {
|
|
|
515
515
|
'post_only': true,
|
|
516
516
|
'limit_only': true,
|
|
517
517
|
};
|
|
518
|
-
return this.
|
|
518
|
+
return this.safeBool(statuses, status, true);
|
|
519
519
|
}
|
|
520
520
|
async fetchUSDTMarkets(params = {}) {
|
|
521
521
|
// these markets can't be scrapped and fetchMarketsFrom api does an extra call
|
|
@@ -554,7 +554,7 @@ export default class gemini extends Exchange {
|
|
|
554
554
|
result[marketId] = this.parseMarket(market);
|
|
555
555
|
}
|
|
556
556
|
const options = this.safeValue(this.options, 'fetchMarketsFromAPI', {});
|
|
557
|
-
const fetchDetailsForAllSymbols = this.
|
|
557
|
+
const fetchDetailsForAllSymbols = this.safeBool(options, 'fetchDetailsForAllSymbols', false);
|
|
558
558
|
const fetchDetailsForMarketIds = this.safeValue(options, 'fetchDetailsForMarketIds', []);
|
|
559
559
|
let promises = [];
|
|
560
560
|
let marketIds = [];
|
|
@@ -1371,7 +1371,7 @@ export default class gemini extends Exchange {
|
|
|
1371
1371
|
request['options'] = ['maker-or-cancel'];
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
|
-
const postOnly = this.
|
|
1374
|
+
const postOnly = this.safeBool(params, 'postOnly', false);
|
|
1375
1375
|
params = this.omit(params, 'postOnly');
|
|
1376
1376
|
if (postOnly) {
|
|
1377
1377
|
request['options'] = ['maker-or-cancel'];
|
package/js/src/hitbtc.js
CHANGED
|
@@ -693,7 +693,7 @@ export default class hitbtc extends Exchange {
|
|
|
693
693
|
const expiry = this.safeInteger(market, 'expiry');
|
|
694
694
|
const contract = (marketType === 'futures');
|
|
695
695
|
const spot = (marketType === 'spot');
|
|
696
|
-
const marginTrading = this.
|
|
696
|
+
const marginTrading = this.safeBool(market, 'margin_trading', false);
|
|
697
697
|
const margin = spot && marginTrading;
|
|
698
698
|
const future = (expiry !== undefined);
|
|
699
699
|
const swap = (contract && !future);
|
|
@@ -828,9 +828,9 @@ export default class hitbtc extends Exchange {
|
|
|
828
828
|
const entry = response[currencyId];
|
|
829
829
|
const name = this.safeString(entry, 'full_name');
|
|
830
830
|
const precision = this.safeNumber(entry, 'precision_transfer');
|
|
831
|
-
const payinEnabled = this.
|
|
832
|
-
const payoutEnabled = this.
|
|
833
|
-
const transferEnabled = this.
|
|
831
|
+
const payinEnabled = this.safeBool(entry, 'payin_enabled', false);
|
|
832
|
+
const payoutEnabled = this.safeBool(entry, 'payout_enabled', false);
|
|
833
|
+
const transferEnabled = this.safeBool(entry, 'transfer_enabled', false);
|
|
834
834
|
const active = payinEnabled && payoutEnabled && transferEnabled;
|
|
835
835
|
const rawNetworks = this.safeValue(entry, 'networks', []);
|
|
836
836
|
const networks = {};
|
|
@@ -843,8 +843,8 @@ export default class hitbtc extends Exchange {
|
|
|
843
843
|
const network = this.safeNetwork(networkId);
|
|
844
844
|
fee = this.safeNumber(rawNetwork, 'payout_fee');
|
|
845
845
|
const networkPrecision = this.safeNumber(rawNetwork, 'precision_payout');
|
|
846
|
-
const payinEnabledNetwork = this.
|
|
847
|
-
const payoutEnabledNetwork = this.
|
|
846
|
+
const payinEnabledNetwork = this.safeBool(entry, 'payin_enabled', false);
|
|
847
|
+
const payoutEnabledNetwork = this.safeBool(entry, 'payout_enabled', false);
|
|
848
848
|
const activeNetwork = payinEnabledNetwork && payoutEnabledNetwork;
|
|
849
849
|
if (payinEnabledNetwork && !depositEnabled) {
|
|
850
850
|
depositEnabled = true;
|
|
@@ -2708,7 +2708,7 @@ export default class hitbtc extends Exchange {
|
|
|
2708
2708
|
params = this.omit(params, 'network');
|
|
2709
2709
|
}
|
|
2710
2710
|
const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
|
|
2711
|
-
const includeFee = this.
|
|
2711
|
+
const includeFee = this.safeBool(withdrawOptions, 'includeFee', false);
|
|
2712
2712
|
if (includeFee) {
|
|
2713
2713
|
request['include_fee'] = true;
|
|
2714
2714
|
}
|
|
@@ -3230,7 +3230,7 @@ export default class hitbtc extends Exchange {
|
|
|
3230
3230
|
await this.loadMarkets();
|
|
3231
3231
|
const market = this.market(symbol);
|
|
3232
3232
|
const leverage = this.safeString(params, 'leverage');
|
|
3233
|
-
if (market['
|
|
3233
|
+
if (market['swap']) {
|
|
3234
3234
|
if (leverage === undefined) {
|
|
3235
3235
|
throw new ArgumentsRequired(this.id + ' modifyMarginHelper() requires a leverage parameter for swap markets');
|
|
3236
3236
|
}
|
|
@@ -3254,21 +3254,15 @@ export default class hitbtc extends Exchange {
|
|
|
3254
3254
|
let marginMode = undefined;
|
|
3255
3255
|
[marketType, params] = this.handleMarketTypeAndParams('modifyMarginHelper', market, params);
|
|
3256
3256
|
[marginMode, params] = this.handleMarginModeAndParams('modifyMarginHelper', params);
|
|
3257
|
-
params = this.omit(params, ['marginMode', 'margin']);
|
|
3258
3257
|
let response = undefined;
|
|
3259
|
-
if (
|
|
3258
|
+
if (marketType === 'swap') {
|
|
3259
|
+
response = await this.privatePutFuturesAccountIsolatedSymbol(this.extend(request, params));
|
|
3260
|
+
}
|
|
3261
|
+
else if ((marketType === 'margin') || (marketType === 'spot') || (marginMode === 'isolated')) {
|
|
3260
3262
|
response = await this.privatePutMarginAccountIsolatedSymbol(this.extend(request, params));
|
|
3261
3263
|
}
|
|
3262
3264
|
else {
|
|
3263
|
-
|
|
3264
|
-
response = await this.privatePutFuturesAccountIsolatedSymbol(this.extend(request, params));
|
|
3265
|
-
}
|
|
3266
|
-
else if (marketType === 'margin') {
|
|
3267
|
-
response = await this.privatePutMarginAccountIsolatedSymbol(this.extend(request, params));
|
|
3268
|
-
}
|
|
3269
|
-
else {
|
|
3270
|
-
throw new NotSupported(this.id + ' modifyMarginHelper() not support this market type');
|
|
3271
|
-
}
|
|
3265
|
+
throw new NotSupported(this.id + ' modifyMarginHelper() not support this market type');
|
|
3272
3266
|
}
|
|
3273
3267
|
//
|
|
3274
3268
|
// {
|
|
@@ -3580,7 +3574,7 @@ export default class hitbtc extends Exchange {
|
|
|
3580
3574
|
* @returns {Array} the marginMode in lowercase
|
|
3581
3575
|
*/
|
|
3582
3576
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
3583
|
-
const isMargin = this.
|
|
3577
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
3584
3578
|
let marginMode = undefined;
|
|
3585
3579
|
[marginMode, params] = super.handleMarginModeAndParams(methodName, params, defaultValue);
|
|
3586
3580
|
if (marginMode === undefined) {
|
package/js/src/hollaex.js
CHANGED
|
@@ -1094,7 +1094,7 @@ export default class hollaex extends Exchange {
|
|
|
1094
1094
|
const filled = this.safeString(order, 'filled');
|
|
1095
1095
|
const status = this.parseOrderStatus(this.safeString(order, 'status'));
|
|
1096
1096
|
const meta = this.safeValue(order, 'meta', {});
|
|
1097
|
-
const postOnly = this.
|
|
1097
|
+
const postOnly = this.safeBool(meta, 'post_only', false);
|
|
1098
1098
|
return this.safeOrder({
|
|
1099
1099
|
'id': id,
|
|
1100
1100
|
'clientOrderId': undefined,
|
|
@@ -1148,7 +1148,7 @@ export default class hollaex extends Exchange {
|
|
|
1148
1148
|
};
|
|
1149
1149
|
const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop']);
|
|
1150
1150
|
const meta = this.safeValue(params, 'meta', {});
|
|
1151
|
-
const exchangeSpecificParam = this.
|
|
1151
|
+
const exchangeSpecificParam = this.safeBool(meta, 'post_only', false);
|
|
1152
1152
|
const isMarketOrder = type === 'market';
|
|
1153
1153
|
const postOnly = this.isPostOnly(isMarketOrder, exchangeSpecificParam, params);
|
|
1154
1154
|
if (!isMarketOrder) {
|
package/js/src/htx.js
CHANGED
|
@@ -3984,7 +3984,7 @@ export default class htx extends Exchange {
|
|
|
3984
3984
|
let response = undefined;
|
|
3985
3985
|
const stop = this.safeValue(params, 'stop');
|
|
3986
3986
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
3987
|
-
const trailing = this.
|
|
3987
|
+
const trailing = this.safeBool(params, 'trailing', false);
|
|
3988
3988
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
3989
3989
|
if (stop || stopLossTakeProfit || trailing) {
|
|
3990
3990
|
if (limit !== undefined) {
|
|
@@ -4359,7 +4359,7 @@ export default class htx extends Exchange {
|
|
|
4359
4359
|
request['contract_code'] = market['id'];
|
|
4360
4360
|
const stop = this.safeValue(params, 'stop');
|
|
4361
4361
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4362
|
-
const trailing = this.
|
|
4362
|
+
const trailing = this.safeBool(params, 'trailing', false);
|
|
4363
4363
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
4364
4364
|
if (market['linear']) {
|
|
4365
4365
|
let marginMode = undefined;
|
|
@@ -5738,7 +5738,7 @@ export default class htx extends Exchange {
|
|
|
5738
5738
|
}
|
|
5739
5739
|
const stop = this.safeValue(params, 'stop');
|
|
5740
5740
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
5741
|
-
const trailing = this.
|
|
5741
|
+
const trailing = this.safeBool(params, 'trailing', false);
|
|
5742
5742
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
5743
5743
|
if (market['linear']) {
|
|
5744
5744
|
let marginMode = undefined;
|
|
@@ -6063,7 +6063,7 @@ export default class htx extends Exchange {
|
|
|
6063
6063
|
request['contract_code'] = market['id'];
|
|
6064
6064
|
const stop = this.safeValue(params, 'stop');
|
|
6065
6065
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
6066
|
-
const trailing = this.
|
|
6066
|
+
const trailing = this.safeBool(params, 'trailing', false);
|
|
6067
6067
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
6068
6068
|
if (market['linear']) {
|
|
6069
6069
|
let marginMode = undefined;
|
|
@@ -6529,7 +6529,7 @@ export default class htx extends Exchange {
|
|
|
6529
6529
|
}
|
|
6530
6530
|
amount = parseFloat(this.currencyToPrecision(code, amount, networkCode));
|
|
6531
6531
|
const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
|
|
6532
|
-
if (this.
|
|
6532
|
+
if (this.safeBool(withdrawOptions, 'includeFee', false)) {
|
|
6533
6533
|
let fee = this.safeNumber(params, 'fee');
|
|
6534
6534
|
if (fee === undefined) {
|
|
6535
6535
|
const currencies = await this.fetchCurrencies();
|
package/js/src/huobijp.js
CHANGED
|
@@ -1046,7 +1046,7 @@ export default class huobijp extends Exchange {
|
|
|
1046
1046
|
const depositEnabled = this.safeValue(currency, 'deposit-enabled');
|
|
1047
1047
|
const withdrawEnabled = this.safeValue(currency, 'withdraw-enabled');
|
|
1048
1048
|
const countryDisabled = this.safeValue(currency, 'country-disabled');
|
|
1049
|
-
const visible = this.
|
|
1049
|
+
const visible = this.safeBool(currency, 'visible', false);
|
|
1050
1050
|
const state = this.safeString(currency, 'state');
|
|
1051
1051
|
const active = visible && depositEnabled && withdrawEnabled && (state === 'online') && !countryDisabled;
|
|
1052
1052
|
const name = this.safeString(currency, 'display-name');
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -548,7 +548,7 @@ export default class krakenfutures extends Exchange {
|
|
|
548
548
|
const volume = this.safeString(ticker, 'vol24h');
|
|
549
549
|
let baseVolume = undefined;
|
|
550
550
|
let quoteVolume = undefined;
|
|
551
|
-
const isIndex = this.
|
|
551
|
+
const isIndex = this.safeBool(market, 'index', false);
|
|
552
552
|
if (!isIndex) {
|
|
553
553
|
if (market['linear']) {
|
|
554
554
|
baseVolume = volume;
|
package/js/src/kucoin.js
CHANGED
|
@@ -943,7 +943,7 @@ export default class kucoin extends Exchange {
|
|
|
943
943
|
//
|
|
944
944
|
const data = this.safeValue(response, 'data');
|
|
945
945
|
const options = this.safeValue(this.options, 'fetchMarkets', {});
|
|
946
|
-
const fetchTickersFees = this.
|
|
946
|
+
const fetchTickersFees = this.safeBool(options, 'fetchTickersFees', true);
|
|
947
947
|
let tickersResponse = {};
|
|
948
948
|
if (fetchTickersFees) {
|
|
949
949
|
tickersResponse = await this.publicGetMarketAllTickers(params);
|
|
@@ -1151,14 +1151,14 @@ export default class kucoin extends Exchange {
|
|
|
1151
1151
|
const chain = chains[j];
|
|
1152
1152
|
const chainId = this.safeString(chain, 'chainId');
|
|
1153
1153
|
const networkCode = this.networkIdToCode(chainId);
|
|
1154
|
-
const chainWithdrawEnabled = this.
|
|
1154
|
+
const chainWithdrawEnabled = this.safeBool(chain, 'isWithdrawEnabled', false);
|
|
1155
1155
|
if (isWithdrawEnabled === undefined) {
|
|
1156
1156
|
isWithdrawEnabled = chainWithdrawEnabled;
|
|
1157
1157
|
}
|
|
1158
1158
|
else {
|
|
1159
1159
|
isWithdrawEnabled = isWithdrawEnabled || chainWithdrawEnabled;
|
|
1160
1160
|
}
|
|
1161
|
-
const chainDepositEnabled = this.
|
|
1161
|
+
const chainDepositEnabled = this.safeBool(chain, 'isDepositEnabled', false);
|
|
1162
1162
|
if (isDepositEnabled === undefined) {
|
|
1163
1163
|
isDepositEnabled = chainDepositEnabled;
|
|
1164
1164
|
}
|
|
@@ -1916,9 +1916,9 @@ export default class kucoin extends Exchange {
|
|
|
1916
1916
|
*/
|
|
1917
1917
|
await this.loadMarkets();
|
|
1918
1918
|
const market = this.market(symbol);
|
|
1919
|
-
const testOrder = this.
|
|
1919
|
+
const testOrder = this.safeBool(params, 'test', false);
|
|
1920
1920
|
params = this.omit(params, 'test');
|
|
1921
|
-
const isHf = this.
|
|
1921
|
+
const isHf = this.safeBool(params, 'hf', false);
|
|
1922
1922
|
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
1923
1923
|
const tradeType = this.safeString(params, 'tradeType'); // keep it for backward compatibility
|
|
1924
1924
|
const isTriggerOrder = (triggerPrice || stopLossPrice || takeProfitPrice);
|
|
@@ -2045,7 +2045,7 @@ export default class kucoin extends Exchange {
|
|
|
2045
2045
|
'symbol': market['id'],
|
|
2046
2046
|
'orderList': ordersRequests,
|
|
2047
2047
|
};
|
|
2048
|
-
const hf = this.
|
|
2048
|
+
const hf = this.safeBool(params, 'hf', false);
|
|
2049
2049
|
params = this.omit(params, 'hf');
|
|
2050
2050
|
let response = undefined;
|
|
2051
2051
|
if (hf) {
|
|
@@ -2227,7 +2227,7 @@ export default class kucoin extends Exchange {
|
|
|
2227
2227
|
const request = {};
|
|
2228
2228
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2229
2229
|
const stop = this.safeValue2(params, 'stop', 'trigger', false);
|
|
2230
|
-
const hf = this.
|
|
2230
|
+
const hf = this.safeBool(params, 'hf', false);
|
|
2231
2231
|
if (hf) {
|
|
2232
2232
|
if (symbol === undefined) {
|
|
2233
2233
|
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol parameter for hf orders');
|
|
@@ -2282,8 +2282,8 @@ export default class kucoin extends Exchange {
|
|
|
2282
2282
|
*/
|
|
2283
2283
|
await this.loadMarkets();
|
|
2284
2284
|
const request = {};
|
|
2285
|
-
const stop = this.
|
|
2286
|
-
const hf = this.
|
|
2285
|
+
const stop = this.safeBool(params, 'stop', false);
|
|
2286
|
+
const hf = this.safeBool(params, 'hf', false);
|
|
2287
2287
|
params = this.omit(params, ['stop', 'hf']);
|
|
2288
2288
|
const [marginMode, query] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
|
2289
2289
|
if (symbol !== undefined) {
|
|
@@ -2340,8 +2340,8 @@ export default class kucoin extends Exchange {
|
|
|
2340
2340
|
await this.loadMarkets();
|
|
2341
2341
|
let lowercaseStatus = status.toLowerCase();
|
|
2342
2342
|
const until = this.safeInteger2(params, 'until', 'till');
|
|
2343
|
-
const stop = this.
|
|
2344
|
-
const hf = this.
|
|
2343
|
+
const stop = this.safeBool(params, 'stop', false);
|
|
2344
|
+
const hf = this.safeBool(params, 'hf', false);
|
|
2345
2345
|
params = this.omit(params, ['stop', 'hf', 'till', 'until']);
|
|
2346
2346
|
const [marginMode, query] = this.handleMarginModeAndParams('fetchOrdersByStatus', params);
|
|
2347
2347
|
if (lowercaseStatus === 'open') {
|
|
@@ -2515,8 +2515,8 @@ export default class kucoin extends Exchange {
|
|
|
2515
2515
|
await this.loadMarkets();
|
|
2516
2516
|
const request = {};
|
|
2517
2517
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2518
|
-
const stop = this.
|
|
2519
|
-
const hf = this.
|
|
2518
|
+
const stop = this.safeBool(params, 'stop', false);
|
|
2519
|
+
const hf = this.safeBool(params, 'hf', false);
|
|
2520
2520
|
let market = undefined;
|
|
2521
2521
|
if (symbol !== undefined) {
|
|
2522
2522
|
market = this.market(symbol);
|
|
@@ -2693,10 +2693,10 @@ export default class kucoin extends Exchange {
|
|
|
2693
2693
|
const marketId = this.safeString(order, 'symbol');
|
|
2694
2694
|
const timestamp = this.safeInteger(order, 'createdAt');
|
|
2695
2695
|
const feeCurrencyId = this.safeString(order, 'feeCurrency');
|
|
2696
|
-
const cancelExist = this.
|
|
2696
|
+
const cancelExist = this.safeBool(order, 'cancelExist', false);
|
|
2697
2697
|
const responseStop = this.safeString(order, 'stop');
|
|
2698
2698
|
const stop = responseStop !== undefined;
|
|
2699
|
-
const stopTriggered = this.
|
|
2699
|
+
const stopTriggered = this.safeBool(order, 'stopTriggered', false);
|
|
2700
2700
|
const isActive = this.safeValue2(order, 'isActive', 'active');
|
|
2701
2701
|
const responseStatus = this.safeString(order, 'status');
|
|
2702
2702
|
let status = undefined;
|
|
@@ -2793,7 +2793,7 @@ export default class kucoin extends Exchange {
|
|
|
2793
2793
|
return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
|
|
2794
2794
|
}
|
|
2795
2795
|
let request = {};
|
|
2796
|
-
const hf = this.
|
|
2796
|
+
const hf = this.safeBool(params, 'hf', false);
|
|
2797
2797
|
if (hf && symbol === undefined) {
|
|
2798
2798
|
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol parameter for hf orders');
|
|
2799
2799
|
}
|
|
@@ -3472,7 +3472,7 @@ export default class kucoin extends Exchange {
|
|
|
3472
3472
|
const accountsByType = this.safeValue(this.options, 'accountsByType');
|
|
3473
3473
|
let type = this.safeString(accountsByType, requestedType, requestedType);
|
|
3474
3474
|
params = this.omit(params, 'type');
|
|
3475
|
-
const isHf = this.
|
|
3475
|
+
const isHf = this.safeBool(params, 'hf', false);
|
|
3476
3476
|
if (isHf) {
|
|
3477
3477
|
type = 'trade_hf';
|
|
3478
3478
|
}
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -1124,7 +1124,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
1124
1124
|
*/
|
|
1125
1125
|
await this.loadMarkets();
|
|
1126
1126
|
const market = this.market(symbol);
|
|
1127
|
-
const testOrder = this.
|
|
1127
|
+
const testOrder = this.safeBool(params, 'test', false);
|
|
1128
1128
|
params = this.omit(params, 'test');
|
|
1129
1129
|
const orderRequest = this.createContractOrderRequest(symbol, type, side, amount, price, params);
|
|
1130
1130
|
let response = undefined;
|
|
@@ -1787,7 +1787,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
1787
1787
|
// const average = Precise.stringDiv (cost, Precise.stringMul (filled, market['contractSize']));
|
|
1788
1788
|
// bool
|
|
1789
1789
|
const isActive = this.safeValue(order, 'isActive');
|
|
1790
|
-
const cancelExist = this.
|
|
1790
|
+
const cancelExist = this.safeBool(order, 'cancelExist', false);
|
|
1791
1791
|
let status = undefined;
|
|
1792
1792
|
if (isActive !== undefined) {
|
|
1793
1793
|
status = isActive ? 'open' : 'closed';
|
|
@@ -2511,7 +2511,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
2511
2511
|
await this.loadMarkets();
|
|
2512
2512
|
const market = this.market(symbol);
|
|
2513
2513
|
let clientOrderId = this.safeString(params, 'clientOrderId');
|
|
2514
|
-
const testOrder = this.
|
|
2514
|
+
const testOrder = this.safeBool(params, 'test', false);
|
|
2515
2515
|
params = this.omit(params, ['test', 'clientOrderId']);
|
|
2516
2516
|
if (clientOrderId === undefined) {
|
|
2517
2517
|
clientOrderId = this.numberToString(this.nonce());
|
package/js/src/lbank.js
CHANGED
|
@@ -1315,7 +1315,7 @@ export default class lbank extends Exchange {
|
|
|
1315
1315
|
await this.loadMarkets();
|
|
1316
1316
|
const market = this.market(symbol);
|
|
1317
1317
|
const clientOrderId = this.safeString2(params, 'custom_id', 'clientOrderId');
|
|
1318
|
-
const postOnly = this.
|
|
1318
|
+
const postOnly = this.safeBool(params, 'postOnly', false);
|
|
1319
1319
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
|
1320
1320
|
params = this.omit(params, ['custom_id', 'clientOrderId', 'timeInForce', 'postOnly']);
|
|
1321
1321
|
const request = {
|
package/js/src/mexc.js
CHANGED
|
@@ -958,8 +958,8 @@ export default class mexc extends Exchange {
|
|
|
958
958
|
const chain = chains[j];
|
|
959
959
|
const networkId = this.safeString(chain, 'network');
|
|
960
960
|
const network = this.safeNetwork(networkId);
|
|
961
|
-
const isDepositEnabled = this.
|
|
962
|
-
const isWithdrawEnabled = this.
|
|
961
|
+
const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
|
|
962
|
+
const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
|
|
963
963
|
const active = (isDepositEnabled && isWithdrawEnabled);
|
|
964
964
|
currencyActive = active || currencyActive;
|
|
965
965
|
const withdrawMin = this.safeString(chain, 'withdrawMin');
|
|
@@ -2218,7 +2218,7 @@ export default class mexc extends Exchange {
|
|
|
2218
2218
|
await this.loadMarkets();
|
|
2219
2219
|
const symbol = market['symbol'];
|
|
2220
2220
|
const unavailableContracts = this.safeValue(this.options, 'unavailableContracts', {});
|
|
2221
|
-
const isContractUnavaiable = this.
|
|
2221
|
+
const isContractUnavaiable = this.safeBool(unavailableContracts, symbol, false);
|
|
2222
2222
|
if (isContractUnavaiable) {
|
|
2223
2223
|
throw new NotSupported(this.id + ' createSwapOrder() does not support yet this symbol:' + symbol);
|
|
2224
2224
|
}
|
|
@@ -2286,7 +2286,7 @@ export default class mexc extends Exchange {
|
|
|
2286
2286
|
throw new ArgumentsRequired(this.id + ' createSwapOrder() requires a leverage parameter for isolated margin orders');
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
|
-
const reduceOnly = this.
|
|
2289
|
+
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
2290
2290
|
if (reduceOnly) {
|
|
2291
2291
|
request['side'] = (side === 'buy') ? 2 : 4;
|
|
2292
2292
|
}
|
|
@@ -3622,7 +3622,7 @@ export default class mexc extends Exchange {
|
|
|
3622
3622
|
const request = {};
|
|
3623
3623
|
[marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
3624
3624
|
const marginMode = this.safeString(params, 'marginMode');
|
|
3625
|
-
const isMargin = this.
|
|
3625
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
3626
3626
|
params = this.omit(params, ['margin', 'marginMode']);
|
|
3627
3627
|
let response = undefined;
|
|
3628
3628
|
if ((marginMode !== undefined) || (isMargin) || (marketType === 'margin')) {
|
|
@@ -5300,7 +5300,7 @@ export default class mexc extends Exchange {
|
|
|
5300
5300
|
* @returns {Array} the marginMode in lowercase
|
|
5301
5301
|
*/
|
|
5302
5302
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
5303
|
-
const isMargin = this.
|
|
5303
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
5304
5304
|
let marginMode = undefined;
|
|
5305
5305
|
[marginMode, params] = super.handleMarginModeAndParams(methodName, params, defaultValue);
|
|
5306
5306
|
if ((defaultType === 'margin') || (isMargin === true)) {
|
|
@@ -5392,7 +5392,7 @@ export default class mexc extends Exchange {
|
|
|
5392
5392
|
// {"code":10216,"msg":"No available deposit address"}
|
|
5393
5393
|
// {"success":true, "code":0, "data":1634095541710}
|
|
5394
5394
|
//
|
|
5395
|
-
const success = this.
|
|
5395
|
+
const success = this.safeBool(response, 'success', false); // v1
|
|
5396
5396
|
if (success === true) {
|
|
5397
5397
|
return undefined;
|
|
5398
5398
|
}
|
package/js/src/novadax.js
CHANGED
|
@@ -1165,7 +1165,7 @@ export default class novadax extends Exchange {
|
|
|
1165
1165
|
//
|
|
1166
1166
|
const transfer = this.parseTransfer(response, currency);
|
|
1167
1167
|
const transferOptions = this.safeValue(this.options, 'transfer', {});
|
|
1168
|
-
const fillResponseFromRequest = this.
|
|
1168
|
+
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
1169
1169
|
if (fillResponseFromRequest) {
|
|
1170
1170
|
transfer['fromAccount'] = fromAccount;
|
|
1171
1171
|
transfer['toAccount'] = toAccount;
|
package/js/src/okcoin.js
CHANGED
|
@@ -860,7 +860,7 @@ export default class okcoin extends Exchange {
|
|
|
860
860
|
const symbol = market['symbol'];
|
|
861
861
|
const last = this.safeString(ticker, 'last');
|
|
862
862
|
const open = this.safeString(ticker, 'open24h');
|
|
863
|
-
const spot = this.
|
|
863
|
+
const spot = this.safeBool(market, 'spot', false);
|
|
864
864
|
const quoteVolume = spot ? this.safeString(ticker, 'volCcy24h') : undefined;
|
|
865
865
|
const baseVolume = this.safeString(ticker, 'vol24h');
|
|
866
866
|
const high = this.safeString(ticker, 'high24h');
|
|
@@ -1404,7 +1404,7 @@ export default class okcoin extends Exchange {
|
|
|
1404
1404
|
}
|
|
1405
1405
|
else {
|
|
1406
1406
|
marginMode = defaultMarginMode;
|
|
1407
|
-
margin = this.
|
|
1407
|
+
margin = this.safeBool(params, 'margin', false);
|
|
1408
1408
|
}
|
|
1409
1409
|
if (margin) {
|
|
1410
1410
|
const defaultCurrency = (side === 'buy') ? market['quote'] : market['base'];
|