ccxt 4.2.59 → 4.2.61
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 +103 -102
- package/build.sh +2 -2
- package/dist/ccxt.browser.js +11853 -3790
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/hyperliquid.js +9 -0
- package/dist/cjs/src/ascendex.js +10 -12
- package/dist/cjs/src/base/Exchange.js +22 -1
- package/dist/cjs/src/base/functions/encode.js +5 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bingx.js +38 -0
- package/dist/cjs/src/bitfinex2.js +20 -3
- package/dist/cjs/src/bitget.js +9 -2
- package/dist/cjs/src/bitmart.js +41 -23
- package/dist/cjs/src/blofin.js +59 -1
- package/dist/cjs/src/coinbase.js +108 -103
- package/dist/cjs/src/coinex.js +61 -1
- package/dist/cjs/src/hitbtc.js +1 -1
- package/dist/cjs/src/htx.js +4 -1
- package/dist/cjs/src/hyperliquid.js +2035 -0
- package/dist/cjs/src/kraken.js +50 -41
- package/dist/cjs/src/krakenfutures.js +28 -0
- package/dist/cjs/src/kucoinfutures.js +3 -2
- package/dist/cjs/src/okx.js +1 -1
- package/dist/cjs/src/phemex.js +2 -2
- package/dist/cjs/src/pro/binance.js +16 -3
- package/dist/cjs/src/pro/bingx.js +1 -0
- package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +158 -0
- package/dist/cjs/src/static_dependencies/ethers/address/address.js +144 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +407 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/address.js +45 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +28 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/array.js +176 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +27 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +52 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +45 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/null.js +30 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/number.js +60 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/string.js +27 -0
- package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +68 -0
- package/dist/cjs/src/static_dependencies/ethers/fragments.js +614 -0
- package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +492 -0
- package/dist/cjs/src/static_dependencies/ethers/index.js +35 -0
- package/dist/cjs/src/static_dependencies/ethers/interface.js +44 -0
- package/dist/cjs/src/static_dependencies/ethers/typed.js +618 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +20 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/data.js +134 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +228 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/events.js +13 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +29 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/index.js +53 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +231 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +47 -0
- package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +218 -0
- package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +292 -0
- package/dist/cjs/src/tokocrypto.js +22 -2
- package/dist/cjs/src/wazirx.js +314 -4
- package/dist/cjs/src/woo.js +157 -77
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/blofin.d.ts +1 -0
- package/js/src/abstract/coinbase.d.ts +3 -3
- package/js/src/abstract/hyperliquid.d.ts +9 -0
- package/js/src/abstract/hyperliquid.js +11 -0
- package/js/src/abstract/wazirx.d.ts +5 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +10 -12
- package/js/src/base/Exchange.d.ts +4 -0
- package/js/src/base/Exchange.js +13 -1
- package/js/src/base/functions/encode.d.ts +2 -1
- package/js/src/base/functions/encode.js +5 -1
- package/js/src/bingx.d.ts +3 -1
- package/js/src/bingx.js +38 -0
- package/js/src/bitfinex2.js +20 -3
- package/js/src/bitget.js +9 -2
- package/js/src/bitmart.d.ts +9 -2
- package/js/src/bitmart.js +41 -23
- package/js/src/blofin.d.ts +2 -1
- package/js/src/blofin.js +59 -1
- package/js/src/coinbase.js +108 -103
- package/js/src/coinex.d.ts +3 -1
- package/js/src/coinex.js +61 -1
- package/js/src/hitbtc.js +1 -1
- package/js/src/htx.js +4 -1
- package/js/src/hyperliquid.d.ts +83 -0
- package/js/src/hyperliquid.js +2036 -0
- package/js/src/kraken.js +50 -41
- package/js/src/krakenfutures.d.ts +2 -1
- package/js/src/krakenfutures.js +28 -0
- package/js/src/kucoinfutures.js +3 -2
- package/js/src/okx.js +1 -1
- package/js/src/phemex.js +2 -2
- package/js/src/pro/binance.js +16 -3
- package/js/src/pro/bingx.js +1 -0
- package/js/src/pro/deribit.d.ts +1 -1
- package/js/src/static_dependencies/ethers/abi-coder.d.ts +50 -0
- package/js/src/static_dependencies/ethers/abi-coder.js +148 -0
- package/js/src/static_dependencies/ethers/address/address.d.ts +55 -0
- package/js/src/static_dependencies/ethers/address/address.js +162 -0
- package/js/src/static_dependencies/ethers/address/checks.d.ts +80 -0
- package/js/src/static_dependencies/ethers/address/checks.js +119 -0
- package/js/src/static_dependencies/ethers/address/contract-address.d.ts +47 -0
- package/js/src/static_dependencies/ethers/address/contract-address.js +73 -0
- package/js/src/static_dependencies/ethers/address/index.d.ts +48 -0
- package/js/src/static_dependencies/ethers/address/index.js +24 -0
- package/js/src/static_dependencies/ethers/bytes32.d.ts +14 -0
- package/js/src/static_dependencies/ethers/bytes32.js +45 -0
- package/js/src/static_dependencies/ethers/coders/abstract-coder.d.ts +120 -0
- package/js/src/static_dependencies/ethers/coders/abstract-coder.js +424 -0
- package/js/src/static_dependencies/ethers/coders/address.d.ts +12 -0
- package/js/src/static_dependencies/ethers/coders/address.js +34 -0
- package/js/src/static_dependencies/ethers/coders/anonymous.d.ts +14 -0
- package/js/src/static_dependencies/ethers/coders/anonymous.js +27 -0
- package/js/src/static_dependencies/ethers/coders/array.d.ts +24 -0
- package/js/src/static_dependencies/ethers/coders/array.js +162 -0
- package/js/src/static_dependencies/ethers/coders/boolean.d.ts +12 -0
- package/js/src/static_dependencies/ethers/coders/boolean.js +26 -0
- package/js/src/static_dependencies/ethers/coders/bytes.d.ts +18 -0
- package/js/src/static_dependencies/ethers/coders/bytes.js +39 -0
- package/js/src/static_dependencies/ethers/coders/fixed-bytes.d.ts +14 -0
- package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +32 -0
- package/js/src/static_dependencies/ethers/coders/null.d.ts +11 -0
- package/js/src/static_dependencies/ethers/coders/null.js +29 -0
- package/js/src/static_dependencies/ethers/coders/number.d.ts +15 -0
- package/js/src/static_dependencies/ethers/coders/number.js +48 -0
- package/js/src/static_dependencies/ethers/coders/string.d.ts +12 -0
- package/js/src/static_dependencies/ethers/coders/string.js +26 -0
- package/js/src/static_dependencies/ethers/coders/tuple.d.ts +15 -0
- package/js/src/static_dependencies/ethers/coders/tuple.js +67 -0
- package/js/src/static_dependencies/ethers/fragments.d.ts +458 -0
- package/js/src/static_dependencies/ethers/fragments.js +1252 -0
- package/js/src/static_dependencies/ethers/hash/index.d.ts +10 -0
- package/js/src/static_dependencies/ethers/hash/index.js +15 -0
- package/js/src/static_dependencies/ethers/hash/solidity.d.ts +30 -0
- package/js/src/static_dependencies/ethers/hash/solidity.js +107 -0
- package/js/src/static_dependencies/ethers/hash/typed-data.d.ts +144 -0
- package/js/src/static_dependencies/ethers/hash/typed-data.js +490 -0
- package/js/src/static_dependencies/ethers/index.d.ts +19 -0
- package/js/src/static_dependencies/ethers/index.js +22 -0
- package/js/src/static_dependencies/ethers/interface.d.ts +380 -0
- package/js/src/static_dependencies/ethers/interface.js +990 -0
- package/js/src/static_dependencies/ethers/typed.d.ts +569 -0
- package/js/src/static_dependencies/ethers/typed.js +608 -0
- package/js/src/static_dependencies/ethers/utils/base58.d.ts +22 -0
- package/js/src/static_dependencies/ethers/utils/base58.js +68 -0
- package/js/src/static_dependencies/ethers/utils/base64-browser.d.ts +3 -0
- package/js/src/static_dependencies/ethers/utils/base64-browser.js +24 -0
- package/js/src/static_dependencies/ethers/utils/base64.d.ts +39 -0
- package/js/src/static_dependencies/ethers/utils/base64.js +58 -0
- package/js/src/static_dependencies/ethers/utils/data.d.ts +92 -0
- package/js/src/static_dependencies/ethers/utils/data.js +175 -0
- package/js/src/static_dependencies/ethers/utils/errors.d.ts +509 -0
- package/js/src/static_dependencies/ethers/utils/errors.js +227 -0
- package/js/src/static_dependencies/ethers/utils/events.d.ts +76 -0
- package/js/src/static_dependencies/ethers/utils/events.js +52 -0
- package/js/src/static_dependencies/ethers/utils/fixednumber.d.ts +251 -0
- package/js/src/static_dependencies/ethers/utils/fixednumber.js +529 -0
- package/js/src/static_dependencies/ethers/utils/index.d.ts +30 -0
- package/js/src/static_dependencies/ethers/utils/index.js +38 -0
- package/js/src/static_dependencies/ethers/utils/maths.d.ts +65 -0
- package/js/src/static_dependencies/ethers/utils/maths.js +220 -0
- package/js/src/static_dependencies/ethers/utils/properties.d.ts +22 -0
- package/js/src/static_dependencies/ethers/utils/properties.js +59 -0
- package/js/src/static_dependencies/ethers/utils/rlp-decode.d.ts +5 -0
- package/js/src/static_dependencies/ethers/utils/rlp-decode.js +84 -0
- package/js/src/static_dependencies/ethers/utils/rlp-encode.d.ts +5 -0
- package/js/src/static_dependencies/ethers/utils/rlp-encode.js +54 -0
- package/js/src/static_dependencies/ethers/utils/rlp.d.ts +16 -0
- package/js/src/static_dependencies/ethers/utils/rlp.js +14 -0
- package/js/src/static_dependencies/ethers/utils/units.d.ts +23 -0
- package/js/src/static_dependencies/ethers/utils/units.js +88 -0
- package/js/src/static_dependencies/ethers/utils/utf8.d.ts +95 -0
- package/js/src/static_dependencies/ethers/utils/utf8.js +225 -0
- package/js/src/static_dependencies/ethers/utils/uuid.d.ts +7 -0
- package/js/src/static_dependencies/ethers/utils/uuid.js +35 -0
- package/js/src/static_dependencies/messagepack/msgpack.d.ts +2 -0
- package/js/src/static_dependencies/messagepack/msgpack.js +572 -0
- package/js/src/tokocrypto.js +22 -2
- package/js/src/wazirx.d.ts +12 -1
- package/js/src/wazirx.js +314 -4
- package/js/src/woo.d.ts +8 -0
- package/js/src/woo.js +157 -77
- package/package.json +1 -1
- package/skip-tests.json +60 -16
package/dist/cjs/ccxt.js
CHANGED
|
@@ -76,6 +76,7 @@ var hollaex = require('./src/hollaex.js');
|
|
|
76
76
|
var htx = require('./src/htx.js');
|
|
77
77
|
var huobi = require('./src/huobi.js');
|
|
78
78
|
var huobijp = require('./src/huobijp.js');
|
|
79
|
+
var hyperliquid = require('./src/hyperliquid.js');
|
|
79
80
|
var idex = require('./src/idex.js');
|
|
80
81
|
var independentreserve = require('./src/independentreserve.js');
|
|
81
82
|
var indodax = require('./src/indodax.js');
|
|
@@ -176,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
176
177
|
|
|
177
178
|
//-----------------------------------------------------------------------------
|
|
178
179
|
// this is updated by vss.js when building
|
|
179
|
-
const version = '4.2.
|
|
180
|
+
const version = '4.2.61';
|
|
180
181
|
Exchange["default"].ccxtVersion = version;
|
|
181
182
|
const exchanges = {
|
|
182
183
|
'ace': ace,
|
|
@@ -243,6 +244,7 @@ const exchanges = {
|
|
|
243
244
|
'htx': htx,
|
|
244
245
|
'huobi': huobi,
|
|
245
246
|
'huobijp': huobijp,
|
|
247
|
+
'hyperliquid': hyperliquid,
|
|
246
248
|
'idex': idex,
|
|
247
249
|
'independentreserve': independentreserve,
|
|
248
250
|
'indodax': indodax,
|
|
@@ -448,6 +450,7 @@ exports.hollaex = hollaex;
|
|
|
448
450
|
exports.htx = htx;
|
|
449
451
|
exports.huobi = huobi;
|
|
450
452
|
exports.huobijp = huobijp;
|
|
453
|
+
exports.hyperliquid = hyperliquid;
|
|
451
454
|
exports.idex = idex;
|
|
452
455
|
exports.independentreserve = independentreserve;
|
|
453
456
|
exports.indodax = indodax;
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -754,11 +754,10 @@ class ascendex extends ascendex$1 {
|
|
|
754
754
|
];
|
|
755
755
|
}
|
|
756
756
|
parseBalance(response) {
|
|
757
|
-
const timestamp = this.milliseconds();
|
|
758
757
|
const result = {
|
|
759
758
|
'info': response,
|
|
760
|
-
'timestamp':
|
|
761
|
-
'datetime':
|
|
759
|
+
'timestamp': undefined,
|
|
760
|
+
'datetime': undefined,
|
|
762
761
|
};
|
|
763
762
|
const balances = this.safeValue(response, 'data', []);
|
|
764
763
|
for (let i = 0; i < balances.length; i++) {
|
|
@@ -772,11 +771,10 @@ class ascendex extends ascendex$1 {
|
|
|
772
771
|
return this.safeBalance(result);
|
|
773
772
|
}
|
|
774
773
|
parseMarginBalance(response) {
|
|
775
|
-
const timestamp = this.milliseconds();
|
|
776
774
|
const result = {
|
|
777
775
|
'info': response,
|
|
778
|
-
'timestamp':
|
|
779
|
-
'datetime':
|
|
776
|
+
'timestamp': undefined,
|
|
777
|
+
'datetime': undefined,
|
|
780
778
|
};
|
|
781
779
|
const balances = this.safeValue(response, 'data', []);
|
|
782
780
|
for (let i = 0; i < balances.length; i++) {
|
|
@@ -793,11 +791,10 @@ class ascendex extends ascendex$1 {
|
|
|
793
791
|
return this.safeBalance(result);
|
|
794
792
|
}
|
|
795
793
|
parseSwapBalance(response) {
|
|
796
|
-
const timestamp = this.milliseconds();
|
|
797
794
|
const result = {
|
|
798
795
|
'info': response,
|
|
799
|
-
'timestamp':
|
|
800
|
-
'datetime':
|
|
796
|
+
'timestamp': undefined,
|
|
797
|
+
'datetime': undefined,
|
|
801
798
|
};
|
|
802
799
|
const data = this.safeValue(response, 'data', {});
|
|
803
800
|
const collaterals = this.safeValue(data, 'collaterals', []);
|
|
@@ -819,6 +816,8 @@ class ascendex extends ascendex$1 {
|
|
|
819
816
|
* @see https://ascendex.github.io/ascendex-pro-api/#margin-account-balance
|
|
820
817
|
* @see https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
|
821
818
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
819
|
+
* @param {string} [params.type] wallet type, 'spot', 'margin', or 'swap'
|
|
820
|
+
* @param {string} [params.marginMode] 'cross' or undefined, for spot margin trading, value of 'isolated' is invalid
|
|
822
821
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
823
822
|
*/
|
|
824
823
|
await this.loadMarkets();
|
|
@@ -3181,12 +3180,11 @@ class ascendex extends ascendex$1 {
|
|
|
3181
3180
|
//
|
|
3182
3181
|
const status = this.safeInteger(transfer, 'code');
|
|
3183
3182
|
const currencyCode = this.safeCurrencyCode(undefined, currency);
|
|
3184
|
-
const timestamp = this.milliseconds();
|
|
3185
3183
|
return {
|
|
3186
3184
|
'info': transfer,
|
|
3187
3185
|
'id': undefined,
|
|
3188
|
-
'timestamp':
|
|
3189
|
-
'datetime':
|
|
3186
|
+
'timestamp': undefined,
|
|
3187
|
+
'datetime': undefined,
|
|
3190
3188
|
'currency': currencyCode,
|
|
3191
3189
|
'amount': undefined,
|
|
3192
3190
|
'fromAccount': undefined,
|
|
@@ -10,6 +10,17 @@ var Future = require('./ws/Future.js');
|
|
|
10
10
|
var OrderBook = require('./ws/OrderBook.js');
|
|
11
11
|
var crypto = require('./functions/crypto.js');
|
|
12
12
|
var totp = require('./functions/totp.js');
|
|
13
|
+
var index = require('../static_dependencies/ethers/index.js');
|
|
14
|
+
require('../static_dependencies/ethers/utils/base58.js');
|
|
15
|
+
require('../static_dependencies/ethers/utils/errors.js');
|
|
16
|
+
require('../static_dependencies/ethers/utils/events.js');
|
|
17
|
+
require('../static_dependencies/ethers/utils/fixednumber.js');
|
|
18
|
+
require('../static_dependencies/ethers/utils/maths.js');
|
|
19
|
+
require('../static_dependencies/ethers/utils/utf8.js');
|
|
20
|
+
require('../static_dependencies/noble-hashes/sha3.js');
|
|
21
|
+
require('../static_dependencies/noble-hashes/sha256.js');
|
|
22
|
+
require('../static_dependencies/ethers/address/address.js');
|
|
23
|
+
var typedData = require('../static_dependencies/ethers/hash/typed-data.js');
|
|
13
24
|
var generic = require('./functions/generic.js');
|
|
14
25
|
var misc = require('./functions/misc.js');
|
|
15
26
|
|
|
@@ -32,7 +43,7 @@ function _interopNamespace(e) {
|
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
// ----------------------------------------------------------------------------
|
|
35
|
-
const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, parseDate, ymd, base64ToString, crc32, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS } = functions;
|
|
46
|
+
const { isNode, deepExtend, extend, clone, flatten, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, merge, binaryConcat, hash, ecdsa, arrayConcat, encode, urlencode, hmac, numberToString, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, uuidv1, numberToLE, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, inArray, isEmpty, ordered, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS } = functions;
|
|
36
47
|
// ----------------------------------------------------------------------------
|
|
37
48
|
/**
|
|
38
49
|
* @class Exchange
|
|
@@ -219,6 +230,7 @@ class Exchange {
|
|
|
219
230
|
this.ymd = ymd;
|
|
220
231
|
this.base64ToString = base64ToString;
|
|
221
232
|
this.crc32 = crc32;
|
|
233
|
+
this.packb = packb;
|
|
222
234
|
this.httpProxyAgentModule = undefined;
|
|
223
235
|
this.httpsProxyAgentModule = undefined;
|
|
224
236
|
this.socksProxyAgentModule = undefined;
|
|
@@ -1414,6 +1426,15 @@ class Exchange {
|
|
|
1414
1426
|
modifiedContent = modifiedContent.replaceAll('}"', '}');
|
|
1415
1427
|
return modifiedContent;
|
|
1416
1428
|
}
|
|
1429
|
+
ethAbiEncode(types, args) {
|
|
1430
|
+
return this.base16ToBinary(index["default"].encode(types, args).slice(2));
|
|
1431
|
+
}
|
|
1432
|
+
ethEncodeStructuredData(domain, messageTypes, messageData) {
|
|
1433
|
+
return this.base16ToBinary(typedData.TypedDataEncoder.encode(domain, messageTypes, messageData).slice(-132));
|
|
1434
|
+
}
|
|
1435
|
+
intToBase16(elem) {
|
|
1436
|
+
return elem.toString(16);
|
|
1437
|
+
}
|
|
1417
1438
|
/* eslint-enable */
|
|
1418
1439
|
// ------------------------------------------------------------------------
|
|
1419
1440
|
// ########################################################################
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var index = require('../../static_dependencies/scure-base/index.js');
|
|
6
6
|
var utils = require('../../static_dependencies/noble-curves/abstract/utils.js');
|
|
7
|
+
var msgpack = require('../../static_dependencies/messagepack/msgpack.js');
|
|
7
8
|
var index$1 = require('../../static_dependencies/qs/index.cjs.js');
|
|
8
9
|
|
|
9
10
|
/* eslint-disable */
|
|
@@ -17,6 +18,9 @@ const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedOb
|
|
|
17
18
|
, urlencodeBase64 = base64string => base64string.replace(/[=]+$/, '')
|
|
18
19
|
.replace(/\+/g, '-')
|
|
19
20
|
.replace(/\//g, '_'), numberToLE = (n, padding) => utils.numberToBytesLE(BigInt(n), padding), numberToBE = (n, padding) => utils.numberToBytesBE(BigInt(n), padding);
|
|
21
|
+
function packb(req) {
|
|
22
|
+
return msgpack.serialize(req);
|
|
23
|
+
}
|
|
20
24
|
/* ------------------------------------------------------------------------ */
|
|
21
25
|
|
|
22
26
|
exports.base16ToBinary = base16ToBinary;
|
|
@@ -35,6 +39,7 @@ exports.isJsonEncodedObject = isJsonEncodedObject;
|
|
|
35
39
|
exports.json = json;
|
|
36
40
|
exports.numberToBE = numberToBE;
|
|
37
41
|
exports.numberToLE = numberToLE;
|
|
42
|
+
exports.packb = packb;
|
|
38
43
|
exports.rawencode = rawencode;
|
|
39
44
|
exports.stringToBase64 = stringToBase64;
|
|
40
45
|
exports.stringToBinary = stringToBinary;
|
|
@@ -117,6 +117,7 @@ exports.isJsonEncodedObject = encode.isJsonEncodedObject;
|
|
|
117
117
|
exports.json = encode.json;
|
|
118
118
|
exports.numberToBE = encode.numberToBE;
|
|
119
119
|
exports.numberToLE = encode.numberToLE;
|
|
120
|
+
exports.packb = encode.packb;
|
|
120
121
|
exports.rawencode = encode.rawencode;
|
|
121
122
|
exports.stringToBase64 = encode.stringToBase64;
|
|
122
123
|
exports.stringToBinary = encode.stringToBinary;
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -59,6 +59,7 @@ class bingx extends bingx$1 {
|
|
|
59
59
|
'fetchFundingRates': true,
|
|
60
60
|
'fetchLeverage': true,
|
|
61
61
|
'fetchLiquidations': false,
|
|
62
|
+
'fetchMarginMode': true,
|
|
62
63
|
'fetchMarkets': true,
|
|
63
64
|
'fetchMarkOHLCV': true,
|
|
64
65
|
'fetchMyLiquidations': true,
|
|
@@ -4166,6 +4167,43 @@ class bingx extends bingx$1 {
|
|
|
4166
4167
|
const data = this.safeDict(response, 'data');
|
|
4167
4168
|
return this.parseOrder(data, market);
|
|
4168
4169
|
}
|
|
4170
|
+
async fetchMarginMode(symbol, params = {}) {
|
|
4171
|
+
/**
|
|
4172
|
+
* @method
|
|
4173
|
+
* @name bingx#fetchMarginMode
|
|
4174
|
+
* @description fetches the margin mode of the trading pair
|
|
4175
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Margin%20Mode
|
|
4176
|
+
* @param {string} symbol unified symbol of the market to fetch the margin mode for
|
|
4177
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4178
|
+
* @returns {object} Struct of MarginMode
|
|
4179
|
+
*/
|
|
4180
|
+
await this.loadMarkets();
|
|
4181
|
+
const market = this.market(symbol);
|
|
4182
|
+
const request = {
|
|
4183
|
+
'symbol': market['id'],
|
|
4184
|
+
};
|
|
4185
|
+
const response = await this.swapV2PrivateGetTradeMarginType(this.extend(request, params));
|
|
4186
|
+
//
|
|
4187
|
+
// {
|
|
4188
|
+
// "code": 0,
|
|
4189
|
+
// "msg": "",
|
|
4190
|
+
// "data": {
|
|
4191
|
+
// "marginType": "CROSSED"
|
|
4192
|
+
// }
|
|
4193
|
+
// }
|
|
4194
|
+
//
|
|
4195
|
+
const data = this.safeDict(response, 'data', {});
|
|
4196
|
+
return this.parseMarginMode(data, market);
|
|
4197
|
+
}
|
|
4198
|
+
parseMarginMode(marginMode, market = undefined) {
|
|
4199
|
+
let marginType = this.safeStringLower(marginMode, 'marginType');
|
|
4200
|
+
marginType = (marginType === 'crossed') ? 'cross' : marginType;
|
|
4201
|
+
return {
|
|
4202
|
+
'info': marginMode,
|
|
4203
|
+
'symbol': market['symbol'],
|
|
4204
|
+
'marginMode': marginType,
|
|
4205
|
+
};
|
|
4206
|
+
}
|
|
4169
4207
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
4170
4208
|
const type = section[0];
|
|
4171
4209
|
const version = section[1];
|
|
@@ -27,8 +27,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
27
27
|
'spot': true,
|
|
28
28
|
'margin': true,
|
|
29
29
|
'swap': true,
|
|
30
|
-
'future':
|
|
31
|
-
'option':
|
|
30
|
+
'future': false,
|
|
31
|
+
'option': false,
|
|
32
32
|
'addMargin': false,
|
|
33
33
|
'borrowCrossMargin': false,
|
|
34
34
|
'borrowIsolatedMargin': false,
|
|
@@ -39,6 +39,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
39
39
|
'createLimitOrder': true,
|
|
40
40
|
'createMarketOrder': true,
|
|
41
41
|
'createOrder': true,
|
|
42
|
+
'createPostOnlyOrder': true,
|
|
42
43
|
'createReduceOnlyOrder': true,
|
|
43
44
|
'createStopLimitOrder': true,
|
|
44
45
|
'createStopMarketOrder': true,
|
|
@@ -49,8 +50,11 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
49
50
|
'editOrder': true,
|
|
50
51
|
'fetchBalance': true,
|
|
51
52
|
'fetchBorrowInterest': false,
|
|
53
|
+
'fetchBorrowRate': false,
|
|
52
54
|
'fetchBorrowRateHistories': false,
|
|
53
55
|
'fetchBorrowRateHistory': false,
|
|
56
|
+
'fetchBorrowRates': false,
|
|
57
|
+
'fetchBorrowRatesPerSymbol': false,
|
|
54
58
|
'fetchClosedOrder': true,
|
|
55
59
|
'fetchClosedOrders': true,
|
|
56
60
|
'fetchCrossBorrowRate': false,
|
|
@@ -79,6 +83,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
79
83
|
'fetchOpenOrder': true,
|
|
80
84
|
'fetchOpenOrders': true,
|
|
81
85
|
'fetchOrder': true,
|
|
86
|
+
'fetchOrderBook': true,
|
|
87
|
+
'fetchOrderBooks': false,
|
|
82
88
|
'fetchOrderTrades': true,
|
|
83
89
|
'fetchPosition': false,
|
|
84
90
|
'fetchPositionMode': false,
|
|
@@ -98,6 +104,8 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
98
104
|
'setMargin': true,
|
|
99
105
|
'setMarginMode': false,
|
|
100
106
|
'setPositionMode': false,
|
|
107
|
+
'signIn': false,
|
|
108
|
+
'transfer': true,
|
|
101
109
|
'withdraw': true,
|
|
102
110
|
},
|
|
103
111
|
'timeframes': {
|
|
@@ -1530,7 +1538,16 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
1530
1538
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
1531
1539
|
* @param {float} [price] the price of the order, in units of the quote currency, ignored in market orders
|
|
1532
1540
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1533
|
-
* @
|
|
1541
|
+
* @param {float} [params.stopPrice] The price at which a trigger order is triggered at
|
|
1542
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1543
|
+
* @param {bool} [params.postOnly]
|
|
1544
|
+
* @param {bool} [params.reduceOnly] Ensures that the executed order does not flip the opened position.
|
|
1545
|
+
* @param {int} [params.flags] additional order parameters: 4096 (Post Only), 1024 (Reduce Only), 16384 (OCO), 64 (Hidden), 512 (Close), 524288 (No Var Rates)
|
|
1546
|
+
* @param {int} [params.lev] leverage for a derivative order, supported by derivative symbol orders only. The value should be between 1 and 100 inclusive.
|
|
1547
|
+
* @param {string} [params.price_traling] The trailing price for a trailing stop order
|
|
1548
|
+
* @param {string} [params.price_aux_limit] Order price for stop limit orders
|
|
1549
|
+
* @param {string} [params.price_oco_stop] OCO stop price
|
|
1550
|
+
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1534
1551
|
*/
|
|
1535
1552
|
const market = this.market(symbol);
|
|
1536
1553
|
let amountString = this.amountToPrecision(symbol, amount);
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -2928,8 +2928,15 @@ class bitget extends bitget$1 {
|
|
|
2928
2928
|
const currencyCode = this.safeCurrencyCode(this.safeString(feeStructure, 'feeCoin'));
|
|
2929
2929
|
fee = {
|
|
2930
2930
|
'currency': currencyCode,
|
|
2931
|
-
'cost': Precise["default"].stringAbs(this.safeString(feeStructure, 'totalFee')),
|
|
2932
2931
|
};
|
|
2932
|
+
const feeCostString = this.safeString(feeStructure, 'totalFee');
|
|
2933
|
+
const deduction = this.safeString(feeStructure, 'deduction') === 'yes' ? true : false;
|
|
2934
|
+
if (deduction) {
|
|
2935
|
+
fee['cost'] = feeCostString;
|
|
2936
|
+
}
|
|
2937
|
+
else {
|
|
2938
|
+
fee['cost'] = Precise["default"].stringNeg(feeCostString);
|
|
2939
|
+
}
|
|
2933
2940
|
}
|
|
2934
2941
|
return this.safeTrade({
|
|
2935
2942
|
'info': trade,
|
|
@@ -4028,7 +4035,7 @@ class bitget extends bitget$1 {
|
|
|
4028
4035
|
* @see https://www.bitget.com/api-doc/margin/isolated/trade/Isolated-Place-Order
|
|
4029
4036
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
4030
4037
|
* @param {string} type 'market' or 'limit'
|
|
4031
|
-
* @param {string} side 'buy' or 'sell'
|
|
4038
|
+
* @param {string} side 'buy' or 'sell'
|
|
4032
4039
|
* @param {float} amount how much you want to trade in units of the base currency
|
|
4033
4040
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
4034
4041
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -512,6 +512,7 @@ class bitmart extends bitmart$1 {
|
|
|
512
512
|
},
|
|
513
513
|
'networks': {
|
|
514
514
|
'ERC20': 'ERC20',
|
|
515
|
+
'SOL': 'SOL',
|
|
515
516
|
'BTC': 'BTC',
|
|
516
517
|
'TRC20': 'TRC20',
|
|
517
518
|
// todo: should be TRX after unification
|
|
@@ -534,7 +535,6 @@ class bitmart extends bitmart$1 {
|
|
|
534
535
|
'FIO': 'FIO',
|
|
535
536
|
'SCRT': 'SCRT',
|
|
536
537
|
'IOTX': 'IOTX',
|
|
537
|
-
'SOL': 'SOL',
|
|
538
538
|
'ALGO': 'ALGO',
|
|
539
539
|
'ATOM': 'ATOM',
|
|
540
540
|
'DOT': 'DOT',
|
|
@@ -3087,6 +3087,7 @@ class bitmart extends bitmart$1 {
|
|
|
3087
3087
|
* @method
|
|
3088
3088
|
* @name bitmart#fetchDepositAddress
|
|
3089
3089
|
* @description fetch the deposit address for a currency associated with this account
|
|
3090
|
+
* @see https://developer-pro.bitmart.com/en/spot/#deposit-address-keyed
|
|
3090
3091
|
* @param {string} code unified currency code
|
|
3091
3092
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3092
3093
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
@@ -3109,40 +3110,57 @@ class bitmart extends bitmart$1 {
|
|
|
3109
3110
|
}
|
|
3110
3111
|
const response = await this.privateGetAccountV1DepositAddress(this.extend(request, params));
|
|
3111
3112
|
//
|
|
3112
|
-
//
|
|
3113
|
-
//
|
|
3114
|
-
//
|
|
3115
|
-
//
|
|
3116
|
-
//
|
|
3117
|
-
//
|
|
3118
|
-
//
|
|
3119
|
-
//
|
|
3120
|
-
//
|
|
3121
|
-
//
|
|
3122
|
-
//
|
|
3113
|
+
// {
|
|
3114
|
+
// "message": "OK",
|
|
3115
|
+
// "code": 1000,
|
|
3116
|
+
// "trace": "0e6edd79-f77f-4251-abe5-83ba75d06c1a",
|
|
3117
|
+
// "data": {
|
|
3118
|
+
// currency: 'ETH',
|
|
3119
|
+
// chain: 'Ethereum',
|
|
3120
|
+
// address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
|
|
3121
|
+
// address_memo: ''
|
|
3122
|
+
// }
|
|
3123
|
+
// }
|
|
3123
3124
|
//
|
|
3124
3125
|
const data = this.safeValue(response, 'data', {});
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3126
|
+
return this.parseDepositAddress(data, currency);
|
|
3127
|
+
}
|
|
3128
|
+
parseDepositAddress(depositAddress, currency = undefined) {
|
|
3129
|
+
//
|
|
3130
|
+
// {
|
|
3131
|
+
// currency: 'ETH',
|
|
3132
|
+
// chain: 'Ethereum',
|
|
3133
|
+
// address: '0x99B5EEc2C520f86F0F62F05820d28D05D36EccCf',
|
|
3134
|
+
// address_memo: ''
|
|
3135
|
+
// }
|
|
3136
|
+
//
|
|
3137
|
+
const currencyId = this.safeString(depositAddress, 'currency');
|
|
3138
|
+
const address = this.safeString(depositAddress, 'address');
|
|
3139
|
+
const chain = this.safeString(depositAddress, 'chain');
|
|
3128
3140
|
let network = undefined;
|
|
3141
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
3129
3142
|
if (chain !== undefined) {
|
|
3130
3143
|
const parts = chain.split('-');
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3144
|
+
const partsLength = parts.length;
|
|
3145
|
+
const networkId = this.safeString(parts, partsLength - 1);
|
|
3146
|
+
network = this.safeNetworkCode(networkId, currency);
|
|
3133
3147
|
}
|
|
3134
3148
|
this.checkAddress(address);
|
|
3135
3149
|
return {
|
|
3136
|
-
'
|
|
3150
|
+
'info': depositAddress,
|
|
3151
|
+
'currency': this.safeString(currency, 'code'),
|
|
3137
3152
|
'address': address,
|
|
3138
|
-
'tag':
|
|
3153
|
+
'tag': this.safeString(depositAddress, 'address_memo'),
|
|
3139
3154
|
'network': network,
|
|
3140
|
-
'info': response,
|
|
3141
3155
|
};
|
|
3142
3156
|
}
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3157
|
+
safeNetworkCode(networkId, currency = undefined) {
|
|
3158
|
+
const name = this.safeString(currency, 'name');
|
|
3159
|
+
if (networkId === name) {
|
|
3160
|
+
const code = this.safeString(currency, 'code');
|
|
3161
|
+
return code;
|
|
3162
|
+
}
|
|
3163
|
+
return this.networkIdToCode(networkId);
|
|
3146
3164
|
}
|
|
3147
3165
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
3148
3166
|
/**
|
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -80,6 +80,7 @@ class blofin extends blofin$1 {
|
|
|
80
80
|
'fetchLedger': true,
|
|
81
81
|
'fetchLedgerEntry': undefined,
|
|
82
82
|
'fetchLeverage': true,
|
|
83
|
+
'fetchLeverages': true,
|
|
83
84
|
'fetchLeverageTiers': false,
|
|
84
85
|
'fetchMarketLeverageTiers': false,
|
|
85
86
|
'fetchMarkets': true,
|
|
@@ -184,6 +185,7 @@ class blofin extends blofin$1 {
|
|
|
184
185
|
'account/balance': 1,
|
|
185
186
|
'account/positions': 1,
|
|
186
187
|
'account/leverage-info': 1,
|
|
188
|
+
'account/batch-leverage-info': 1,
|
|
187
189
|
'trade/orders-tpsl-pending': 1,
|
|
188
190
|
'trade/orders-history': 1,
|
|
189
191
|
'trade/orders-tpsl-history': 1,
|
|
@@ -1881,12 +1883,68 @@ class blofin extends blofin$1 {
|
|
|
1881
1883
|
'takeProfitPrice': undefined,
|
|
1882
1884
|
});
|
|
1883
1885
|
}
|
|
1886
|
+
async fetchLeverages(symbols = undefined, params = {}) {
|
|
1887
|
+
/**
|
|
1888
|
+
* @method
|
|
1889
|
+
* @name blofin#fetchLeverages
|
|
1890
|
+
* @description fetch the set leverage for all contract markets
|
|
1891
|
+
* @see https://docs.blofin.com/index.html#get-multiple-leverage
|
|
1892
|
+
* @param {string[]} symbols a list of unified market symbols, required on blofin
|
|
1893
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1894
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
1895
|
+
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
1896
|
+
*/
|
|
1897
|
+
await this.loadMarkets();
|
|
1898
|
+
if (symbols === undefined) {
|
|
1899
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchLeverages() requires a symbols argument');
|
|
1900
|
+
}
|
|
1901
|
+
let marginMode = undefined;
|
|
1902
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchLeverages', params);
|
|
1903
|
+
if (marginMode === undefined) {
|
|
1904
|
+
marginMode = this.safeString(params, 'marginMode', 'cross'); // cross as default marginMode
|
|
1905
|
+
}
|
|
1906
|
+
if ((marginMode !== 'cross') && (marginMode !== 'isolated')) {
|
|
1907
|
+
throw new errors.BadRequest(this.id + ' fetchLeverages() requires a marginMode parameter that must be either cross or isolated');
|
|
1908
|
+
}
|
|
1909
|
+
symbols = this.marketSymbols(symbols);
|
|
1910
|
+
let instIds = '';
|
|
1911
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
1912
|
+
const entry = symbols[i];
|
|
1913
|
+
const entryMarket = this.market(entry);
|
|
1914
|
+
if (i > 0) {
|
|
1915
|
+
instIds = instIds + ',' + entryMarket['id'];
|
|
1916
|
+
}
|
|
1917
|
+
else {
|
|
1918
|
+
instIds = instIds + entryMarket['id'];
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
const request = {
|
|
1922
|
+
'instId': instIds,
|
|
1923
|
+
'marginMode': marginMode,
|
|
1924
|
+
};
|
|
1925
|
+
const response = await this.privateGetAccountBatchLeverageInfo(this.extend(request, params));
|
|
1926
|
+
//
|
|
1927
|
+
// {
|
|
1928
|
+
// "code": "0",
|
|
1929
|
+
// "msg": "success",
|
|
1930
|
+
// "data": [
|
|
1931
|
+
// {
|
|
1932
|
+
// "leverage": "3",
|
|
1933
|
+
// "marginMode": "cross",
|
|
1934
|
+
// "instId": "BTC-USDT"
|
|
1935
|
+
// },
|
|
1936
|
+
// ]
|
|
1937
|
+
// }
|
|
1938
|
+
//
|
|
1939
|
+
const leverages = this.safeList(response, 'data', []);
|
|
1940
|
+
return this.parseLeverages(leverages, symbols, 'instId');
|
|
1941
|
+
}
|
|
1884
1942
|
async fetchLeverage(symbol, params = {}) {
|
|
1885
1943
|
/**
|
|
1886
1944
|
* @method
|
|
1887
1945
|
* @name blofin#fetchLeverage
|
|
1888
1946
|
* @description fetch the set leverage for a market
|
|
1889
|
-
* @see https://blofin.com/
|
|
1947
|
+
* @see https://docs.blofin.com/index.html#get-leverage
|
|
1890
1948
|
* @param {string} symbol unified market symbol
|
|
1891
1949
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1892
1950
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|