ccxt 4.4.28 → 4.4.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/README.md +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +59 -7
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/binance.js +9 -0
- package/dist/cjs/src/bitbns.js +12 -12
- package/dist/cjs/src/bitfinex.js +9 -9
- package/dist/cjs/src/bitget.js +99 -6
- package/dist/cjs/src/bitmart.js +53 -53
- package/dist/cjs/src/bitopro.js +21 -21
- package/dist/cjs/src/bitrue.js +28 -28
- package/dist/cjs/src/bitvavo.js +4 -0
- package/dist/cjs/src/bybit.js +51 -646
- package/dist/cjs/src/coincatch.js +24 -4
- package/dist/cjs/src/deribit.js +7 -3
- package/dist/cjs/src/hyperliquid.js +108 -4
- package/dist/cjs/src/lbank.js +7 -1
- package/dist/cjs/src/pro/bitvavo.js +2 -1
- package/dist/cjs/src/pro/blofin.js +2 -1
- package/dist/cjs/src/pro/mexc.js +198 -30
- package/dist/cjs/src/vertex.js +51 -6
- package/examples/README.md +0 -2
- package/examples/js/cli.js +7 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/alpaca.d.ts +1 -0
- package/js/src/abstract/binance.d.ts +9 -0
- package/js/src/abstract/binancecoinm.d.ts +9 -0
- package/js/src/abstract/binanceus.d.ts +9 -0
- package/js/src/abstract/binanceusdm.d.ts +9 -0
- package/js/src/abstract/bybit.d.ts +0 -13
- package/js/src/alpaca.d.ts +2 -0
- package/js/src/alpaca.js +59 -7
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/binance.js +9 -0
- package/js/src/bitbns.js +12 -12
- package/js/src/bitfinex.js +9 -9
- package/js/src/bitfinex2.d.ts +1 -1
- package/js/src/bitget.d.ts +2 -1
- package/js/src/bitget.js +99 -6
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +53 -53
- package/js/src/bitopro.js +21 -21
- package/js/src/bitrue.js +28 -28
- package/js/src/bitvavo.js +4 -0
- package/js/src/bybit.d.ts +0 -8
- package/js/src/bybit.js +51 -646
- package/js/src/coincatch.d.ts +1 -1
- package/js/src/coincatch.js +24 -4
- package/js/src/deribit.js +7 -3
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +108 -4
- package/js/src/lbank.js +7 -1
- package/js/src/pro/bitvavo.js +2 -1
- package/js/src/pro/blofin.js +2 -1
- package/js/src/pro/mexc.js +198 -30
- package/js/src/vertex.d.ts +4 -2
- package/js/src/vertex.js +51 -6
- package/js/src/whitebit.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -706,7 +706,7 @@ class bitmart extends bitmart$1 {
|
|
|
706
706
|
// }
|
|
707
707
|
// }
|
|
708
708
|
//
|
|
709
|
-
const data = this.
|
|
709
|
+
const data = this.safeDict(response, 'data', {});
|
|
710
710
|
return this.safeInteger(data, 'server_time');
|
|
711
711
|
}
|
|
712
712
|
async fetchStatus(params = {}) {
|
|
@@ -717,7 +717,7 @@ class bitmart extends bitmart$1 {
|
|
|
717
717
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
718
718
|
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
719
719
|
*/
|
|
720
|
-
const options = this.
|
|
720
|
+
const options = this.safeDict(this.options, 'fetchStatus', {});
|
|
721
721
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
722
722
|
let type = this.safeString(options, 'type', defaultType);
|
|
723
723
|
type = this.safeString(params, 'type', type);
|
|
@@ -748,13 +748,13 @@ class bitmart extends bitmart$1 {
|
|
|
748
748
|
// }
|
|
749
749
|
// }
|
|
750
750
|
//
|
|
751
|
-
const data = this.
|
|
752
|
-
const services = this.
|
|
751
|
+
const data = this.safeDict(response, 'data', {});
|
|
752
|
+
const services = this.safeList(data, 'service', []);
|
|
753
753
|
const servicesByType = this.indexBy(services, 'service_type');
|
|
754
754
|
if (type === 'swap') {
|
|
755
755
|
type = 'contract';
|
|
756
756
|
}
|
|
757
|
-
const service = this.
|
|
757
|
+
const service = this.safeString(servicesByType, type);
|
|
758
758
|
let status = undefined;
|
|
759
759
|
let eta = undefined;
|
|
760
760
|
if (service !== undefined) {
|
|
@@ -803,8 +803,8 @@ class bitmart extends bitmart$1 {
|
|
|
803
803
|
// }
|
|
804
804
|
// }
|
|
805
805
|
//
|
|
806
|
-
const data = this.
|
|
807
|
-
const symbols = this.
|
|
806
|
+
const data = this.safeDict(response, 'data', {});
|
|
807
|
+
const symbols = this.safeList(data, 'symbols', []);
|
|
808
808
|
const result = [];
|
|
809
809
|
for (let i = 0; i < symbols.length; i++) {
|
|
810
810
|
const market = symbols[i];
|
|
@@ -913,8 +913,8 @@ class bitmart extends bitmart$1 {
|
|
|
913
913
|
// }
|
|
914
914
|
// }
|
|
915
915
|
//
|
|
916
|
-
const data = this.
|
|
917
|
-
const symbols = this.
|
|
916
|
+
const data = this.safeDict(response, 'data', {});
|
|
917
|
+
const symbols = this.safeList(data, 'symbols', []);
|
|
918
918
|
const result = [];
|
|
919
919
|
for (let i = 0; i < symbols.length; i++) {
|
|
920
920
|
const market = symbols[i];
|
|
@@ -1022,16 +1022,16 @@ class bitmart extends bitmart$1 {
|
|
|
1022
1022
|
// }
|
|
1023
1023
|
// }
|
|
1024
1024
|
//
|
|
1025
|
-
const data = this.
|
|
1026
|
-
const currencies = this.
|
|
1025
|
+
const data = this.safeDict(response, 'data', {});
|
|
1026
|
+
const currencies = this.safeList(data, 'currencies', []);
|
|
1027
1027
|
const result = {};
|
|
1028
1028
|
for (let i = 0; i < currencies.length; i++) {
|
|
1029
1029
|
const currency = currencies[i];
|
|
1030
1030
|
const id = this.safeString(currency, 'id');
|
|
1031
1031
|
const code = this.safeCurrencyCode(id);
|
|
1032
1032
|
const name = this.safeString(currency, 'name');
|
|
1033
|
-
const withdrawEnabled = this.
|
|
1034
|
-
const depositEnabled = this.
|
|
1033
|
+
const withdrawEnabled = this.safeBool(currency, 'withdraw_enabled');
|
|
1034
|
+
const depositEnabled = this.safeBool(currency, 'deposit_enabled');
|
|
1035
1035
|
const active = withdrawEnabled && depositEnabled;
|
|
1036
1036
|
result[code] = {
|
|
1037
1037
|
'id': id,
|
|
@@ -1399,7 +1399,7 @@ class bitmart extends bitmart$1 {
|
|
|
1399
1399
|
else {
|
|
1400
1400
|
const data = this.safeDict(response, 'data', {});
|
|
1401
1401
|
tickers = this.safeList(data, 'symbols', []);
|
|
1402
|
-
ticker = this.
|
|
1402
|
+
ticker = this.safeDict(tickers, 0, {});
|
|
1403
1403
|
}
|
|
1404
1404
|
return this.parseTicker(ticker, market);
|
|
1405
1405
|
}
|
|
@@ -1419,7 +1419,7 @@ class bitmart extends bitmart$1 {
|
|
|
1419
1419
|
let type = undefined;
|
|
1420
1420
|
let market = undefined;
|
|
1421
1421
|
if (symbols !== undefined) {
|
|
1422
|
-
const symbol = this.
|
|
1422
|
+
const symbol = this.safeString(symbols, 0);
|
|
1423
1423
|
market = this.market(symbol);
|
|
1424
1424
|
}
|
|
1425
1425
|
[type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
|
|
@@ -1594,7 +1594,7 @@ class bitmart extends bitmart$1 {
|
|
|
1594
1594
|
// "trace": "4cad855074664097ac6ba5258c47305d.72.16952643834721135"
|
|
1595
1595
|
// }
|
|
1596
1596
|
//
|
|
1597
|
-
const data = this.
|
|
1597
|
+
const data = this.safeDict(response, 'data', {});
|
|
1598
1598
|
const timestamp = this.safeInteger2(data, 'ts', 'timestamp');
|
|
1599
1599
|
return this.parseOrderBook(data, market['symbol'], timestamp);
|
|
1600
1600
|
}
|
|
@@ -1950,7 +1950,7 @@ class bitmart extends bitmart$1 {
|
|
|
1950
1950
|
if (marginMode === 'isolated') {
|
|
1951
1951
|
request['orderMode'] = 'iso_margin';
|
|
1952
1952
|
}
|
|
1953
|
-
const options = this.
|
|
1953
|
+
const options = this.safeDict(this.options, 'fetchMyTrades', {});
|
|
1954
1954
|
const defaultLimit = this.safeInteger(options, 'limit', 200);
|
|
1955
1955
|
if (limit === undefined) {
|
|
1956
1956
|
limit = defaultLimit;
|
|
@@ -2055,16 +2055,16 @@ class bitmart extends bitmart$1 {
|
|
|
2055
2055
|
return this.parseTrades(data, undefined, since, limit);
|
|
2056
2056
|
}
|
|
2057
2057
|
customParseBalance(response, marketType) {
|
|
2058
|
-
const data = this.
|
|
2058
|
+
const data = this.safeDict(response, 'data', {});
|
|
2059
2059
|
let wallet = undefined;
|
|
2060
2060
|
if (marketType === 'swap') {
|
|
2061
|
-
wallet = this.
|
|
2061
|
+
wallet = this.safeList(response, 'data', []);
|
|
2062
2062
|
}
|
|
2063
2063
|
else if (marketType === 'margin') {
|
|
2064
|
-
wallet = this.
|
|
2064
|
+
wallet = this.safeList(data, 'symbols', []);
|
|
2065
2065
|
}
|
|
2066
2066
|
else {
|
|
2067
|
-
wallet = this.
|
|
2067
|
+
wallet = this.safeList(data, 'wallet', []);
|
|
2068
2068
|
}
|
|
2069
2069
|
const result = { 'info': response };
|
|
2070
2070
|
if (marketType === 'margin') {
|
|
@@ -2072,8 +2072,8 @@ class bitmart extends bitmart$1 {
|
|
|
2072
2072
|
const entry = wallet[i];
|
|
2073
2073
|
const marketId = this.safeString(entry, 'symbol');
|
|
2074
2074
|
const symbol = this.safeSymbol(marketId, undefined, '_');
|
|
2075
|
-
const base = this.
|
|
2076
|
-
const quote = this.
|
|
2075
|
+
const base = this.safeDict(entry, 'base', {});
|
|
2076
|
+
const quote = this.safeDict(entry, 'quote', {});
|
|
2077
2077
|
const baseCode = this.safeCurrencyCode(this.safeString(base, 'currency'));
|
|
2078
2078
|
const quoteCode = this.safeCurrencyCode(this.safeString(quote, 'currency'));
|
|
2079
2079
|
const subResult = {};
|
|
@@ -2290,7 +2290,7 @@ class bitmart extends bitmart$1 {
|
|
|
2290
2290
|
// }
|
|
2291
2291
|
// }
|
|
2292
2292
|
//
|
|
2293
|
-
const data = this.
|
|
2293
|
+
const data = this.safeDict(response, 'data', {});
|
|
2294
2294
|
return this.parseTradingFee(data);
|
|
2295
2295
|
}
|
|
2296
2296
|
parseOrder(order, market = undefined) {
|
|
@@ -2453,7 +2453,7 @@ class bitmart extends bitmart$1 {
|
|
|
2453
2453
|
'4': 'closed', // Completed
|
|
2454
2454
|
},
|
|
2455
2455
|
};
|
|
2456
|
-
const statuses = this.
|
|
2456
|
+
const statuses = this.safeDict(statusesByType, type, {});
|
|
2457
2457
|
return this.safeString(statuses, status, status);
|
|
2458
2458
|
}
|
|
2459
2459
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
@@ -2555,7 +2555,7 @@ class bitmart extends bitmart$1 {
|
|
|
2555
2555
|
// swap
|
|
2556
2556
|
// {"code":1000,"message":"Ok","data":{"order_id":231116359426639,"price":"market price"},"trace":"7f9c94e10f9d4513bc08a7bfc2a5559a.62.16996369620521911"}
|
|
2557
2557
|
//
|
|
2558
|
-
const data = this.
|
|
2558
|
+
const data = this.safeDict(response, 'data', {});
|
|
2559
2559
|
const order = this.parseOrder(data, market);
|
|
2560
2560
|
order['type'] = type;
|
|
2561
2561
|
order['side'] = side;
|
|
@@ -2902,7 +2902,7 @@ class bitmart extends bitmart$1 {
|
|
|
2902
2902
|
response = await this.privatePostSpotV3CancelOrder(this.extend(request, params));
|
|
2903
2903
|
}
|
|
2904
2904
|
else {
|
|
2905
|
-
const stop = this.
|
|
2905
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
2906
2906
|
params = this.omit(params, ['stop', 'trigger']);
|
|
2907
2907
|
if (!stop) {
|
|
2908
2908
|
response = await this.privatePostContractPrivateCancelOrder(this.extend(request, params));
|
|
@@ -3127,7 +3127,7 @@ class bitmart extends bitmart$1 {
|
|
|
3127
3127
|
// }
|
|
3128
3128
|
// }
|
|
3129
3129
|
//
|
|
3130
|
-
const data = this.
|
|
3130
|
+
const data = this.safeDict(response, 'data', {});
|
|
3131
3131
|
const orders = this.safeList(data, 'orders', []);
|
|
3132
3132
|
return this.parseOrders(orders, market, since, limit);
|
|
3133
3133
|
}
|
|
@@ -3182,7 +3182,7 @@ class bitmart extends bitmart$1 {
|
|
|
3182
3182
|
response = await this.privatePostSpotV4QueryOpenOrders(this.extend(request, params));
|
|
3183
3183
|
}
|
|
3184
3184
|
else if (type === 'swap') {
|
|
3185
|
-
const isStop = this.
|
|
3185
|
+
const isStop = this.safeBool2(params, 'stop', 'trigger');
|
|
3186
3186
|
params = this.omit(params, ['stop', 'trigger']);
|
|
3187
3187
|
if (isStop) {
|
|
3188
3188
|
response = await this.privateGetContractPrivateCurrentPlanOrder(this.extend(request, params));
|
|
@@ -3454,7 +3454,7 @@ class bitmart extends bitmart$1 {
|
|
|
3454
3454
|
if (code === 'USDT') {
|
|
3455
3455
|
const defaultNetworks = this.safeValue(this.options, 'defaultNetworks');
|
|
3456
3456
|
const defaultNetwork = this.safeStringUpper(defaultNetworks, code);
|
|
3457
|
-
const networks = this.
|
|
3457
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
3458
3458
|
let networkInner = this.safeStringUpper(params, 'network', defaultNetwork); // this line allows the user to specify either ERC20 or ETH
|
|
3459
3459
|
networkInner = this.safeString(networks, networkInner, networkInner); // handle ERC20>ETH alias
|
|
3460
3460
|
if (networkInner !== undefined) {
|
|
@@ -3541,7 +3541,7 @@ class bitmart extends bitmart$1 {
|
|
|
3541
3541
|
if (code === 'USDT') {
|
|
3542
3542
|
const defaultNetworks = this.safeValue(this.options, 'defaultNetworks');
|
|
3543
3543
|
const defaultNetwork = this.safeStringUpper(defaultNetworks, code);
|
|
3544
|
-
const networks = this.
|
|
3544
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
3545
3545
|
let network = this.safeStringUpper(params, 'network', defaultNetwork); // this line allows the user to specify either ERC20 or ETH
|
|
3546
3546
|
network = this.safeString(networks, network, network); // handle ERC20>ETH alias
|
|
3547
3547
|
if (network !== undefined) {
|
|
@@ -3560,7 +3560,7 @@ class bitmart extends bitmart$1 {
|
|
|
3560
3560
|
// }
|
|
3561
3561
|
// }
|
|
3562
3562
|
//
|
|
3563
|
-
const data = this.
|
|
3563
|
+
const data = this.safeDict(response, 'data', {});
|
|
3564
3564
|
const transaction = this.parseTransaction(data, currency);
|
|
3565
3565
|
return this.extend(transaction, {
|
|
3566
3566
|
'code': code,
|
|
@@ -3586,7 +3586,7 @@ class bitmart extends bitmart$1 {
|
|
|
3586
3586
|
if (code === 'USDT') {
|
|
3587
3587
|
const defaultNetworks = this.safeValue(this.options, 'defaultNetworks');
|
|
3588
3588
|
const defaultNetwork = this.safeStringUpper(defaultNetworks, code);
|
|
3589
|
-
const networks = this.
|
|
3589
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
3590
3590
|
let network = this.safeStringUpper(params, 'network', defaultNetwork); // this line allows the user to specify either ERC20 or ETH
|
|
3591
3591
|
network = this.safeString(networks, network, network); // handle ERC20>ETH alias
|
|
3592
3592
|
if (network !== undefined) {
|
|
@@ -3620,7 +3620,7 @@ class bitmart extends bitmart$1 {
|
|
|
3620
3620
|
// }
|
|
3621
3621
|
// }
|
|
3622
3622
|
//
|
|
3623
|
-
const data = this.
|
|
3623
|
+
const data = this.safeDict(response, 'data', {});
|
|
3624
3624
|
const records = this.safeList(data, 'records', []);
|
|
3625
3625
|
return this.parseTransactions(records, currency, since, limit);
|
|
3626
3626
|
}
|
|
@@ -3661,7 +3661,7 @@ class bitmart extends bitmart$1 {
|
|
|
3661
3661
|
// }
|
|
3662
3662
|
// }
|
|
3663
3663
|
//
|
|
3664
|
-
const data = this.
|
|
3664
|
+
const data = this.safeDict(response, 'data', {});
|
|
3665
3665
|
const record = this.safeDict(data, 'record', {});
|
|
3666
3666
|
return this.parseTransaction(record);
|
|
3667
3667
|
}
|
|
@@ -3715,7 +3715,7 @@ class bitmart extends bitmart$1 {
|
|
|
3715
3715
|
// }
|
|
3716
3716
|
// }
|
|
3717
3717
|
//
|
|
3718
|
-
const data = this.
|
|
3718
|
+
const data = this.safeDict(response, 'data', {});
|
|
3719
3719
|
const record = this.safeDict(data, 'record', {});
|
|
3720
3720
|
return this.parseTransaction(record);
|
|
3721
3721
|
}
|
|
@@ -3849,7 +3849,7 @@ class bitmart extends bitmart$1 {
|
|
|
3849
3849
|
// }
|
|
3850
3850
|
// }
|
|
3851
3851
|
//
|
|
3852
|
-
const data = this.
|
|
3852
|
+
const data = this.safeDict(response, 'data', {});
|
|
3853
3853
|
const transaction = this.parseMarginLoan(data, currency);
|
|
3854
3854
|
return this.extend(transaction, {
|
|
3855
3855
|
'amount': amount,
|
|
@@ -3887,7 +3887,7 @@ class bitmart extends bitmart$1 {
|
|
|
3887
3887
|
// }
|
|
3888
3888
|
// }
|
|
3889
3889
|
//
|
|
3890
|
-
const data = this.
|
|
3890
|
+
const data = this.safeDict(response, 'data', {});
|
|
3891
3891
|
const transaction = this.parseMarginLoan(data, currency);
|
|
3892
3892
|
return this.extend(transaction, {
|
|
3893
3893
|
'amount': amount,
|
|
@@ -3966,9 +3966,9 @@ class bitmart extends bitmart$1 {
|
|
|
3966
3966
|
// }
|
|
3967
3967
|
// }
|
|
3968
3968
|
//
|
|
3969
|
-
const data = this.
|
|
3970
|
-
const symbols = this.
|
|
3971
|
-
const borrowRate = this.
|
|
3969
|
+
const data = this.safeDict(response, 'data', {});
|
|
3970
|
+
const symbols = this.safeList(data, 'symbols', []);
|
|
3971
|
+
const borrowRate = this.safeDict(symbols, 0, []);
|
|
3972
3972
|
return this.parseIsolatedBorrowRate(borrowRate, market);
|
|
3973
3973
|
}
|
|
3974
3974
|
parseIsolatedBorrowRate(info, market = undefined) {
|
|
@@ -3997,8 +3997,8 @@ class bitmart extends bitmart$1 {
|
|
|
3997
3997
|
//
|
|
3998
3998
|
const marketId = this.safeString(info, 'symbol');
|
|
3999
3999
|
const symbol = this.safeSymbol(marketId, market);
|
|
4000
|
-
const baseData = this.
|
|
4001
|
-
const quoteData = this.
|
|
4000
|
+
const baseData = this.safeDict(info, 'base', {});
|
|
4001
|
+
const quoteData = this.safeDict(info, 'quote', {});
|
|
4002
4002
|
const baseId = this.safeString(baseData, 'currency');
|
|
4003
4003
|
const quoteId = this.safeString(quoteData, 'currency');
|
|
4004
4004
|
return {
|
|
@@ -4056,8 +4056,8 @@ class bitmart extends bitmart$1 {
|
|
|
4056
4056
|
// }
|
|
4057
4057
|
// }
|
|
4058
4058
|
//
|
|
4059
|
-
const data = this.
|
|
4060
|
-
const symbols = this.
|
|
4059
|
+
const data = this.safeDict(response, 'data', {});
|
|
4060
|
+
const symbols = this.safeList(data, 'symbols', []);
|
|
4061
4061
|
return this.parseIsolatedBorrowRates(symbols);
|
|
4062
4062
|
}
|
|
4063
4063
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
@@ -4136,7 +4136,7 @@ class bitmart extends bitmart$1 {
|
|
|
4136
4136
|
// }
|
|
4137
4137
|
// }
|
|
4138
4138
|
//
|
|
4139
|
-
const data = this.
|
|
4139
|
+
const data = this.safeDict(response, 'data', {});
|
|
4140
4140
|
return this.extend(this.parseTransfer(data, currency), {
|
|
4141
4141
|
'status': this.parseTransferStatus(this.safeString2(response, 'code', 'message')),
|
|
4142
4142
|
});
|
|
@@ -4261,7 +4261,7 @@ class bitmart extends bitmart$1 {
|
|
|
4261
4261
|
// }
|
|
4262
4262
|
// }
|
|
4263
4263
|
//
|
|
4264
|
-
const data = this.
|
|
4264
|
+
const data = this.safeDict(response, 'data', {});
|
|
4265
4265
|
const records = this.safeList(data, 'records', []);
|
|
4266
4266
|
return this.parseTransfers(records, currency, since, limit);
|
|
4267
4267
|
}
|
|
@@ -4314,8 +4314,8 @@ class bitmart extends bitmart$1 {
|
|
|
4314
4314
|
// }
|
|
4315
4315
|
// }
|
|
4316
4316
|
//
|
|
4317
|
-
const data = this.
|
|
4318
|
-
const rows = this.
|
|
4317
|
+
const data = this.safeDict(response, 'data', {});
|
|
4318
|
+
const rows = this.safeList(data, 'records', []);
|
|
4319
4319
|
const interest = this.parseBorrowInterests(rows, market);
|
|
4320
4320
|
return this.filterByCurrencySinceLimit(interest, code, since, limit);
|
|
4321
4321
|
}
|
|
@@ -4465,7 +4465,7 @@ class bitmart extends bitmart$1 {
|
|
|
4465
4465
|
// "trace": "4cad855074654097ac7ba5257c47305d.54.16951844206655589"
|
|
4466
4466
|
// }
|
|
4467
4467
|
//
|
|
4468
|
-
const data = this.
|
|
4468
|
+
const data = this.safeDict(response, 'data', {});
|
|
4469
4469
|
return this.parseFundingRate(data, market);
|
|
4470
4470
|
}
|
|
4471
4471
|
parseFundingRate(contract, market = undefined) {
|
|
@@ -4546,7 +4546,7 @@ class bitmart extends bitmart$1 {
|
|
|
4546
4546
|
// "trace":"4cad855074664097ac5ba5257c47305d.67.16963925142065945"
|
|
4547
4547
|
// }
|
|
4548
4548
|
//
|
|
4549
|
-
const data = this.
|
|
4549
|
+
const data = this.safeList(response, 'data', []);
|
|
4550
4550
|
const first = this.safeDict(data, 0, {});
|
|
4551
4551
|
return this.parsePosition(first, market);
|
|
4552
4552
|
}
|
|
@@ -4604,7 +4604,7 @@ class bitmart extends bitmart$1 {
|
|
|
4604
4604
|
// "trace":"4cad855074664097ac5ba5257c47305d.67.16963925142065945"
|
|
4605
4605
|
// }
|
|
4606
4606
|
//
|
|
4607
|
-
const positions = this.
|
|
4607
|
+
const positions = this.safeList(response, 'data', []);
|
|
4608
4608
|
const result = [];
|
|
4609
4609
|
for (let i = 0; i < positions.length; i++) {
|
|
4610
4610
|
result.push(this.parsePosition(positions[i]));
|
|
@@ -4730,7 +4730,7 @@ class bitmart extends bitmart$1 {
|
|
|
4730
4730
|
// "trace": "4cad855074664097ac6ba4257c47305d.71.16965658195443021"
|
|
4731
4731
|
// }
|
|
4732
4732
|
//
|
|
4733
|
-
const data = this.
|
|
4733
|
+
const data = this.safeList(response, 'data', []);
|
|
4734
4734
|
const result = [];
|
|
4735
4735
|
for (let i = 0; i < data.length; i++) {
|
|
4736
4736
|
const entry = data[i];
|
package/dist/cjs/src/bitopro.js
CHANGED
|
@@ -226,7 +226,7 @@ class bitopro extends bitopro$1 {
|
|
|
226
226
|
* @returns {object} an associative dictionary of currencies
|
|
227
227
|
*/
|
|
228
228
|
const response = await this.publicGetProvisioningCurrencies(params);
|
|
229
|
-
const currencies = this.
|
|
229
|
+
const currencies = this.safeList(response, 'data', []);
|
|
230
230
|
//
|
|
231
231
|
// {
|
|
232
232
|
// "data":[
|
|
@@ -248,8 +248,8 @@ class bitopro extends bitopro$1 {
|
|
|
248
248
|
const currency = currencies[i];
|
|
249
249
|
const currencyId = this.safeString(currency, 'currency');
|
|
250
250
|
const code = this.safeCurrencyCode(currencyId);
|
|
251
|
-
const deposit = this.
|
|
252
|
-
const withdraw = this.
|
|
251
|
+
const deposit = this.safeBool(currency, 'deposit');
|
|
252
|
+
const withdraw = this.safeBool(currency, 'withdraw');
|
|
253
253
|
const fee = this.safeNumber(currency, 'withdrawFee');
|
|
254
254
|
const withdrawMin = this.safeNumber(currency, 'minWithdraw');
|
|
255
255
|
const withdrawMax = this.safeNumber(currency, 'maxWithdraw');
|
|
@@ -289,7 +289,7 @@ class bitopro extends bitopro$1 {
|
|
|
289
289
|
* @returns {object[]} an array of objects representing market data
|
|
290
290
|
*/
|
|
291
291
|
const response = await this.publicGetProvisioningTradingPairs();
|
|
292
|
-
const markets = this.
|
|
292
|
+
const markets = this.safeList(response, 'data', []);
|
|
293
293
|
//
|
|
294
294
|
// {
|
|
295
295
|
// "data":[
|
|
@@ -313,7 +313,7 @@ class bitopro extends bitopro$1 {
|
|
|
313
313
|
return this.parseMarkets(markets);
|
|
314
314
|
}
|
|
315
315
|
parseMarket(market) {
|
|
316
|
-
const active = !this.
|
|
316
|
+
const active = !this.safeBool(market, 'maintain');
|
|
317
317
|
const id = this.safeString(market, 'pair');
|
|
318
318
|
const uppercaseId = id.toUpperCase();
|
|
319
319
|
const baseId = this.safeString(market, 'base');
|
|
@@ -427,7 +427,7 @@ class bitopro extends bitopro$1 {
|
|
|
427
427
|
'pair': market['id'],
|
|
428
428
|
};
|
|
429
429
|
const response = await this.publicGetTickersPair(this.extend(request, params));
|
|
430
|
-
const ticker = this.
|
|
430
|
+
const ticker = this.safeDict(response, 'data', {});
|
|
431
431
|
//
|
|
432
432
|
// {
|
|
433
433
|
// "data":{
|
|
@@ -455,7 +455,7 @@ class bitopro extends bitopro$1 {
|
|
|
455
455
|
*/
|
|
456
456
|
await this.loadMarkets();
|
|
457
457
|
const response = await this.publicGetTickers();
|
|
458
|
-
const tickers = this.
|
|
458
|
+
const tickers = this.safeList(response, 'data', []);
|
|
459
459
|
//
|
|
460
460
|
// {
|
|
461
461
|
// "data":[
|
|
@@ -556,7 +556,7 @@ class bitopro extends bitopro$1 {
|
|
|
556
556
|
const type = this.safeStringLower(trade, 'type');
|
|
557
557
|
let side = this.safeStringLower(trade, 'action');
|
|
558
558
|
if (side === undefined) {
|
|
559
|
-
const isBuyer = this.
|
|
559
|
+
const isBuyer = this.safeBool(trade, 'isBuyer');
|
|
560
560
|
if (isBuyer) {
|
|
561
561
|
side = 'buy';
|
|
562
562
|
}
|
|
@@ -578,7 +578,7 @@ class bitopro extends bitopro$1 {
|
|
|
578
578
|
'rate': undefined,
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
|
-
const isTaker = this.
|
|
581
|
+
const isTaker = this.safeBool(trade, 'isTaker');
|
|
582
582
|
let takerOrMaker = undefined;
|
|
583
583
|
if (isTaker !== undefined) {
|
|
584
584
|
if (isTaker) {
|
|
@@ -622,7 +622,7 @@ class bitopro extends bitopro$1 {
|
|
|
622
622
|
'pair': market['id'],
|
|
623
623
|
};
|
|
624
624
|
const response = await this.publicGetTradesPair(this.extend(request, params));
|
|
625
|
-
const trades = this.
|
|
625
|
+
const trades = this.safeList(response, 'data', []);
|
|
626
626
|
//
|
|
627
627
|
// {
|
|
628
628
|
// "data":[
|
|
@@ -648,7 +648,7 @@ class bitopro extends bitopro$1 {
|
|
|
648
648
|
*/
|
|
649
649
|
await this.loadMarkets();
|
|
650
650
|
const response = await this.publicGetProvisioningLimitationsAndFees(params);
|
|
651
|
-
const tradingFeeRate = this.
|
|
651
|
+
const tradingFeeRate = this.safeDict(response, 'tradingFeeRate', {});
|
|
652
652
|
const first = this.safeValue(tradingFeeRate, 0);
|
|
653
653
|
//
|
|
654
654
|
// {
|
|
@@ -777,7 +777,7 @@ class bitopro extends bitopro$1 {
|
|
|
777
777
|
request['to'] = this.sum(request['from'], limit * timeframeInSeconds);
|
|
778
778
|
}
|
|
779
779
|
const response = await this.publicGetTradingHistoryPair(this.extend(request, params));
|
|
780
|
-
const data = this.
|
|
780
|
+
const data = this.safeList(response, 'data', []);
|
|
781
781
|
//
|
|
782
782
|
// {
|
|
783
783
|
// "data":[
|
|
@@ -874,7 +874,7 @@ class bitopro extends bitopro$1 {
|
|
|
874
874
|
*/
|
|
875
875
|
await this.loadMarkets();
|
|
876
876
|
const response = await this.privateGetAccountsBalance(params);
|
|
877
|
-
const balances = this.
|
|
877
|
+
const balances = this.safeList(response, 'data', []);
|
|
878
878
|
//
|
|
879
879
|
// {
|
|
880
880
|
// "data":[
|
|
@@ -1157,7 +1157,7 @@ class bitopro extends bitopro$1 {
|
|
|
1157
1157
|
else {
|
|
1158
1158
|
response = await this.privateDeleteOrdersAll(this.extend(request, params));
|
|
1159
1159
|
}
|
|
1160
|
-
const data = this.
|
|
1160
|
+
const data = this.safeDict(response, 'data', {});
|
|
1161
1161
|
//
|
|
1162
1162
|
// {
|
|
1163
1163
|
// "data":{
|
|
@@ -1247,7 +1247,7 @@ class bitopro extends bitopro$1 {
|
|
|
1247
1247
|
request['limit'] = limit;
|
|
1248
1248
|
}
|
|
1249
1249
|
const response = await this.privateGetOrdersAllPair(this.extend(request, params));
|
|
1250
|
-
let orders = this.
|
|
1250
|
+
let orders = this.safeList(response, 'data', []);
|
|
1251
1251
|
if (orders === undefined) {
|
|
1252
1252
|
orders = [];
|
|
1253
1253
|
}
|
|
@@ -1323,7 +1323,7 @@ class bitopro extends bitopro$1 {
|
|
|
1323
1323
|
'pair': market['id'],
|
|
1324
1324
|
};
|
|
1325
1325
|
const response = await this.privateGetOrdersTradesPair(this.extend(request, params));
|
|
1326
|
-
const trades = this.
|
|
1326
|
+
const trades = this.safeList(response, 'data', []);
|
|
1327
1327
|
//
|
|
1328
1328
|
// {
|
|
1329
1329
|
// "data":[
|
|
@@ -1471,7 +1471,7 @@ class bitopro extends bitopro$1 {
|
|
|
1471
1471
|
request['limit'] = limit;
|
|
1472
1472
|
}
|
|
1473
1473
|
const response = await this.privateGetWalletDepositHistoryCurrency(this.extend(request, params));
|
|
1474
|
-
const result = this.
|
|
1474
|
+
const result = this.safeList(response, 'data', []);
|
|
1475
1475
|
//
|
|
1476
1476
|
// {
|
|
1477
1477
|
// "data":[
|
|
@@ -1523,7 +1523,7 @@ class bitopro extends bitopro$1 {
|
|
|
1523
1523
|
request['limit'] = limit;
|
|
1524
1524
|
}
|
|
1525
1525
|
const response = await this.privateGetWalletWithdrawHistoryCurrency(this.extend(request, params));
|
|
1526
|
-
const result = this.
|
|
1526
|
+
const result = this.safeList(response, 'data', []);
|
|
1527
1527
|
//
|
|
1528
1528
|
// {
|
|
1529
1529
|
// "data":[
|
|
@@ -1565,7 +1565,7 @@ class bitopro extends bitopro$1 {
|
|
|
1565
1565
|
'currency': currency['id'],
|
|
1566
1566
|
};
|
|
1567
1567
|
const response = await this.privateGetWalletWithdrawCurrencySerial(this.extend(request, params));
|
|
1568
|
-
const result = this.
|
|
1568
|
+
const result = this.safeDict(response, 'data', {});
|
|
1569
1569
|
//
|
|
1570
1570
|
// {
|
|
1571
1571
|
// "data":{
|
|
@@ -1607,7 +1607,7 @@ class bitopro extends bitopro$1 {
|
|
|
1607
1607
|
'address': address,
|
|
1608
1608
|
};
|
|
1609
1609
|
if ('network' in params) {
|
|
1610
|
-
const networks = this.
|
|
1610
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
1611
1611
|
const requestedNetwork = this.safeStringUpper(params, 'network');
|
|
1612
1612
|
params = this.omit(params, ['network']);
|
|
1613
1613
|
const networkId = this.safeString(networks, requestedNetwork);
|
|
@@ -1620,7 +1620,7 @@ class bitopro extends bitopro$1 {
|
|
|
1620
1620
|
request['message'] = tag;
|
|
1621
1621
|
}
|
|
1622
1622
|
const response = await this.privatePostWalletWithdrawCurrency(this.extend(request, params));
|
|
1623
|
-
const result = this.
|
|
1623
|
+
const result = this.safeDict(response, 'data', {});
|
|
1624
1624
|
//
|
|
1625
1625
|
// {
|
|
1626
1626
|
// "data":{
|