ccxt 4.2.91 → 4.2.93
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/build.sh +1 -1
- package/dist/ccxt.browser.js +213 -205
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +33 -9
- package/dist/cjs/src/base/functions/encode.js +4 -4
- package/dist/cjs/src/bybit.js +1 -0
- package/dist/cjs/src/coinex.js +0 -30
- package/dist/cjs/src/deribit.js +114 -101
- package/dist/cjs/src/digifinex.js +1 -22
- package/dist/cjs/src/kraken.js +56 -7
- package/dist/cjs/src/probit.js +3 -4
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +8 -8
- package/js/src/base/Exchange.js +33 -9
- package/js/src/base/functions/encode.d.ts +1 -1
- package/js/src/base/functions/encode.js +4 -4
- package/js/src/base/functions/rsa.d.ts +1 -1
- package/js/src/bybit.js +1 -0
- package/js/src/coinex.d.ts +0 -1
- package/js/src/coinex.js +0 -30
- package/js/src/deribit.js +114 -101
- package/js/src/digifinex.d.ts +0 -1
- package/js/src/digifinex.js +1 -49
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +56 -7
- package/js/src/probit.d.ts +1 -1
- package/js/src/probit.js +3 -4
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -182,7 +182,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
182
182
|
|
|
183
183
|
//-----------------------------------------------------------------------------
|
|
184
184
|
// this is updated by vss.js when building
|
|
185
|
-
const version = '4.2.
|
|
185
|
+
const version = '4.2.93';
|
|
186
186
|
Exchange["default"].ccxtVersion = version;
|
|
187
187
|
const exchanges = {
|
|
188
188
|
'ace': ace,
|
|
@@ -3447,14 +3447,34 @@ class Exchange {
|
|
|
3447
3447
|
// marketIdKey should only be undefined when response is a dictionary
|
|
3448
3448
|
symbols = this.marketSymbols(symbols);
|
|
3449
3449
|
const tiers = {};
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3450
|
+
let symbolsLength = 0;
|
|
3451
|
+
if (symbols !== undefined) {
|
|
3452
|
+
symbolsLength = symbols.length;
|
|
3453
|
+
}
|
|
3454
|
+
const noSymbols = (symbols === undefined) || (symbolsLength === 0);
|
|
3455
|
+
if (Array.isArray(response)) {
|
|
3456
|
+
for (let i = 0; i < response.length; i++) {
|
|
3457
|
+
const item = response[i];
|
|
3458
|
+
const id = this.safeString(item, marketIdKey);
|
|
3459
|
+
const market = this.safeMarket(id, undefined, undefined, 'swap');
|
|
3460
|
+
const symbol = market['symbol'];
|
|
3461
|
+
const contract = this.safeBool(market, 'contract', false);
|
|
3462
|
+
if (contract && (noSymbols || this.inArray(symbol, symbols))) {
|
|
3463
|
+
tiers[symbol] = this.parseMarketLeverageTiers(item, market);
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
}
|
|
3467
|
+
else {
|
|
3468
|
+
const keys = Object.keys(response);
|
|
3469
|
+
for (let i = 0; i < keys.length; i++) {
|
|
3470
|
+
const marketId = keys[i];
|
|
3471
|
+
const item = response[marketId];
|
|
3472
|
+
const market = this.safeMarket(marketId, undefined, undefined, 'swap');
|
|
3473
|
+
const symbol = market['symbol'];
|
|
3474
|
+
const contract = this.safeBool(market, 'contract', false);
|
|
3475
|
+
if (contract && (noSymbols || this.inArray(symbol, symbols))) {
|
|
3476
|
+
tiers[symbol] = this.parseMarketLeverageTiers(item, market);
|
|
3477
|
+
}
|
|
3458
3478
|
}
|
|
3459
3479
|
}
|
|
3460
3480
|
return tiers;
|
|
@@ -5807,7 +5827,7 @@ class Exchange {
|
|
|
5807
5827
|
return reconstructedDate;
|
|
5808
5828
|
}
|
|
5809
5829
|
convertMarketIdExpireDate(date) {
|
|
5810
|
-
// parse
|
|
5830
|
+
// parse 03JAN24 to 240103
|
|
5811
5831
|
const monthMappping = {
|
|
5812
5832
|
'JAN': '01',
|
|
5813
5833
|
'FEB': '02',
|
|
@@ -5822,6 +5842,10 @@ class Exchange {
|
|
|
5822
5842
|
'NOV': '11',
|
|
5823
5843
|
'DEC': '12',
|
|
5824
5844
|
};
|
|
5845
|
+
// if exchange omits first zero and provides i.e. '3JAN24' instead of '03JAN24'
|
|
5846
|
+
if (date.length === 6) {
|
|
5847
|
+
date = '0' + date;
|
|
5848
|
+
}
|
|
5825
5849
|
const year = date.slice(0, 2);
|
|
5826
5850
|
const monthName = date.slice(2, 5);
|
|
5827
5851
|
const month = this.safeString(monthMappping, monthName);
|
|
@@ -9,13 +9,13 @@ var index$1 = require('../../static_dependencies/qs/index.cjs.js');
|
|
|
9
9
|
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
/* ------------------------------------------------------------------------ */
|
|
12
|
-
const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedObject = object => ((typeof object === 'string') &&
|
|
12
|
+
const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedObject = (object) => ((typeof object === 'string') &&
|
|
13
13
|
(object.length >= 2) &&
|
|
14
|
-
((object[0] === '{') || (object[0] === '['))), binaryToString = index.utf8.encode, stringToBinary = index.utf8.decode, stringToBase64 = string => index.base64.encode(index.utf8.decode(string)), base64ToString = string => index.utf8.encode(index.base64.decode(string)), base64ToBinary = index.base64.decode, binaryToBase64 = index.base64.encode, base16ToBinary = index.base16.decode, binaryToBase16 = index.base16.encode, base58ToBinary = index.base58.decode, binaryToBase58 = index.base58.encode, binaryConcat = utils.concatBytes, binaryConcatArray = (arr) => utils.concatBytes(...arr), urlencode = object => index$1.stringify(object), urlencodeNested = object => index$1.stringify(object) // implemented only in python
|
|
15
|
-
, urlencodeWithArrayRepeat = object => index$1.stringify(object, { arrayFormat: 'repeat' }), rawencode = object => index$1.stringify(object, { encode: false }), encode = index.utf8.decode // lol
|
|
14
|
+
((object[0] === '{') || (object[0] === '['))), binaryToString = index.utf8.encode, stringToBinary = index.utf8.decode, stringToBase64 = (string) => index.base64.encode(index.utf8.decode(string)), base64ToString = (string) => index.utf8.encode(index.base64.decode(string)), base64ToBinary = index.base64.decode, binaryToBase64 = index.base64.encode, base16ToBinary = index.base16.decode, binaryToBase16 = index.base16.encode, base58ToBinary = index.base58.decode, binaryToBase58 = index.base58.encode, binaryConcat = utils.concatBytes, binaryConcatArray = (arr) => utils.concatBytes(...arr), urlencode = (object) => index$1.stringify(object), urlencodeNested = (object) => index$1.stringify(object) // implemented only in python
|
|
15
|
+
, urlencodeWithArrayRepeat = (object) => index$1.stringify(object, { arrayFormat: 'repeat' }), rawencode = (object) => index$1.stringify(object, { encode: false }), encode = index.utf8.decode // lol
|
|
16
16
|
, decode = index.utf8.encode
|
|
17
17
|
// Url-safe-base64 without equals signs, with + replaced by - and slashes replaced by underscores
|
|
18
|
-
, urlencodeBase64 = base64string => base64string.replace(/[=]+$/, '')
|
|
18
|
+
, urlencodeBase64 = (base64string) => base64string.replace(/[=]+$/, '')
|
|
19
19
|
.replace(/\+/g, '-')
|
|
20
20
|
.replace(/\//g, '_'), numberToLE = (n, padding) => utils.numberToBytesLE(BigInt(n), padding), numberToBE = (n, padding) => utils.numberToBytesBE(BigInt(n), padding);
|
|
21
21
|
function packb(req) {
|
package/dist/cjs/src/bybit.js
CHANGED
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -4125,36 +4125,6 @@ class coinex extends coinex$1 {
|
|
|
4125
4125
|
const data = this.safeValue(response, 'data', {});
|
|
4126
4126
|
return this.parseLeverageTiers(data, symbols, undefined);
|
|
4127
4127
|
}
|
|
4128
|
-
parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
|
|
4129
|
-
//
|
|
4130
|
-
// {
|
|
4131
|
-
// "BTCUSD": [
|
|
4132
|
-
// ["500001", "100", "0.005"],
|
|
4133
|
-
// ["1000001", "50", "0.01"],
|
|
4134
|
-
// ["2000001", "30", "0.015"],
|
|
4135
|
-
// ["5000001", "20", "0.02"],
|
|
4136
|
-
// ["10000001", "15", "0.025"],
|
|
4137
|
-
// ["20000001", "10", "0.03"]
|
|
4138
|
-
// ],
|
|
4139
|
-
// ...
|
|
4140
|
-
// }
|
|
4141
|
-
//
|
|
4142
|
-
const tiers = {};
|
|
4143
|
-
const marketIds = Object.keys(response);
|
|
4144
|
-
for (let i = 0; i < marketIds.length; i++) {
|
|
4145
|
-
const marketId = marketIds[i];
|
|
4146
|
-
const market = this.safeMarket(marketId, undefined, undefined, 'spot');
|
|
4147
|
-
const symbol = this.safeString(market, 'symbol');
|
|
4148
|
-
let symbolsLength = 0;
|
|
4149
|
-
if (symbols !== undefined) {
|
|
4150
|
-
symbolsLength = symbols.length;
|
|
4151
|
-
}
|
|
4152
|
-
if (symbol !== undefined && (symbolsLength === 0 || this.inArray(symbols, symbol))) {
|
|
4153
|
-
tiers[symbol] = this.parseMarketLeverageTiers(response[marketId], market);
|
|
4154
|
-
}
|
|
4155
|
-
}
|
|
4156
|
-
return tiers;
|
|
4157
|
-
}
|
|
4158
4128
|
parseMarketLeverageTiers(item, market = undefined) {
|
|
4159
4129
|
const tiers = [];
|
|
4160
4130
|
let minNotional = 0;
|
package/dist/cjs/src/deribit.js
CHANGED
|
@@ -697,117 +697,130 @@ class deribit extends deribit$1 {
|
|
|
697
697
|
* @name deribit#fetchMarkets
|
|
698
698
|
* @description retrieves data on all markets for deribit
|
|
699
699
|
* @see https://docs.deribit.com/#public-get_currencies
|
|
700
|
+
* @see https://docs.deribit.com/#public-get_instruments
|
|
700
701
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
701
702
|
* @returns {object[]} an array of objects representing market data
|
|
702
703
|
*/
|
|
703
|
-
const
|
|
704
|
-
//
|
|
705
|
-
// {
|
|
706
|
-
// "jsonrpc": "2.0",
|
|
707
|
-
// "result": [
|
|
708
|
-
// {
|
|
709
|
-
// "withdrawal_priorities": [
|
|
710
|
-
// { value: 0.15, name: "very_low" },
|
|
711
|
-
// { value: 1.5, name: "very_high" },
|
|
712
|
-
// ],
|
|
713
|
-
// "withdrawal_fee": 0.0005,
|
|
714
|
-
// "min_withdrawal_fee": 0.0005,
|
|
715
|
-
// "min_confirmations": 1,
|
|
716
|
-
// "fee_precision": 4,
|
|
717
|
-
// "currency_long": "Bitcoin",
|
|
718
|
-
// "currency": "BTC",
|
|
719
|
-
// "coin_type": "BITCOIN"
|
|
720
|
-
// }
|
|
721
|
-
// ],
|
|
722
|
-
// "usIn": 1583761588590479,
|
|
723
|
-
// "usOut": 1583761588590544,
|
|
724
|
-
// "usDiff": 65,
|
|
725
|
-
// "testnet": false
|
|
726
|
-
// }
|
|
727
|
-
//
|
|
728
|
-
const parsedMarkets = {};
|
|
729
|
-
const currenciesResult = this.safeValue(currenciesResponse, 'result', []);
|
|
704
|
+
const instrumentsResponses = [];
|
|
730
705
|
const result = [];
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
706
|
+
const parsedMarkets = {};
|
|
707
|
+
let fetchAllMarkets = undefined;
|
|
708
|
+
[fetchAllMarkets, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'fetchAllMarkets', true);
|
|
709
|
+
if (fetchAllMarkets) {
|
|
710
|
+
const instrumentsResponse = await this.publicGetGetInstruments(params);
|
|
711
|
+
instrumentsResponses.push(instrumentsResponse);
|
|
712
|
+
}
|
|
713
|
+
else {
|
|
714
|
+
const currenciesResponse = await this.publicGetGetCurrencies(params);
|
|
737
715
|
//
|
|
738
716
|
// {
|
|
739
|
-
// "jsonrpc":"2.0",
|
|
740
|
-
// "result":[
|
|
717
|
+
// "jsonrpc": "2.0",
|
|
718
|
+
// "result": [
|
|
741
719
|
// {
|
|
742
|
-
// "
|
|
743
|
-
//
|
|
744
|
-
//
|
|
745
|
-
//
|
|
746
|
-
// "
|
|
747
|
-
// "
|
|
748
|
-
// "
|
|
749
|
-
// "
|
|
750
|
-
// "
|
|
751
|
-
// "
|
|
752
|
-
// "
|
|
753
|
-
//
|
|
754
|
-
// "expiration_timestamp":1656057600000,
|
|
755
|
-
// "creation_timestamp":1648199543000,
|
|
756
|
-
// "counter_currency":"USD",
|
|
757
|
-
// "contract_size":1.0,
|
|
758
|
-
// "block_trade_commission":0.0003,
|
|
759
|
-
// "base_currency":"BTC"
|
|
760
|
-
// },
|
|
761
|
-
// {
|
|
762
|
-
// "tick_size":0.5,
|
|
763
|
-
// "taker_commission":0.0005,
|
|
764
|
-
// "settlement_period":"month", // month, week
|
|
765
|
-
// "settlement_currency":"BTC",
|
|
766
|
-
// "quote_currency":"USD",
|
|
767
|
-
// "min_trade_amount":10.0,
|
|
768
|
-
// "max_liquidation_commission":0.0075,
|
|
769
|
-
// "max_leverage":50,
|
|
770
|
-
// "maker_commission":0.0,
|
|
771
|
-
// "kind":"future",
|
|
772
|
-
// "is_active":true,
|
|
773
|
-
// "instrument_name":"BTC-27MAY22",
|
|
774
|
-
// "future_type":"reversed",
|
|
775
|
-
// "expiration_timestamp":1653638400000,
|
|
776
|
-
// "creation_timestamp":1648195209000,
|
|
777
|
-
// "counter_currency":"USD",
|
|
778
|
-
// "contract_size":10.0,
|
|
779
|
-
// "block_trade_commission":0.0001,
|
|
780
|
-
// "base_currency":"BTC"
|
|
781
|
-
// },
|
|
782
|
-
// {
|
|
783
|
-
// "tick_size":0.5,
|
|
784
|
-
// "taker_commission":0.0005,
|
|
785
|
-
// "settlement_period":"perpetual",
|
|
786
|
-
// "settlement_currency":"BTC",
|
|
787
|
-
// "quote_currency":"USD",
|
|
788
|
-
// "min_trade_amount":10.0,
|
|
789
|
-
// "max_liquidation_commission":0.0075,
|
|
790
|
-
// "max_leverage":50,
|
|
791
|
-
// "maker_commission":0.0,
|
|
792
|
-
// "kind":"future",
|
|
793
|
-
// "is_active":true,
|
|
794
|
-
// "instrument_name":"BTC-PERPETUAL",
|
|
795
|
-
// "future_type":"reversed",
|
|
796
|
-
// "expiration_timestamp":32503708800000,
|
|
797
|
-
// "creation_timestamp":1534242287000,
|
|
798
|
-
// "counter_currency":"USD",
|
|
799
|
-
// "contract_size":10.0,
|
|
800
|
-
// "block_trade_commission":0.0001,
|
|
801
|
-
// "base_currency":"BTC"
|
|
802
|
-
// },
|
|
720
|
+
// "withdrawal_priorities": [
|
|
721
|
+
// { value: 0.15, name: "very_low" },
|
|
722
|
+
// { value: 1.5, name: "very_high" },
|
|
723
|
+
// ],
|
|
724
|
+
// "withdrawal_fee": 0.0005,
|
|
725
|
+
// "min_withdrawal_fee": 0.0005,
|
|
726
|
+
// "min_confirmations": 1,
|
|
727
|
+
// "fee_precision": 4,
|
|
728
|
+
// "currency_long": "Bitcoin",
|
|
729
|
+
// "currency": "BTC",
|
|
730
|
+
// "coin_type": "BITCOIN"
|
|
731
|
+
// }
|
|
803
732
|
// ],
|
|
804
|
-
// "usIn":
|
|
805
|
-
// "usOut":
|
|
806
|
-
// "usDiff":
|
|
807
|
-
// "testnet":false
|
|
733
|
+
// "usIn": 1583761588590479,
|
|
734
|
+
// "usOut": 1583761588590544,
|
|
735
|
+
// "usDiff": 65,
|
|
736
|
+
// "testnet": false
|
|
808
737
|
// }
|
|
809
738
|
//
|
|
810
|
-
const
|
|
739
|
+
const currenciesResult = this.safeValue(currenciesResponse, 'result', []);
|
|
740
|
+
for (let i = 0; i < currenciesResult.length; i++) {
|
|
741
|
+
const currencyId = this.safeString(currenciesResult[i], 'currency');
|
|
742
|
+
const request = {
|
|
743
|
+
'currency': currencyId,
|
|
744
|
+
};
|
|
745
|
+
const instrumentsResponse = await this.publicGetGetInstruments(this.extend(request, params));
|
|
746
|
+
//
|
|
747
|
+
// {
|
|
748
|
+
// "jsonrpc":"2.0",
|
|
749
|
+
// "result":[
|
|
750
|
+
// {
|
|
751
|
+
// "tick_size":0.0005,
|
|
752
|
+
// "taker_commission":0.0003,
|
|
753
|
+
// "strike":52000.0,
|
|
754
|
+
// "settlement_period":"month",
|
|
755
|
+
// "settlement_currency":"BTC",
|
|
756
|
+
// "quote_currency":"BTC",
|
|
757
|
+
// "option_type":"put", // put, call
|
|
758
|
+
// "min_trade_amount":0.1,
|
|
759
|
+
// "maker_commission":0.0003,
|
|
760
|
+
// "kind":"option",
|
|
761
|
+
// "is_active":true,
|
|
762
|
+
// "instrument_name":"BTC-24JUN22-52000-P",
|
|
763
|
+
// "expiration_timestamp":1656057600000,
|
|
764
|
+
// "creation_timestamp":1648199543000,
|
|
765
|
+
// "counter_currency":"USD",
|
|
766
|
+
// "contract_size":1.0,
|
|
767
|
+
// "block_trade_commission":0.0003,
|
|
768
|
+
// "base_currency":"BTC"
|
|
769
|
+
// },
|
|
770
|
+
// {
|
|
771
|
+
// "tick_size":0.5,
|
|
772
|
+
// "taker_commission":0.0005,
|
|
773
|
+
// "settlement_period":"month", // month, week
|
|
774
|
+
// "settlement_currency":"BTC",
|
|
775
|
+
// "quote_currency":"USD",
|
|
776
|
+
// "min_trade_amount":10.0,
|
|
777
|
+
// "max_liquidation_commission":0.0075,
|
|
778
|
+
// "max_leverage":50,
|
|
779
|
+
// "maker_commission":0.0,
|
|
780
|
+
// "kind":"future",
|
|
781
|
+
// "is_active":true,
|
|
782
|
+
// "instrument_name":"BTC-27MAY22",
|
|
783
|
+
// "future_type":"reversed",
|
|
784
|
+
// "expiration_timestamp":1653638400000,
|
|
785
|
+
// "creation_timestamp":1648195209000,
|
|
786
|
+
// "counter_currency":"USD",
|
|
787
|
+
// "contract_size":10.0,
|
|
788
|
+
// "block_trade_commission":0.0001,
|
|
789
|
+
// "base_currency":"BTC"
|
|
790
|
+
// },
|
|
791
|
+
// {
|
|
792
|
+
// "tick_size":0.5,
|
|
793
|
+
// "taker_commission":0.0005,
|
|
794
|
+
// "settlement_period":"perpetual",
|
|
795
|
+
// "settlement_currency":"BTC",
|
|
796
|
+
// "quote_currency":"USD",
|
|
797
|
+
// "min_trade_amount":10.0,
|
|
798
|
+
// "max_liquidation_commission":0.0075,
|
|
799
|
+
// "max_leverage":50,
|
|
800
|
+
// "maker_commission":0.0,
|
|
801
|
+
// "kind":"future",
|
|
802
|
+
// "is_active":true,
|
|
803
|
+
// "instrument_name":"BTC-PERPETUAL",
|
|
804
|
+
// "future_type":"reversed",
|
|
805
|
+
// "expiration_timestamp":32503708800000,
|
|
806
|
+
// "creation_timestamp":1534242287000,
|
|
807
|
+
// "counter_currency":"USD",
|
|
808
|
+
// "contract_size":10.0,
|
|
809
|
+
// "block_trade_commission":0.0001,
|
|
810
|
+
// "base_currency":"BTC"
|
|
811
|
+
// },
|
|
812
|
+
// ],
|
|
813
|
+
// "usIn":1648691472831791,
|
|
814
|
+
// "usOut":1648691472831896,
|
|
815
|
+
// "usDiff":105,
|
|
816
|
+
// "testnet":false
|
|
817
|
+
// }
|
|
818
|
+
//
|
|
819
|
+
instrumentsResponses.push(instrumentsResponse);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
for (let i = 0; i < instrumentsResponses.length; i++) {
|
|
823
|
+
const instrumentsResult = this.safeValue(instrumentsResponses[i], 'result', []);
|
|
811
824
|
for (let k = 0; k < instrumentsResult.length; k++) {
|
|
812
825
|
const market = instrumentsResult[k];
|
|
813
826
|
const kind = this.safeString(market, 'kind');
|
|
@@ -3805,28 +3805,7 @@ class digifinex extends digifinex$1 {
|
|
|
3805
3805
|
//
|
|
3806
3806
|
const data = this.safeValue(response, 'data', []);
|
|
3807
3807
|
symbols = this.marketSymbols(symbols);
|
|
3808
|
-
return this.parseLeverageTiers(data, symbols, '
|
|
3809
|
-
}
|
|
3810
|
-
parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
|
|
3811
|
-
const result = {};
|
|
3812
|
-
for (let i = 0; i < response.length; i++) {
|
|
3813
|
-
const entry = response[i];
|
|
3814
|
-
const marketId = this.safeString(entry, 'instrument_id');
|
|
3815
|
-
const market = this.safeMarket(marketId);
|
|
3816
|
-
const symbol = this.safeSymbol(marketId, market);
|
|
3817
|
-
let symbolsLength = 0;
|
|
3818
|
-
this.parseMarketLeverageTiers(response[i], market);
|
|
3819
|
-
if (symbols !== undefined) {
|
|
3820
|
-
symbolsLength = symbols.length;
|
|
3821
|
-
if (this.inArray(symbol, symbols)) {
|
|
3822
|
-
result[symbol] = this.parseMarketLeverageTiers(response[i], market);
|
|
3823
|
-
}
|
|
3824
|
-
}
|
|
3825
|
-
if (symbol !== undefined && (symbolsLength === 0 || this.inArray(symbols, symbol))) {
|
|
3826
|
-
result[symbol] = this.parseMarketLeverageTiers(response[i], market);
|
|
3827
|
-
}
|
|
3828
|
-
}
|
|
3829
|
-
return result;
|
|
3808
|
+
return this.parseLeverageTiers(data, symbols, 'instrument_id');
|
|
3830
3809
|
}
|
|
3831
3810
|
async fetchMarketLeverageTiers(symbol, params = {}) {
|
|
3832
3811
|
/**
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -2703,15 +2703,15 @@ class kraken extends kraken$1 {
|
|
|
2703
2703
|
* @name kraken#fetchPositions
|
|
2704
2704
|
* @description fetch all open positions
|
|
2705
2705
|
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenPositions
|
|
2706
|
-
* @param {string[]
|
|
2706
|
+
* @param {string[]} [symbols] not used by kraken fetchPositions ()
|
|
2707
2707
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2708
2708
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2709
2709
|
*/
|
|
2710
2710
|
await this.loadMarkets();
|
|
2711
2711
|
const request = {
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2712
|
+
// 'txid': 'comma delimited list of transaction ids to restrict output to',
|
|
2713
|
+
'docalcs': 'true',
|
|
2714
|
+
'consolidation': 'market', // what to consolidate the positions data around, market will consolidate positions based on market pair
|
|
2715
2715
|
};
|
|
2716
2716
|
const response = await this.privatePostOpenPositions(this.extend(request, params));
|
|
2717
2717
|
//
|
|
@@ -2759,9 +2759,58 @@ class kraken extends kraken$1 {
|
|
|
2759
2759
|
// ]
|
|
2760
2760
|
// }
|
|
2761
2761
|
//
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2762
|
+
symbols = this.marketSymbols(symbols);
|
|
2763
|
+
const result = this.safeList(response, 'result');
|
|
2764
|
+
const results = this.parsePositions(result, symbols);
|
|
2765
|
+
return this.filterByArrayPositions(results, 'symbol', symbols, false);
|
|
2766
|
+
}
|
|
2767
|
+
parsePosition(position, market = undefined) {
|
|
2768
|
+
//
|
|
2769
|
+
// {
|
|
2770
|
+
// "pair": "ETHUSDT",
|
|
2771
|
+
// "positions": "1",
|
|
2772
|
+
// "type": "buy",
|
|
2773
|
+
// "leverage": "2.00000",
|
|
2774
|
+
// "cost": "28.49800",
|
|
2775
|
+
// "fee": "0.07979",
|
|
2776
|
+
// "vol": "0.02000000",
|
|
2777
|
+
// "vol_closed": "0.00000000",
|
|
2778
|
+
// "margin": "14.24900"
|
|
2779
|
+
// }
|
|
2780
|
+
//
|
|
2781
|
+
const marketId = this.safeString(position, 'pair');
|
|
2782
|
+
const rawSide = this.safeString(position, 'type');
|
|
2783
|
+
const side = (rawSide === 'buy') ? 'long' : 'short';
|
|
2784
|
+
return this.safePosition({
|
|
2785
|
+
'info': position,
|
|
2786
|
+
'id': undefined,
|
|
2787
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
2788
|
+
'notional': undefined,
|
|
2789
|
+
'marginMode': undefined,
|
|
2790
|
+
'liquidationPrice': undefined,
|
|
2791
|
+
'entryPrice': undefined,
|
|
2792
|
+
'unrealizedPnl': this.safeNumber(position, 'net'),
|
|
2793
|
+
'realizedPnl': undefined,
|
|
2794
|
+
'percentage': undefined,
|
|
2795
|
+
'contracts': this.safeNumber(position, 'vol'),
|
|
2796
|
+
'contractSize': undefined,
|
|
2797
|
+
'markPrice': undefined,
|
|
2798
|
+
'lastPrice': undefined,
|
|
2799
|
+
'side': side,
|
|
2800
|
+
'hedged': undefined,
|
|
2801
|
+
'timestamp': undefined,
|
|
2802
|
+
'datetime': undefined,
|
|
2803
|
+
'lastUpdateTimestamp': undefined,
|
|
2804
|
+
'maintenanceMargin': undefined,
|
|
2805
|
+
'maintenanceMarginPercentage': undefined,
|
|
2806
|
+
'collateral': undefined,
|
|
2807
|
+
'initialMargin': this.safeNumber(position, 'margin'),
|
|
2808
|
+
'initialMarginPercentage': undefined,
|
|
2809
|
+
'leverage': this.safeNumber(position, 'leverage'),
|
|
2810
|
+
'marginRatio': undefined,
|
|
2811
|
+
'stopLossPrice': undefined,
|
|
2812
|
+
'takeProfitPrice': undefined,
|
|
2813
|
+
});
|
|
2765
2814
|
}
|
|
2766
2815
|
parseAccountType(account) {
|
|
2767
2816
|
const accountByType = {
|
package/dist/cjs/src/probit.js
CHANGED
|
@@ -1487,12 +1487,11 @@ class probit extends probit$1 {
|
|
|
1487
1487
|
const result = await this.fetchTransactions(code, since, limit, this.extend(request, params));
|
|
1488
1488
|
return result;
|
|
1489
1489
|
}
|
|
1490
|
-
async
|
|
1490
|
+
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1491
1491
|
/**
|
|
1492
1492
|
* @method
|
|
1493
|
-
* @name probit#
|
|
1494
|
-
* @
|
|
1495
|
-
* @description use fetchDepositsWithdrawals instead
|
|
1493
|
+
* @name probit#fetchDepositsWithdrawals
|
|
1494
|
+
* @description fetch history of deposits and withdrawals
|
|
1496
1495
|
* @see https://docs-en.probit.com/reference/transferpayment
|
|
1497
1496
|
* @param {string} code unified currency code
|
|
1498
1497
|
* @param {int} [since] the earliest time in ms to fetch transactions for
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.2.
|
|
7
|
+
declare const version = "4.2.92";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ExchangeClosedByUser } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.2.
|
|
41
|
+
const version = '4.2.93';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -172,6 +172,7 @@ interface Exchange {
|
|
|
172
172
|
privateGetV5BrokerEarningRecord(params?: {}): Promise<implicitReturnType>;
|
|
173
173
|
privateGetV5BrokerEarningsInfo(params?: {}): Promise<implicitReturnType>;
|
|
174
174
|
privateGetV5BrokerAccountInfo(params?: {}): Promise<implicitReturnType>;
|
|
175
|
+
privateGetV5BrokerAssetQuerySubMemberDepositRecord(params?: {}): Promise<implicitReturnType>;
|
|
175
176
|
privatePostOptionUsdcOpenapiPrivateV1PlaceOrder(params?: {}): Promise<implicitReturnType>;
|
|
176
177
|
privatePostOptionUsdcOpenapiPrivateV1ReplaceOrder(params?: {}): Promise<implicitReturnType>;
|
|
177
178
|
privatePostOptionUsdcOpenapiPrivateV1CancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
@@ -219,7 +219,7 @@ export default class Exchange {
|
|
|
219
219
|
}, digest?: "binary" | "hex" | "base64") => any;
|
|
220
220
|
arrayConcat: (a: any, b: any) => any;
|
|
221
221
|
encode: (str: string) => Uint8Array;
|
|
222
|
-
urlencode: (object:
|
|
222
|
+
urlencode: (object: object) => string;
|
|
223
223
|
hmac: (request: import("../static_dependencies/noble-hashes/utils.js").Input, secret: import("../static_dependencies/noble-hashes/utils.js").Input, hash: {
|
|
224
224
|
(message: import("../static_dependencies/noble-hashes/utils.js").Input): Uint8Array;
|
|
225
225
|
outputLen: number;
|
|
@@ -234,12 +234,12 @@ export default class Exchange {
|
|
|
234
234
|
yyyymmdd: (timestamp: any, infix?: string) => string;
|
|
235
235
|
safeStringUpper: (o: any, k: IndexType, $default?: string) => string;
|
|
236
236
|
safeTimestamp: (o: any, k: IndexType, $default?: number) => number;
|
|
237
|
-
binaryConcatArray: (arr: any) => Uint8Array;
|
|
237
|
+
binaryConcatArray: (arr: any[]) => Uint8Array;
|
|
238
238
|
uuidv1: () => string;
|
|
239
239
|
numberToLE: (n: number, padding: number) => Uint8Array;
|
|
240
240
|
ymdhms: (timestamp: any, infix?: string) => string;
|
|
241
241
|
yymmdd: (timestamp: any, infix?: string) => string;
|
|
242
|
-
stringToBase64: (string:
|
|
242
|
+
stringToBase64: (string: string) => string;
|
|
243
243
|
decode: (data: Uint8Array) => string;
|
|
244
244
|
uuid22: (a?: any) => string;
|
|
245
245
|
safeIntegerProduct2: (o: any, k1: IndexType, k2: IndexType, $factor: number, $default?: number) => number;
|
|
@@ -248,7 +248,7 @@ export default class Exchange {
|
|
|
248
248
|
base58ToBinary: (str: string) => Uint8Array;
|
|
249
249
|
base64ToBinary: (str: string) => Uint8Array;
|
|
250
250
|
safeTimestamp2: (o: any, k1: IndexType, k2: IndexType, $default?: any) => number;
|
|
251
|
-
rawencode: (object:
|
|
251
|
+
rawencode: (object: object) => string;
|
|
252
252
|
keysort: (x: any, out?: {}) => {};
|
|
253
253
|
inArray: (needle: any, haystack: any) => any;
|
|
254
254
|
safeStringLower2: (o: any, k1: IndexType, k2: IndexType, $default?: string) => string;
|
|
@@ -257,7 +257,7 @@ export default class Exchange {
|
|
|
257
257
|
ordered: (x: any) => any;
|
|
258
258
|
filterBy: (x: any, k: any, value?: any, out?: any[]) => any[];
|
|
259
259
|
uuid16: (a?: any) => string;
|
|
260
|
-
urlencodeWithArrayRepeat: (object:
|
|
260
|
+
urlencodeWithArrayRepeat: (object: object) => string;
|
|
261
261
|
microseconds: () => number;
|
|
262
262
|
binaryToBase64: (data: Uint8Array) => string;
|
|
263
263
|
strip: (s: string) => string;
|
|
@@ -270,10 +270,10 @@ export default class Exchange {
|
|
|
270
270
|
safeStringN: (o: any, k: IndexType[], $default?: string) => string;
|
|
271
271
|
safeStringLowerN: (o: any, k: IndexType[], $default?: string) => string;
|
|
272
272
|
safeStringUpperN: (o: any, k: IndexType[], $default?: string) => string;
|
|
273
|
-
urlencodeNested: (object:
|
|
273
|
+
urlencodeNested: (object: object) => string;
|
|
274
274
|
parseDate: (x: any) => number;
|
|
275
275
|
ymd: (timestamp: any, infix: any, fullYear?: boolean) => string;
|
|
276
|
-
base64ToString: (string:
|
|
276
|
+
base64ToString: (string: string) => string;
|
|
277
277
|
crc32: typeof functions.crc32;
|
|
278
278
|
packb: typeof functions.packb;
|
|
279
279
|
describe(): {
|
|
@@ -792,7 +792,7 @@ export default class Exchange {
|
|
|
792
792
|
safeNumber2(dictionary: object, key1: IndexType, key2: IndexType, d?: any): number;
|
|
793
793
|
parseOrderBook(orderbook: object, symbol: string, timestamp?: Int, bidsKey?: string, asksKey?: string, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): OrderBook;
|
|
794
794
|
parseOHLCVs(ohlcvs: object[], market?: any, timeframe?: string, since?: Int, limit?: Int): OHLCV[];
|
|
795
|
-
parseLeverageTiers(response:
|
|
795
|
+
parseLeverageTiers(response: any, symbols?: string[], marketIdKey?: any): {};
|
|
796
796
|
loadTradingLimits(symbols?: string[], reload?: boolean, params?: {}): Promise<Dictionary<any>>;
|
|
797
797
|
safePosition(position: any): Position;
|
|
798
798
|
parsePositions(positions: any[], symbols?: string[], params?: {}): Position[];
|