ccxt 4.2.51 → 4.2.53
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/CHANGELOG.md +76 -16
- package/README.md +5 -6
- package/dist/ccxt.browser.js +994 -1412
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -4
- package/dist/cjs/src/base/Exchange.js +65 -26
- package/dist/cjs/src/binance.js +92 -3
- package/dist/cjs/src/bingx.js +32 -1
- package/dist/cjs/src/bitget.js +1 -0
- package/dist/cjs/src/bitvavo.js +1 -1
- package/dist/cjs/src/coinbase.js +186 -12
- package/dist/cjs/src/htx.js +10 -4
- package/dist/cjs/src/pro/binance.js +156 -1
- package/dist/cjs/src/pro/bitfinex2.js +3 -1
- package/dist/cjs/src/pro/bitvavo.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +7 -25
- package/dist/cjs/src/pro/deribit.js +2 -2
- package/dist/cjs/src/pro/gate.js +2 -1
- package/dist/cjs/src/pro/gemini.js +1 -1
- package/dist/cjs/src/pro/okx.js +18 -4
- package/dist/cjs/src/woo.js +3 -1
- package/js/ccxt.d.ts +2 -5
- package/js/ccxt.js +2 -4
- package/js/src/abstract/coinbase.d.ts +1 -1
- package/js/src/base/Exchange.d.ts +65 -26
- package/js/src/base/Exchange.js +65 -26
- package/js/src/binance.d.ts +6 -0
- package/js/src/binance.js +92 -3
- package/js/src/bingx.d.ts +4 -0
- package/js/src/bingx.js +32 -1
- package/js/src/bitget.js +1 -0
- package/js/src/bitvavo.js +1 -1
- package/js/src/coinbase.d.ts +2 -0
- package/js/src/coinbase.js +186 -12
- package/js/src/deribit.js +1 -1
- package/js/src/htx.js +10 -4
- package/js/src/ndax.js +1 -1
- package/js/src/pro/binance.d.ts +3 -0
- package/js/src/pro/binance.js +156 -1
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex2.js +3 -1
- package/js/src/pro/bitvavo.js +1 -1
- package/js/src/pro/blockchaincom.d.ts +0 -1
- package/js/src/pro/blockchaincom.js +7 -25
- package/js/src/pro/deribit.js +2 -2
- package/js/src/pro/gate.js +2 -1
- package/js/src/pro/gemini.js +1 -1
- package/js/src/pro/okx.js +18 -4
- package/js/src/woo.js +4 -2
- package/package.json +2 -1
- package/skip-tests.json +29 -13
- package/dist/cjs/src/abstract/bitforex.js +0 -9
- package/dist/cjs/src/bitforex.js +0 -884
- package/js/src/abstract/bitforex.d.ts +0 -27
- package/js/src/abstract/bitforex.js +0 -11
- package/js/src/bitforex.d.ts +0 -39
- package/js/src/bitforex.js +0 -885
package/js/src/pro/binance.js
CHANGED
|
@@ -41,9 +41,11 @@ export default class binance extends binanceRest {
|
|
|
41
41
|
'fetchDepositsWs': false,
|
|
42
42
|
'fetchMarketsWs': false,
|
|
43
43
|
'fetchMyTradesWs': true,
|
|
44
|
+
'fetchOHLCVWs': true,
|
|
44
45
|
'fetchOpenOrdersWs': true,
|
|
45
46
|
'fetchOrderWs': true,
|
|
46
47
|
'fetchOrdersWs': true,
|
|
48
|
+
'fetchTradesWs': true,
|
|
47
49
|
'fetchTradingFeesWs': false,
|
|
48
50
|
'fetchWithdrawalsWs': false,
|
|
49
51
|
},
|
|
@@ -840,6 +842,94 @@ export default class binance extends binanceRest {
|
|
|
840
842
|
stored.append(parsed);
|
|
841
843
|
client.resolve(stored, messageHash);
|
|
842
844
|
}
|
|
845
|
+
async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
846
|
+
/**
|
|
847
|
+
* @method
|
|
848
|
+
* @name binance#fetchOHLCVWs
|
|
849
|
+
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#klines
|
|
850
|
+
* @description query historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
851
|
+
* @param {string} symbol unified symbol of the market to query OHLCV data for
|
|
852
|
+
* @param {string} timeframe the length of time each candle represents
|
|
853
|
+
* @param {int} since timestamp in ms of the earliest candle to fetch
|
|
854
|
+
* @param {int} limit the maximum amount of candles to fetch
|
|
855
|
+
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
856
|
+
* @param {int} params.until timestamp in ms of the earliest candle to fetch
|
|
857
|
+
*
|
|
858
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
859
|
+
* @param {string} params.timeZone default=0 (UTC)
|
|
860
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
861
|
+
*/
|
|
862
|
+
await this.loadMarkets();
|
|
863
|
+
this.checkIsSpot('fetchOHLCVWs', symbol, params);
|
|
864
|
+
const url = this.urls['api']['ws']['ws'];
|
|
865
|
+
const requestId = this.requestId(url);
|
|
866
|
+
const messageHash = requestId.toString();
|
|
867
|
+
let returnRateLimits = false;
|
|
868
|
+
[returnRateLimits, params] = this.handleOptionAndParams(params, 'fetchOHLCVWs', 'returnRateLimits', false);
|
|
869
|
+
const payload = {
|
|
870
|
+
'symbol': this.marketId(symbol),
|
|
871
|
+
'returnRateLimits': returnRateLimits,
|
|
872
|
+
'interval': this.timeframes[timeframe],
|
|
873
|
+
};
|
|
874
|
+
const until = this.safeInteger(params, 'until');
|
|
875
|
+
params = this.omit(params, 'until');
|
|
876
|
+
if (since !== undefined) {
|
|
877
|
+
payload['startTime'] = since;
|
|
878
|
+
}
|
|
879
|
+
if (limit !== undefined) {
|
|
880
|
+
payload['limit'] = limit;
|
|
881
|
+
}
|
|
882
|
+
if (until !== undefined) {
|
|
883
|
+
payload['endTime'] = until;
|
|
884
|
+
}
|
|
885
|
+
const message = {
|
|
886
|
+
'id': messageHash,
|
|
887
|
+
'method': 'klines',
|
|
888
|
+
'params': this.extend(payload, params),
|
|
889
|
+
};
|
|
890
|
+
const subscription = {
|
|
891
|
+
'method': this.handleFetchOHLCV,
|
|
892
|
+
};
|
|
893
|
+
return await this.watch(url, messageHash, message, messageHash, subscription);
|
|
894
|
+
}
|
|
895
|
+
handleFetchOHLCV(client, message) {
|
|
896
|
+
//
|
|
897
|
+
// {
|
|
898
|
+
// "id": "1dbbeb56-8eea-466a-8f6e-86bdcfa2fc0b",
|
|
899
|
+
// "status": 200,
|
|
900
|
+
// "result": [
|
|
901
|
+
// [
|
|
902
|
+
// 1655971200000, // Kline open time
|
|
903
|
+
// "0.01086000", // Open price
|
|
904
|
+
// "0.01086600", // High price
|
|
905
|
+
// "0.01083600", // Low price
|
|
906
|
+
// "0.01083800", // Close price
|
|
907
|
+
// "2290.53800000", // Volume
|
|
908
|
+
// 1655974799999, // Kline close time
|
|
909
|
+
// "24.85074442", // Quote asset volume
|
|
910
|
+
// 2283, // Number of trades
|
|
911
|
+
// "1171.64000000", // Taker buy base asset volume
|
|
912
|
+
// "12.71225884", // Taker buy quote asset volume
|
|
913
|
+
// "0" // Unused field, ignore
|
|
914
|
+
// ]
|
|
915
|
+
// ],
|
|
916
|
+
// "rateLimits": [
|
|
917
|
+
// {
|
|
918
|
+
// "rateLimitType": "REQUEST_WEIGHT",
|
|
919
|
+
// "interval": "MINUTE",
|
|
920
|
+
// "intervalNum": 1,
|
|
921
|
+
// "limit": 6000,
|
|
922
|
+
// "count": 2
|
|
923
|
+
// }
|
|
924
|
+
// ]
|
|
925
|
+
// }
|
|
926
|
+
//
|
|
927
|
+
const result = this.safeList(message, 'result');
|
|
928
|
+
const parsed = this.parseOHLCVs(result);
|
|
929
|
+
// use a reverse lookup in a static map instead
|
|
930
|
+
const messageHash = this.safeString(message, 'id');
|
|
931
|
+
client.resolve(parsed, messageHash);
|
|
932
|
+
}
|
|
843
933
|
async watchTicker(symbol, params = {}) {
|
|
844
934
|
/**
|
|
845
935
|
* @method
|
|
@@ -2541,12 +2631,58 @@ export default class binance extends binanceRest {
|
|
|
2541
2631
|
const trades = await this.watch(url, messageHash, message, messageHash, subscription);
|
|
2542
2632
|
return this.filterBySymbolSinceLimit(trades, symbol, since, limit);
|
|
2543
2633
|
}
|
|
2634
|
+
async fetchTradesWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2635
|
+
/**
|
|
2636
|
+
* @method
|
|
2637
|
+
* @name binance#fetchTradesWs
|
|
2638
|
+
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#recent-trades
|
|
2639
|
+
* @description fetch all trades made by the user
|
|
2640
|
+
* @param {string} symbol unified market symbol
|
|
2641
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2642
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve, default=500, max=1000
|
|
2643
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2644
|
+
*
|
|
2645
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
2646
|
+
* @param {int} [params.fromId] trade ID to begin at
|
|
2647
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2648
|
+
*/
|
|
2649
|
+
await this.loadMarkets();
|
|
2650
|
+
if (symbol === undefined) {
|
|
2651
|
+
throw new BadRequest(this.id + ' fetchTradesWs () requires a symbol argument');
|
|
2652
|
+
}
|
|
2653
|
+
this.checkIsSpot('fetchTradesWs', symbol, params);
|
|
2654
|
+
const url = this.urls['api']['ws']['ws'];
|
|
2655
|
+
const requestId = this.requestId(url);
|
|
2656
|
+
const messageHash = requestId.toString();
|
|
2657
|
+
let returnRateLimits = false;
|
|
2658
|
+
[returnRateLimits, params] = this.handleOptionAndParams(params, 'fetchTradesWs', 'returnRateLimits', false);
|
|
2659
|
+
const payload = {
|
|
2660
|
+
'symbol': this.marketId(symbol),
|
|
2661
|
+
'returnRateLimits': returnRateLimits,
|
|
2662
|
+
};
|
|
2663
|
+
if (limit !== undefined) {
|
|
2664
|
+
payload['limit'] = limit;
|
|
2665
|
+
}
|
|
2666
|
+
const message = {
|
|
2667
|
+
'id': messageHash,
|
|
2668
|
+
'method': 'trades.historical',
|
|
2669
|
+
'params': this.extend(payload, params),
|
|
2670
|
+
};
|
|
2671
|
+
const subscription = {
|
|
2672
|
+
'method': this.handleTradesWs,
|
|
2673
|
+
};
|
|
2674
|
+
const trades = await this.watch(url, messageHash, message, messageHash, subscription);
|
|
2675
|
+
return this.filterBySinceLimit(trades, since, limit);
|
|
2676
|
+
}
|
|
2544
2677
|
handleTradesWs(client, message) {
|
|
2678
|
+
//
|
|
2679
|
+
// fetchMyTradesWs
|
|
2545
2680
|
//
|
|
2546
2681
|
// {
|
|
2547
2682
|
// "id": "f4ce6a53-a29d-4f70-823b-4ab59391d6e8",
|
|
2548
2683
|
// "status": 200,
|
|
2549
|
-
// "result": [
|
|
2684
|
+
// "result": [
|
|
2685
|
+
// {
|
|
2550
2686
|
// "symbol": "BTCUSDT",
|
|
2551
2687
|
// "id": 1650422481,
|
|
2552
2688
|
// "orderId": 12569099453,
|
|
@@ -2565,6 +2701,25 @@ export default class binance extends binanceRest {
|
|
|
2565
2701
|
// ],
|
|
2566
2702
|
// }
|
|
2567
2703
|
//
|
|
2704
|
+
// fetchTradesWs
|
|
2705
|
+
//
|
|
2706
|
+
// {
|
|
2707
|
+
// "id": "f4ce6a53-a29d-4f70-823b-4ab59391d6e8",
|
|
2708
|
+
// "status": 200,
|
|
2709
|
+
// "result": [
|
|
2710
|
+
// {
|
|
2711
|
+
// "id": 0,
|
|
2712
|
+
// "price": "0.00005000",
|
|
2713
|
+
// "qty": "40.00000000",
|
|
2714
|
+
// "quoteQty": "0.00200000",
|
|
2715
|
+
// "time": 1500004800376,
|
|
2716
|
+
// "isBuyerMaker": true,
|
|
2717
|
+
// "isBestMatch": true
|
|
2718
|
+
// }
|
|
2719
|
+
// ...
|
|
2720
|
+
// ],
|
|
2721
|
+
// }
|
|
2722
|
+
//
|
|
2568
2723
|
const messageHash = this.safeString(message, 'id');
|
|
2569
2724
|
const result = this.safeValue(message, 'result', []);
|
|
2570
2725
|
const trades = this.parseTrades(result);
|
package/js/src/pro/bingx.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import bingxRest from '../bingx.js';
|
|
9
9
|
import { BadRequest, NetworkError } from '../base/errors.js';
|
|
10
10
|
import { ArrayCache, ArrayCacheByTimestamp, ArrayCacheBySymbolById } from '../base/ws/Cache.js';
|
|
11
|
-
import Precise from '../base/Precise.js';
|
|
11
|
+
import { Precise } from '../base/Precise.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
export default class bingx extends bingxRest {
|
|
14
14
|
describe() {
|
package/js/src/pro/bitfinex2.js
CHANGED
|
@@ -323,7 +323,9 @@ export default class bitfinex2 extends bitfinex2Rest {
|
|
|
323
323
|
const messageLength = message.length;
|
|
324
324
|
if (messageLength === 2) {
|
|
325
325
|
// initial snapshot
|
|
326
|
-
|
|
326
|
+
let trades = this.safeList(message, 1, []);
|
|
327
|
+
// needs to be reversed to make chronological order
|
|
328
|
+
trades = trades.reverse();
|
|
327
329
|
for (let i = 0; i < trades.length; i++) {
|
|
328
330
|
const parsed = this.parseWsTrade(trades[i], market);
|
|
329
331
|
stored.append(parsed);
|
package/js/src/pro/bitvavo.js
CHANGED
|
@@ -105,7 +105,7 @@ export default class bitvavo extends bitvavoRest {
|
|
|
105
105
|
// "volume": "3587.05020246",
|
|
106
106
|
// "volumeQuote": "708030.17",
|
|
107
107
|
// "bid": "199.56",
|
|
108
|
-
// "bidSize": "4.
|
|
108
|
+
// "bidSize": "4.14730802",
|
|
109
109
|
// "ask": "199.57",
|
|
110
110
|
// "askSize": "6.13642074",
|
|
111
111
|
// "timestamp": 1590770885217
|
|
@@ -21,7 +21,6 @@ export default class blockchaincom extends blockchaincomRest {
|
|
|
21
21
|
handleOrderBook(client: Client, message: any): void;
|
|
22
22
|
handleDelta(bookside: any, delta: any): void;
|
|
23
23
|
handleDeltas(bookside: any, deltas: any): void;
|
|
24
|
-
checkSequenceNumber(client: Client, message: any): void;
|
|
25
24
|
handleMessage(client: Client, message: any): void;
|
|
26
25
|
handleAuthenticationMessage(client: Client, message: any): void;
|
|
27
26
|
authenticate(params?: {}): Promise<any>;
|
|
@@ -37,7 +37,6 @@ export default class blockchaincom extends blockchaincomRest {
|
|
|
37
37
|
},
|
|
38
38
|
'noOriginHeader': false,
|
|
39
39
|
},
|
|
40
|
-
'sequenceNumbers': {},
|
|
41
40
|
},
|
|
42
41
|
'streaming': {},
|
|
43
42
|
'exceptions': {},
|
|
@@ -681,21 +680,20 @@ export default class blockchaincom extends blockchaincomRest {
|
|
|
681
680
|
// }
|
|
682
681
|
//
|
|
683
682
|
const event = this.safeString(message, 'event');
|
|
683
|
+
if (event === 'subscribed') {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
684
686
|
const type = this.safeString(message, 'channel');
|
|
685
687
|
const marketId = this.safeString(message, 'symbol');
|
|
686
688
|
const symbol = this.safeSymbol(marketId);
|
|
687
689
|
const messageHash = 'orderbook:' + symbol + ':' + type;
|
|
688
690
|
const datetime = this.safeString(message, 'timestamp');
|
|
689
691
|
const timestamp = this.parse8601(datetime);
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
orderbook = this.countedOrderBook({});
|
|
693
|
-
this.orderbooks[symbol] = orderbook;
|
|
694
|
-
}
|
|
695
|
-
if (event === 'subscribed') {
|
|
696
|
-
return;
|
|
692
|
+
if (this.safeValue(this.orderbooks, symbol) === undefined) {
|
|
693
|
+
this.orderbooks[symbol] = this.countedOrderBook();
|
|
697
694
|
}
|
|
698
|
-
|
|
695
|
+
const orderbook = this.orderbooks[symbol];
|
|
696
|
+
if (event === 'snapshot') {
|
|
699
697
|
const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'px', 'qty', 'num');
|
|
700
698
|
orderbook.reset(snapshot);
|
|
701
699
|
}
|
|
@@ -721,23 +719,7 @@ export default class blockchaincom extends blockchaincomRest {
|
|
|
721
719
|
this.handleDelta(bookside, deltas[i]);
|
|
722
720
|
}
|
|
723
721
|
}
|
|
724
|
-
checkSequenceNumber(client, message) {
|
|
725
|
-
const seqnum = this.safeInteger(message, 'seqnum', 0);
|
|
726
|
-
const channel = this.safeString(message, 'channel', '');
|
|
727
|
-
const sequenceNumbersByChannel = this.safeValue(this.options, 'sequenceNumbers', {});
|
|
728
|
-
const lastSeqnum = this.safeInteger(sequenceNumbersByChannel, channel);
|
|
729
|
-
if (lastSeqnum === undefined) {
|
|
730
|
-
this.options['sequenceNumbers'][channel] = seqnum;
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
if (seqnum !== lastSeqnum + 1) {
|
|
734
|
-
throw new ExchangeError(this.id + ' ' + channel + ' seqnum ' + seqnum + ' is not the expected ' + (lastSeqnum + 1));
|
|
735
|
-
}
|
|
736
|
-
this.options['sequenceNumbers'][channel] = seqnum;
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
722
|
handleMessage(client, message) {
|
|
740
|
-
this.checkSequenceNumber(client, message);
|
|
741
723
|
const channel = this.safeString(message, 'channel');
|
|
742
724
|
const handlers = {
|
|
743
725
|
'ticker': this.handleTicker,
|
package/js/src/pro/deribit.js
CHANGED
|
@@ -180,7 +180,7 @@ export default class deribit extends deribitRest {
|
|
|
180
180
|
// "params": {
|
|
181
181
|
// "channel": "ticker.BTC_USDC-PERPETUAL.raw",
|
|
182
182
|
// "data": {
|
|
183
|
-
// "timestamp":
|
|
183
|
+
// "timestamp": 1655393725040,
|
|
184
184
|
// "stats": [Object],
|
|
185
185
|
// "state": "open",
|
|
186
186
|
// "settlement_price": 21729.5891,
|
|
@@ -663,7 +663,7 @@ export default class deribit extends deribitRest {
|
|
|
663
663
|
const symbol = this.safeSymbol(marketId);
|
|
664
664
|
const ohlcv = this.safeValue(params, 'data', {});
|
|
665
665
|
const parsed = [
|
|
666
|
-
this.
|
|
666
|
+
this.safeInteger(ohlcv, 'tick'),
|
|
667
667
|
this.safeNumber(ohlcv, 'open'),
|
|
668
668
|
this.safeNumber(ohlcv, 'high'),
|
|
669
669
|
this.safeNumber(ohlcv, 'low'),
|
package/js/src/pro/gate.js
CHANGED
|
@@ -386,8 +386,9 @@ export default class gate extends gateRest {
|
|
|
386
386
|
const parts = channel.split('.');
|
|
387
387
|
const rawMarketType = this.safeString(parts, 0);
|
|
388
388
|
const marketType = (rawMarketType === 'futures') ? 'contract' : 'spot';
|
|
389
|
+
const result = this.safeValue(message, 'result');
|
|
389
390
|
let results = [];
|
|
390
|
-
if (
|
|
391
|
+
if (Array.isArray(result)) {
|
|
391
392
|
results = this.safeList(message, 'result', []);
|
|
392
393
|
}
|
|
393
394
|
else {
|
package/js/src/pro/gemini.js
CHANGED
|
@@ -206,7 +206,7 @@ export default class gemini extends geminiRest {
|
|
|
206
206
|
// "time_ms": 1655323185000,
|
|
207
207
|
// "result": "failure",
|
|
208
208
|
// "highest_bid_price": "21661.90",
|
|
209
|
-
// "lowest_ask_price": "21663.
|
|
209
|
+
// "lowest_ask_price": "21663.78",
|
|
210
210
|
// "collar_price": "21662.845"
|
|
211
211
|
// },
|
|
212
212
|
// ]
|
package/js/src/pro/okx.js
CHANGED
|
@@ -910,9 +910,6 @@ export default class okx extends okxRest {
|
|
|
910
910
|
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
911
911
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
912
912
|
*/
|
|
913
|
-
if (this.isEmpty(symbols)) {
|
|
914
|
-
throw new ArgumentsRequired(this.id + ' watchPositions requires a list of symbols');
|
|
915
|
-
}
|
|
916
913
|
await this.loadMarkets();
|
|
917
914
|
await this.authenticate(params);
|
|
918
915
|
symbols = this.marketSymbols(symbols);
|
|
@@ -920,7 +917,23 @@ export default class okx extends okxRest {
|
|
|
920
917
|
'instType': 'ANY',
|
|
921
918
|
};
|
|
922
919
|
const channel = 'positions';
|
|
923
|
-
|
|
920
|
+
let newPositions = undefined;
|
|
921
|
+
if (symbols === undefined) {
|
|
922
|
+
const arg = {
|
|
923
|
+
'channel': 'positions',
|
|
924
|
+
'instType': 'ANY',
|
|
925
|
+
};
|
|
926
|
+
const args = [arg];
|
|
927
|
+
const nonSymbolRequest = {
|
|
928
|
+
'op': 'subscribe',
|
|
929
|
+
'args': args,
|
|
930
|
+
};
|
|
931
|
+
const url = this.getUrl(channel, 'private');
|
|
932
|
+
newPositions = await this.watch(url, channel, nonSymbolRequest, channel);
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
newPositions = await this.subscribeMultiple('private', channel, symbols, this.extend(request, params));
|
|
936
|
+
}
|
|
924
937
|
if (this.newUpdates) {
|
|
925
938
|
return newPositions;
|
|
926
939
|
}
|
|
@@ -1018,6 +1031,7 @@ export default class okx extends okxRest {
|
|
|
1018
1031
|
client.resolve(positions, messageHash);
|
|
1019
1032
|
}
|
|
1020
1033
|
}
|
|
1034
|
+
client.resolve(newPositions, channel);
|
|
1021
1035
|
}
|
|
1022
1036
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1023
1037
|
/**
|
package/js/src/woo.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/woo.js';
|
|
9
|
-
import { AuthenticationError, RateLimitExceeded, BadRequest, ExchangeError, InvalidOrder, ArgumentsRequired, NotSupported } from './base/errors.js';
|
|
9
|
+
import { AuthenticationError, RateLimitExceeded, BadRequest, ExchangeError, InvalidOrder, ArgumentsRequired, NotSupported, OnMaintenance } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
@@ -298,7 +298,6 @@ export default class woo extends Exchange {
|
|
|
298
298
|
'-1007': BadRequest,
|
|
299
299
|
'-1008': InvalidOrder,
|
|
300
300
|
'-1009': BadRequest,
|
|
301
|
-
'-1011': ExchangeError,
|
|
302
301
|
'-1012': BadRequest,
|
|
303
302
|
'-1101': InvalidOrder,
|
|
304
303
|
'-1102': InvalidOrder,
|
|
@@ -307,6 +306,8 @@ export default class woo extends Exchange {
|
|
|
307
306
|
'-1105': InvalidOrder, // { "code": -1105, "message": "Price is X% too high or X% too low from the mid price." }
|
|
308
307
|
},
|
|
309
308
|
'broad': {
|
|
309
|
+
'Can not place': ExchangeError,
|
|
310
|
+
'maintenance': OnMaintenance,
|
|
310
311
|
'symbol must not be blank': BadRequest,
|
|
311
312
|
'The token is not supported': BadRequest,
|
|
312
313
|
'Your order and symbol are not valid or already canceled': BadRequest,
|
|
@@ -2383,6 +2384,7 @@ export default class woo extends Exchange {
|
|
|
2383
2384
|
}
|
|
2384
2385
|
//
|
|
2385
2386
|
// 400 Bad Request {"success":false,"code":-1012,"message":"Amount is required for buy market orders when margin disabled."}
|
|
2387
|
+
// {"code":"-1011","message":"The system is under maintenance.","success":false}
|
|
2386
2388
|
//
|
|
2387
2389
|
const success = this.safeValue(response, 'success');
|
|
2388
2390
|
const errorCode = this.safeString(response, 'code');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccxt",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.53",
|
|
4
4
|
"description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
|
|
5
5
|
"unpkg": "dist/ccxt.browser.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"force-build": "npm run pre-transpile && npm run force-transpile-fast && npm run csharp && npm run post-transpile && npm run update-badges",
|
|
36
36
|
"build-docs": "node jsdoc2md.js && node examples2md.js",
|
|
37
37
|
"serve-docs": "docsify serve ./wiki",
|
|
38
|
+
"tsBuildFile": "tsc --skipLibCheck --strictNullChecks false --strict --noImplicitAny false --esModuleInterop --isolatedModules false --forceConsistentCasingInFileNames --removeComments false --target ES2020 --declaration --allowJs --checkJs false --moduleResolution Node --module ES2022 --outDir ./js/src --lib ES2020.BigInt --lib dom ",
|
|
38
39
|
"tsBuild": "tsc || true",
|
|
39
40
|
"tsBuildExamples": "tsc -p ./examples/tsconfig.json",
|
|
40
41
|
"emitAPI": "node build/generateImplicitAPI.js",
|
package/skip-tests.json
CHANGED
|
@@ -48,6 +48,18 @@
|
|
|
48
48
|
"fetchTickers": {
|
|
49
49
|
"bid":"broken bid-ask",
|
|
50
50
|
"ask":"broken bid-ask"
|
|
51
|
+
},
|
|
52
|
+
"fetchOrderBook": {
|
|
53
|
+
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269129438#L3841"
|
|
54
|
+
},
|
|
55
|
+
"fetchL2OrderBook": {
|
|
56
|
+
"spread": "same"
|
|
57
|
+
},
|
|
58
|
+
"watchOrderBook": {
|
|
59
|
+
"spread": "same"
|
|
60
|
+
},
|
|
61
|
+
"watchOrderBookForSymbols": {
|
|
62
|
+
"spread": "same"
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
65
|
},
|
|
@@ -199,7 +211,6 @@
|
|
|
199
211
|
}
|
|
200
212
|
},
|
|
201
213
|
"bitfinex2": {
|
|
202
|
-
"skipWs": true,
|
|
203
214
|
"skipMethods": {
|
|
204
215
|
"loadMarkets": {
|
|
205
216
|
"currencyIdAndCode": "broken currencies"
|
|
@@ -208,9 +219,18 @@
|
|
|
208
219
|
"withdraw": "not provided",
|
|
209
220
|
"deposit": "not provided"
|
|
210
221
|
},
|
|
211
|
-
"fetchOrderBook":
|
|
212
|
-
|
|
213
|
-
|
|
222
|
+
"fetchOrderBook": {
|
|
223
|
+
"bid": "multiple bids might have same value"
|
|
224
|
+
},
|
|
225
|
+
"fetchL2OrderBook": {
|
|
226
|
+
"bid": "same"
|
|
227
|
+
},
|
|
228
|
+
"watchOrderBook": {
|
|
229
|
+
"bid": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269129438#L3999"
|
|
230
|
+
},
|
|
231
|
+
"watchOrderBookForSymbols": {
|
|
232
|
+
"bid": "same"
|
|
233
|
+
}
|
|
214
234
|
}
|
|
215
235
|
},
|
|
216
236
|
"bitflyer": {
|
|
@@ -371,7 +391,6 @@
|
|
|
371
391
|
}
|
|
372
392
|
},
|
|
373
393
|
"bitrue": {
|
|
374
|
-
"skipWs": true,
|
|
375
394
|
"skipMethods": {
|
|
376
395
|
"loadMarkets": {
|
|
377
396
|
"currencyIdAndCode": "broken currencies",
|
|
@@ -391,15 +410,19 @@
|
|
|
391
410
|
}
|
|
392
411
|
},
|
|
393
412
|
"bitso": {
|
|
413
|
+
"skipWs": true,
|
|
394
414
|
"skipMethods": {
|
|
395
415
|
"loadMarkets": {
|
|
396
416
|
"active": "not provided"
|
|
397
417
|
},
|
|
418
|
+
"fetchOrderBook": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269129438#L4148",
|
|
398
419
|
"fetchOHLCV": "randomly failing with 404 not found"
|
|
399
420
|
}
|
|
400
421
|
},
|
|
422
|
+
"bitforex": {
|
|
423
|
+
"skipWs": true
|
|
424
|
+
},
|
|
401
425
|
"bitstamp": {
|
|
402
|
-
"skipWs": true,
|
|
403
426
|
"skipMethods": {
|
|
404
427
|
"fetchOrderBook": "bid/ask might be 0",
|
|
405
428
|
"fetchL2OrderBook": "same",
|
|
@@ -450,9 +473,6 @@
|
|
|
450
473
|
}
|
|
451
474
|
},
|
|
452
475
|
"bitvavo": {
|
|
453
|
-
"skip": "temp",
|
|
454
|
-
"skipWs": "temp",
|
|
455
|
-
"httpsProxy": "http://51.83.140.52:11230",
|
|
456
476
|
"skipMethods": {
|
|
457
477
|
"fetchCurrencies": {
|
|
458
478
|
"precision": "not provided",
|
|
@@ -471,7 +491,6 @@
|
|
|
471
491
|
}
|
|
472
492
|
},
|
|
473
493
|
"blockchaincom": {
|
|
474
|
-
"skipWs": "https://app.travis-ci.com/github/ccxt/ccxt/builds/265225134#L2304",
|
|
475
494
|
"skipMethods": {
|
|
476
495
|
"loadMarkets": {
|
|
477
496
|
"taker":"not provided",
|
|
@@ -765,7 +784,6 @@
|
|
|
765
784
|
}
|
|
766
785
|
},
|
|
767
786
|
"cryptocom": {
|
|
768
|
-
"skipWs": "timeout",
|
|
769
787
|
"skipMethods": {
|
|
770
788
|
"proxies": "probably they do not permit our proxy",
|
|
771
789
|
"loadMarkets": {
|
|
@@ -849,7 +867,6 @@
|
|
|
849
867
|
}
|
|
850
868
|
},
|
|
851
869
|
"deribit": {
|
|
852
|
-
"skipWs": "timeouts",
|
|
853
870
|
"skipMethods": {
|
|
854
871
|
"fetchCurrencies": "deposit/withdraw not provided",
|
|
855
872
|
"loadMarkets": "strike is set when option is not true",
|
|
@@ -896,7 +913,6 @@
|
|
|
896
913
|
}
|
|
897
914
|
},
|
|
898
915
|
"gemini": {
|
|
899
|
-
"skipWs": "temporary",
|
|
900
916
|
"skipMethods": {
|
|
901
917
|
"loadMarkets": {
|
|
902
918
|
"currencyIdAndCode": "messed codes",
|