ccxt 4.2.89 → 4.2.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -16
- package/README.md +3 -3
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +1167 -274
- package/dist/ccxt.browser.min.js +6 -4
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/base/Exchange.js +39 -9
- package/dist/cjs/src/base/functions/crypto.js +37 -0
- package/dist/cjs/src/base/functions/rsa.js +19 -4
- package/dist/cjs/src/binance.js +90 -9
- package/dist/cjs/src/bingx.js +101 -1
- package/dist/cjs/src/bitfinex2.js +1 -0
- package/dist/cjs/src/bitget.js +2 -0
- package/dist/cjs/src/bitmex.js +1 -0
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bybit.js +61 -0
- package/dist/cjs/src/coinbase.js +51 -25
- package/dist/cjs/src/coinbaseinternational.js +1 -0
- package/dist/cjs/src/coinex.js +102 -8
- package/dist/cjs/src/cryptocom.js +1 -0
- package/dist/cjs/src/delta.js +1 -0
- package/dist/cjs/src/digifinex.js +1 -0
- package/dist/cjs/src/exmo.js +1 -0
- package/dist/cjs/src/gate.js +2 -0
- package/dist/cjs/src/gemini.js +12 -10
- package/dist/cjs/src/hitbtc.js +1 -0
- package/dist/cjs/src/htx.js +1 -0
- package/dist/cjs/src/hyperliquid.js +1 -0
- package/dist/cjs/src/kraken.js +11 -9
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/kucoinfutures.js +34 -3
- package/dist/cjs/src/mexc.js +1 -0
- package/dist/cjs/src/okx.js +187 -38
- package/dist/cjs/src/phemex.js +1 -0
- package/dist/cjs/src/pro/bitmex.js +39 -18
- package/dist/cjs/src/pro/kucoin.js +91 -0
- package/dist/cjs/src/pro/kucoinfutures.js +151 -82
- package/dist/cjs/src/static_dependencies/noble-curves/p256.js +48 -0
- package/dist/cjs/src/woo.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +2 -0
- package/js/src/abstract/bybit.d.ts +2 -0
- package/js/src/ascendex.js +1 -0
- package/js/src/base/Exchange.d.ts +5 -0
- package/js/src/base/Exchange.js +39 -9
- package/js/src/base/functions/crypto.js +37 -0
- package/js/src/base/functions/rsa.d.ts +1 -1
- package/js/src/base/functions/rsa.js +21 -5
- package/js/src/base/types.d.ts +1 -0
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +90 -9
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +101 -1
- package/js/src/bitfinex2.js +1 -0
- package/js/src/bitget.js +2 -0
- package/js/src/bitmex.js +1 -0
- package/js/src/bitrue.js +1 -0
- package/js/src/bybit.d.ts +2 -0
- package/js/src/bybit.js +61 -0
- package/js/src/coinbase.js +51 -25
- package/js/src/coinbaseinternational.js +1 -0
- package/js/src/coinex.d.ts +2 -0
- package/js/src/coinex.js +102 -8
- package/js/src/cryptocom.js +1 -0
- package/js/src/delta.js +1 -0
- package/js/src/digifinex.js +1 -0
- package/js/src/exmo.js +1 -0
- package/js/src/gate.js +2 -0
- package/js/src/gemini.js +12 -10
- package/js/src/hitbtc.js +1 -0
- package/js/src/htx.js +1 -0
- package/js/src/hyperliquid.js +1 -0
- package/js/src/kraken.js +11 -9
- package/js/src/kucoin.js +1 -0
- package/js/src/kucoinfutures.d.ts +2 -9
- package/js/src/kucoinfutures.js +34 -3
- package/js/src/mexc.js +1 -0
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +187 -38
- package/js/src/phemex.js +1 -0
- package/js/src/pro/bitmex.d.ts +1 -0
- package/js/src/pro/bitmex.js +39 -18
- package/js/src/pro/kucoin.d.ts +4 -0
- package/js/src/pro/kucoin.js +91 -0
- package/js/src/pro/kucoinfutures.d.ts +9 -5
- package/js/src/pro/kucoinfutures.js +151 -82
- package/js/src/woo.js +1 -0
- package/package.json +1 -1
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -5,6 +5,7 @@ var errors = require('./base/errors.js');
|
|
|
5
5
|
var Precise = require('./base/Precise.js');
|
|
6
6
|
var number = require('./base/functions/number.js');
|
|
7
7
|
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
8
|
+
var rsa = require('./base/functions/rsa.js');
|
|
8
9
|
|
|
9
10
|
// ----------------------------------------------------------------------------
|
|
10
11
|
// ----------------------------------------------------------------------------
|
|
@@ -327,6 +328,7 @@ class coinbase extends coinbase$1 {
|
|
|
327
328
|
'CGLD': 'CELO',
|
|
328
329
|
},
|
|
329
330
|
'options': {
|
|
331
|
+
'brokerId': 'ccxt',
|
|
330
332
|
'stablePairs': ['BUSD-USD', 'CBETH-ETH', 'DAI-USD', 'GUSD-USD', 'GYEN-USD', 'PAX-USD', 'PAX-USDT', 'USDC-EUR', 'USDC-GBP', 'USDT-EUR', 'USDT-GBP', 'USDT-USD', 'USDT-USDC', 'WBTC-BTC'],
|
|
331
333
|
'fetchCurrencies': {
|
|
332
334
|
'expires': 5000,
|
|
@@ -2337,8 +2339,9 @@ class coinbase extends coinbase$1 {
|
|
|
2337
2339
|
*/
|
|
2338
2340
|
await this.loadMarkets();
|
|
2339
2341
|
const market = this.market(symbol);
|
|
2342
|
+
const id = this.safeString(this.options, 'brokerId', 'ccxt');
|
|
2340
2343
|
let request = {
|
|
2341
|
-
'client_order_id': this.uuid(),
|
|
2344
|
+
'client_order_id': id + '-' + this.uuid(),
|
|
2342
2345
|
'product_id': market['id'],
|
|
2343
2346
|
'side': side.toUpperCase(),
|
|
2344
2347
|
};
|
|
@@ -3783,31 +3786,16 @@ class coinbase extends coinbase$1 {
|
|
|
3783
3786
|
const url = this.urls['api']['rest'] + fullPath;
|
|
3784
3787
|
if (signed) {
|
|
3785
3788
|
const authorization = this.safeString(this.headers, 'Authorization');
|
|
3789
|
+
let authorizationString = undefined;
|
|
3786
3790
|
if (authorization !== undefined) {
|
|
3787
|
-
|
|
3788
|
-
'Authorization': authorization,
|
|
3789
|
-
'Content-Type': 'application/json',
|
|
3790
|
-
};
|
|
3791
|
-
if (method !== 'GET') {
|
|
3792
|
-
if (Object.keys(query).length) {
|
|
3793
|
-
body = this.json(query);
|
|
3794
|
-
}
|
|
3795
|
-
}
|
|
3791
|
+
authorizationString = authorization;
|
|
3796
3792
|
}
|
|
3797
3793
|
else if (this.token && !this.checkRequiredCredentials(false)) {
|
|
3798
|
-
|
|
3799
|
-
'Authorization': 'Bearer ' + this.token,
|
|
3800
|
-
'Content-Type': 'application/json',
|
|
3801
|
-
};
|
|
3802
|
-
if (method !== 'GET') {
|
|
3803
|
-
if (Object.keys(query).length) {
|
|
3804
|
-
body = this.json(query);
|
|
3805
|
-
}
|
|
3806
|
-
}
|
|
3794
|
+
authorizationString = 'Bearer ' + this.token;
|
|
3807
3795
|
}
|
|
3808
3796
|
else {
|
|
3809
3797
|
this.checkRequiredCredentials();
|
|
3810
|
-
const
|
|
3798
|
+
const seconds = this.seconds();
|
|
3811
3799
|
let payload = '';
|
|
3812
3800
|
if (method !== 'GET') {
|
|
3813
3801
|
if (Object.keys(query).length) {
|
|
@@ -3826,14 +3814,52 @@ class coinbase extends coinbase$1 {
|
|
|
3826
3814
|
// https://docs.cloud.coinbase.com/advanced-trade-api/docs/auth#example-request
|
|
3827
3815
|
// v2: 'GET' require payload in the signature
|
|
3828
3816
|
// https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-key-authentication
|
|
3829
|
-
const
|
|
3830
|
-
|
|
3817
|
+
const isCloudAPiKey = (this.apiKey.indexOf('organizations/') >= 0) || (this.secret.startsWith('-----BEGIN'));
|
|
3818
|
+
if (isCloudAPiKey) {
|
|
3819
|
+
if (this.apiKey.startsWith('-----BEGIN')) {
|
|
3820
|
+
throw new errors.ArgumentsRequired(this.id + ' apiKey should contain the name (eg: organizations/3b910e93....) and not the public key');
|
|
3821
|
+
}
|
|
3822
|
+
// it may not work for v2
|
|
3823
|
+
let uri = method + ' ' + url.replace('https://', '');
|
|
3824
|
+
const quesPos = uri.indexOf('?');
|
|
3825
|
+
if (quesPos >= 0) {
|
|
3826
|
+
uri = uri.slice(0, quesPos);
|
|
3827
|
+
}
|
|
3828
|
+
const nonce = this.randomBytes(16);
|
|
3829
|
+
const request = {
|
|
3830
|
+
'aud': ['retail_rest_api_proxy'],
|
|
3831
|
+
'iss': 'coinbase-cloud',
|
|
3832
|
+
'nbf': seconds,
|
|
3833
|
+
'exp': seconds + 120,
|
|
3834
|
+
'sub': this.apiKey,
|
|
3835
|
+
'uri': uri,
|
|
3836
|
+
'iat': seconds,
|
|
3837
|
+
};
|
|
3838
|
+
const token = rsa.jwt(request, this.encode(this.secret), sha256.sha256, false, { 'kid': this.apiKey, 'nonce': nonce, 'alg': 'ES256' });
|
|
3839
|
+
authorizationString = 'Bearer ' + token;
|
|
3840
|
+
}
|
|
3841
|
+
else {
|
|
3842
|
+
const timestampString = this.seconds().toString();
|
|
3843
|
+
const auth = timestampString + method + savedPath + payload;
|
|
3844
|
+
const signature = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
|
|
3845
|
+
headers = {
|
|
3846
|
+
'CB-ACCESS-KEY': this.apiKey,
|
|
3847
|
+
'CB-ACCESS-SIGN': signature,
|
|
3848
|
+
'CB-ACCESS-TIMESTAMP': timestampString,
|
|
3849
|
+
'Content-Type': 'application/json',
|
|
3850
|
+
};
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
if (authorizationString !== undefined) {
|
|
3831
3854
|
headers = {
|
|
3832
|
-
'
|
|
3833
|
-
'CB-ACCESS-SIGN': signature,
|
|
3834
|
-
'CB-ACCESS-TIMESTAMP': timestampString,
|
|
3855
|
+
'Authorization': authorizationString,
|
|
3835
3856
|
'Content-Type': 'application/json',
|
|
3836
3857
|
};
|
|
3858
|
+
if (method !== 'GET') {
|
|
3859
|
+
if (Object.keys(query).length) {
|
|
3860
|
+
body = this.json(query);
|
|
3861
|
+
}
|
|
3862
|
+
}
|
|
3837
3863
|
}
|
|
3838
3864
|
}
|
|
3839
3865
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
@@ -76,6 +76,7 @@ class coinbaseinternational extends coinbaseinternational$1 {
|
|
|
76
76
|
'fetchLedger': false,
|
|
77
77
|
'fetchLeverage': false,
|
|
78
78
|
'fetchLeverageTiers': false,
|
|
79
|
+
'fetchMarginAdjustmentHistory': false,
|
|
79
80
|
'fetchMarginMode': false,
|
|
80
81
|
'fetchMarkets': true,
|
|
81
82
|
'fetchMarkOHLCV': false,
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -80,6 +80,7 @@ class coinex extends coinex$1 {
|
|
|
80
80
|
'fetchLeverage': 'emulated',
|
|
81
81
|
'fetchLeverages': true,
|
|
82
82
|
'fetchLeverageTiers': true,
|
|
83
|
+
'fetchMarginAdjustmentHistory': true,
|
|
83
84
|
'fetchMarketLeverageTiers': 'emulated',
|
|
84
85
|
'fetchMarkets': true,
|
|
85
86
|
'fetchMarkOHLCV': false,
|
|
@@ -4239,11 +4240,10 @@ class coinex extends coinex$1 {
|
|
|
4239
4240
|
// "message":"OK"
|
|
4240
4241
|
// }
|
|
4241
4242
|
//
|
|
4243
|
+
const data = this.safeDict(response, 'data');
|
|
4242
4244
|
const status = this.safeString(response, 'message');
|
|
4243
|
-
|
|
4244
|
-
return this.extend(this.parseMarginModification(response, market), {
|
|
4245
|
+
return this.extend(this.parseMarginModification(data, market), {
|
|
4245
4246
|
'amount': this.parseNumber(amount),
|
|
4246
|
-
'type': type,
|
|
4247
4247
|
'status': status,
|
|
4248
4248
|
});
|
|
4249
4249
|
}
|
|
@@ -4303,13 +4303,34 @@ class coinex extends coinex$1 {
|
|
|
4303
4303
|
// "user_id": 3620173
|
|
4304
4304
|
// }
|
|
4305
4305
|
//
|
|
4306
|
-
|
|
4306
|
+
// fetchMarginAdjustmentHistory
|
|
4307
|
+
//
|
|
4308
|
+
// {
|
|
4309
|
+
// bkr_price: '0',
|
|
4310
|
+
// leverage: '3',
|
|
4311
|
+
// liq_price: '0',
|
|
4312
|
+
// margin_amount: '5.33236666666666666666',
|
|
4313
|
+
// margin_change: '3',
|
|
4314
|
+
// market: 'XRPUSDT',
|
|
4315
|
+
// position_amount: '11',
|
|
4316
|
+
// position_id: '297155652',
|
|
4317
|
+
// position_type: '2',
|
|
4318
|
+
// settle_price: '0.6361',
|
|
4319
|
+
// time: '1711050906.382891',
|
|
4320
|
+
// type: '1',
|
|
4321
|
+
// user_id: '3685860'
|
|
4322
|
+
// }
|
|
4323
|
+
//
|
|
4324
|
+
const marketId = this.safeString(data, 'market');
|
|
4325
|
+
const type = this.safeString(data, 'type');
|
|
4326
|
+
const timestamp = this.safeIntegerProduct2(data, 'time', 'update_time', 1000);
|
|
4307
4327
|
return {
|
|
4308
4328
|
'info': data,
|
|
4309
|
-
'symbol': this.safeSymbol(undefined,
|
|
4310
|
-
'type':
|
|
4311
|
-
'
|
|
4312
|
-
'
|
|
4329
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4330
|
+
'type': (type === '1') ? 'add' : 'reduce',
|
|
4331
|
+
'marginMode': 'isolated',
|
|
4332
|
+
'amount': this.safeNumber(data, 'margin_change'),
|
|
4333
|
+
'total': this.safeNumber(data, 'position_amount'),
|
|
4313
4334
|
'code': market['quote'],
|
|
4314
4335
|
'status': undefined,
|
|
4315
4336
|
'timestamp': timestamp,
|
|
@@ -4960,6 +4981,7 @@ class coinex extends coinex$1 {
|
|
|
4960
4981
|
const currencyId = this.safeString(transfer, 'asset');
|
|
4961
4982
|
const currencyCode = this.safeCurrencyCode(currencyId, currency);
|
|
4962
4983
|
return {
|
|
4984
|
+
'info': transfer,
|
|
4963
4985
|
'id': this.safeInteger(transfer, 'id'),
|
|
4964
4986
|
'timestamp': timestamp,
|
|
4965
4987
|
'datetime': this.iso8601(timestamp),
|
|
@@ -5792,6 +5814,78 @@ class coinex extends coinex$1 {
|
|
|
5792
5814
|
}
|
|
5793
5815
|
return undefined;
|
|
5794
5816
|
}
|
|
5817
|
+
async fetchMarginAdjustmentHistory(symbol = undefined, type = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5818
|
+
/**
|
|
5819
|
+
* @method
|
|
5820
|
+
* @name coinex#fetchMarginAdjustmentHistory
|
|
5821
|
+
* @description fetches the history of margin added or reduced from contract isolated positions
|
|
5822
|
+
* @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http046_position_margin_history
|
|
5823
|
+
* @param {string} [symbol] unified market symbol
|
|
5824
|
+
* @param {string} [type] not used by coinex fetchMarginAdjustmentHistory
|
|
5825
|
+
* @param {int} [since] timestamp in ms of the earliest change to fetch
|
|
5826
|
+
* @param {int} [limit] the maximum amount of changes to fetch, default=100, max=100
|
|
5827
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
5828
|
+
* @param {int} [params.until] timestamp in ms of the latest change to fetch
|
|
5829
|
+
*
|
|
5830
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5831
|
+
* @param {int} [params.offset] offset
|
|
5832
|
+
* @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
5833
|
+
*/
|
|
5834
|
+
await this.loadMarkets();
|
|
5835
|
+
const until = this.safeInteger(params, 'until');
|
|
5836
|
+
params = this.omit(params, 'until');
|
|
5837
|
+
if (limit === undefined) {
|
|
5838
|
+
limit = 100;
|
|
5839
|
+
}
|
|
5840
|
+
const request = {
|
|
5841
|
+
'market': '',
|
|
5842
|
+
'position_id': 0,
|
|
5843
|
+
'offset': 0,
|
|
5844
|
+
'limit': limit,
|
|
5845
|
+
};
|
|
5846
|
+
if (symbol !== undefined) {
|
|
5847
|
+
const market = this.market(symbol);
|
|
5848
|
+
request['market'] = market['id'];
|
|
5849
|
+
}
|
|
5850
|
+
if (since !== undefined) {
|
|
5851
|
+
request['start_time'] = since;
|
|
5852
|
+
}
|
|
5853
|
+
if (until !== undefined) {
|
|
5854
|
+
request['end_time'] = until;
|
|
5855
|
+
}
|
|
5856
|
+
const response = await this.v1PerpetualPrivateGetPositionMarginHistory(this.extend(request, params));
|
|
5857
|
+
//
|
|
5858
|
+
// {
|
|
5859
|
+
// code: '0',
|
|
5860
|
+
// data: {
|
|
5861
|
+
// limit: '100',
|
|
5862
|
+
// offset: '0',
|
|
5863
|
+
// records: [
|
|
5864
|
+
// {
|
|
5865
|
+
// bkr_price: '0',
|
|
5866
|
+
// leverage: '3',
|
|
5867
|
+
// liq_price: '0',
|
|
5868
|
+
// margin_amount: '5.33236666666666666666',
|
|
5869
|
+
// margin_change: '3',
|
|
5870
|
+
// market: 'XRPUSDT',
|
|
5871
|
+
// position_amount: '11',
|
|
5872
|
+
// position_id: '297155652',
|
|
5873
|
+
// position_type: '2',
|
|
5874
|
+
// settle_price: '0.6361',
|
|
5875
|
+
// time: '1711050906.382891',
|
|
5876
|
+
// type: '1',
|
|
5877
|
+
// user_id: '3685860'
|
|
5878
|
+
// }
|
|
5879
|
+
// ]
|
|
5880
|
+
// },
|
|
5881
|
+
// message: 'OK'
|
|
5882
|
+
// }
|
|
5883
|
+
//
|
|
5884
|
+
const data = this.safeDict(response, 'data', {});
|
|
5885
|
+
const records = this.safeList(data, 'records', []);
|
|
5886
|
+
const modifications = this.parseMarginModifications(records, undefined, 'market', 'swap');
|
|
5887
|
+
return this.filterBySymbolSinceLimit(modifications, symbol, since, limit);
|
|
5888
|
+
}
|
|
5795
5889
|
}
|
|
5796
5890
|
|
|
5797
5891
|
module.exports = coinex;
|
package/dist/cjs/src/delta.js
CHANGED
|
@@ -4135,6 +4135,7 @@ class digifinex extends digifinex$1 {
|
|
|
4135
4135
|
'info': data,
|
|
4136
4136
|
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4137
4137
|
'type': (rawType === 1) ? 'add' : 'reduce',
|
|
4138
|
+
'marginMode': 'isolated',
|
|
4138
4139
|
'amount': this.safeNumber(data, 'amount'),
|
|
4139
4140
|
'total': undefined,
|
|
4140
4141
|
'code': market['settle'],
|
package/dist/cjs/src/exmo.js
CHANGED
package/dist/cjs/src/gate.js
CHANGED
|
@@ -120,6 +120,7 @@ class gate extends gate$1 {
|
|
|
120
120
|
'fetchLeverages': true,
|
|
121
121
|
'fetchLeverageTiers': true,
|
|
122
122
|
'fetchLiquidations': true,
|
|
123
|
+
'fetchMarginAdjustmentHistory': false,
|
|
123
124
|
'fetchMarginMode': false,
|
|
124
125
|
'fetchMarketLeverageTiers': true,
|
|
125
126
|
'fetchMarkets': true,
|
|
@@ -6119,6 +6120,7 @@ class gate extends gate$1 {
|
|
|
6119
6120
|
'info': data,
|
|
6120
6121
|
'symbol': market['symbol'],
|
|
6121
6122
|
'type': undefined,
|
|
6123
|
+
'marginMode': 'isolated',
|
|
6122
6124
|
'amount': undefined,
|
|
6123
6125
|
'total': total,
|
|
6124
6126
|
'code': this.safeValue(market, 'quote'),
|
package/dist/cjs/src/gemini.js
CHANGED
|
@@ -107,6 +107,7 @@ class gemini extends gemini$1 {
|
|
|
107
107
|
// https://github.com/ccxt/ccxt/issues/7874
|
|
108
108
|
// https://github.com/ccxt/ccxt/issues/7894
|
|
109
109
|
'web': 'https://docs.gemini.com',
|
|
110
|
+
'webExchange': 'https://exchange.gemini.com',
|
|
110
111
|
},
|
|
111
112
|
'fees': [
|
|
112
113
|
'https://gemini.com/api-fee-schedule',
|
|
@@ -442,7 +443,8 @@ class gemini extends gemini$1 {
|
|
|
442
443
|
// '<td>0.01 USD', // quote currency price increment
|
|
443
444
|
// '</tr>'
|
|
444
445
|
// ]
|
|
445
|
-
|
|
446
|
+
let marketId = cells[0].replace('<td>', '');
|
|
447
|
+
marketId = marketId.replace('*', '');
|
|
446
448
|
// const base = this.safeCurrencyCode (baseId);
|
|
447
449
|
const minAmountString = cells[1].replace('<td>', '');
|
|
448
450
|
const minAmountParts = minAmountString.split(' ');
|
|
@@ -644,7 +646,7 @@ class gemini extends gemini$1 {
|
|
|
644
646
|
let quoteId = undefined;
|
|
645
647
|
let settleId = undefined;
|
|
646
648
|
let tickSize = undefined;
|
|
647
|
-
let
|
|
649
|
+
let amountPrecision = undefined;
|
|
648
650
|
let minSize = undefined;
|
|
649
651
|
let status = undefined;
|
|
650
652
|
let swap = false;
|
|
@@ -655,9 +657,9 @@ class gemini extends gemini$1 {
|
|
|
655
657
|
const isArray = (Array.isArray(response));
|
|
656
658
|
if (!isString && !isArray) {
|
|
657
659
|
marketId = this.safeStringLower(response, 'symbol');
|
|
660
|
+
amountPrecision = this.safeNumber(response, 'tick_size'); // right, exchange has an imperfect naming and this turns out to be an amount-precision
|
|
661
|
+
tickSize = this.safeNumber(response, 'quote_increment'); // this is tick-size actually
|
|
658
662
|
minSize = this.safeNumber(response, 'min_order_size');
|
|
659
|
-
tickSize = this.safeNumber(response, 'tick_size');
|
|
660
|
-
increment = this.safeNumber(response, 'quote_increment');
|
|
661
663
|
status = this.parseMarketActive(this.safeString(response, 'status'));
|
|
662
664
|
baseId = this.safeString(response, 'base_currency');
|
|
663
665
|
quoteId = this.safeString(response, 'quote_currency');
|
|
@@ -670,9 +672,9 @@ class gemini extends gemini$1 {
|
|
|
670
672
|
}
|
|
671
673
|
else {
|
|
672
674
|
marketId = this.safeStringLower(response, 0);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
tickSize = this.parseNumber(this.parsePrecision(this.safeString(response, 1))); // priceTickDecimalPlaces
|
|
676
|
+
amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(response, 2))); // quantityTickDecimalPlaces
|
|
677
|
+
minSize = this.safeNumber(response, 3); // quantityMinimum
|
|
676
678
|
}
|
|
677
679
|
const marketIdUpper = marketId.toUpperCase();
|
|
678
680
|
const isPerp = (marketIdUpper.indexOf('PERP') >= 0);
|
|
@@ -727,8 +729,8 @@ class gemini extends gemini$1 {
|
|
|
727
729
|
'strike': undefined,
|
|
728
730
|
'optionType': undefined,
|
|
729
731
|
'precision': {
|
|
730
|
-
'price':
|
|
731
|
-
'amount':
|
|
732
|
+
'price': tickSize,
|
|
733
|
+
'amount': amountPrecision,
|
|
732
734
|
},
|
|
733
735
|
'limits': {
|
|
734
736
|
'leverage': {
|
|
@@ -1802,7 +1804,7 @@ class gemini extends gemini$1 {
|
|
|
1802
1804
|
if (apiKey.indexOf('account') < 0) {
|
|
1803
1805
|
throw new errors.AuthenticationError(this.id + ' sign() requires an account-key, master-keys are not-supported');
|
|
1804
1806
|
}
|
|
1805
|
-
const nonce = this.nonce();
|
|
1807
|
+
const nonce = this.nonce().toString();
|
|
1806
1808
|
const request = this.extend({
|
|
1807
1809
|
'request': url,
|
|
1808
1810
|
'nonce': nonce,
|
package/dist/cjs/src/hitbtc.js
CHANGED
package/dist/cjs/src/htx.js
CHANGED
|
@@ -2137,6 +2137,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2137
2137
|
'info': data,
|
|
2138
2138
|
'symbol': this.safeSymbol(undefined, market),
|
|
2139
2139
|
'type': undefined,
|
|
2140
|
+
'marginMode': 'isolated',
|
|
2140
2141
|
'amount': undefined,
|
|
2141
2142
|
'total': undefined,
|
|
2142
2143
|
'code': this.safeString(market, 'settle'),
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -596,10 +596,7 @@ class kraken extends kraken$1 {
|
|
|
596
596
|
if (currencyId !== undefined) {
|
|
597
597
|
if (currencyId.length > 3) {
|
|
598
598
|
if ((currencyId.indexOf('X') === 0) || (currencyId.indexOf('Z') === 0)) {
|
|
599
|
-
if (currencyId.indexOf('.') > 0) {
|
|
600
|
-
return super.safeCurrency(currencyId, currency);
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
599
|
+
if (!(currencyId.indexOf('.') > 0)) {
|
|
603
600
|
currencyId = currencyId.slice(1);
|
|
604
601
|
}
|
|
605
602
|
}
|
|
@@ -648,8 +645,13 @@ class kraken extends kraken$1 {
|
|
|
648
645
|
// {
|
|
649
646
|
// "error": [],
|
|
650
647
|
// "result": {
|
|
651
|
-
// "
|
|
652
|
-
//
|
|
648
|
+
// "BCH": {
|
|
649
|
+
// "aclass": "currency",
|
|
650
|
+
// "altname": "BCH",
|
|
651
|
+
// "decimals": 10,
|
|
652
|
+
// "display_decimals": 5
|
|
653
|
+
// "status": "enabled",
|
|
654
|
+
// },
|
|
653
655
|
// ...
|
|
654
656
|
// },
|
|
655
657
|
// }
|
|
@@ -664,15 +666,15 @@ class kraken extends kraken$1 {
|
|
|
664
666
|
// see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
|
|
665
667
|
// to add support for multiple withdrawal/deposit methods and
|
|
666
668
|
// differentiated fees for each particular method
|
|
667
|
-
const code = this.safeCurrencyCode(
|
|
669
|
+
const code = this.safeCurrencyCode(id);
|
|
668
670
|
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
669
671
|
// assumes all currencies are active except those listed above
|
|
670
|
-
const active =
|
|
672
|
+
const active = this.safeString(currency, 'status') === 'enabled';
|
|
671
673
|
result[code] = {
|
|
672
674
|
'id': id,
|
|
673
675
|
'code': code,
|
|
674
676
|
'info': currency,
|
|
675
|
-
'name':
|
|
677
|
+
'name': this.safeString(currency, 'altname'),
|
|
676
678
|
'active': active,
|
|
677
679
|
'deposit': undefined,
|
|
678
680
|
'withdraw': undefined,
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -67,6 +67,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
67
67
|
'fetchL3OrderBook': true,
|
|
68
68
|
'fetchLedger': true,
|
|
69
69
|
'fetchLeverageTiers': false,
|
|
70
|
+
'fetchMarginAdjustmentHistory': false,
|
|
70
71
|
'fetchMarginMode': false,
|
|
71
72
|
'fetchMarketLeverageTiers': true,
|
|
72
73
|
'fetchMarkets': true,
|
|
@@ -1613,14 +1614,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1613
1614
|
const crossMode = this.safeValue(info, 'crossMode');
|
|
1614
1615
|
const mode = crossMode ? 'cross' : 'isolated';
|
|
1615
1616
|
const marketId = this.safeString(market, 'symbol');
|
|
1617
|
+
const timestamp = this.safeInteger(info, 'currentTimestamp');
|
|
1616
1618
|
return {
|
|
1617
1619
|
'info': info,
|
|
1618
|
-
'
|
|
1619
|
-
'
|
|
1620
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
1621
|
+
'type': undefined,
|
|
1622
|
+
'marginMode': mode,
|
|
1620
1623
|
'amount': undefined,
|
|
1624
|
+
'total': undefined,
|
|
1621
1625
|
'code': this.safeCurrencyCode(currencyId),
|
|
1622
|
-
'symbol': this.safeSymbol(marketId, market),
|
|
1623
1626
|
'status': undefined,
|
|
1627
|
+
'timestamp': timestamp,
|
|
1628
|
+
'datetime': this.iso8601(timestamp),
|
|
1624
1629
|
};
|
|
1625
1630
|
}
|
|
1626
1631
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1761,6 +1766,32 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1761
1766
|
}
|
|
1762
1767
|
return await this.fetchOrdersByStatus('done', symbol, since, limit, params);
|
|
1763
1768
|
}
|
|
1769
|
+
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1770
|
+
/**
|
|
1771
|
+
* @method
|
|
1772
|
+
* @name kucoinfutures#fetchOpenOrders
|
|
1773
|
+
* @description fetches information on multiple open orders made by the user
|
|
1774
|
+
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
1775
|
+
* @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
|
|
1776
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1777
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1778
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1779
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1780
|
+
* @param {int} [params.till] end time in ms
|
|
1781
|
+
* @param {string} [params.side] buy or sell
|
|
1782
|
+
* @param {string} [params.type] limit, or market
|
|
1783
|
+
* @param {boolean} [params.trigger] set to true to retrieve untriggered stop orders
|
|
1784
|
+
* @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)
|
|
1785
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1786
|
+
*/
|
|
1787
|
+
await this.loadMarkets();
|
|
1788
|
+
let paginate = false;
|
|
1789
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
1790
|
+
if (paginate) {
|
|
1791
|
+
return await this.fetchPaginatedCallDynamic('fetchOpenOrders', symbol, since, limit, params);
|
|
1792
|
+
}
|
|
1793
|
+
return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
|
|
1794
|
+
}
|
|
1764
1795
|
async fetchOrder(id = undefined, symbol = undefined, params = {}) {
|
|
1765
1796
|
/**
|
|
1766
1797
|
* @method
|
package/dist/cjs/src/mexc.js
CHANGED