ccxt 4.3.10 → 4.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +15 -0
- package/dist/cjs/src/bigone.js +22 -22
- package/dist/cjs/src/binance.js +5 -5
- package/dist/cjs/src/bingx.js +2 -2
- package/dist/cjs/src/bitget.js +7 -4
- package/dist/cjs/src/bitmart.js +3 -8
- package/dist/cjs/src/bitmex.js +2 -2
- package/dist/cjs/src/blofin.js +2 -0
- package/dist/cjs/src/bybit.js +81 -71
- package/dist/cjs/src/coinbase.js +8 -8
- package/dist/cjs/src/coinbaseinternational.js +2 -2
- package/dist/cjs/src/coinex.js +513 -449
- package/dist/cjs/src/coinlist.js +12 -12
- package/dist/cjs/src/coinmetro.js +2 -2
- package/dist/cjs/src/cryptocom.js +16 -16
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hitbtc.js +3 -3
- package/dist/cjs/src/htx.js +3 -7
- package/dist/cjs/src/indodax.js +2 -2
- package/dist/cjs/src/kraken.js +3 -1
- package/dist/cjs/src/kucoin.js +4 -4
- package/dist/cjs/src/kucoinfutures.js +6 -6
- package/dist/cjs/src/mexc.js +5 -5
- package/dist/cjs/src/okx.js +6 -6
- package/dist/cjs/src/poloniexfutures.js +4 -4
- package/dist/cjs/src/pro/bitget.js +140 -89
- package/dist/cjs/src/pro/bybit.js +196 -11
- package/dist/cjs/src/pro/coinbase.js +107 -29
- package/dist/cjs/src/pro/mexc.js +21 -1
- package/dist/cjs/src/probit.js +2 -2
- package/dist/cjs/src/whitebit.js +76 -1
- package/dist/cjs/src/woo.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/blofin.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +15 -0
- package/js/src/base/types.d.ts +17 -2
- package/js/src/bigone.js +22 -22
- package/js/src/binance.d.ts +2 -9
- package/js/src/binance.js +5 -5
- package/js/src/bingx.js +2 -2
- package/js/src/bitget.d.ts +4 -31
- package/js/src/bitget.js +7 -4
- package/js/src/bitmart.d.ts +4 -24
- package/js/src/bitmart.js +3 -8
- package/js/src/bitmex.js +2 -2
- package/js/src/blofin.js +2 -0
- package/js/src/bybit.d.ts +7 -9
- package/js/src/bybit.js +81 -71
- package/js/src/coinbase.js +8 -8
- package/js/src/coinbaseinternational.js +2 -2
- package/js/src/coinex.d.ts +4 -24
- package/js/src/coinex.js +513 -449
- package/js/src/coinlist.js +12 -12
- package/js/src/coinmetro.js +2 -2
- package/js/src/cryptocom.js +16 -16
- package/js/src/digifinex.d.ts +3 -10
- package/js/src/gate.js +2 -2
- package/js/src/hitbtc.js +3 -3
- package/js/src/htx.d.ts +3 -13
- package/js/src/htx.js +3 -7
- package/js/src/indodax.js +2 -2
- package/js/src/kraken.js +3 -1
- package/js/src/kucoin.js +4 -4
- package/js/src/kucoinfutures.js +6 -6
- package/js/src/mexc.js +5 -5
- package/js/src/okx.d.ts +3 -10
- package/js/src/okx.js +6 -6
- package/js/src/poloniexfutures.js +4 -4
- package/js/src/pro/bitget.js +140 -89
- package/js/src/pro/bybit.d.ts +5 -1
- package/js/src/pro/bybit.js +196 -11
- package/js/src/pro/coinbase.d.ts +4 -0
- package/js/src/pro/coinbase.js +107 -29
- package/js/src/pro/mexc.js +21 -1
- package/js/src/probit.js +2 -2
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +76 -1
- package/js/src/woo.js +2 -2
- package/package.json +6 -5
- package/dist/cjs/src/flowbtc.js +0 -35
|
@@ -25,10 +25,12 @@ class coinbase extends coinbase$1 {
|
|
|
25
25
|
'watchMyTrades': false,
|
|
26
26
|
'watchOHLCV': false,
|
|
27
27
|
'watchOrderBook': true,
|
|
28
|
+
'watchOrderBookForSymbols': true,
|
|
28
29
|
'watchOrders': true,
|
|
29
30
|
'watchTicker': true,
|
|
30
31
|
'watchTickers': true,
|
|
31
32
|
'watchTrades': true,
|
|
33
|
+
'watchTradesForSymbols': true,
|
|
32
34
|
},
|
|
33
35
|
'urls': {
|
|
34
36
|
'api': {
|
|
@@ -73,8 +75,7 @@ class coinbase extends coinbase$1 {
|
|
|
73
75
|
productIds = [market['id']];
|
|
74
76
|
}
|
|
75
77
|
const url = this.urls['api']['ws'];
|
|
76
|
-
|
|
77
|
-
const subscribe = {
|
|
78
|
+
let subscribe = {
|
|
78
79
|
'type': 'subscribe',
|
|
79
80
|
'product_ids': productIds,
|
|
80
81
|
'channel': name,
|
|
@@ -83,36 +84,75 @@ class coinbase extends coinbase$1 {
|
|
|
83
84
|
// 'signature': this.hmac (this.encode (auth), this.encode (this.secret), sha256),
|
|
84
85
|
};
|
|
85
86
|
if (isPrivate) {
|
|
86
|
-
this.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
subscribe = this.extend(subscribe, this.createWSAuth(name, productIds));
|
|
88
|
+
}
|
|
89
|
+
return await this.watch(url, messageHash, subscribe, messageHash);
|
|
90
|
+
}
|
|
91
|
+
async subscribeMultiple(name, isPrivate, symbols = undefined, params = {}) {
|
|
92
|
+
/**
|
|
93
|
+
* @ignore
|
|
94
|
+
* @method
|
|
95
|
+
* @description subscribes to a websocket channel
|
|
96
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-overview#subscribe
|
|
97
|
+
* @param {string} name the name of the channel
|
|
98
|
+
* @param {string[]} [symbols] unified market symbol
|
|
99
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
100
|
+
* @returns {object} subscription to a websocket channel
|
|
101
|
+
*/
|
|
102
|
+
await this.loadMarkets();
|
|
103
|
+
const productIds = [];
|
|
104
|
+
const messageHashes = [];
|
|
105
|
+
symbols = this.marketSymbols(symbols, undefined, false);
|
|
106
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
107
|
+
const symbol = symbols[i];
|
|
108
|
+
const market = this.market(symbol);
|
|
109
|
+
const marketId = market['id'];
|
|
110
|
+
productIds.push(marketId);
|
|
111
|
+
messageHashes.push(name + '::' + marketId);
|
|
112
|
+
}
|
|
113
|
+
const url = this.urls['api']['ws'];
|
|
114
|
+
let subscribe = {
|
|
115
|
+
'type': 'subscribe',
|
|
116
|
+
'product_ids': productIds,
|
|
117
|
+
'channel': name,
|
|
118
|
+
};
|
|
119
|
+
if (isPrivate) {
|
|
120
|
+
subscribe = this.extend(subscribe, this.createWSAuth(name, productIds));
|
|
121
|
+
}
|
|
122
|
+
return await this.watchMultiple(url, messageHashes, subscribe, messageHashes);
|
|
123
|
+
}
|
|
124
|
+
createWSAuth(name, productIds) {
|
|
125
|
+
const subscribe = {};
|
|
126
|
+
const timestamp = this.numberToString(this.seconds());
|
|
127
|
+
this.checkRequiredCredentials();
|
|
128
|
+
const isCloudAPiKey = (this.apiKey.indexOf('organizations/') >= 0) || (this.secret.startsWith('-----BEGIN'));
|
|
129
|
+
const auth = timestamp + name + productIds.join(',');
|
|
130
|
+
if (!isCloudAPiKey) {
|
|
131
|
+
subscribe['api_key'] = this.apiKey;
|
|
132
|
+
subscribe['timestamp'] = timestamp;
|
|
133
|
+
subscribe['signature'] = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
if (this.apiKey.startsWith('-----BEGIN')) {
|
|
137
|
+
throw new errors.ArgumentsRequired(this.id + ' apiKey should contain the name (eg: organizations/3b910e93....) and not the public key');
|
|
93
138
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// we should generate new token
|
|
103
|
-
const token = this.createAuthToken(seconds);
|
|
104
|
-
this.options['wsToken'] = token;
|
|
105
|
-
this.options['wsTokenTimestamp'] = seconds;
|
|
106
|
-
}
|
|
107
|
-
subscribe['jwt'] = this.safeString(this.options, 'wsToken');
|
|
139
|
+
const currentToken = this.safeString(this.options, 'wsToken');
|
|
140
|
+
const tokenTimestamp = this.safeInteger(this.options, 'wsTokenTimestamp', 0);
|
|
141
|
+
const seconds = this.seconds();
|
|
142
|
+
if (currentToken === undefined || tokenTimestamp + 120 < seconds) {
|
|
143
|
+
// we should generate new token
|
|
144
|
+
const token = this.createAuthToken(seconds);
|
|
145
|
+
this.options['wsToken'] = token;
|
|
146
|
+
this.options['wsTokenTimestamp'] = seconds;
|
|
108
147
|
}
|
|
148
|
+
subscribe['jwt'] = this.safeString(this.options, 'wsToken');
|
|
109
149
|
}
|
|
110
|
-
return
|
|
150
|
+
return subscribe;
|
|
111
151
|
}
|
|
112
152
|
async watchTicker(symbol, params = {}) {
|
|
113
153
|
/**
|
|
114
154
|
* @method
|
|
115
|
-
* @name
|
|
155
|
+
* @name coinbase#watchTicker
|
|
116
156
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
117
157
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#ticker-channel
|
|
118
158
|
* @param {string} [symbol] unified symbol of the market to fetch the ticker for
|
|
@@ -125,7 +165,7 @@ class coinbase extends coinbase$1 {
|
|
|
125
165
|
async watchTickers(symbols = undefined, params = {}) {
|
|
126
166
|
/**
|
|
127
167
|
* @method
|
|
128
|
-
* @name
|
|
168
|
+
* @name coinbase#watchTickers
|
|
129
169
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
130
170
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#ticker-batch-channel
|
|
131
171
|
* @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
|
|
@@ -288,7 +328,7 @@ class coinbase extends coinbase$1 {
|
|
|
288
328
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
289
329
|
/**
|
|
290
330
|
* @method
|
|
291
|
-
* @name
|
|
331
|
+
* @name coinbase#watchTrades
|
|
292
332
|
* @description get the list of most recent trades for a particular symbol
|
|
293
333
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#market-trades-channel
|
|
294
334
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
@@ -306,10 +346,32 @@ class coinbase extends coinbase$1 {
|
|
|
306
346
|
}
|
|
307
347
|
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
308
348
|
}
|
|
349
|
+
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
350
|
+
/**
|
|
351
|
+
* @method
|
|
352
|
+
* @name coinbase#watchTradesForSymbols
|
|
353
|
+
* @description get the list of most recent trades for a particular symbol
|
|
354
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#market-trades-channel
|
|
355
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
356
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
357
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
358
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
359
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
360
|
+
*/
|
|
361
|
+
await this.loadMarkets();
|
|
362
|
+
const name = 'market_trades';
|
|
363
|
+
const trades = await this.subscribeMultiple(name, false, symbols, params);
|
|
364
|
+
if (this.newUpdates) {
|
|
365
|
+
const first = this.safeDict(trades, 0);
|
|
366
|
+
const tradeSymbol = this.safeString(first, 'symbol');
|
|
367
|
+
limit = trades.getLimit(tradeSymbol, limit);
|
|
368
|
+
}
|
|
369
|
+
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
370
|
+
}
|
|
309
371
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
310
372
|
/**
|
|
311
373
|
* @method
|
|
312
|
-
* @name
|
|
374
|
+
* @name coinbase#watchOrders
|
|
313
375
|
* @description watches information on multiple orders made by the user
|
|
314
376
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#user-channel
|
|
315
377
|
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
@@ -329,7 +391,7 @@ class coinbase extends coinbase$1 {
|
|
|
329
391
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
330
392
|
/**
|
|
331
393
|
* @method
|
|
332
|
-
* @name
|
|
394
|
+
* @name coinbase#watchOrderBook
|
|
333
395
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
334
396
|
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#level2-channel
|
|
335
397
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
@@ -344,6 +406,22 @@ class coinbase extends coinbase$1 {
|
|
|
344
406
|
const orderbook = await this.subscribe(name, false, symbol, params);
|
|
345
407
|
return orderbook.limit();
|
|
346
408
|
}
|
|
409
|
+
async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
|
|
410
|
+
/**
|
|
411
|
+
* @method
|
|
412
|
+
* @name coinbase#watchOrderBookForSymbols
|
|
413
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
414
|
+
* @see https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-channels#level2-channel
|
|
415
|
+
* @param {string[]} symbols unified array of symbols
|
|
416
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
417
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
418
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
419
|
+
*/
|
|
420
|
+
await this.loadMarkets();
|
|
421
|
+
const name = 'level2';
|
|
422
|
+
const orderbook = await this.subscribeMultiple(name, false, symbols, params);
|
|
423
|
+
return orderbook.limit();
|
|
424
|
+
}
|
|
347
425
|
handleTrade(client, message) {
|
|
348
426
|
//
|
|
349
427
|
// {
|
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -704,6 +704,21 @@ class mexc extends mexc$1 {
|
|
|
704
704
|
// "v": "5"
|
|
705
705
|
// }
|
|
706
706
|
//
|
|
707
|
+
//
|
|
708
|
+
// d: {
|
|
709
|
+
// p: '1.0005',
|
|
710
|
+
// v: '5.71',
|
|
711
|
+
// a: '5.712855',
|
|
712
|
+
// S: 1,
|
|
713
|
+
// T: 1714325698237,
|
|
714
|
+
// t: 'edafcd9fdc2f426e82443d114691f724',
|
|
715
|
+
// c: '',
|
|
716
|
+
// i: 'C02__413321238354677760043',
|
|
717
|
+
// m: 0,
|
|
718
|
+
// st: 0,
|
|
719
|
+
// n: '0.005712855',
|
|
720
|
+
// N: 'USDT'
|
|
721
|
+
// }
|
|
707
722
|
let timestamp = this.safeInteger(trade, 'T');
|
|
708
723
|
let tradeId = this.safeString(trade, 't');
|
|
709
724
|
if (timestamp === undefined) {
|
|
@@ -715,6 +730,8 @@ class mexc extends mexc$1 {
|
|
|
715
730
|
const rawSide = this.safeString(trade, 'S');
|
|
716
731
|
const side = (rawSide === '1') ? 'buy' : 'sell';
|
|
717
732
|
const isMaker = this.safeInteger(trade, 'm');
|
|
733
|
+
const feeAmount = this.safeNumber(trade, 'n');
|
|
734
|
+
const feeCurrencyId = this.safeString(trade, 'N');
|
|
718
735
|
return this.safeTrade({
|
|
719
736
|
'info': trade,
|
|
720
737
|
'id': tradeId,
|
|
@@ -728,7 +745,10 @@ class mexc extends mexc$1 {
|
|
|
728
745
|
'price': priceString,
|
|
729
746
|
'amount': amountString,
|
|
730
747
|
'cost': undefined,
|
|
731
|
-
'fee':
|
|
748
|
+
'fee': {
|
|
749
|
+
'cost': feeAmount,
|
|
750
|
+
'currency': this.safeCurrencyCode(feeCurrencyId),
|
|
751
|
+
},
|
|
732
752
|
}, market);
|
|
733
753
|
}
|
|
734
754
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
package/dist/cjs/src/probit.js
CHANGED
|
@@ -1516,10 +1516,10 @@ class probit extends probit$1 {
|
|
|
1516
1516
|
else {
|
|
1517
1517
|
request['start_time'] = this.iso8601(1);
|
|
1518
1518
|
}
|
|
1519
|
-
const until = this.
|
|
1519
|
+
const until = this.safeInteger(params, 'until');
|
|
1520
1520
|
if (until !== undefined) {
|
|
1521
1521
|
request['end_time'] = this.iso8601(until);
|
|
1522
|
-
params = this.omit(params, ['until'
|
|
1522
|
+
params = this.omit(params, ['until']);
|
|
1523
1523
|
}
|
|
1524
1524
|
else {
|
|
1525
1525
|
request['end_time'] = this.iso8601(this.milliseconds());
|
package/dist/cjs/src/whitebit.js
CHANGED
|
@@ -47,6 +47,7 @@ class whitebit extends whitebit$1 {
|
|
|
47
47
|
'fetchDeposit': true,
|
|
48
48
|
'fetchDepositAddress': true,
|
|
49
49
|
'fetchDeposits': true,
|
|
50
|
+
'fetchDepositsWithdrawals': true,
|
|
50
51
|
'fetchDepositWithdrawFee': 'emulated',
|
|
51
52
|
'fetchDepositWithdrawFees': true,
|
|
52
53
|
'fetchFundingHistory': false,
|
|
@@ -1979,6 +1980,7 @@ class whitebit extends whitebit$1 {
|
|
|
1979
1980
|
// {
|
|
1980
1981
|
// "address": "3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE", // deposit address
|
|
1981
1982
|
// "uniqueId": null, // unique Id of deposit
|
|
1983
|
+
// "transactionId": "a6d71d69-2b17-4ad8-8b15-2d686c54a1a5",
|
|
1982
1984
|
// "createdAt": 1593437922, // timestamp of deposit
|
|
1983
1985
|
// "currency": "Bitcoin", // deposit currency
|
|
1984
1986
|
// "ticker": "BTC", // deposit currency ticker
|
|
@@ -2002,6 +2004,7 @@ class whitebit extends whitebit$1 {
|
|
|
2002
2004
|
// "actual": 1, // current block confirmations
|
|
2003
2005
|
// "required": 2 // required block confirmation for successful deposit
|
|
2004
2006
|
// }
|
|
2007
|
+
// "centralized": false,
|
|
2005
2008
|
// }
|
|
2006
2009
|
//
|
|
2007
2010
|
currency = this.safeCurrency(undefined, currency);
|
|
@@ -2012,7 +2015,7 @@ class whitebit extends whitebit$1 {
|
|
|
2012
2015
|
const method = this.safeString(transaction, 'method');
|
|
2013
2016
|
return {
|
|
2014
2017
|
'id': this.safeString(transaction, 'uniqueId'),
|
|
2015
|
-
'txid': this.safeString(transaction, '
|
|
2018
|
+
'txid': this.safeString(transaction, 'transactionId'),
|
|
2016
2019
|
'timestamp': timestamp,
|
|
2017
2020
|
'datetime': this.iso8601(timestamp),
|
|
2018
2021
|
'network': this.safeString(transaction, 'network'),
|
|
@@ -2404,6 +2407,78 @@ class whitebit extends whitebit$1 {
|
|
|
2404
2407
|
'previousFundingDatetime': undefined,
|
|
2405
2408
|
};
|
|
2406
2409
|
}
|
|
2410
|
+
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2411
|
+
/**
|
|
2412
|
+
* @method
|
|
2413
|
+
* @name whitebit#fetchDepositsWithdrawals
|
|
2414
|
+
* @description fetch history of deposits and withdrawals
|
|
2415
|
+
* @see https://github.com/whitebit-exchange/api-docs/blob/main/pages/private/http-main-v4.md#get-depositwithdraw-history
|
|
2416
|
+
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
2417
|
+
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
2418
|
+
* @param {int} [limit] max number of deposit/withdrawals to return, default = 50, Min: 1, Max: 100
|
|
2419
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2420
|
+
*
|
|
2421
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
2422
|
+
* @param {number} [params.transactionMethod] Method. Example: 1 to display deposits / 2 to display withdraws. Do not send this parameter in order to receive both deposits and withdraws.
|
|
2423
|
+
* @param {string} [params.address] Can be used for filtering transactions by specific address or memo.
|
|
2424
|
+
* @param {string[]} [params.addresses] Can be used for filtering transactions by specific addresses or memos (max: 20).
|
|
2425
|
+
* @param {string} [params.uniqueId] Can be used for filtering transactions by specific unique id
|
|
2426
|
+
* @param {int} [params.offset] If you want the request to return entries starting from a particular line, you can use OFFSET clause to tell it where it should start. Default: 0, Min: 0, Max: 10000
|
|
2427
|
+
* @param {string[]} [params.status] Can be used for filtering transactions by status codes. Caution: You must use this parameter with appropriate transactionMethod and use valid status codes for this method. You can find them below. Example: "status": [3,7]
|
|
2428
|
+
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2429
|
+
*/
|
|
2430
|
+
await this.loadMarkets();
|
|
2431
|
+
const request = {};
|
|
2432
|
+
let currency = undefined;
|
|
2433
|
+
if (code !== undefined) {
|
|
2434
|
+
currency = this.currency(code);
|
|
2435
|
+
request['ticker'] = currency['id'];
|
|
2436
|
+
}
|
|
2437
|
+
if (limit !== undefined) {
|
|
2438
|
+
request['limit'] = limit; // default 1000
|
|
2439
|
+
}
|
|
2440
|
+
const response = await this.v4PrivatePostMainAccountHistory(this.extend(request, params));
|
|
2441
|
+
//
|
|
2442
|
+
// {
|
|
2443
|
+
// "limit": 100,
|
|
2444
|
+
// "offset": 0,
|
|
2445
|
+
// "records": [
|
|
2446
|
+
// {
|
|
2447
|
+
// "address": "3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE", // deposit address
|
|
2448
|
+
// "uniqueId": null, // unique Id of deposit
|
|
2449
|
+
// "createdAt": 1593437922, // timestamp of deposit
|
|
2450
|
+
// "currency": "Bitcoin", // deposit currency
|
|
2451
|
+
// "ticker": "BTC", // deposit currency ticker
|
|
2452
|
+
// "method": 1, // called method 1 - deposit, 2 - withdraw
|
|
2453
|
+
// "amount": "0.0006", // amount of deposit
|
|
2454
|
+
// "description": "", // deposit description
|
|
2455
|
+
// "memo": "", // deposit memo
|
|
2456
|
+
// "fee": "0", // deposit fee
|
|
2457
|
+
// "status": 15, // transactions status
|
|
2458
|
+
// "network": null, // if currency is multinetwork
|
|
2459
|
+
// "transactionHash": "a275a514013e4e0f927fd0d1bed215e7f6f2c4c6ce762836fe135ec22529d886", // deposit transaction hash
|
|
2460
|
+
// "transactionId": "5e112b38-9652-11ed-a1eb-0242ac120002", // transaction id
|
|
2461
|
+
// "details": {
|
|
2462
|
+
// "partial": { // details about partially successful withdrawals
|
|
2463
|
+
// "requestAmount": "50000", // requested withdrawal amount
|
|
2464
|
+
// "processedAmount": "39000", // processed withdrawal amount
|
|
2465
|
+
// "processedFee": "273", // fee for processed withdrawal amount
|
|
2466
|
+
// "normalizeTransaction": "" // deposit id
|
|
2467
|
+
// }
|
|
2468
|
+
// },
|
|
2469
|
+
// "confirmations": { // if transaction status == 15 (Pending) you can see this object
|
|
2470
|
+
// "actual": 1, // current block confirmations
|
|
2471
|
+
// "required": 2 // required block confirmation for successful deposit
|
|
2472
|
+
// }
|
|
2473
|
+
// },
|
|
2474
|
+
// {...},
|
|
2475
|
+
// ],
|
|
2476
|
+
// "total": 300 // total number of transactions, use this for calculating ‘limit’ and ‘offset'
|
|
2477
|
+
// }
|
|
2478
|
+
//
|
|
2479
|
+
const records = this.safeList(response, 'records');
|
|
2480
|
+
return this.parseTransactions(records, currency, since, limit);
|
|
2481
|
+
}
|
|
2407
2482
|
isFiat(currency) {
|
|
2408
2483
|
const fiatCurrencies = this.safeValue(this.options, 'fiatCurrencies', []);
|
|
2409
2484
|
return this.inArray(currency, fiatCurrencies);
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -2319,8 +2319,8 @@ class woo extends woo$1 {
|
|
|
2319
2319
|
if (since !== undefined) {
|
|
2320
2320
|
request['start_t'] = since;
|
|
2321
2321
|
}
|
|
2322
|
-
const until = this.
|
|
2323
|
-
params = this.omit(params, ['until'
|
|
2322
|
+
const until = this.safeInteger(params, 'until'); // unified in milliseconds
|
|
2323
|
+
params = this.omit(params, ['until']);
|
|
2324
2324
|
if (until !== undefined) {
|
|
2325
2325
|
request['end_t'] = until;
|
|
2326
2326
|
}
|
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 { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
7
|
+
declare const version = "4.3.11";
|
|
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, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } 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.12';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -23,6 +23,8 @@ interface Exchange {
|
|
|
23
23
|
privateGetTradeOrdersTpslPending(params?: {}): Promise<implicitReturnType>;
|
|
24
24
|
privateGetTradeOrdersHistory(params?: {}): Promise<implicitReturnType>;
|
|
25
25
|
privateGetTradeOrdersTpslHistory(params?: {}): Promise<implicitReturnType>;
|
|
26
|
+
privateGetUserQueryApikey(params?: {}): Promise<implicitReturnType>;
|
|
27
|
+
privateGetAffiliateBasic(params?: {}): Promise<implicitReturnType>;
|
|
26
28
|
privatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
|
|
27
29
|
privatePostTradeCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
28
30
|
privatePostAccountSetLeverage(params?: {}): Promise<implicitReturnType>;
|
|
@@ -3,8 +3,8 @@ import { // eslint-disable-line object-curly-newline
|
|
|
3
3
|
ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
|
|
4
4
|
import WsClient from './ws/WsClient.js';
|
|
5
5
|
import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
|
|
6
|
-
import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest } from './types.js';
|
|
7
|
-
export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry,
|
|
6
|
+
import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest, IsolatedBorrowRate, IsolatedBorrowRates, CrossBorrowRates, CrossBorrowRate } from './types.js';
|
|
7
|
+
export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, CrossBorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, Conversion } from './types.js';
|
|
8
8
|
import { ArrayCache, ArrayCacheByTimestamp } from './ws/Cache.js';
|
|
9
9
|
import { OrderBook as Ob } from './ws/OrderBook.js';
|
|
10
10
|
/**
|
|
@@ -370,6 +370,8 @@ export default class Exchange {
|
|
|
370
370
|
fetchClosedOrdersWs: any;
|
|
371
371
|
fetchConvertCurrencies: any;
|
|
372
372
|
fetchConvertQuote: any;
|
|
373
|
+
fetchConvertTrade: any;
|
|
374
|
+
fetchConvertTradeHistory: any;
|
|
373
375
|
fetchCrossBorrowRate: any;
|
|
374
376
|
fetchCrossBorrowRates: any;
|
|
375
377
|
fetchCurrencies: string;
|
|
@@ -705,13 +707,14 @@ export default class Exchange {
|
|
|
705
707
|
parseAccount(account: any): Account;
|
|
706
708
|
parseLedgerEntry(item: any, currency?: Currency): object;
|
|
707
709
|
parseOrder(order: any, market?: Market): Order;
|
|
708
|
-
fetchCrossBorrowRates(params?: {}): Promise<
|
|
709
|
-
fetchIsolatedBorrowRates(params?: {}): Promise<
|
|
710
|
+
fetchCrossBorrowRates(params?: {}): Promise<CrossBorrowRates>;
|
|
711
|
+
fetchIsolatedBorrowRates(params?: {}): Promise<IsolatedBorrowRates>;
|
|
710
712
|
parseMarketLeverageTiers(info: any, market?: Market): object;
|
|
711
713
|
fetchLeverageTiers(symbols?: string[], params?: {}): Promise<Dictionary<LeverageTier[]>>;
|
|
712
714
|
parsePosition(position: any, market?: Market): Position;
|
|
713
715
|
parseFundingRateHistory(info: any, market?: Market): FundingRateHistory;
|
|
714
716
|
parseBorrowInterest(info: any, market?: Market): BorrowInterest;
|
|
717
|
+
parseIsolatedBorrowRate(info: any, market?: Market): IsolatedBorrowRate;
|
|
715
718
|
parseWsTrade(trade: any, market?: Market): Trade;
|
|
716
719
|
parseWsOrder(order: any, market?: Market): Order;
|
|
717
720
|
parseWsOrderTrade(trade: any, market?: Market): Trade;
|
|
@@ -884,8 +887,8 @@ export default class Exchange {
|
|
|
884
887
|
fetchDepositWithdrawFees(codes?: string[], params?: {}): Promise<Dictionary<DepositWithdrawFeeNetwork>>;
|
|
885
888
|
fetchDepositWithdrawFee(code: string, params?: {}): Promise<DepositWithdrawFeeNetwork>;
|
|
886
889
|
getSupportedMapping(key: any, mapping?: {}): any;
|
|
887
|
-
fetchCrossBorrowRate(code: string, params?: {}): Promise<
|
|
888
|
-
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<
|
|
890
|
+
fetchCrossBorrowRate(code: string, params?: {}): Promise<CrossBorrowRate>;
|
|
891
|
+
fetchIsolatedBorrowRate(symbol: string, params?: {}): Promise<IsolatedBorrowRate>;
|
|
889
892
|
handleOptionAndParams(params: object, methodName: string, optionName: string, defaultValue?: any): any[];
|
|
890
893
|
handleOptionAndParams2(params: object, methodName: string, methodName2: string, optionName: string, defaultValue?: any): any[];
|
|
891
894
|
handleOption(methodName: string, optionName: string, defaultValue?: any): any;
|
|
@@ -1019,6 +1022,7 @@ export default class Exchange {
|
|
|
1019
1022
|
parseTickers(tickers: any, symbols?: string[], params?: {}): Dictionary<Ticker>;
|
|
1020
1023
|
parseDepositAddresses(addresses: any, codes?: string[], indexed?: boolean, params?: {}): Dictionary<any>;
|
|
1021
1024
|
parseBorrowInterests(response: any, market?: Market): any[];
|
|
1025
|
+
parseIsolatedBorrowRates(info: any): IsolatedBorrowRates;
|
|
1022
1026
|
parseFundingRateHistories(response: any, market?: any, since?: Int, limit?: Int): FundingRateHistory[];
|
|
1023
1027
|
safeSymbol(marketId: Str, market?: Market, delimiter?: Str, marketType?: Str): string;
|
|
1024
1028
|
parseFundingRate(contract: string, market?: Market): object;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -428,6 +428,8 @@ export default class Exchange {
|
|
|
428
428
|
'fetchClosedOrdersWs': undefined,
|
|
429
429
|
'fetchConvertCurrencies': undefined,
|
|
430
430
|
'fetchConvertQuote': undefined,
|
|
431
|
+
'fetchConvertTrade': undefined,
|
|
432
|
+
'fetchConvertTradeHistory': undefined,
|
|
431
433
|
'fetchCrossBorrowRate': undefined,
|
|
432
434
|
'fetchCrossBorrowRates': undefined,
|
|
433
435
|
'fetchCurrencies': 'emulated',
|
|
@@ -2015,6 +2017,9 @@ export default class Exchange {
|
|
|
2015
2017
|
parseBorrowInterest(info, market = undefined) {
|
|
2016
2018
|
throw new NotSupported(this.id + ' parseBorrowInterest() is not supported yet');
|
|
2017
2019
|
}
|
|
2020
|
+
parseIsolatedBorrowRate(info, market = undefined) {
|
|
2021
|
+
throw new NotSupported(this.id + ' parseIsolatedBorrowRate() is not supported yet');
|
|
2022
|
+
}
|
|
2018
2023
|
parseWsTrade(trade, market = undefined) {
|
|
2019
2024
|
throw new NotSupported(this.id + ' parseWsTrade() is not supported yet');
|
|
2020
2025
|
}
|
|
@@ -5278,6 +5283,16 @@ export default class Exchange {
|
|
|
5278
5283
|
}
|
|
5279
5284
|
return interests;
|
|
5280
5285
|
}
|
|
5286
|
+
parseIsolatedBorrowRates(info) {
|
|
5287
|
+
const result = {};
|
|
5288
|
+
for (let i = 0; i < info.length; i++) {
|
|
5289
|
+
const item = info[i];
|
|
5290
|
+
const borrowRate = this.parseIsolatedBorrowRate(item);
|
|
5291
|
+
const symbol = this.safeString(borrowRate, 'symbol');
|
|
5292
|
+
result[symbol] = borrowRate;
|
|
5293
|
+
}
|
|
5294
|
+
return result;
|
|
5295
|
+
}
|
|
5281
5296
|
parseFundingRateHistories(response, market = undefined, since = undefined, limit = undefined) {
|
|
5282
5297
|
const rates = [];
|
|
5283
5298
|
for (let i = 0; i < response.length; i++) {
|
package/js/src/base/types.d.ts
CHANGED
|
@@ -353,13 +353,24 @@ export interface TransferEntry {
|
|
|
353
353
|
toAccount?: Str;
|
|
354
354
|
status?: Str;
|
|
355
355
|
}
|
|
356
|
-
export interface
|
|
356
|
+
export interface CrossBorrowRate {
|
|
357
|
+
info: any;
|
|
357
358
|
currency?: Str;
|
|
358
|
-
rate
|
|
359
|
+
rate: number;
|
|
359
360
|
period?: number;
|
|
360
361
|
timestamp?: number;
|
|
361
362
|
datetime?: Str;
|
|
363
|
+
}
|
|
364
|
+
export interface IsolatedBorrowRate {
|
|
362
365
|
info: any;
|
|
366
|
+
symbol: string;
|
|
367
|
+
base: string;
|
|
368
|
+
baseRate: number;
|
|
369
|
+
quote: string;
|
|
370
|
+
quoteRate: number;
|
|
371
|
+
period?: Int;
|
|
372
|
+
timestamp?: Int;
|
|
373
|
+
datetime?: Str;
|
|
363
374
|
}
|
|
364
375
|
export interface FundingRateHistory {
|
|
365
376
|
info: any;
|
|
@@ -505,6 +516,10 @@ export interface MarginModes extends Dictionary<MarginMode> {
|
|
|
505
516
|
}
|
|
506
517
|
export interface OptionChain extends Dictionary<Option> {
|
|
507
518
|
}
|
|
519
|
+
export interface IsolatedBorrowRates extends Dictionary<IsolatedBorrowRates> {
|
|
520
|
+
}
|
|
521
|
+
export interface CrossBorrowRates extends Dictionary<CrossBorrowRates> {
|
|
522
|
+
}
|
|
508
523
|
/** [ timestamp, open, high, low, close, volume ] */
|
|
509
524
|
export declare type OHLCV = [Num, Num, Num, Num, Num, Num];
|
|
510
525
|
/** [ timestamp, open, high, low, close, volume, count ] */
|