ccxt 4.4.20 → 4.4.21
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 +4 -4
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +13 -0
- package/dist/cjs/src/base/ws/Future.js +3 -1
- package/dist/cjs/src/binance.js +0 -10
- package/dist/cjs/src/bingx.js +6 -1
- package/dist/cjs/src/bybit.js +65 -3
- package/dist/cjs/src/htx.js +28 -0
- package/dist/cjs/src/hyperliquid.js +7 -6
- package/dist/cjs/src/kucoin.js +16 -36
- package/dist/cjs/src/kucoinfutures.js +2 -2
- package/dist/cjs/src/okx.js +8 -10
- package/dist/cjs/src/paradex.js +1 -2
- package/dist/cjs/src/static_dependencies/noble-hashes/_sha2.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/hmac.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/sha3.js +1 -1
- package/dist/cjs/src/static_dependencies/watchable/src/unpromise.js +298 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/kucoin.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.d.ts +1 -0
- package/js/src/abstract/okx.d.ts +3 -0
- package/js/src/base/Exchange.d.ts +3 -1
- package/js/src/base/Exchange.js +13 -0
- package/js/src/base/ws/Future.js +2 -1
- package/js/src/binance.d.ts +0 -1
- package/js/src/binance.js +0 -10
- package/js/src/bingx.js +6 -1
- package/js/src/bybit.d.ts +1 -0
- package/js/src/bybit.js +65 -3
- package/js/src/htx.d.ts +2 -2
- package/js/src/htx.js +28 -0
- package/js/src/hyperliquid.js +7 -6
- package/js/src/kucoin.d.ts +0 -1
- package/js/src/kucoin.js +16 -36
- package/js/src/kucoinfutures.js +2 -2
- package/js/src/okx.d.ts +0 -1
- package/js/src/okx.js +9 -11
- package/js/src/paradex.js +1 -1
- package/js/src/static_dependencies/noble-hashes/_blake2.js +1 -1
- package/js/src/static_dependencies/noble-hashes/_sha2.js +1 -1
- package/js/src/static_dependencies/noble-hashes/hmac.js +1 -1
- package/js/src/static_dependencies/noble-hashes/sha3-addons.js +5 -5
- package/js/src/static_dependencies/noble-hashes/sha3.js +1 -1
- package/js/src/static_dependencies/watchable/src/index.d.ts +2 -0
- package/js/src/static_dependencies/watchable/src/index.js +7 -0
- package/js/src/static_dependencies/watchable/src/types.d.ts +28 -0
- package/js/src/static_dependencies/watchable/src/types.js +8 -0
- package/js/src/static_dependencies/watchable/src/unpromise.d.ts +120 -0
- package/js/src/static_dependencies/watchable/src/unpromise.js +297 -0
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -195,7 +195,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
195
195
|
|
|
196
196
|
//-----------------------------------------------------------------------------
|
|
197
197
|
// this is updated by vss.js when building
|
|
198
|
-
const version = '4.4.
|
|
198
|
+
const version = '4.4.21';
|
|
199
199
|
Exchange["default"].ccxtVersion = version;
|
|
200
200
|
const exchanges = {
|
|
201
201
|
'ace': ace,
|
|
@@ -5524,6 +5524,19 @@ class Exchange {
|
|
|
5524
5524
|
}
|
|
5525
5525
|
return interests;
|
|
5526
5526
|
}
|
|
5527
|
+
parseBorrowRate(info, currency = undefined) {
|
|
5528
|
+
throw new errors.NotSupported(this.id + ' parseBorrowRate() is not supported yet');
|
|
5529
|
+
}
|
|
5530
|
+
parseBorrowRateHistory(response, code, since, limit) {
|
|
5531
|
+
const result = [];
|
|
5532
|
+
for (let i = 0; i < response.length; i++) {
|
|
5533
|
+
const item = response[i];
|
|
5534
|
+
const borrowRate = this.parseBorrowRate(item);
|
|
5535
|
+
result.push(borrowRate);
|
|
5536
|
+
}
|
|
5537
|
+
const sorted = this.sortBy(result, 'timestamp');
|
|
5538
|
+
return this.filterByCurrencySinceLimit(sorted, code, since, limit);
|
|
5539
|
+
}
|
|
5527
5540
|
parseIsolatedBorrowRates(info) {
|
|
5528
5541
|
const result = {};
|
|
5529
5542
|
for (let i = 0; i < info.length; i++) {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var unpromise = require('../../static_dependencies/watchable/src/unpromise.js');
|
|
6
|
+
|
|
5
7
|
// @ts-nocheck
|
|
6
8
|
function Future() {
|
|
7
9
|
let resolve = undefined, reject = undefined;
|
|
@@ -29,6 +31,6 @@ function wrapFuture(aggregatePromise) {
|
|
|
29
31
|
aggregatePromise.then(p.resolve, p.reject);
|
|
30
32
|
return p;
|
|
31
33
|
}
|
|
32
|
-
Future.race = (futures) => wrapFuture(
|
|
34
|
+
Future.race = (futures) => wrapFuture(unpromise.Unpromise.race(futures));
|
|
33
35
|
|
|
34
36
|
exports.Future = Future;
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -12115,16 +12115,6 @@ class binance extends binance$1 {
|
|
|
12115
12115
|
//
|
|
12116
12116
|
return this.parseBorrowRateHistory(response, code, since, limit);
|
|
12117
12117
|
}
|
|
12118
|
-
parseBorrowRateHistory(response, code, since, limit) {
|
|
12119
|
-
const result = [];
|
|
12120
|
-
for (let i = 0; i < response.length; i++) {
|
|
12121
|
-
const item = response[i];
|
|
12122
|
-
const borrowRate = this.parseBorrowRate(item);
|
|
12123
|
-
result.push(borrowRate);
|
|
12124
|
-
}
|
|
12125
|
-
const sorted = this.sortBy(result, 'timestamp');
|
|
12126
|
-
return this.filterByCurrencySinceLimit(sorted, code, since, limit);
|
|
12127
|
-
}
|
|
12128
12118
|
parseBorrowRate(info, currency = undefined) {
|
|
12129
12119
|
//
|
|
12130
12120
|
// {
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -5316,7 +5316,7 @@ class bingx extends bingx$1 {
|
|
|
5316
5316
|
* @method
|
|
5317
5317
|
* @name bingx#withdraw
|
|
5318
5318
|
* @description make a withdrawal
|
|
5319
|
-
* @see https://bingx-api.github.io/docs/#/
|
|
5319
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/wallet-api.html#Withdraw
|
|
5320
5320
|
* @param {string} code unified currency code
|
|
5321
5321
|
* @param {float} amount the amount to withdraw
|
|
5322
5322
|
* @param {string} address the address to withdraw to
|
|
@@ -5325,6 +5325,8 @@ class bingx extends bingx$1 {
|
|
|
5325
5325
|
* @param {int} [params.walletType] 1 fund account, 2 standard account, 3 perpetual account
|
|
5326
5326
|
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5327
5327
|
*/
|
|
5328
|
+
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5329
|
+
this.checkAddress(address);
|
|
5328
5330
|
await this.loadMarkets();
|
|
5329
5331
|
const currency = this.currency(code);
|
|
5330
5332
|
let walletType = this.safeInteger(params, 'walletType');
|
|
@@ -5344,6 +5346,9 @@ class bingx extends bingx$1 {
|
|
|
5344
5346
|
if (network !== undefined) {
|
|
5345
5347
|
request['network'] = this.networkCodeToId(network);
|
|
5346
5348
|
}
|
|
5349
|
+
if (tag !== undefined) {
|
|
5350
|
+
request['addressTag'] = tag;
|
|
5351
|
+
}
|
|
5347
5352
|
params = this.omit(params, ['walletType', 'network']);
|
|
5348
5353
|
const response = await this.walletsV1PrivatePostCapitalWithdrawApply(this.extend(request, params));
|
|
5349
5354
|
const data = this.safeValue(response, 'data');
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -368,6 +368,7 @@ class bybit extends bybit$1 {
|
|
|
368
368
|
// spot leverage token
|
|
369
369
|
'v5/spot-lever-token/order-record': 1,
|
|
370
370
|
// spot margin trade
|
|
371
|
+
'v5/spot-margin-trade/interest-rate-history': 5,
|
|
371
372
|
'v5/spot-margin-trade/state': 5,
|
|
372
373
|
'v5/spot-cross-margin-trade/loan-info': 1,
|
|
373
374
|
'v5/spot-cross-margin-trade/account': 1,
|
|
@@ -7314,12 +7315,22 @@ class bybit extends bybit$1 {
|
|
|
7314
7315
|
// "timestamp": 1666734490778
|
|
7315
7316
|
// }
|
|
7316
7317
|
//
|
|
7318
|
+
// fetchBorrowRateHistory
|
|
7319
|
+
// {
|
|
7320
|
+
// "timestamp": 1721469600000,
|
|
7321
|
+
// "currency": "USDC",
|
|
7322
|
+
// "hourlyBorrowRate": "0.000014621596",
|
|
7323
|
+
// "vipLevel": "No VIP"
|
|
7324
|
+
// }
|
|
7325
|
+
//
|
|
7317
7326
|
const timestamp = this.safeInteger(info, 'timestamp');
|
|
7318
|
-
const currencyId = this.
|
|
7327
|
+
const currencyId = this.safeString2(info, 'coin', 'currency');
|
|
7328
|
+
const hourlyBorrowRate = this.safeNumber(info, 'hourlyBorrowRate');
|
|
7329
|
+
const period = (hourlyBorrowRate !== undefined) ? 3600000 : 86400000; // 1h or 1d
|
|
7319
7330
|
return {
|
|
7320
7331
|
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
7321
|
-
'rate': this.safeNumber(info, 'interestRate'),
|
|
7322
|
-
'period':
|
|
7332
|
+
'rate': this.safeNumber(info, 'interestRate', hourlyBorrowRate),
|
|
7333
|
+
'period': period,
|
|
7323
7334
|
'timestamp': timestamp,
|
|
7324
7335
|
'datetime': this.iso8601(timestamp),
|
|
7325
7336
|
'info': info,
|
|
@@ -7371,6 +7382,57 @@ class bybit extends bybit$1 {
|
|
|
7371
7382
|
const interest = this.parseBorrowInterests(rows, undefined);
|
|
7372
7383
|
return this.filterByCurrencySinceLimit(interest, code, since, limit);
|
|
7373
7384
|
}
|
|
7385
|
+
async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
|
|
7386
|
+
/**
|
|
7387
|
+
* @method
|
|
7388
|
+
* @name bybit#fetchBorrowRateHistory
|
|
7389
|
+
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
7390
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
|
|
7391
|
+
* @param {string} code unified currency code
|
|
7392
|
+
* @param {int} [since] timestamp for the earliest borrow rate
|
|
7393
|
+
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
7394
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7395
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
7396
|
+
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
7397
|
+
*/
|
|
7398
|
+
await this.loadMarkets();
|
|
7399
|
+
const currency = this.currency(code);
|
|
7400
|
+
const request = {
|
|
7401
|
+
'currency': currency['id'],
|
|
7402
|
+
};
|
|
7403
|
+
if (since === undefined) {
|
|
7404
|
+
since = this.milliseconds() - 86400000 * 30; // last 30 days
|
|
7405
|
+
}
|
|
7406
|
+
request['startTime'] = since;
|
|
7407
|
+
let endTime = this.safeInteger2(params, 'until', 'endTime');
|
|
7408
|
+
params = this.omit(params, ['until']);
|
|
7409
|
+
if (endTime === undefined) {
|
|
7410
|
+
endTime = since + 86400000 * 30; // since + 30 days
|
|
7411
|
+
}
|
|
7412
|
+
request['endTime'] = endTime;
|
|
7413
|
+
const response = await this.privateGetV5SpotMarginTradeInterestRateHistory(this.extend(request, params));
|
|
7414
|
+
//
|
|
7415
|
+
// {
|
|
7416
|
+
// "retCode": 0,
|
|
7417
|
+
// "retMsg": "OK",
|
|
7418
|
+
// "result": {
|
|
7419
|
+
// "list": [
|
|
7420
|
+
// {
|
|
7421
|
+
// "timestamp": 1721469600000,
|
|
7422
|
+
// "currency": "USDC",
|
|
7423
|
+
// "hourlyBorrowRate": "0.000014621596",
|
|
7424
|
+
// "vipLevel": "No VIP"
|
|
7425
|
+
// }
|
|
7426
|
+
// ]
|
|
7427
|
+
// },
|
|
7428
|
+
// "retExtInfo": "{}",
|
|
7429
|
+
// "time": 1721899048991
|
|
7430
|
+
// }
|
|
7431
|
+
//
|
|
7432
|
+
const data = this.safeDict(response, 'result');
|
|
7433
|
+
const rows = this.safeList(data, 'list', []);
|
|
7434
|
+
return this.parseBorrowRateHistory(rows, code, since, limit);
|
|
7435
|
+
}
|
|
7374
7436
|
parseBorrowInterest(info, market = undefined) {
|
|
7375
7437
|
//
|
|
7376
7438
|
// {
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -1636,6 +1636,10 @@ class htx extends htx$1 {
|
|
|
1636
1636
|
* @method
|
|
1637
1637
|
* @name htx#fetchMarkets
|
|
1638
1638
|
* @description retrieves data on all markets for huobi
|
|
1639
|
+
* @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
|
|
1640
|
+
* @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
|
|
1641
|
+
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
|
|
1642
|
+
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
|
|
1639
1643
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1640
1644
|
* @returns {object[]} an array of objects representing market data
|
|
1641
1645
|
*/
|
|
@@ -1666,6 +1670,20 @@ class htx extends htx$1 {
|
|
|
1666
1670
|
return allMarkets;
|
|
1667
1671
|
}
|
|
1668
1672
|
async fetchMarketsByTypeAndSubType(type, subType, params = {}) {
|
|
1673
|
+
/**
|
|
1674
|
+
* @ignore
|
|
1675
|
+
* @method
|
|
1676
|
+
* @name htx#fetchMarketsByTypeAndSubType
|
|
1677
|
+
* @description retrieves data on all markets of a certain type and/or subtype
|
|
1678
|
+
* @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
|
|
1679
|
+
* @see https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
|
|
1680
|
+
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
|
|
1681
|
+
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
|
|
1682
|
+
* @param {string} [type] 'spot', 'swap' or 'future'
|
|
1683
|
+
* @param {string} [subType] 'linear' or 'inverse'
|
|
1684
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1685
|
+
* @returns {object[]} an array of objects representing market data
|
|
1686
|
+
*/
|
|
1669
1687
|
const isSpot = (type === 'spot');
|
|
1670
1688
|
const request = {};
|
|
1671
1689
|
let response = undefined;
|
|
@@ -3188,6 +3206,16 @@ class htx extends htx$1 {
|
|
|
3188
3206
|
};
|
|
3189
3207
|
}
|
|
3190
3208
|
async fetchAccountIdByType(type, marginMode = undefined, symbol = undefined, params = {}) {
|
|
3209
|
+
/**
|
|
3210
|
+
* @method
|
|
3211
|
+
* @name htx#fetchAccountIdByType
|
|
3212
|
+
* @description fetch all the accounts by a type and marginModeassociated with a profile
|
|
3213
|
+
* @see https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
|
|
3214
|
+
* @param {string} type 'spot', 'swap' or 'future
|
|
3215
|
+
* @param {string} [marginMode] 'cross' or 'isolated'
|
|
3216
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3217
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
3218
|
+
*/
|
|
3191
3219
|
const accounts = await this.loadAccounts();
|
|
3192
3220
|
const accountId = this.safeValue2(params, 'accountId', 'account-id');
|
|
3193
3221
|
if (accountId !== undefined) {
|
|
@@ -642,9 +642,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
642
642
|
const code = this.safeCurrencyCode(this.safeString(balance, 'coin'));
|
|
643
643
|
const account = this.account();
|
|
644
644
|
const total = this.safeString(balance, 'total');
|
|
645
|
-
const
|
|
645
|
+
const used = this.safeString(balance, 'hold');
|
|
646
646
|
account['total'] = total;
|
|
647
|
-
account['used'] =
|
|
647
|
+
account['used'] = used;
|
|
648
648
|
spotBalances[code] = account;
|
|
649
649
|
}
|
|
650
650
|
return this.safeBalance(spotBalances);
|
|
@@ -653,8 +653,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
653
653
|
const result = {
|
|
654
654
|
'info': response,
|
|
655
655
|
'USDC': {
|
|
656
|
-
'total': this.
|
|
657
|
-
'
|
|
656
|
+
'total': this.safeNumber(data, 'accountValue'),
|
|
657
|
+
'free': this.safeNumber(response, 'withdrawable'),
|
|
658
658
|
},
|
|
659
659
|
};
|
|
660
660
|
const timestamp = this.safeInteger(response, 'time');
|
|
@@ -2227,10 +2227,11 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2227
2227
|
const leverage = this.safeDict(entry, 'leverage', {});
|
|
2228
2228
|
const marginMode = this.safeString(leverage, 'type');
|
|
2229
2229
|
const isIsolated = (marginMode === 'isolated');
|
|
2230
|
-
|
|
2230
|
+
let size = this.safeString(entry, 'szi');
|
|
2231
2231
|
let side = undefined;
|
|
2232
2232
|
if (size !== undefined) {
|
|
2233
|
-
side = (size
|
|
2233
|
+
side = Precise["default"].stringGt(size, '0') ? 'long' : 'short';
|
|
2234
|
+
size = Precise["default"].stringAbs(size);
|
|
2234
2235
|
}
|
|
2235
2236
|
const unrealizedPnl = this.safeNumber(entry, 'unrealizedPnl');
|
|
2236
2237
|
const initialMargin = this.safeNumber(entry, 'marginUsed');
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -163,7 +163,8 @@ class kucoin extends kucoin$1 {
|
|
|
163
163
|
// margin trading
|
|
164
164
|
'mark-price/{symbol}/current': 3,
|
|
165
165
|
'mark-price/all-symbols': 3,
|
|
166
|
-
'margin/config': 25,
|
|
166
|
+
'margin/config': 25,
|
|
167
|
+
'announcements': 20, // 20W
|
|
167
168
|
},
|
|
168
169
|
'post': {
|
|
169
170
|
// ws
|
|
@@ -453,6 +454,7 @@ class kucoin extends kucoin$1 {
|
|
|
453
454
|
'precisionMode': number.TICK_SIZE,
|
|
454
455
|
'exceptions': {
|
|
455
456
|
'exact': {
|
|
457
|
+
'The order does not exist.': errors.OrderNotFound,
|
|
456
458
|
'order not exist': errors.OrderNotFound,
|
|
457
459
|
'order not exist.': errors.OrderNotFound,
|
|
458
460
|
'order_not_exist': errors.OrderNotFound,
|
|
@@ -653,6 +655,7 @@ class kucoin extends kucoin$1 {
|
|
|
653
655
|
'currencies/{currency}': 'v3',
|
|
654
656
|
'symbols': 'v2',
|
|
655
657
|
'mark-price/all-symbols': 'v3',
|
|
658
|
+
'announcements': 'v3',
|
|
656
659
|
},
|
|
657
660
|
},
|
|
658
661
|
'private': {
|
|
@@ -1541,41 +1544,28 @@ class kucoin extends kucoin$1 {
|
|
|
1541
1544
|
// "chain": "ERC20"
|
|
1542
1545
|
// }
|
|
1543
1546
|
//
|
|
1547
|
+
const minWithdrawFee = this.safeNumber(fee, 'withdrawMinFee');
|
|
1544
1548
|
const result = {
|
|
1545
1549
|
'info': fee,
|
|
1546
1550
|
'withdraw': {
|
|
1551
|
+
'fee': minWithdrawFee,
|
|
1552
|
+
'percentage': false,
|
|
1553
|
+
},
|
|
1554
|
+
'deposit': {
|
|
1547
1555
|
'fee': undefined,
|
|
1548
1556
|
'percentage': undefined,
|
|
1549
1557
|
},
|
|
1558
|
+
'networks': {},
|
|
1559
|
+
};
|
|
1560
|
+
const networkId = this.safeString(fee, 'chain');
|
|
1561
|
+
const networkCode = this.networkIdToCode(networkId, this.safeString(currency, 'code'));
|
|
1562
|
+
result['networks'][networkCode] = {
|
|
1563
|
+
'withdraw': minWithdrawFee,
|
|
1550
1564
|
'deposit': {
|
|
1551
1565
|
'fee': undefined,
|
|
1552
1566
|
'percentage': undefined,
|
|
1553
1567
|
},
|
|
1554
|
-
'networks': {},
|
|
1555
1568
|
};
|
|
1556
|
-
const isWithdrawEnabled = this.safeBool(fee, 'isWithdrawEnabled', true);
|
|
1557
|
-
let minFee = undefined;
|
|
1558
|
-
if (isWithdrawEnabled) {
|
|
1559
|
-
result['withdraw']['percentage'] = false;
|
|
1560
|
-
const chains = this.safeList(fee, 'chains', []);
|
|
1561
|
-
for (let i = 0; i < chains.length; i++) {
|
|
1562
|
-
const chain = chains[i];
|
|
1563
|
-
const networkId = this.safeString(chain, 'chainId');
|
|
1564
|
-
const networkCode = this.networkIdToCode(networkId, this.safeString(currency, 'code'));
|
|
1565
|
-
const withdrawFee = this.safeString(chain, 'withdrawalMinFee');
|
|
1566
|
-
if (minFee === undefined || (Precise["default"].stringLt(withdrawFee, minFee))) {
|
|
1567
|
-
minFee = withdrawFee;
|
|
1568
|
-
}
|
|
1569
|
-
result['networks'][networkCode] = {
|
|
1570
|
-
'withdraw': this.parseNumber(withdrawFee),
|
|
1571
|
-
'deposit': {
|
|
1572
|
-
'fee': undefined,
|
|
1573
|
-
'percentage': undefined,
|
|
1574
|
-
},
|
|
1575
|
-
};
|
|
1576
|
-
}
|
|
1577
|
-
result['withdraw']['fee'] = this.parseNumber(minFee);
|
|
1578
|
-
}
|
|
1579
1569
|
return result;
|
|
1580
1570
|
}
|
|
1581
1571
|
isFuturesMethod(methodName, params) {
|
|
@@ -3091,7 +3081,7 @@ class kucoin extends kucoin$1 {
|
|
|
3091
3081
|
},
|
|
3092
3082
|
'status': status,
|
|
3093
3083
|
'lastTradeTimestamp': undefined,
|
|
3094
|
-
'average':
|
|
3084
|
+
'average': this.safeString(order, 'avgDealPrice'),
|
|
3095
3085
|
'trades': undefined,
|
|
3096
3086
|
}, market);
|
|
3097
3087
|
}
|
|
@@ -4426,16 +4416,6 @@ class kucoin extends kucoin$1 {
|
|
|
4426
4416
|
}
|
|
4427
4417
|
return this.safeValue(config, 'cost', 1);
|
|
4428
4418
|
}
|
|
4429
|
-
parseBorrowRateHistory(response, code, since, limit) {
|
|
4430
|
-
const result = [];
|
|
4431
|
-
for (let i = 0; i < response.length; i++) {
|
|
4432
|
-
const item = response[i];
|
|
4433
|
-
const borrowRate = this.parseBorrowRate(item);
|
|
4434
|
-
result.push(borrowRate);
|
|
4435
|
-
}
|
|
4436
|
-
const sorted = this.sortBy(result, 'timestamp');
|
|
4437
|
-
return this.filterByCurrencySinceLimit(sorted, code, since, limit);
|
|
4438
|
-
}
|
|
4439
4419
|
parseBorrowRate(info, currency = undefined) {
|
|
4440
4420
|
//
|
|
4441
4421
|
// {
|
|
@@ -2217,8 +2217,8 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2217
2217
|
const amount = this.safeString(order, 'size');
|
|
2218
2218
|
const filled = this.safeString(order, 'filledSize');
|
|
2219
2219
|
const cost = this.safeString(order, 'filledValue');
|
|
2220
|
-
let average =
|
|
2221
|
-
if (Precise["default"].stringGt(filled, '0')) {
|
|
2220
|
+
let average = this.safeString(order, 'avgDealPrice');
|
|
2221
|
+
if ((average === undefined) && Precise["default"].stringGt(filled, '0')) {
|
|
2222
2222
|
const contractSize = this.safeString(market, 'contractSize');
|
|
2223
2223
|
if (market['linear']) {
|
|
2224
2224
|
average = Precise["default"].stringDiv(cost, Precise["default"].stringMul(contractSize, filled));
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -353,6 +353,9 @@ class okx extends okx$1 {
|
|
|
353
353
|
'account/fixed-loan/borrowing-limit': 4,
|
|
354
354
|
'account/fixed-loan/borrowing-quote': 5,
|
|
355
355
|
'account/fixed-loan/borrowing-orders-list': 5,
|
|
356
|
+
'account/spot-manual-borrow-repay': 10,
|
|
357
|
+
'account/set-auto-repay': 4,
|
|
358
|
+
'account/spot-borrow-repay-history': 4,
|
|
356
359
|
// subaccount
|
|
357
360
|
'users/subaccount/list': 10,
|
|
358
361
|
'account/subaccount/balances': 10 / 3,
|
|
@@ -884,6 +887,11 @@ class okx extends okx$1 {
|
|
|
884
887
|
'59301': errors.ExchangeError,
|
|
885
888
|
'59313': errors.ExchangeError,
|
|
886
889
|
'59401': errors.ExchangeError,
|
|
890
|
+
'59410': errors.OperationRejected,
|
|
891
|
+
'59411': errors.InsufficientFunds,
|
|
892
|
+
'59412': errors.OperationRejected,
|
|
893
|
+
'59413': errors.OperationRejected,
|
|
894
|
+
'59414': errors.BadRequest,
|
|
887
895
|
'59500': errors.ExchangeError,
|
|
888
896
|
'59501': errors.ExchangeError,
|
|
889
897
|
'59502': errors.ExchangeError,
|
|
@@ -6673,16 +6681,6 @@ class okx extends okx$1 {
|
|
|
6673
6681
|
}
|
|
6674
6682
|
return borrowRateHistories;
|
|
6675
6683
|
}
|
|
6676
|
-
parseBorrowRateHistory(response, code, since, limit) {
|
|
6677
|
-
const result = [];
|
|
6678
|
-
for (let i = 0; i < response.length; i++) {
|
|
6679
|
-
const item = response[i];
|
|
6680
|
-
const borrowRate = this.parseBorrowRate(item);
|
|
6681
|
-
result.push(borrowRate);
|
|
6682
|
-
}
|
|
6683
|
-
const sorted = this.sortBy(result, 'timestamp');
|
|
6684
|
-
return this.filterByCurrencySinceLimit(sorted, code, since, limit);
|
|
6685
|
-
}
|
|
6686
6684
|
async fetchBorrowRateHistories(codes = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6687
6685
|
/**
|
|
6688
6686
|
* @method
|
package/dist/cjs/src/paradex.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('
|
|
3
|
+
var Precise = require('./base/Precise.js');
|
|
4
4
|
var paradex$1 = require('./abstract/paradex.js');
|
|
5
5
|
var errors = require('./base/errors.js');
|
|
6
6
|
var number = require('./base/functions/number.js');
|
|
7
7
|
var crypto = require('./base/functions/crypto.js');
|
|
8
8
|
var sha3 = require('./static_dependencies/noble-hashes/sha3.js');
|
|
9
9
|
var secp256k1 = require('./static_dependencies/noble-curves/secp256k1.js');
|
|
10
|
-
var Precise = require('./base/Precise.js');
|
|
11
10
|
|
|
12
11
|
// ---------------------------------------------------------------------------
|
|
13
12
|
// ---------------------------------------------------------------------------
|
|
@@ -104,7 +104,7 @@ class SHA2 extends utils.Hash {
|
|
|
104
104
|
return res;
|
|
105
105
|
}
|
|
106
106
|
_cloneInto(to) {
|
|
107
|
-
to
|
|
107
|
+
to ||= new this.constructor();
|
|
108
108
|
to.set(...this.get());
|
|
109
109
|
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
110
110
|
to.length = length;
|
|
@@ -54,7 +54,7 @@ class HMAC extends utils.Hash {
|
|
|
54
54
|
}
|
|
55
55
|
_cloneInto(to) {
|
|
56
56
|
// Create new instance without calling constructor since key already in state and we don't know it.
|
|
57
|
-
to
|
|
57
|
+
to ||= Object.create(Object.getPrototypeOf(this), {});
|
|
58
58
|
const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
|
|
59
59
|
to = to;
|
|
60
60
|
to.finished = finished;
|
|
@@ -174,7 +174,7 @@ class Keccak extends utils.Hash {
|
|
|
174
174
|
}
|
|
175
175
|
_cloneInto(to) {
|
|
176
176
|
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
177
|
-
to
|
|
177
|
+
to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);
|
|
178
178
|
to.state32.set(this.state32);
|
|
179
179
|
to.pos = this.pos;
|
|
180
180
|
to.posOut = this.posOut;
|