ccxt 4.1.8 → 4.1.9
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.js +1240 -189
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/base/Exchange.js +58 -2
- package/dist/cjs/src/bingx.js +100 -39
- package/dist/cjs/src/bitget.js +26 -2
- package/dist/cjs/src/gate.js +9 -1
- package/dist/cjs/src/kucoinfutures.js +2 -2
- package/dist/cjs/src/pro/bingx.js +891 -0
- package/js/ccxt.d.ts +6 -3
- package/js/ccxt.js +3 -1
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +58 -2
- package/js/src/base/types.d.ts +7 -0
- package/js/src/binance.d.ts +17 -17
- package/js/src/bingx.d.ts +4 -3
- package/js/src/bingx.js +100 -39
- package/js/src/bitfinex2.d.ts +13 -13
- package/js/src/bitget.d.ts +15 -15
- package/js/src/bitget.js +26 -2
- package/js/src/bitmex.d.ts +15 -15
- package/js/src/bybit.d.ts +23 -23
- package/js/src/coinbase.d.ts +16 -16
- package/js/src/coinbasepro.d.ts +12 -12
- package/js/src/coinex.d.ts +2 -2
- package/js/src/cryptocom.d.ts +12 -12
- package/js/src/deribit.d.ts +2 -2
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/gate.d.ts +10 -10
- package/js/src/gate.js +9 -1
- package/js/src/huobi.d.ts +16 -16
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +6 -6
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoinfutures.d.ts +10 -10
- package/js/src/kucoinfutures.js +2 -2
- package/js/src/mexc.d.ts +3 -3
- package/js/src/okx.d.ts +13 -13
- package/js/src/phemex.d.ts +2 -2
- package/js/src/poloniex.d.ts +5 -5
- package/js/src/pro/bingx.d.ts +24 -0
- package/js/src/pro/bingx.js +892 -0
- package/js/src/woo.d.ts +2 -2
- package/package.json +1 -1
- package/skip-tests.json +3 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -124,6 +124,7 @@ var binance$1 = require('./src/pro/binance.js');
|
|
|
124
124
|
var binancecoinm$1 = require('./src/pro/binancecoinm.js');
|
|
125
125
|
var binanceus$1 = require('./src/pro/binanceus.js');
|
|
126
126
|
var binanceusdm$1 = require('./src/pro/binanceusdm.js');
|
|
127
|
+
var bingx$1 = require('./src/pro/bingx.js');
|
|
127
128
|
var bitcoincom$1 = require('./src/pro/bitcoincom.js');
|
|
128
129
|
var bitfinex$1 = require('./src/pro/bitfinex.js');
|
|
129
130
|
var bitfinex2$1 = require('./src/pro/bitfinex2.js');
|
|
@@ -179,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
179
180
|
|
|
180
181
|
//-----------------------------------------------------------------------------
|
|
181
182
|
// this is updated by vss.js when building
|
|
182
|
-
const version = '4.1.
|
|
183
|
+
const version = '4.1.9';
|
|
183
184
|
Exchange["default"].ccxtVersion = version;
|
|
184
185
|
const exchanges = {
|
|
185
186
|
'ace': ace,
|
|
@@ -296,6 +297,7 @@ const pro = {
|
|
|
296
297
|
'binancecoinm': binancecoinm$1,
|
|
297
298
|
'binanceus': binanceus$1,
|
|
298
299
|
'binanceusdm': binanceusdm$1,
|
|
300
|
+
'bingx': bingx$1,
|
|
299
301
|
'bitcoincom': bitcoincom$1,
|
|
300
302
|
'bitfinex': bitfinex$1,
|
|
301
303
|
'bitfinex2': bitfinex2$1,
|
|
@@ -3291,6 +3291,9 @@ class Exchange {
|
|
|
3291
3291
|
async fetchOpenInterest(symbol, params = {}) {
|
|
3292
3292
|
throw new errors.NotSupported(this.id + ' fetchOpenInterest() is not supported yet');
|
|
3293
3293
|
}
|
|
3294
|
+
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3295
|
+
throw new errors.NotSupported(this.id + ' fetchFundingRateHistory() is not supported yet');
|
|
3296
|
+
}
|
|
3294
3297
|
parseLastPrice(price, market = undefined) {
|
|
3295
3298
|
throw new errors.NotSupported(this.id + ' parseLastPrice() is not supported yet');
|
|
3296
3299
|
}
|
|
@@ -4181,7 +4184,9 @@ class Exchange {
|
|
|
4181
4184
|
}
|
|
4182
4185
|
}
|
|
4183
4186
|
}
|
|
4184
|
-
|
|
4187
|
+
const uniqueResults = this.removeRepeatedElementsFromArray(result);
|
|
4188
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
4189
|
+
return this.filterBySinceLimit(uniqueResults, since, limit, key);
|
|
4185
4190
|
}
|
|
4186
4191
|
async safeDeterministicCall(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}) {
|
|
4187
4192
|
let maxRetries = undefined;
|
|
@@ -4236,7 +4241,9 @@ class Exchange {
|
|
|
4236
4241
|
for (let i = 0; i < results.length; i++) {
|
|
4237
4242
|
result = this.arrayConcat(result, results[i]);
|
|
4238
4243
|
}
|
|
4239
|
-
|
|
4244
|
+
const uniqueResults = this.removeRepeatedElementsFromArray(result);
|
|
4245
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
4246
|
+
return this.filterBySinceLimit(uniqueResults, since, limit, key);
|
|
4240
4247
|
}
|
|
4241
4248
|
async fetchPaginatedCallCursor(method, symbol = undefined, since = undefined, limit = undefined, params = {}, cursorReceived = undefined, cursorSent = undefined, cursorIncrement = undefined, maxEntriesPerRequest = undefined) {
|
|
4242
4249
|
let maxCalls = undefined;
|
|
@@ -4280,6 +4287,55 @@ class Exchange {
|
|
|
4280
4287
|
}
|
|
4281
4288
|
i += 1;
|
|
4282
4289
|
}
|
|
4290
|
+
const sorted = this.sortCursorPaginatedResult(result);
|
|
4291
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
4292
|
+
return this.filterBySinceLimit(sorted, since, limit, key);
|
|
4293
|
+
}
|
|
4294
|
+
async fetchPaginatedCallIncremental(method, symbol = undefined, since = undefined, limit = undefined, params = {}, pageKey = undefined, maxEntriesPerRequest = undefined) {
|
|
4295
|
+
let maxCalls = undefined;
|
|
4296
|
+
[maxCalls, params] = this.handleOptionAndParams(params, method, 'paginationCalls', 10);
|
|
4297
|
+
let maxRetries = undefined;
|
|
4298
|
+
[maxRetries, params] = this.handleOptionAndParams(params, method, 'maxRetries', 3);
|
|
4299
|
+
[maxEntriesPerRequest, params] = this.handleMaxEntriesPerRequestAndParams(method, maxEntriesPerRequest, params);
|
|
4300
|
+
let i = 0;
|
|
4301
|
+
let errors = 0;
|
|
4302
|
+
let result = [];
|
|
4303
|
+
while (i < maxCalls) {
|
|
4304
|
+
try {
|
|
4305
|
+
params[pageKey] = i + 1;
|
|
4306
|
+
const response = await this[method](symbol, since, maxEntriesPerRequest, params);
|
|
4307
|
+
errors = 0;
|
|
4308
|
+
const responseLength = response.length;
|
|
4309
|
+
if (this.verbose) {
|
|
4310
|
+
this.log('Incremental pagination call', i + 1, 'method', method, 'response length', responseLength);
|
|
4311
|
+
}
|
|
4312
|
+
if (responseLength === 0) {
|
|
4313
|
+
break;
|
|
4314
|
+
}
|
|
4315
|
+
result = this.arrayConcat(result, response);
|
|
4316
|
+
}
|
|
4317
|
+
catch (e) {
|
|
4318
|
+
errors += 1;
|
|
4319
|
+
if (errors > maxRetries) {
|
|
4320
|
+
throw e;
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
i += 1;
|
|
4324
|
+
}
|
|
4325
|
+
const sorted = this.sortCursorPaginatedResult(result);
|
|
4326
|
+
const key = (method === 'fetchOHLCV') ? 0 : 'timestamp';
|
|
4327
|
+
return this.filterBySinceLimit(sorted, since, limit, key);
|
|
4328
|
+
}
|
|
4329
|
+
sortCursorPaginatedResult(result) {
|
|
4330
|
+
const first = this.safeValue(result, 0);
|
|
4331
|
+
if (first !== undefined) {
|
|
4332
|
+
if ('timestamp' in first) {
|
|
4333
|
+
return this.sortBy(result, 'timestamp');
|
|
4334
|
+
}
|
|
4335
|
+
if ('id' in first) {
|
|
4336
|
+
return this.sortBy(result, 'id');
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4283
4339
|
return result;
|
|
4284
4340
|
}
|
|
4285
4341
|
removeRepeatedElementsFromArray(input) {
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -66,6 +66,7 @@ class bingx extends bingx$1 {
|
|
|
66
66
|
'swap': 'https://open-api.{hostname}/openApi',
|
|
67
67
|
'contract': 'https://open-api.{hostname}/openApi',
|
|
68
68
|
'wallets': 'https://open-api.{hostname}/openApi',
|
|
69
|
+
'user': 'https://open-api.{hostname}/openApi',
|
|
69
70
|
'subAccount': 'https://open-api.{hostname}/openApi',
|
|
70
71
|
'account': 'https://open-api.{hostname}/openApi',
|
|
71
72
|
},
|
|
@@ -234,6 +235,15 @@ class bingx extends bingx$1 {
|
|
|
234
235
|
},
|
|
235
236
|
},
|
|
236
237
|
},
|
|
238
|
+
'user': {
|
|
239
|
+
'auth': {
|
|
240
|
+
'private': {
|
|
241
|
+
'post': {
|
|
242
|
+
'userDataStream': 1,
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
237
247
|
'copyTrading': {
|
|
238
248
|
'v1': {
|
|
239
249
|
'private': {
|
|
@@ -311,6 +321,7 @@ class bingx extends bingx$1 {
|
|
|
311
321
|
},
|
|
312
322
|
'commonCurrencies': {},
|
|
313
323
|
'options': {
|
|
324
|
+
'defaultType': 'spot',
|
|
314
325
|
'accountsByType': {
|
|
315
326
|
'spot': 'FUND',
|
|
316
327
|
'swap': 'PFUTURES',
|
|
@@ -830,37 +841,63 @@ class bingx extends bingx$1 {
|
|
|
830
841
|
// filledTime: '2023-07-04T20:56:01.000+0800'
|
|
831
842
|
// }
|
|
832
843
|
//
|
|
833
|
-
|
|
844
|
+
//
|
|
845
|
+
// ws
|
|
846
|
+
//
|
|
847
|
+
// spot
|
|
848
|
+
//
|
|
849
|
+
// {
|
|
850
|
+
// E: 1690214529432,
|
|
851
|
+
// T: 1690214529386,
|
|
852
|
+
// e: 'trade',
|
|
853
|
+
// m: true,
|
|
854
|
+
// p: '29110.19',
|
|
855
|
+
// q: '0.1868',
|
|
856
|
+
// s: 'BTC-USDT',
|
|
857
|
+
// t: '57903921'
|
|
858
|
+
// }
|
|
859
|
+
//
|
|
860
|
+
// swap
|
|
861
|
+
//
|
|
862
|
+
// {
|
|
863
|
+
// q: '0.0421',
|
|
864
|
+
// p: '29023.5',
|
|
865
|
+
// T: 1690221401344,
|
|
866
|
+
// m: false,
|
|
867
|
+
// s: 'BTC-USDT'
|
|
868
|
+
// }
|
|
869
|
+
//
|
|
870
|
+
let time = this.safeIntegerN(trade, ['time', 'filledTm', 'T']);
|
|
834
871
|
const datetimeId = this.safeString(trade, 'filledTm');
|
|
835
872
|
if (datetimeId !== undefined) {
|
|
836
873
|
time = this.parse8601(datetimeId);
|
|
837
874
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
let side = undefined;
|
|
841
|
-
if (isBuyerMaker !== undefined) {
|
|
842
|
-
side = isBuyerMaker ? 'sell' : 'buy';
|
|
843
|
-
takeOrMaker = 'taker';
|
|
875
|
+
if (time === 0) {
|
|
876
|
+
time = undefined;
|
|
844
877
|
}
|
|
878
|
+
const isBuyerMaker = this.safeValue2(trade, 'buyerMaker', 'isBuyerMaker');
|
|
879
|
+
const side = this.safeStringLower2(trade, 'side', 'S');
|
|
845
880
|
const cost = this.safeString(trade, 'quoteQty');
|
|
846
881
|
const type = (cost === undefined) ? 'spot' : 'swap';
|
|
847
|
-
const currencyId = this.
|
|
882
|
+
const currencyId = this.safeString2(trade, 'currency', 'N');
|
|
848
883
|
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
884
|
+
const m = this.safeValue(trade, 'm', false);
|
|
885
|
+
const marketId = this.safeString(trade, 's');
|
|
849
886
|
return this.safeTrade({
|
|
850
|
-
'id': this.
|
|
887
|
+
'id': this.safeStringN(trade, ['id', 't']),
|
|
851
888
|
'info': trade,
|
|
852
889
|
'timestamp': time,
|
|
853
890
|
'datetime': this.iso8601(time),
|
|
854
|
-
'symbol': this.safeSymbol(
|
|
855
|
-
'order':
|
|
856
|
-
'type':
|
|
857
|
-
'side': side,
|
|
858
|
-
'takerOrMaker':
|
|
859
|
-
'price': this.
|
|
860
|
-
'amount': this.
|
|
891
|
+
'symbol': this.safeSymbol(marketId, market, '-', type),
|
|
892
|
+
'order': this.safeString2(trade, 'orderId', 'i'),
|
|
893
|
+
'type': this.safeStringLower(trade, 'o'),
|
|
894
|
+
'side': this.parseOrderSide(side),
|
|
895
|
+
'takerOrMaker': (isBuyerMaker || m) ? 'maker' : 'taker',
|
|
896
|
+
'price': this.safeString2(trade, 'price', 'p'),
|
|
897
|
+
'amount': this.safeStringN(trade, ['qty', 'amount', 'q']),
|
|
861
898
|
'cost': cost,
|
|
862
899
|
'fee': {
|
|
863
|
-
'cost': this.parseNumber(Precise["default"].stringAbs(this.
|
|
900
|
+
'cost': this.parseNumber(Precise["default"].stringAbs(this.safeString2(trade, 'commission', 'n'))),
|
|
864
901
|
'currency': currencyCode,
|
|
865
902
|
'rate': undefined,
|
|
866
903
|
},
|
|
@@ -1580,15 +1617,20 @@ class bingx extends bingx$1 {
|
|
|
1580
1617
|
request['timeInForce'] = 'POC';
|
|
1581
1618
|
}
|
|
1582
1619
|
const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice', true);
|
|
1583
|
-
if (
|
|
1584
|
-
if (
|
|
1585
|
-
|
|
1620
|
+
if (isMarketOrder && (side === 'buy')) {
|
|
1621
|
+
if (createMarketBuyOrderRequiresPrice) {
|
|
1622
|
+
if (price === undefined) {
|
|
1623
|
+
throw new errors.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
|
|
1624
|
+
}
|
|
1625
|
+
else {
|
|
1626
|
+
const amountString = this.numberToString(amount);
|
|
1627
|
+
const priceString = this.numberToString(price);
|
|
1628
|
+
const cost = this.parseNumber(Precise["default"].stringMul(amountString, priceString));
|
|
1629
|
+
request['quoteOrderQty'] = this.priceToPrecision(symbol, cost);
|
|
1630
|
+
}
|
|
1586
1631
|
}
|
|
1587
1632
|
else {
|
|
1588
|
-
|
|
1589
|
-
const priceString = this.numberToString(price);
|
|
1590
|
-
const cost = this.parseNumber(Precise["default"].stringMul(amountString, priceString));
|
|
1591
|
-
request['quoteOrderQty'] = this.priceToPrecision(symbol, cost);
|
|
1633
|
+
request['quoteOrderQty'] = this.priceToPrecision(symbol, amount);
|
|
1592
1634
|
}
|
|
1593
1635
|
}
|
|
1594
1636
|
else {
|
|
@@ -1704,6 +1746,15 @@ class bingx extends bingx$1 {
|
|
|
1704
1746
|
const order = this.safeValue(data, 'order', data);
|
|
1705
1747
|
return this.parseOrder(order, market);
|
|
1706
1748
|
}
|
|
1749
|
+
parseOrderSide(side) {
|
|
1750
|
+
const sides = {
|
|
1751
|
+
'BUY': 'buy',
|
|
1752
|
+
'SELL': 'sell',
|
|
1753
|
+
'SHORT': 'sell',
|
|
1754
|
+
'LONG': 'buy',
|
|
1755
|
+
};
|
|
1756
|
+
return this.safeString(sides, side, side);
|
|
1757
|
+
}
|
|
1707
1758
|
parseOrder(order, market = undefined) {
|
|
1708
1759
|
//
|
|
1709
1760
|
// spot
|
|
@@ -1801,39 +1852,49 @@ class bingx extends bingx$1 {
|
|
|
1801
1852
|
// "workingType": "MARK_PRICE"
|
|
1802
1853
|
// }
|
|
1803
1854
|
//
|
|
1804
|
-
const positionSide = this.
|
|
1855
|
+
const positionSide = this.safeString2(order, 'positionSide', 'ps');
|
|
1805
1856
|
const marketType = (positionSide === undefined) ? 'spot' : 'swap';
|
|
1806
|
-
const marketId = this.
|
|
1857
|
+
const marketId = this.safeString2(order, 'symbol', 's');
|
|
1807
1858
|
const symbol = this.safeSymbol(marketId, market, '-', marketType);
|
|
1808
|
-
const
|
|
1859
|
+
const orderId = this.safeString2(order, 'orderId', 'i');
|
|
1860
|
+
const side = this.safeStringLower2(order, 'side', 'S');
|
|
1861
|
+
const type = this.safeStringLower2(order, 'type', 'o');
|
|
1862
|
+
const timestamp = this.safeIntegerN(order, ['time', 'transactTime', 'E']);
|
|
1863
|
+
const lastTradeTimestamp = this.safeInteger2(order, 'updateTime', 'T');
|
|
1864
|
+
const price = this.safeString2(order, 'price', 'p');
|
|
1865
|
+
const average = this.safeString2(order, 'avgPrice', 'ap');
|
|
1866
|
+
const amount = this.safeString2(order, 'origQty', 'q');
|
|
1867
|
+
const filled = this.safeString2(order, 'executedQty', 'z');
|
|
1868
|
+
const statusId = this.safeString2(order, 'status', 'X');
|
|
1809
1869
|
const fee = {
|
|
1810
|
-
'currency': this.
|
|
1811
|
-
'rate': this.
|
|
1870
|
+
'currency': this.safeString2(order, 'feeAsset', 'N'),
|
|
1871
|
+
'rate': this.safeStringN(order, ['fee', 'commission', 'n']),
|
|
1812
1872
|
};
|
|
1873
|
+
const clientOrderId = this.safeString2(order, 'clientOrderId', 'c');
|
|
1813
1874
|
return this.safeOrder({
|
|
1814
1875
|
'info': order,
|
|
1815
|
-
'id':
|
|
1816
|
-
'clientOrderId':
|
|
1876
|
+
'id': orderId,
|
|
1877
|
+
'clientOrderId': clientOrderId,
|
|
1817
1878
|
'timestamp': timestamp,
|
|
1818
1879
|
'datetime': this.iso8601(timestamp),
|
|
1819
|
-
'lastTradeTimestamp':
|
|
1880
|
+
'lastTradeTimestamp': lastTradeTimestamp,
|
|
1820
1881
|
'lastUpdateTimestamp': this.safeInteger(order, 'updateTime'),
|
|
1821
1882
|
'symbol': symbol,
|
|
1822
|
-
'type':
|
|
1883
|
+
'type': type,
|
|
1823
1884
|
'timeInForce': undefined,
|
|
1824
1885
|
'postOnly': undefined,
|
|
1825
|
-
'side': this.
|
|
1826
|
-
'price':
|
|
1886
|
+
'side': this.parseOrderSide(side),
|
|
1887
|
+
'price': price,
|
|
1827
1888
|
'stopPrice': this.safeNumber(order, 'stopPrice'),
|
|
1828
1889
|
'triggerPrice': this.safeNumber(order, 'stopPrice'),
|
|
1829
1890
|
'stopLossPrice': this.safeNumber(order, 'stopLoss'),
|
|
1830
1891
|
'takeProfitPrice': this.safeNumber(order, 'takeProfit'),
|
|
1831
|
-
'average':
|
|
1892
|
+
'average': average,
|
|
1832
1893
|
'cost': undefined,
|
|
1833
|
-
'amount':
|
|
1834
|
-
'filled':
|
|
1894
|
+
'amount': amount,
|
|
1895
|
+
'filled': filled,
|
|
1835
1896
|
'remaining': undefined,
|
|
1836
|
-
'status': this.parseOrderStatus(
|
|
1897
|
+
'status': this.parseOrderStatus(statusId),
|
|
1837
1898
|
'fee': fee,
|
|
1838
1899
|
'trades': undefined,
|
|
1839
1900
|
}, market);
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1649,8 +1649,26 @@ class bitget extends bitget$1 {
|
|
|
1649
1649
|
// "data": "888291686266343424"
|
|
1650
1650
|
// }
|
|
1651
1651
|
//
|
|
1652
|
+
// {
|
|
1653
|
+
// "code":"00000",
|
|
1654
|
+
// "msg":"success",
|
|
1655
|
+
// "requestTime":1696784219602,
|
|
1656
|
+
// "data":{
|
|
1657
|
+
// "orderId":"1094957867615789056",
|
|
1658
|
+
// "clientOrderId":"64f1e4ce842041d296b4517df1b5c2d7"
|
|
1659
|
+
// }
|
|
1660
|
+
// }
|
|
1661
|
+
//
|
|
1662
|
+
const data = this.safeValue(response, 'data');
|
|
1663
|
+
let id = undefined;
|
|
1664
|
+
if (typeof data === 'string') {
|
|
1665
|
+
id = data;
|
|
1666
|
+
}
|
|
1667
|
+
else if (data !== undefined) {
|
|
1668
|
+
id = this.safeString(data, 'orderId');
|
|
1669
|
+
}
|
|
1652
1670
|
const result = {
|
|
1653
|
-
'id':
|
|
1671
|
+
'id': id,
|
|
1654
1672
|
'info': response,
|
|
1655
1673
|
'txid': undefined,
|
|
1656
1674
|
'timestamp': undefined,
|
|
@@ -4433,15 +4451,20 @@ class bitget extends bitget$1 {
|
|
|
4433
4451
|
* @name bitget#fetchFundingRateHistory
|
|
4434
4452
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
|
|
4435
4453
|
* @description fetches historical funding rate prices
|
|
4436
|
-
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
|
|
4437
4454
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
4438
4455
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
4439
4456
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
4440
4457
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
4458
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4441
4459
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
4442
4460
|
*/
|
|
4443
4461
|
this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
|
|
4444
4462
|
await this.loadMarkets();
|
|
4463
|
+
let paginate = false;
|
|
4464
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
4465
|
+
if (paginate) {
|
|
4466
|
+
return await this.fetchPaginatedCallIncremental('fetchFundingRateHistory', symbol, since, limit, params, 'pageNo', 50);
|
|
4467
|
+
}
|
|
4445
4468
|
const market = this.market(symbol);
|
|
4446
4469
|
const request = {
|
|
4447
4470
|
'symbol': market['id'],
|
|
@@ -4452,6 +4475,7 @@ class bitget extends bitget$1 {
|
|
|
4452
4475
|
if (limit !== undefined) {
|
|
4453
4476
|
request['pageSize'] = limit;
|
|
4454
4477
|
}
|
|
4478
|
+
request['nextPage'] = true;
|
|
4455
4479
|
const response = await this.publicMixGetMarketHistoryFundRate(this.extend(request, params));
|
|
4456
4480
|
//
|
|
4457
4481
|
// {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -3573,6 +3573,13 @@ class gate extends gate$1 {
|
|
|
3573
3573
|
// "memo": null
|
|
3574
3574
|
// }
|
|
3575
3575
|
//
|
|
3576
|
+
// {
|
|
3577
|
+
// "currency":"usdt",
|
|
3578
|
+
// "address":"0x01b0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806",
|
|
3579
|
+
// "amount":"1880",
|
|
3580
|
+
// "chain":"eth"
|
|
3581
|
+
// }
|
|
3582
|
+
//
|
|
3576
3583
|
const id = this.safeString(transaction, 'id');
|
|
3577
3584
|
let type = undefined;
|
|
3578
3585
|
let amountString = this.safeString(transaction, 'amount');
|
|
@@ -3590,6 +3597,7 @@ class gate extends gate$1 {
|
|
|
3590
3597
|
if (type === 'withdrawal') {
|
|
3591
3598
|
amountString = Precise["default"].stringSub(amountString, feeCostString);
|
|
3592
3599
|
}
|
|
3600
|
+
const networkId = this.safeStringUpper(transaction, 'chain');
|
|
3593
3601
|
const currencyId = this.safeString(transaction, 'currency');
|
|
3594
3602
|
const code = this.safeCurrencyCode(currencyId);
|
|
3595
3603
|
const txid = this.safeString(transaction, 'txid');
|
|
@@ -3604,7 +3612,7 @@ class gate extends gate$1 {
|
|
|
3604
3612
|
'txid': txid,
|
|
3605
3613
|
'currency': code,
|
|
3606
3614
|
'amount': this.parseNumber(amountString),
|
|
3607
|
-
'network':
|
|
3615
|
+
'network': this.networkIdToCode(networkId),
|
|
3608
3616
|
'address': address,
|
|
3609
3617
|
'addressTo': undefined,
|
|
3610
3618
|
'addressFrom': undefined,
|
|
@@ -2325,12 +2325,12 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2325
2325
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2326
2326
|
/**
|
|
2327
2327
|
* @method
|
|
2328
|
-
* @name
|
|
2328
|
+
* @name kucoinfutures#fetchFundingRateHistory
|
|
2329
2329
|
* @description fetches historical funding rate prices
|
|
2330
2330
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2331
2331
|
* @param {int} [since] not used by kucuoinfutures
|
|
2332
2332
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
2333
|
-
* @param {object} [params] extra parameters specific to the
|
|
2333
|
+
* @param {object} [params] extra parameters specific to the kucoinfutures api endpoint
|
|
2334
2334
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
2335
2335
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
2336
2336
|
*/
|