ccxt 4.2.69 → 4.2.71
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 +4 -4
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +991 -211
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/base/Exchange.js +32 -30
- package/dist/cjs/src/bitget.js +14 -6
- package/dist/cjs/src/coinbase.js +108 -89
- package/dist/cjs/src/digifinex.js +2 -1
- package/dist/cjs/src/gate.js +174 -1
- package/dist/cjs/src/hyperliquid.js +1 -1
- package/dist/cjs/src/kraken.js +1 -0
- package/dist/cjs/src/mexc.js +9 -0
- package/dist/cjs/src/pro/hyperliquid.js +556 -0
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/coinbase.d.ts +2 -0
- package/js/src/base/Exchange.d.ts +2 -2
- package/js/src/base/Exchange.js +32 -30
- package/js/src/base/types.d.ts +48 -48
- package/js/src/bitget.js +14 -6
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +108 -89
- package/js/src/digifinex.js +2 -1
- package/js/src/gate.d.ts +4 -1
- package/js/src/gate.js +174 -1
- package/js/src/hyperliquid.js +1 -1
- package/js/src/kraken.js +1 -0
- package/js/src/mexc.js +9 -0
- package/js/src/pro/hyperliquid.d.ts +23 -0
- package/js/src/pro/hyperliquid.js +557 -0
- package/package.json +1 -1
- package/skip-tests.json +49 -58
package/dist/cjs/ccxt.js
CHANGED
|
@@ -152,6 +152,7 @@ var hollaex$1 = require('./src/pro/hollaex.js');
|
|
|
152
152
|
var htx$1 = require('./src/pro/htx.js');
|
|
153
153
|
var huobi$1 = require('./src/pro/huobi.js');
|
|
154
154
|
var huobijp$1 = require('./src/pro/huobijp.js');
|
|
155
|
+
var hyperliquid$1 = require('./src/pro/hyperliquid.js');
|
|
155
156
|
var idex$1 = require('./src/pro/idex.js');
|
|
156
157
|
var independentreserve$1 = require('./src/pro/independentreserve.js');
|
|
157
158
|
var kraken$1 = require('./src/pro/kraken.js');
|
|
@@ -177,7 +178,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
177
178
|
|
|
178
179
|
//-----------------------------------------------------------------------------
|
|
179
180
|
// this is updated by vss.js when building
|
|
180
|
-
const version = '4.2.
|
|
181
|
+
const version = '4.2.71';
|
|
181
182
|
Exchange["default"].ccxtVersion = version;
|
|
182
183
|
const exchanges = {
|
|
183
184
|
'ace': ace,
|
|
@@ -322,6 +323,7 @@ const pro = {
|
|
|
322
323
|
'htx': htx$1,
|
|
323
324
|
'huobi': huobi$1,
|
|
324
325
|
'huobijp': huobijp$1,
|
|
326
|
+
'hyperliquid': hyperliquid$1,
|
|
325
327
|
'idex': idex$1,
|
|
326
328
|
'independentreserve': independentreserve$1,
|
|
327
329
|
'kraken': kraken$1,
|
|
@@ -236,7 +236,7 @@ class Exchange {
|
|
|
236
236
|
this.socksProxyAgentModule = undefined;
|
|
237
237
|
this.socksProxyAgentModuleChecked = false;
|
|
238
238
|
this.proxyDictionaries = {};
|
|
239
|
-
this.
|
|
239
|
+
this.proxiesModulesLoading = undefined;
|
|
240
240
|
Object.assign(this, functions);
|
|
241
241
|
//
|
|
242
242
|
// if (isNode) {
|
|
@@ -731,36 +731,38 @@ class Exchange {
|
|
|
731
731
|
console.log(...args);
|
|
732
732
|
}
|
|
733
733
|
async loadProxyModules() {
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
734
|
+
// when loading markets, multiple parallel calls are made, so need one promise
|
|
735
|
+
if (this.proxiesModulesLoading === undefined) {
|
|
736
|
+
this.proxiesModulesLoading = (async () => {
|
|
737
|
+
// we have to handle it with below nested way, because of dynamic
|
|
738
|
+
// import issues (https://github.com/ccxt/ccxt/pull/20687)
|
|
739
|
+
try {
|
|
740
|
+
// todo: possible sync alternatives: https://stackoverflow.com/questions/51069002/convert-import-to-synchronous
|
|
741
|
+
this.httpProxyAgentModule = await Promise.resolve().then(function () { return require(/* webpackIgnore: true */ '../static_dependencies/proxies/http-proxy-agent/index.js'); });
|
|
742
|
+
this.httpsProxyAgentModule = await Promise.resolve().then(function () { return require(/* webpackIgnore: true */ '../static_dependencies/proxies/https-proxy-agent/index.js'); });
|
|
743
|
+
}
|
|
744
|
+
catch (e) {
|
|
745
|
+
// if several users are using those frameworks which cause exceptions,
|
|
746
|
+
// let them to be able to load modules still, by installing them
|
|
747
|
+
try {
|
|
748
|
+
// @ts-ignore
|
|
749
|
+
this.httpProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'http-proxy-agent')); });
|
|
750
|
+
// @ts-ignore
|
|
751
|
+
this.httpProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'https-proxy-agent')); });
|
|
752
|
+
}
|
|
753
|
+
catch (e) { }
|
|
754
|
+
}
|
|
755
|
+
if (this.socksProxyAgentModuleChecked === false) {
|
|
756
|
+
try {
|
|
757
|
+
// @ts-ignore
|
|
758
|
+
this.socksProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'socks-proxy-agent')); });
|
|
759
|
+
}
|
|
760
|
+
catch (e) { }
|
|
761
|
+
this.socksProxyAgentModuleChecked = true;
|
|
762
|
+
}
|
|
763
|
+
})();
|
|
763
764
|
}
|
|
765
|
+
return await this.proxiesModulesLoading;
|
|
764
766
|
}
|
|
765
767
|
setProxyAgents(httpProxy, httpsProxy, socksProxy) {
|
|
766
768
|
let chosenAgent = undefined;
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -6308,11 +6308,13 @@ class bitget extends bitget$1 {
|
|
|
6308
6308
|
* @description fetch all open positions
|
|
6309
6309
|
* @see https://www.bitget.com/api-doc/contract/position/get-all-position
|
|
6310
6310
|
* @see https://www.bitget.com/api-doc/contract/position/Get-History-Position
|
|
6311
|
-
* @param {string[]
|
|
6311
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
6312
6312
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6313
6313
|
* @param {string} [params.marginCoin] the settle currency of the positions, needs to match the productType
|
|
6314
6314
|
* @param {string} [params.productType] 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
6315
6315
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
6316
|
+
* @param {boolean} [params.useHistoryEndpoint] default false, when true will use the historic endpoint to fetch positions
|
|
6317
|
+
* @param {string} [params.method] either (default) 'privateMixGetV2MixPositionAllPosition' or 'privateMixGetV2MixPositionHistoryPosition'
|
|
6316
6318
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
6317
6319
|
*/
|
|
6318
6320
|
await this.loadMarkets();
|
|
@@ -6321,8 +6323,14 @@ class bitget extends bitget$1 {
|
|
|
6321
6323
|
if (paginate) {
|
|
6322
6324
|
return await this.fetchPaginatedCallCursor('fetchPositions', undefined, undefined, undefined, params, 'endId', 'idLessThan');
|
|
6323
6325
|
}
|
|
6324
|
-
|
|
6325
|
-
const
|
|
6326
|
+
let method = undefined;
|
|
6327
|
+
const useHistoryEndpoint = this.safeBool(params, 'useHistoryEndpoint', false);
|
|
6328
|
+
if (useHistoryEndpoint) {
|
|
6329
|
+
method = 'privateMixGetV2MixPositionHistoryPosition';
|
|
6330
|
+
}
|
|
6331
|
+
else {
|
|
6332
|
+
[method, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method', 'privateMixGetV2MixPositionAllPosition');
|
|
6333
|
+
}
|
|
6326
6334
|
let market = undefined;
|
|
6327
6335
|
if (symbols !== undefined) {
|
|
6328
6336
|
const first = this.safeString(symbols, 0);
|
|
@@ -6438,11 +6446,11 @@ class bitget extends bitget$1 {
|
|
|
6438
6446
|
//
|
|
6439
6447
|
let position = [];
|
|
6440
6448
|
if (!isHistory) {
|
|
6441
|
-
position = this.
|
|
6449
|
+
position = this.safeList(response, 'data', []);
|
|
6442
6450
|
}
|
|
6443
6451
|
else {
|
|
6444
|
-
const data = this.
|
|
6445
|
-
position = this.
|
|
6452
|
+
const data = this.safeDict(response, 'data', {});
|
|
6453
|
+
position = this.safeList(data, 'list', []);
|
|
6446
6454
|
}
|
|
6447
6455
|
const result = [];
|
|
6448
6456
|
for (let i = 0; i < position.length; i++) {
|