ccxt 4.3.3 → 4.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +296 -6
- package/dist/cjs/src/binance.js +22 -17
- package/dist/cjs/src/kucoin.js +53 -3
- package/dist/cjs/src/phemex.js +5 -0
- package/dist/cjs/src/pro/binance.js +439 -75
- package/dist/cjs/src/pro/woo.js +0 -1
- package/dist/cjs/src/whitebit.js +132 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/whitebit.d.ts +21 -0
- package/js/src/base/Exchange.d.ts +51 -3
- package/js/src/base/Exchange.js +296 -6
- package/js/src/binance.d.ts +4 -0
- package/js/src/binance.js +22 -17
- package/js/src/kucoin.d.ts +1 -0
- package/js/src/kucoin.js +53 -3
- package/js/src/phemex.js +5 -0
- package/js/src/pro/binance.d.ts +9 -1
- package/js/src/pro/binance.js +439 -75
- package/js/src/pro/cex.d.ts +1 -1
- package/js/src/pro/lbank.d.ts +1 -1
- package/js/src/pro/woo.js +0 -1
- package/js/src/whitebit.d.ts +2 -0
- package/js/src/whitebit.js +132 -2
- package/package.json +1 -1
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -1149,8 +1149,10 @@ class kucoin extends kucoin$1 {
|
|
|
1149
1149
|
// "chains":[
|
|
1150
1150
|
// {
|
|
1151
1151
|
// "chainName":"ERC20",
|
|
1152
|
-
// "
|
|
1152
|
+
// "chainId": "eth"
|
|
1153
1153
|
// "withdrawalMinSize":"2999",
|
|
1154
|
+
// "depositMinSize":null,
|
|
1155
|
+
// "withdrawFeeRate":"0",
|
|
1154
1156
|
// "withdrawalMinFee":"2999",
|
|
1155
1157
|
// "isWithdrawEnabled":false,
|
|
1156
1158
|
// "isDepositEnabled":false,
|
|
@@ -1258,7 +1260,7 @@ class kucoin extends kucoin$1 {
|
|
|
1258
1260
|
'max': undefined,
|
|
1259
1261
|
},
|
|
1260
1262
|
'deposit': {
|
|
1261
|
-
'min': this.safeNumber(
|
|
1263
|
+
'min': this.safeNumber(chain, 'depositMinSize'),
|
|
1262
1264
|
'max': undefined,
|
|
1263
1265
|
},
|
|
1264
1266
|
},
|
|
@@ -3201,7 +3203,6 @@ class kucoin extends kucoin$1 {
|
|
|
3201
3203
|
const request = {
|
|
3202
3204
|
'currency': currency['id'],
|
|
3203
3205
|
'address': address,
|
|
3204
|
-
'amount': amount,
|
|
3205
3206
|
// 'memo': tag,
|
|
3206
3207
|
// 'isInner': false, // internal transfer or external withdrawal
|
|
3207
3208
|
// 'remark': 'optional',
|
|
@@ -3215,6 +3216,8 @@ class kucoin extends kucoin$1 {
|
|
|
3215
3216
|
if (networkCode !== undefined) {
|
|
3216
3217
|
request['chain'] = this.networkCodeToId(networkCode).toLowerCase();
|
|
3217
3218
|
}
|
|
3219
|
+
await this.loadCurrencyPrecision(currency, networkCode);
|
|
3220
|
+
request['amount'] = this.currencyToPrecision(code, amount, networkCode);
|
|
3218
3221
|
let includeFee = undefined;
|
|
3219
3222
|
[includeFee, params] = this.handleOptionAndParams(params, 'withdraw', 'includeFee', false);
|
|
3220
3223
|
if (includeFee) {
|
|
@@ -3234,6 +3237,53 @@ class kucoin extends kucoin$1 {
|
|
|
3234
3237
|
const data = this.safeDict(response, 'data', {});
|
|
3235
3238
|
return this.parseTransaction(data, currency);
|
|
3236
3239
|
}
|
|
3240
|
+
async loadCurrencyPrecision(currency, networkCode = undefined) {
|
|
3241
|
+
// as kucoin might not have network specific precisions defined in fetchCurrencies (because of webapi failure)
|
|
3242
|
+
// we should check and refetch precision once-per-instance for that specific currency & network
|
|
3243
|
+
// so avoids thorwing exceptions and burden to users
|
|
3244
|
+
// Note: this needs to be executed only if networkCode was provided
|
|
3245
|
+
if (networkCode !== undefined) {
|
|
3246
|
+
const networks = currency['networks'];
|
|
3247
|
+
const network = this.safeDict(networks, networkCode);
|
|
3248
|
+
if (this.safeNumber(network, 'precision') !== undefined) {
|
|
3249
|
+
// if precision exists, no need to refetch
|
|
3250
|
+
return;
|
|
3251
|
+
}
|
|
3252
|
+
// otherwise try to fetch and store in instance
|
|
3253
|
+
const request = {
|
|
3254
|
+
'currency': currency['id'],
|
|
3255
|
+
'chain': this.networkCodeToId(networkCode).toLowerCase(),
|
|
3256
|
+
};
|
|
3257
|
+
const response = await this.privateGetWithdrawalsQuotas(request);
|
|
3258
|
+
//
|
|
3259
|
+
// {
|
|
3260
|
+
// "code": "200000",
|
|
3261
|
+
// "data": {
|
|
3262
|
+
// "currency": "USDT",
|
|
3263
|
+
// "limitBTCAmount": "14.24094850",
|
|
3264
|
+
// "usedBTCAmount": "0.00000000",
|
|
3265
|
+
// "quotaCurrency": "USDT",
|
|
3266
|
+
// "limitQuotaCurrencyAmount": "999999.00000000",
|
|
3267
|
+
// "usedQuotaCurrencyAmount": "0",
|
|
3268
|
+
// "remainAmount": "999999.0000",
|
|
3269
|
+
// "availableAmount": "10.77545071",
|
|
3270
|
+
// "withdrawMinFee": "1",
|
|
3271
|
+
// "innerWithdrawMinFee": "0",
|
|
3272
|
+
// "withdrawMinSize": "10",
|
|
3273
|
+
// "isWithdrawEnabled": true,
|
|
3274
|
+
// "precision": 4,
|
|
3275
|
+
// "chain": "EOS",
|
|
3276
|
+
// "reason": null,
|
|
3277
|
+
// "lockedAmount": "0"
|
|
3278
|
+
// }
|
|
3279
|
+
// }
|
|
3280
|
+
//
|
|
3281
|
+
const data = this.safeDict(response, 'data', {});
|
|
3282
|
+
const precision = this.parseNumber(this.parsePrecision(this.safeString(data, 'precision')));
|
|
3283
|
+
const code = currency['code'];
|
|
3284
|
+
this.currencies[code]['networks'][networkCode]['precision'] = precision;
|
|
3285
|
+
}
|
|
3286
|
+
}
|
|
3237
3287
|
parseTransactionStatus(status) {
|
|
3238
3288
|
const statuses = {
|
|
3239
3289
|
'SUCCESS': 'ok',
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -2865,11 +2865,16 @@ class phemex extends phemex$1 {
|
|
|
2865
2865
|
}
|
|
2866
2866
|
await this.loadMarkets();
|
|
2867
2867
|
const market = this.market(symbol);
|
|
2868
|
+
const stop = this.safeValue2(params, 'stop', 'trigger', false);
|
|
2869
|
+
params = this.omit(params, 'stop', 'trigger');
|
|
2868
2870
|
const request = {
|
|
2869
2871
|
'symbol': market['id'],
|
|
2870
2872
|
// 'untriggerred': false, // false to cancel non-conditional orders, true to cancel conditional orders
|
|
2871
2873
|
// 'text': 'up to 40 characters max',
|
|
2872
2874
|
};
|
|
2875
|
+
if (stop) {
|
|
2876
|
+
request['untriggerred'] = stop;
|
|
2877
|
+
}
|
|
2873
2878
|
let response = undefined;
|
|
2874
2879
|
if (market['settle'] === 'USDT') {
|
|
2875
2880
|
response = await this.privateDeleteGOrdersAll(this.extend(request, params));
|