ccxt 4.3.61 → 4.3.62
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/binance.js +44 -34
- package/dist/cjs/src/bingx.js +41 -33
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/pro/alpaca.js +3 -3
- package/dist/cjs/src/pro/binance.js +2 -4
- package/dist/cjs/src/pro/bingx.js +2 -2
- package/dist/cjs/src/pro/bitfinex2.js +2 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitopro.js +1 -1
- package/dist/cjs/src/pro/bybit.js +5 -5
- package/dist/cjs/src/pro/coinbaseexchange.js +2 -2
- package/dist/cjs/src/pro/coincheck.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +1 -1
- package/dist/cjs/src/pro/deribit.js +1 -1
- package/dist/cjs/src/pro/gate.js +2 -2
- package/dist/cjs/src/pro/hollaex.js +1 -1
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/pro/hyperliquid.js +3 -3
- package/dist/cjs/src/pro/kraken.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/pro/okx.js +1 -1
- package/dist/cjs/src/pro/oxfun.js +1 -1
- package/dist/cjs/src/pro/phemex.js +1 -1
- package/dist/cjs/src/pro/upbit.js +1 -1
- package/dist/cjs/src/pro/vertex.js +2 -2
- package/dist/cjs/src/pro/whitebit.js +1 -1
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/tradeogre.js +1 -1
- package/dist/cjs/src/xt.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/ws/Client.d.ts +1 -1
- package/js/src/binance.js +44 -34
- package/js/src/bingx.js +41 -33
- package/js/src/bybit.js +1 -1
- package/js/src/pro/alpaca.js +3 -3
- package/js/src/pro/binance.js +2 -4
- package/js/src/pro/bingx.js +2 -2
- package/js/src/pro/bitfinex2.js +2 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitopro.js +1 -1
- package/js/src/pro/bybit.js +5 -5
- package/js/src/pro/coinbaseexchange.js +2 -2
- package/js/src/pro/coincheck.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +1 -1
- package/js/src/pro/deribit.js +1 -1
- package/js/src/pro/gate.js +2 -2
- package/js/src/pro/hollaex.js +1 -1
- package/js/src/pro/htx.js +1 -1
- package/js/src/pro/hyperliquid.js +3 -3
- package/js/src/pro/kraken.js +1 -1
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/pro/okx.js +1 -1
- package/js/src/pro/oxfun.js +1 -1
- package/js/src/pro/phemex.js +1 -1
- package/js/src/pro/upbit.js +1 -1
- package/js/src/pro/vertex.js +2 -2
- package/js/src/pro/whitebit.js +1 -1
- package/js/src/pro/woo.js +1 -1
- package/js/src/tradeogre.js +1 -1
- package/js/src/xt.js +1 -1
- package/package.json +1 -1
|
@@ -306,7 +306,7 @@ class upbit extends upbit$1 {
|
|
|
306
306
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
307
307
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
308
308
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
309
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
309
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
310
310
|
*/
|
|
311
311
|
await this.loadMarkets();
|
|
312
312
|
const channel = 'myOrder';
|
|
@@ -84,7 +84,7 @@ class vertex extends vertex$1 {
|
|
|
84
84
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
85
85
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
86
86
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
87
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
87
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
88
88
|
*/
|
|
89
89
|
await this.loadMarkets();
|
|
90
90
|
const market = this.market(symbol);
|
|
@@ -145,7 +145,7 @@ class vertex extends vertex$1 {
|
|
|
145
145
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
146
146
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
147
147
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
148
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
148
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
149
149
|
*/
|
|
150
150
|
if (symbol === undefined) {
|
|
151
151
|
throw new errors.ArgumentsRequired(this.id + ' watchMyTrades requires a symbol.');
|
|
@@ -475,7 +475,7 @@ class whitebit extends whitebit$1 {
|
|
|
475
475
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
476
476
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
477
477
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
478
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
478
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
479
479
|
*/
|
|
480
480
|
if (symbol === undefined) {
|
|
481
481
|
throw new errors.ArgumentsRequired(this.id + ' watchOrders() requires a symbol argument');
|
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -376,7 +376,7 @@ class woo extends woo$1 {
|
|
|
376
376
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
377
377
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
378
378
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
379
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
379
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
380
380
|
*/
|
|
381
381
|
await this.loadMarkets();
|
|
382
382
|
const market = this.market(symbol);
|
|
@@ -215,7 +215,7 @@ class tradeogre extends tradeogre$1 {
|
|
|
215
215
|
'inverse': undefined,
|
|
216
216
|
'contractSize': undefined,
|
|
217
217
|
'taker': this.fees['trading']['taker'],
|
|
218
|
-
'maker': this.fees['trading']['
|
|
218
|
+
'maker': this.fees['trading']['maker'],
|
|
219
219
|
'expiry': undefined,
|
|
220
220
|
'expiryDatetime': undefined,
|
|
221
221
|
'strike': undefined,
|
package/dist/cjs/src/xt.js
CHANGED
|
@@ -4781,7 +4781,7 @@ class xt extends xt$1 {
|
|
|
4781
4781
|
if (isUndefinedBody) {
|
|
4782
4782
|
if (urlencoded) {
|
|
4783
4783
|
url += '?' + urlencoded;
|
|
4784
|
-
payloadString += '#' + method + '#' + payload + '#' +
|
|
4784
|
+
payloadString += '#' + method + '#' + payload + '#' + this.rawencode(this.keysort(query));
|
|
4785
4785
|
}
|
|
4786
4786
|
else {
|
|
4787
4787
|
payloadString += '#' + method + '#' + payload;
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
7
|
+
declare const version = "4.3.61";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.62';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -5,7 +5,7 @@ export default class Client {
|
|
|
5
5
|
disconnected: ReturnType<typeof Future>;
|
|
6
6
|
futures: Dictionary<any>;
|
|
7
7
|
rejections: Dictionary<any>;
|
|
8
|
-
messageQueue: Dictionary<
|
|
8
|
+
messageQueue: Dictionary<any>;
|
|
9
9
|
useMessageQueue: boolean;
|
|
10
10
|
keepAlive: number;
|
|
11
11
|
connection: any;
|
package/js/src/binance.js
CHANGED
|
@@ -9787,40 +9787,45 @@ export default class binance extends Exchange {
|
|
|
9787
9787
|
if (marginMode === 'cross') {
|
|
9788
9788
|
// calculate collateral
|
|
9789
9789
|
const precision = this.safeDict(market, 'precision', {});
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
if (
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
let entryPriceSignString = entryPriceString;
|
|
9812
|
-
if (side === 'short') {
|
|
9813
|
-
onePlusMaintenanceMarginPercentageString = Precise.stringSub('1', maintenanceMarginPercentageString);
|
|
9790
|
+
const basePrecisionValue = this.safeString(precision, 'base');
|
|
9791
|
+
const quotePrecisionValue = this.safeString2(precision, 'quote', 'price');
|
|
9792
|
+
const precisionIsUndefined = (basePrecisionValue === undefined) && (quotePrecisionValue === undefined);
|
|
9793
|
+
if (!precisionIsUndefined) {
|
|
9794
|
+
if (linear) {
|
|
9795
|
+
// walletBalance = (liquidationPrice * (±1 + mmp) ± entryPrice) * contracts
|
|
9796
|
+
let onePlusMaintenanceMarginPercentageString = undefined;
|
|
9797
|
+
let entryPriceSignString = entryPriceString;
|
|
9798
|
+
if (side === 'short') {
|
|
9799
|
+
onePlusMaintenanceMarginPercentageString = Precise.stringAdd('1', maintenanceMarginPercentageString);
|
|
9800
|
+
entryPriceSignString = Precise.stringMul('-1', entryPriceSignString);
|
|
9801
|
+
}
|
|
9802
|
+
else {
|
|
9803
|
+
onePlusMaintenanceMarginPercentageString = Precise.stringAdd('-1', maintenanceMarginPercentageString);
|
|
9804
|
+
}
|
|
9805
|
+
const inner = Precise.stringMul(liquidationPriceString, onePlusMaintenanceMarginPercentageString);
|
|
9806
|
+
const leftSide = Precise.stringAdd(inner, entryPriceSignString);
|
|
9807
|
+
const quotePrecision = this.precisionFromString(this.safeString2(precision, 'quote', 'price'));
|
|
9808
|
+
if (quotePrecision !== undefined) {
|
|
9809
|
+
collateralString = Precise.stringDiv(Precise.stringMul(leftSide, contractsAbs), '1', quotePrecision);
|
|
9810
|
+
}
|
|
9814
9811
|
}
|
|
9815
9812
|
else {
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9813
|
+
// walletBalance = (contracts * contractSize) * (±1/entryPrice - (±1 - mmp) / liquidationPrice)
|
|
9814
|
+
let onePlusMaintenanceMarginPercentageString = undefined;
|
|
9815
|
+
let entryPriceSignString = entryPriceString;
|
|
9816
|
+
if (side === 'short') {
|
|
9817
|
+
onePlusMaintenanceMarginPercentageString = Precise.stringSub('1', maintenanceMarginPercentageString);
|
|
9818
|
+
}
|
|
9819
|
+
else {
|
|
9820
|
+
onePlusMaintenanceMarginPercentageString = Precise.stringSub('-1', maintenanceMarginPercentageString);
|
|
9821
|
+
entryPriceSignString = Precise.stringMul('-1', entryPriceSignString);
|
|
9822
|
+
}
|
|
9823
|
+
const leftSide = Precise.stringMul(contractsAbs, contractSizeString);
|
|
9824
|
+
const rightSide = Precise.stringSub(Precise.stringDiv('1', entryPriceSignString), Precise.stringDiv(onePlusMaintenanceMarginPercentageString, liquidationPriceString));
|
|
9825
|
+
const basePrecision = this.precisionFromString(this.safeString(precision, 'base'));
|
|
9826
|
+
if (basePrecision !== undefined) {
|
|
9827
|
+
collateralString = Precise.stringDiv(Precise.stringMul(leftSide, rightSide), '1', basePrecision);
|
|
9828
|
+
}
|
|
9824
9829
|
}
|
|
9825
9830
|
}
|
|
9826
9831
|
}
|
|
@@ -10452,9 +10457,10 @@ export default class binance extends Exchange {
|
|
|
10452
10457
|
//
|
|
10453
10458
|
const result = [];
|
|
10454
10459
|
for (let i = 0; i < response.length; i++) {
|
|
10455
|
-
const
|
|
10456
|
-
const entryPrice = this.safeString(
|
|
10460
|
+
const rawPosition = response[i];
|
|
10461
|
+
const entryPrice = this.safeString(rawPosition, 'entryPrice');
|
|
10457
10462
|
if ((entryPrice !== '0') && (entryPrice !== '0.0') && (entryPrice !== '0.00000000')) {
|
|
10463
|
+
const parsed = this.parsePositionRisk(response[i]);
|
|
10458
10464
|
result.push(parsed);
|
|
10459
10465
|
}
|
|
10460
10466
|
}
|
|
@@ -12175,6 +12181,9 @@ export default class binance extends Exchange {
|
|
|
12175
12181
|
const request = {};
|
|
12176
12182
|
if (market['option']) {
|
|
12177
12183
|
request['underlyingAsset'] = market['baseId'];
|
|
12184
|
+
if (market['expiry'] === undefined) {
|
|
12185
|
+
throw new NotSupported(this.id + ' fetchOpenInterest does not support ' + symbol);
|
|
12186
|
+
}
|
|
12178
12187
|
request['expiration'] = this.yymmdd(market['expiry']);
|
|
12179
12188
|
}
|
|
12180
12189
|
else {
|
|
@@ -12221,6 +12230,7 @@ export default class binance extends Exchange {
|
|
|
12221
12230
|
// ]
|
|
12222
12231
|
//
|
|
12223
12232
|
if (market['option']) {
|
|
12233
|
+
symbol = market['symbol'];
|
|
12224
12234
|
const result = this.parseOpenInterests(response, market);
|
|
12225
12235
|
for (let i = 0; i < result.length; i++) {
|
|
12226
12236
|
const item = result[i];
|
package/js/src/bingx.js
CHANGED
|
@@ -522,37 +522,40 @@ export default class bingx extends Exchange {
|
|
|
522
522
|
const response = await this.walletsV1PrivateGetCapitalConfigGetall(params);
|
|
523
523
|
//
|
|
524
524
|
// {
|
|
525
|
-
//
|
|
526
|
-
//
|
|
527
|
-
//
|
|
525
|
+
// "code": 0,
|
|
526
|
+
// "timestamp": 1702623271477,
|
|
527
|
+
// "data": [
|
|
528
|
+
// {
|
|
529
|
+
// "coin": "BTC",
|
|
530
|
+
// "name": "BTC",
|
|
531
|
+
// "networkList": [
|
|
528
532
|
// {
|
|
529
|
-
// "coin": "BTC",
|
|
530
533
|
// "name": "BTC",
|
|
531
|
-
// "
|
|
532
|
-
//
|
|
533
|
-
//
|
|
534
|
-
//
|
|
535
|
-
//
|
|
536
|
-
//
|
|
537
|
-
//
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
//
|
|
541
|
-
//
|
|
542
|
-
//
|
|
543
|
-
//
|
|
544
|
-
//
|
|
545
|
-
//
|
|
546
|
-
//
|
|
547
|
-
//
|
|
548
|
-
//
|
|
549
|
-
//
|
|
550
|
-
//
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
//
|
|
554
|
-
//
|
|
555
|
-
//
|
|
534
|
+
// "network": "BTC",
|
|
535
|
+
// "isDefault": true,
|
|
536
|
+
// "minConfirm": 2,
|
|
537
|
+
// "withdrawEnable": true,
|
|
538
|
+
// "depositEnable": true,
|
|
539
|
+
// "withdrawFee": "0.0006",
|
|
540
|
+
// "withdrawMax": "1.17522",
|
|
541
|
+
// "withdrawMin": "0.0005",
|
|
542
|
+
// "depositMin": "0.0002"
|
|
543
|
+
// },
|
|
544
|
+
// {
|
|
545
|
+
// "name": "BTC",
|
|
546
|
+
// "network": "BEP20",
|
|
547
|
+
// "isDefault": false,
|
|
548
|
+
// "minConfirm": 15,
|
|
549
|
+
// "withdrawEnable": true,
|
|
550
|
+
// "depositEnable": true,
|
|
551
|
+
// "withdrawFee": "0.0000066",
|
|
552
|
+
// "withdrawMax": "1.17522",
|
|
553
|
+
// "withdrawMin": "0.0000066",
|
|
554
|
+
// "depositMin": "0.0002"
|
|
555
|
+
// }
|
|
556
|
+
// ]
|
|
557
|
+
// }
|
|
558
|
+
// ]
|
|
556
559
|
// }
|
|
557
560
|
//
|
|
558
561
|
const data = this.safeList(response, 'data', []);
|
|
@@ -566,6 +569,7 @@ export default class bingx extends Exchange {
|
|
|
566
569
|
const networks = {};
|
|
567
570
|
let fee = undefined;
|
|
568
571
|
let active = undefined;
|
|
572
|
+
let depositEnabled = undefined;
|
|
569
573
|
let withdrawEnabled = undefined;
|
|
570
574
|
let defaultLimits = {};
|
|
571
575
|
for (let j = 0; j < networkList.length; j++) {
|
|
@@ -573,13 +577,17 @@ export default class bingx extends Exchange {
|
|
|
573
577
|
const network = this.safeString(rawNetwork, 'network');
|
|
574
578
|
const networkCode = this.networkIdToCode(network);
|
|
575
579
|
const isDefault = this.safeBool(rawNetwork, 'isDefault');
|
|
580
|
+
depositEnabled = this.safeBool(rawNetwork, 'depositEnable');
|
|
576
581
|
withdrawEnabled = this.safeBool(rawNetwork, 'withdrawEnable');
|
|
577
582
|
const limits = {
|
|
578
|
-
'
|
|
583
|
+
'withdraw': {
|
|
584
|
+
'min': this.safeNumber(rawNetwork, 'withdrawMin'),
|
|
585
|
+
'max': this.safeNumber(rawNetwork, 'withdrawMax'),
|
|
586
|
+
},
|
|
579
587
|
};
|
|
580
588
|
if (isDefault) {
|
|
581
589
|
fee = this.safeNumber(rawNetwork, 'withdrawFee');
|
|
582
|
-
active = withdrawEnabled;
|
|
590
|
+
active = depositEnabled || withdrawEnabled;
|
|
583
591
|
defaultLimits = limits;
|
|
584
592
|
}
|
|
585
593
|
networks[networkCode] = {
|
|
@@ -588,7 +596,7 @@ export default class bingx extends Exchange {
|
|
|
588
596
|
'network': networkCode,
|
|
589
597
|
'fee': fee,
|
|
590
598
|
'active': active,
|
|
591
|
-
'deposit':
|
|
599
|
+
'deposit': depositEnabled,
|
|
592
600
|
'withdraw': withdrawEnabled,
|
|
593
601
|
'precision': undefined,
|
|
594
602
|
'limits': limits,
|
|
@@ -601,7 +609,7 @@ export default class bingx extends Exchange {
|
|
|
601
609
|
'precision': undefined,
|
|
602
610
|
'name': name,
|
|
603
611
|
'active': active,
|
|
604
|
-
'deposit':
|
|
612
|
+
'deposit': depositEnabled,
|
|
605
613
|
'withdraw': withdrawEnabled,
|
|
606
614
|
'networks': networks,
|
|
607
615
|
'fee': fee,
|
package/js/src/bybit.js
CHANGED
|
@@ -6317,6 +6317,7 @@ export default class bybit extends Exchange {
|
|
|
6317
6317
|
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
6318
6318
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
6319
6319
|
*/
|
|
6320
|
+
await this.loadMarkets();
|
|
6320
6321
|
let symbol = undefined;
|
|
6321
6322
|
if ((symbols !== undefined) && Array.isArray(symbols)) {
|
|
6322
6323
|
const symbolsLength = symbols.length;
|
|
@@ -6332,7 +6333,6 @@ export default class bybit extends Exchange {
|
|
|
6332
6333
|
symbol = symbols;
|
|
6333
6334
|
symbols = [this.symbol(symbol)];
|
|
6334
6335
|
}
|
|
6335
|
-
await this.loadMarkets();
|
|
6336
6336
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
6337
6337
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
6338
6338
|
const request = {};
|
package/js/src/pro/alpaca.js
CHANGED
|
@@ -266,7 +266,7 @@ export default class alpaca extends alpacaRest {
|
|
|
266
266
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
267
267
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
268
268
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
269
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
269
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
270
270
|
*/
|
|
271
271
|
const url = this.urls['api']['ws']['crypto'];
|
|
272
272
|
await this.authenticate(url);
|
|
@@ -319,7 +319,7 @@ export default class alpaca extends alpacaRest {
|
|
|
319
319
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
320
320
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
321
321
|
* @param {boolean} [params.unifiedMargin] use unified margin account
|
|
322
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
322
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
323
323
|
*/
|
|
324
324
|
const url = this.urls['api']['ws']['trading'];
|
|
325
325
|
await this.authenticate(url);
|
|
@@ -350,7 +350,7 @@ export default class alpaca extends alpacaRest {
|
|
|
350
350
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
351
351
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
352
352
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
353
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
353
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
354
354
|
*/
|
|
355
355
|
const url = this.urls['api']['ws']['trading'];
|
|
356
356
|
await this.authenticate(url);
|
package/js/src/pro/binance.js
CHANGED
|
@@ -714,10 +714,8 @@ export default class binance extends binanceRest {
|
|
|
714
714
|
client.resolve(orderbook, messageHash);
|
|
715
715
|
}
|
|
716
716
|
async fetchOrderBookSnapshot(client, message, subscription) {
|
|
717
|
-
const name = this.safeString(subscription, 'name');
|
|
718
717
|
const symbol = this.safeString(subscription, 'symbol');
|
|
719
|
-
const
|
|
720
|
-
const messageHash = market['lowercaseId'] + '@' + name;
|
|
718
|
+
const messageHash = 'orderbook::' + symbol;
|
|
721
719
|
try {
|
|
722
720
|
const defaultLimit = this.safeInteger(this.options, 'watchOrderBookLimit', 1000);
|
|
723
721
|
const type = this.safeValue(subscription, 'type');
|
|
@@ -3556,7 +3554,7 @@ export default class binance extends binanceRest {
|
|
|
3556
3554
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
3557
3555
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3558
3556
|
* @param {boolean} [params.portfolioMargin] set to true if you would like to watch trades in a portfolio margin account
|
|
3559
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
3557
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3560
3558
|
*/
|
|
3561
3559
|
await this.loadMarkets();
|
|
3562
3560
|
let type = undefined;
|
package/js/src/pro/bingx.js
CHANGED
|
@@ -444,7 +444,7 @@ export default class bingx extends bingxRest {
|
|
|
444
444
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
445
445
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
446
446
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
447
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
447
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
448
448
|
*/
|
|
449
449
|
await this.loadMarkets();
|
|
450
450
|
const market = this.market(symbol);
|
|
@@ -891,7 +891,7 @@ export default class bingx extends bingxRest {
|
|
|
891
891
|
* @param {int} [since] the earliest time in ms to trades orders for
|
|
892
892
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
893
893
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
894
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
894
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
895
895
|
*/
|
|
896
896
|
await this.loadMarkets();
|
|
897
897
|
await this.authenticate();
|
package/js/src/pro/bitfinex2.js
CHANGED
|
@@ -213,7 +213,7 @@ export default class bitfinex2 extends bitfinex2Rest {
|
|
|
213
213
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
214
214
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
215
215
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
216
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
216
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
217
217
|
*/
|
|
218
218
|
await this.loadMarkets();
|
|
219
219
|
let messageHash = 'myTrade';
|
|
@@ -894,7 +894,7 @@ export default class bitfinex2 extends bitfinex2Rest {
|
|
|
894
894
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
895
895
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
896
896
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
897
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
897
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
898
898
|
*/
|
|
899
899
|
await this.loadMarkets();
|
|
900
900
|
let messageHash = 'orders';
|
package/js/src/pro/bitget.js
CHANGED
|
@@ -972,7 +972,7 @@ export default class bitget extends bitgetRest {
|
|
|
972
972
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for watching spot margin orders]
|
|
973
973
|
* @param {string} [params.type] 'spot', 'swap'
|
|
974
974
|
* @param {string} [params.subType] 'linear', 'inverse'
|
|
975
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
975
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
976
976
|
*/
|
|
977
977
|
await this.loadMarkets();
|
|
978
978
|
let market = undefined;
|
package/js/src/pro/bitmex.js
CHANGED
|
@@ -1149,7 +1149,7 @@ export default class bitmex extends bitmexRest {
|
|
|
1149
1149
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1150
1150
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
1151
1151
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1152
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
1152
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1153
1153
|
*/
|
|
1154
1154
|
await this.loadMarkets();
|
|
1155
1155
|
await this.authenticate();
|
package/js/src/pro/bitopro.js
CHANGED
|
@@ -187,7 +187,7 @@ export default class bitopro extends bitoproRest {
|
|
|
187
187
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
188
188
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
189
189
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
190
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
190
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
191
191
|
*/
|
|
192
192
|
this.checkRequiredCredentials();
|
|
193
193
|
await this.loadMarkets();
|
package/js/src/pro/bybit.js
CHANGED
|
@@ -763,7 +763,7 @@ export default class bybit extends bybitRest {
|
|
|
763
763
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
764
764
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
765
765
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
766
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
766
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
767
767
|
*/
|
|
768
768
|
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
769
769
|
}
|
|
@@ -940,7 +940,7 @@ export default class bybit extends bybitRest {
|
|
|
940
940
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
941
941
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
942
942
|
* @param {boolean} [params.unifiedMargin] use unified margin account
|
|
943
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
943
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
944
944
|
*/
|
|
945
945
|
const method = 'watchMyTrades';
|
|
946
946
|
let messageHash = 'myTrades';
|
|
@@ -1257,7 +1257,7 @@ export default class bybit extends bybitRest {
|
|
|
1257
1257
|
const rawLiquidation = this.safeDict(message, 'data', {});
|
|
1258
1258
|
const marketId = this.safeString(rawLiquidation, 'symbol');
|
|
1259
1259
|
const market = this.safeMarket(marketId, undefined, '', 'contract');
|
|
1260
|
-
const symbol =
|
|
1260
|
+
const symbol = market['symbol'];
|
|
1261
1261
|
const liquidation = this.parseWsLiquidation(rawLiquidation, market);
|
|
1262
1262
|
let liquidations = this.safeValue(this.liquidations, symbol);
|
|
1263
1263
|
if (liquidations === undefined) {
|
|
@@ -1284,7 +1284,7 @@ export default class bybit extends bybitRest {
|
|
|
1284
1284
|
const timestamp = this.safeInteger(liquidation, 'updatedTime');
|
|
1285
1285
|
return this.safeLiquidation({
|
|
1286
1286
|
'info': liquidation,
|
|
1287
|
-
'symbol':
|
|
1287
|
+
'symbol': market['symbol'],
|
|
1288
1288
|
'contracts': this.safeNumber(liquidation, 'size'),
|
|
1289
1289
|
'contractSize': this.safeNumber(market, 'contractSize'),
|
|
1290
1290
|
'price': this.safeNumber(liquidation, 'price'),
|
|
@@ -1304,7 +1304,7 @@ export default class bybit extends bybitRest {
|
|
|
1304
1304
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1305
1305
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1306
1306
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1307
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
1307
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1308
1308
|
*/
|
|
1309
1309
|
await this.loadMarkets();
|
|
1310
1310
|
const method = 'watchOrders';
|
|
@@ -201,7 +201,7 @@ export default class coinbaseexchange extends coinbaseexchangeRest {
|
|
|
201
201
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
202
202
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
203
203
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
204
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
204
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
205
205
|
*/
|
|
206
206
|
if (symbol === undefined) {
|
|
207
207
|
throw new ArgumentsRequired(this.id + ' watchMyTrades() requires a symbol argument');
|
|
@@ -226,7 +226,7 @@ export default class coinbaseexchange extends coinbaseexchangeRest {
|
|
|
226
226
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
227
227
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
228
228
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
229
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
229
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
230
230
|
*/
|
|
231
231
|
symbols = this.marketSymbols(symbols, undefined, false);
|
|
232
232
|
await this.loadMarkets();
|
package/js/src/pro/coincheck.js
CHANGED
|
@@ -114,7 +114,7 @@ export default class coincheck extends coincheckRest {
|
|
|
114
114
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
115
115
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
116
116
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
117
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
117
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
118
118
|
*/
|
|
119
119
|
await this.loadMarkets();
|
|
120
120
|
const market = this.market(symbol);
|
package/js/src/pro/coinone.js
CHANGED
|
@@ -257,7 +257,7 @@ export default class coinone extends coinoneRest {
|
|
|
257
257
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
258
258
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
259
259
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
260
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
260
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
261
261
|
*/
|
|
262
262
|
await this.loadMarkets();
|
|
263
263
|
const market = this.market(symbol);
|
package/js/src/pro/cryptocom.js
CHANGED
|
@@ -330,7 +330,7 @@ export default class cryptocom extends cryptocomRest {
|
|
|
330
330
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
331
331
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
332
332
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
333
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
333
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
334
334
|
*/
|
|
335
335
|
await this.loadMarkets();
|
|
336
336
|
let market = undefined;
|
package/js/src/pro/deribit.js
CHANGED
|
@@ -566,7 +566,7 @@ export default class deribit extends deribitRest {
|
|
|
566
566
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
567
567
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
568
568
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
569
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
569
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
570
570
|
*/
|
|
571
571
|
await this.loadMarkets();
|
|
572
572
|
await this.authenticate(params);
|
package/js/src/pro/gate.js
CHANGED
|
@@ -845,7 +845,7 @@ export default class gate extends gateRest {
|
|
|
845
845
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
846
846
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
847
847
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
848
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
848
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
849
849
|
*/
|
|
850
850
|
await this.loadMarkets();
|
|
851
851
|
let subType = undefined;
|
|
@@ -1193,7 +1193,7 @@ export default class gate extends gateRest {
|
|
|
1193
1193
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1194
1194
|
* @param {string} [params.type] spot, margin, swap, future, or option. Required if listening to all symbols.
|
|
1195
1195
|
* @param {boolean} [params.isInverse] if future, listen to inverse or linear contracts
|
|
1196
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
1196
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1197
1197
|
*/
|
|
1198
1198
|
await this.loadMarkets();
|
|
1199
1199
|
let market = undefined;
|
package/js/src/pro/hollaex.js
CHANGED
|
@@ -176,7 +176,7 @@ export default class hollaex extends hollaexRest {
|
|
|
176
176
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
177
177
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
178
178
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
179
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
179
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
180
180
|
*/
|
|
181
181
|
await this.loadMarkets();
|
|
182
182
|
let messageHash = 'usertrade';
|
package/js/src/pro/htx.js
CHANGED
|
@@ -671,7 +671,7 @@ export default class htx extends htxRest {
|
|
|
671
671
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
672
672
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
673
673
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
674
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
674
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
675
675
|
*/
|
|
676
676
|
this.checkRequiredCredentials();
|
|
677
677
|
await this.loadMarkets();
|