ccxt 4.3.14 → 4.3.15
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/LICENSE.txt +1 -1
- package/README.md +3 -3
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/base/Exchange.js +6 -6
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/base/functions/misc.js +2 -2
- package/dist/cjs/src/base/ws/Client.js +2 -1
- package/dist/cjs/src/binance.js +3 -3
- package/dist/cjs/src/bingx.js +1 -0
- package/dist/cjs/src/bybit.js +6 -6
- package/dist/cjs/src/coinex.js +36 -35
- package/dist/cjs/src/cryptocom.js +2 -1
- package/dist/cjs/src/hitbtc.js +1 -0
- package/dist/cjs/src/luno.js +2 -0
- package/dist/cjs/src/phemex.js +1 -1
- package/dist/cjs/src/pro/hitbtc.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +3 -3
- package/dist/cjs/src/pro/poloniex.js +3 -3
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/luno.d.ts +2 -0
- package/js/src/alpaca.d.ts +1 -1
- package/js/src/base/Exchange.d.ts +4 -4
- package/js/src/base/Exchange.js +6 -6
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +5 -1
- package/js/src/base/errors.js +8 -2
- package/js/src/base/functions/misc.d.ts +5 -4
- package/js/src/base/functions/misc.js +2 -2
- package/js/src/base/functions/number.d.ts +5 -5
- package/js/src/base/ws/Client.d.ts +8 -7
- package/js/src/base/ws/Client.js +2 -1
- package/js/src/binance.js +4 -4
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +1 -0
- package/js/src/bybit.js +6 -6
- package/js/src/coinex.js +36 -35
- package/js/src/cryptocom.js +2 -1
- package/js/src/hitbtc.js +1 -0
- package/js/src/luno.js +2 -0
- package/js/src/phemex.js +1 -1
- package/js/src/pro/hitbtc.js +1 -1
- package/js/src/pro/independentreserve.js +3 -3
- package/js/src/pro/poloniex.js +3 -3
- package/js/src/upbit.d.ts +1 -1
- package/js/src/woo.d.ts +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/package.json +1 -1
package/LICENSE.txt
CHANGED
package/README.md
CHANGED
|
@@ -213,13 +213,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
213
213
|
|
|
214
214
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
215
215
|
|
|
216
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
217
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
|
216
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.15/dist/ccxt.browser.js
|
|
217
|
+
* unpkg: https://unpkg.com/ccxt@4.3.15/dist/ccxt.browser.js
|
|
218
218
|
|
|
219
219
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
220
220
|
|
|
221
221
|
```HTML
|
|
222
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
222
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.15/dist/ccxt.browser.js"></script>
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
Creates a global `ccxt` object:
|
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.3.
|
|
185
|
+
const version = '4.3.15';
|
|
186
186
|
Exchange["default"].ccxtVersion = version;
|
|
187
187
|
const exchanges = {
|
|
188
188
|
'ace': ace,
|
|
@@ -385,6 +385,7 @@ exports.InvalidAddress = errors.InvalidAddress;
|
|
|
385
385
|
exports.InvalidNonce = errors.InvalidNonce;
|
|
386
386
|
exports.InvalidOrder = errors.InvalidOrder;
|
|
387
387
|
exports.MarginModeAlreadySet = errors.MarginModeAlreadySet;
|
|
388
|
+
exports.MarketClosed = errors.MarketClosed;
|
|
388
389
|
exports.NetworkError = errors.NetworkError;
|
|
389
390
|
exports.NoChange = errors.NoChange;
|
|
390
391
|
exports.NotSupported = errors.NotSupported;
|
|
@@ -3058,15 +3058,15 @@ class Exchange {
|
|
|
3058
3058
|
// timestamp and symbol operations don't belong in safeTicker
|
|
3059
3059
|
// they should be done in the derived classes
|
|
3060
3060
|
return this.extend(ticker, {
|
|
3061
|
-
'bid': this.parseNumber(this.omitZero(this.
|
|
3061
|
+
'bid': this.parseNumber(this.omitZero(this.safeString(ticker, 'bid'))),
|
|
3062
3062
|
'bidVolume': this.safeNumber(ticker, 'bidVolume'),
|
|
3063
|
-
'ask': this.parseNumber(this.omitZero(this.
|
|
3063
|
+
'ask': this.parseNumber(this.omitZero(this.safeString(ticker, 'ask'))),
|
|
3064
3064
|
'askVolume': this.safeNumber(ticker, 'askVolume'),
|
|
3065
3065
|
'high': this.parseNumber(this.omitZero(this.safeString(ticker, 'high'))),
|
|
3066
|
-
'low': this.parseNumber(this.omitZero(this.
|
|
3067
|
-
'open': this.parseNumber(this.omitZero(
|
|
3068
|
-
'close': this.parseNumber(this.omitZero(
|
|
3069
|
-
'last': this.parseNumber(this.omitZero(
|
|
3066
|
+
'low': this.parseNumber(this.omitZero(this.safeString(ticker, 'low'))),
|
|
3067
|
+
'open': this.parseNumber(this.omitZero(open)),
|
|
3068
|
+
'close': this.parseNumber(this.omitZero(close)),
|
|
3069
|
+
'last': this.parseNumber(this.omitZero(last)),
|
|
3070
3070
|
'change': this.parseNumber(change),
|
|
3071
3071
|
'percentage': this.parseNumber(percentage),
|
|
3072
3072
|
'average': this.parseNumber(average),
|
|
@@ -75,6 +75,12 @@ class MarginModeAlreadySet extends NoChange {
|
|
|
75
75
|
this.name = 'MarginModeAlreadySet';
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
class MarketClosed extends OperationRejected {
|
|
79
|
+
constructor(message) {
|
|
80
|
+
super(message);
|
|
81
|
+
this.name = 'MarketClosed';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
78
84
|
class BadResponse extends ExchangeError {
|
|
79
85
|
constructor(message) {
|
|
80
86
|
super(message);
|
|
@@ -219,7 +225,7 @@ class RequestTimeout extends NetworkError {
|
|
|
219
225
|
this.name = 'RequestTimeout';
|
|
220
226
|
}
|
|
221
227
|
}
|
|
222
|
-
var errors = { 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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
228
|
+
var errors = { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
223
229
|
|
|
224
230
|
exports.AccountNotEnabled = AccountNotEnabled;
|
|
225
231
|
exports.AccountSuspended = AccountSuspended;
|
|
@@ -242,6 +248,7 @@ exports.InvalidAddress = InvalidAddress;
|
|
|
242
248
|
exports.InvalidNonce = InvalidNonce;
|
|
243
249
|
exports.InvalidOrder = InvalidOrder;
|
|
244
250
|
exports.MarginModeAlreadySet = MarginModeAlreadySet;
|
|
251
|
+
exports.MarketClosed = MarketClosed;
|
|
245
252
|
exports.NetworkError = NetworkError;
|
|
246
253
|
exports.NoChange = NoChange;
|
|
247
254
|
exports.NotSupported = NotSupported;
|
|
@@ -81,10 +81,10 @@ function aggregate(bidasks) {
|
|
|
81
81
|
for (let i = 0; i < bidasks.length; i++) {
|
|
82
82
|
const [price, volume] = bidasks[i];
|
|
83
83
|
if (volume > 0) {
|
|
84
|
-
result[price] = (result[price] || 0) + volume;
|
|
84
|
+
result[price] = (result[price] || 0) + volume; // TODO: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.ts(7053)
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
return Object.keys(result).map((price) => [parseFloat(price), parseFloat(result[price])]);
|
|
87
|
+
return Object.keys(result).map((price) => [parseFloat(price), parseFloat(result[price])]); // TODO: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}', No index signature with a parameter of type 'string' was found on type '{}'.ts(7053)
|
|
88
88
|
}
|
|
89
89
|
/* ------------------------------------------------------------------------ */
|
|
90
90
|
|
|
@@ -12,6 +12,7 @@ var index = require('../../static_dependencies/scure-base/index.js');
|
|
|
12
12
|
|
|
13
13
|
class Client {
|
|
14
14
|
constructor(url, onMessageCallback, onErrorCallback, onCloseCallback, onConnectedCallback, config = {}) {
|
|
15
|
+
this.verbose = false;
|
|
15
16
|
const defaults = {
|
|
16
17
|
url,
|
|
17
18
|
onMessageCallback,
|
|
@@ -61,7 +62,7 @@ class Client {
|
|
|
61
62
|
if (this.verbose && (messageHash === undefined)) {
|
|
62
63
|
this.log(new Date(), 'resolve received undefined messageHash');
|
|
63
64
|
}
|
|
64
|
-
if (messageHash in this.futures) {
|
|
65
|
+
if ((messageHash !== undefined) && (messageHash in this.futures)) {
|
|
65
66
|
const promise = this.futures[messageHash];
|
|
66
67
|
promise.resolve(result);
|
|
67
68
|
delete this.futures[messageHash];
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -2396,7 +2396,7 @@ class binance extends binance$1 {
|
|
|
2396
2396
|
'Rest API trading is not enabled.': errors.PermissionDenied,
|
|
2397
2397
|
'This account may not place or cancel orders.': errors.PermissionDenied,
|
|
2398
2398
|
"You don't have permission.": errors.PermissionDenied,
|
|
2399
|
-
'Market is closed.': errors.
|
|
2399
|
+
'Market is closed.': errors.MarketClosed,
|
|
2400
2400
|
'Too many requests. Please try again later.': errors.RateLimitExceeded,
|
|
2401
2401
|
'This action is disabled on this account.': errors.AccountSuspended,
|
|
2402
2402
|
'Limit orders require GTC for this phase.': errors.BadRequest,
|
|
@@ -3999,8 +3999,8 @@ class binance extends binance$1 {
|
|
|
3999
3999
|
* @name binance#fetchLastPrices
|
|
4000
4000
|
* @description fetches the last price for multiple markets
|
|
4001
4001
|
* @see https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker // spot
|
|
4002
|
-
* @see https://binance-docs.github.io/apidocs/
|
|
4003
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-
|
|
4002
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#symbol-price-ticker // swap
|
|
4003
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-tickers // future
|
|
4004
4004
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4005
4005
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4006
4006
|
* @param {string} [params.subType] "linear" or "inverse"
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -386,6 +386,7 @@ class bingx extends bingx$1 {
|
|
|
386
386
|
'100202': errors.InsufficientFunds,
|
|
387
387
|
'100204': errors.BadRequest,
|
|
388
388
|
'100400': errors.BadRequest,
|
|
389
|
+
'100410': errors.OperationFailed,
|
|
389
390
|
'100421': errors.BadSymbol,
|
|
390
391
|
'100440': errors.ExchangeError,
|
|
391
392
|
'100500': errors.OperationFailed,
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -6752,20 +6752,20 @@ class bybit extends bybit$1 {
|
|
|
6752
6752
|
const isUsdcSettled = market['settle'] === 'USDC';
|
|
6753
6753
|
// engage in leverage setting
|
|
6754
6754
|
// we reuse the code here instead of having two methods
|
|
6755
|
-
|
|
6755
|
+
const leverageString = this.numberToString(leverage);
|
|
6756
6756
|
const request = {
|
|
6757
6757
|
'symbol': market['id'],
|
|
6758
|
-
'buyLeverage':
|
|
6759
|
-
'sellLeverage':
|
|
6758
|
+
'buyLeverage': leverageString,
|
|
6759
|
+
'sellLeverage': leverageString,
|
|
6760
6760
|
};
|
|
6761
6761
|
let response = undefined;
|
|
6762
6762
|
if (isUsdcSettled && !isUnifiedAccount) {
|
|
6763
|
-
request['leverage'] =
|
|
6763
|
+
request['leverage'] = leverageString;
|
|
6764
6764
|
response = await this.privatePostPerpetualUsdcOpenapiPrivateV1PositionLeverageSave(this.extend(request, params));
|
|
6765
6765
|
}
|
|
6766
6766
|
else {
|
|
6767
|
-
request['buyLeverage'] =
|
|
6768
|
-
request['sellLeverage'] =
|
|
6767
|
+
request['buyLeverage'] = leverageString;
|
|
6768
|
+
request['sellLeverage'] = leverageString;
|
|
6769
6769
|
if (market['linear']) {
|
|
6770
6770
|
request['category'] = 'linear';
|
|
6771
6771
|
}
|
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -3698,31 +3698,34 @@ class coinex extends coinex$1 {
|
|
|
3698
3698
|
* @method
|
|
3699
3699
|
* @name coinex#createDepositAddress
|
|
3700
3700
|
* @description create a currency deposit address
|
|
3701
|
-
* @see https://
|
|
3701
|
+
* @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/update-deposit-address
|
|
3702
3702
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
3703
3703
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3704
|
+
* @param {string} [params.network] the blockchain network to create a deposit address on
|
|
3704
3705
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
3705
3706
|
*/
|
|
3706
3707
|
await this.loadMarkets();
|
|
3707
3708
|
const currency = this.currency(code);
|
|
3709
|
+
const network = this.safeString2(params, 'chain', 'network');
|
|
3710
|
+
if (network === undefined) {
|
|
3711
|
+
throw new errors.ArgumentsRequired(this.id + ' createDepositAddress() requires a network parameter');
|
|
3712
|
+
}
|
|
3713
|
+
params = this.omit(params, 'network');
|
|
3708
3714
|
const request = {
|
|
3709
|
-
'
|
|
3715
|
+
'ccy': currency['id'],
|
|
3716
|
+
'chain': this.networkCodeToId(network, currency['code']),
|
|
3710
3717
|
};
|
|
3711
|
-
|
|
3712
|
-
const network = this.safeString(params, 'network');
|
|
3713
|
-
params = this.omit(params, 'network');
|
|
3714
|
-
request['smart_contract_name'] = network;
|
|
3715
|
-
}
|
|
3716
|
-
const response = await this.v1PrivatePutBalanceDepositAddressCoinType(this.extend(request, params));
|
|
3718
|
+
const response = await this.v2PrivatePostAssetsRenewalDepositAddress(this.extend(request, params));
|
|
3717
3719
|
//
|
|
3718
3720
|
// {
|
|
3719
3721
|
// "code": 0,
|
|
3720
3722
|
// "data": {
|
|
3721
|
-
// "
|
|
3722
|
-
// "
|
|
3723
|
+
// "address": "0x321bd6479355142334f45653ad5d8b76105a1234",
|
|
3724
|
+
// "memo": ""
|
|
3723
3725
|
// },
|
|
3724
|
-
// "message": "
|
|
3726
|
+
// "message": "OK"
|
|
3725
3727
|
// }
|
|
3728
|
+
//
|
|
3726
3729
|
const data = this.safeDict(response, 'data', {});
|
|
3727
3730
|
return this.parseDepositAddress(data, currency);
|
|
3728
3731
|
}
|
|
@@ -3731,18 +3734,16 @@ class coinex extends coinex$1 {
|
|
|
3731
3734
|
* @method
|
|
3732
3735
|
* @name coinex#fetchDepositAddress
|
|
3733
3736
|
* @description fetch the deposit address for a currency associated with this account
|
|
3734
|
-
* @see https://
|
|
3737
|
+
* @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-address
|
|
3735
3738
|
* @param {string} code unified currency code
|
|
3736
3739
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3740
|
+
* @param {string} [params.network] the blockchain network to create a deposit address on
|
|
3737
3741
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
3738
3742
|
*/
|
|
3739
3743
|
await this.loadMarkets();
|
|
3740
3744
|
const currency = this.currency(code);
|
|
3741
|
-
const
|
|
3742
|
-
|
|
3743
|
-
};
|
|
3744
|
-
const networks = this.safeValue(currency, 'networks', {});
|
|
3745
|
-
const network = this.safeString(params, 'network');
|
|
3745
|
+
const networks = this.safeDict(currency, 'networks', {});
|
|
3746
|
+
const network = this.safeString2(params, 'network', 'chain');
|
|
3746
3747
|
params = this.omit(params, 'network');
|
|
3747
3748
|
const networksKeys = Object.keys(networks);
|
|
3748
3749
|
const numOfNetworks = networksKeys.length;
|
|
@@ -3754,24 +3755,24 @@ class coinex extends coinex$1 {
|
|
|
3754
3755
|
throw new errors.ExchangeError(this.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code);
|
|
3755
3756
|
}
|
|
3756
3757
|
}
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3758
|
+
const request = {
|
|
3759
|
+
'ccy': currency['id'],
|
|
3760
|
+
'chain': network,
|
|
3761
|
+
};
|
|
3762
|
+
const response = await this.v2PrivateGetAssetsDepositAddress(this.extend(request, params));
|
|
3761
3763
|
//
|
|
3762
|
-
//
|
|
3763
|
-
//
|
|
3764
|
-
//
|
|
3765
|
-
//
|
|
3766
|
-
//
|
|
3767
|
-
//
|
|
3768
|
-
//
|
|
3769
|
-
//
|
|
3770
|
-
// }
|
|
3764
|
+
// {
|
|
3765
|
+
// "code": 0,
|
|
3766
|
+
// "data": {
|
|
3767
|
+
// "address": "0x321bd6479355142334f45653ad5d8b76105a1234",
|
|
3768
|
+
// "memo": ""
|
|
3769
|
+
// },
|
|
3770
|
+
// "message": "OK"
|
|
3771
|
+
// }
|
|
3771
3772
|
//
|
|
3772
|
-
const data = this.
|
|
3773
|
+
const data = this.safeDict(response, 'data', {});
|
|
3773
3774
|
const depositAddress = this.parseDepositAddress(data, currency);
|
|
3774
|
-
const options = this.
|
|
3775
|
+
const options = this.safeDict(this.options, 'fetchDepositAddress', {});
|
|
3775
3776
|
const fillResponseFromRequest = this.safeBool(options, 'fillResponseFromRequest', true);
|
|
3776
3777
|
if (fillResponseFromRequest) {
|
|
3777
3778
|
depositAddress['network'] = this.safeNetworkCode(network, currency);
|
|
@@ -3797,11 +3798,11 @@ class coinex extends coinex$1 {
|
|
|
3797
3798
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
3798
3799
|
//
|
|
3799
3800
|
// {
|
|
3800
|
-
// "
|
|
3801
|
-
// "
|
|
3801
|
+
// "address": "1P1JqozxioQwaqPwgMAQdNDYNyaVSqgARq",
|
|
3802
|
+
// "memo": ""
|
|
3802
3803
|
// }
|
|
3803
3804
|
//
|
|
3804
|
-
const coinAddress = this.safeString(depositAddress, '
|
|
3805
|
+
const coinAddress = this.safeString(depositAddress, 'address');
|
|
3805
3806
|
const parts = coinAddress.split(':');
|
|
3806
3807
|
let address = undefined;
|
|
3807
3808
|
let tag = undefined;
|
|
@@ -496,7 +496,8 @@ class cryptocom extends cryptocom$1 {
|
|
|
496
496
|
const strike = this.safeString(market, 'strike');
|
|
497
497
|
const marginBuyEnabled = this.safeValue(market, 'margin_buy_enabled');
|
|
498
498
|
const marginSellEnabled = this.safeValue(market, 'margin_sell_enabled');
|
|
499
|
-
const
|
|
499
|
+
const expiryString = this.omitZero(this.safeString(market, 'expiry_timestamp_ms'));
|
|
500
|
+
const expiry = (expiryString !== undefined) ? parseInt(expiryString) : undefined;
|
|
500
501
|
let symbol = base + '/' + quote;
|
|
501
502
|
let type = undefined;
|
|
502
503
|
let contract = undefined;
|
package/dist/cjs/src/hitbtc.js
CHANGED
package/dist/cjs/src/luno.js
CHANGED
|
@@ -147,6 +147,7 @@ class luno extends luno$1 {
|
|
|
147
147
|
'withdrawals': 1,
|
|
148
148
|
'send': 1,
|
|
149
149
|
'oauth2/grant': 1,
|
|
150
|
+
'beneficiaries': 1,
|
|
150
151
|
// POST /api/exchange/1/move
|
|
151
152
|
},
|
|
152
153
|
'put': {
|
|
@@ -154,6 +155,7 @@ class luno extends luno$1 {
|
|
|
154
155
|
},
|
|
155
156
|
'delete': {
|
|
156
157
|
'withdrawals/{id}': 1,
|
|
158
|
+
'beneficiaries/{id}': 1,
|
|
157
159
|
},
|
|
158
160
|
},
|
|
159
161
|
},
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -2380,7 +2380,7 @@ class phemex extends phemex$1 {
|
|
|
2380
2380
|
lastTradeTimestamp = undefined;
|
|
2381
2381
|
}
|
|
2382
2382
|
const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
|
|
2383
|
-
const stopPrice = this.omitZero(this.
|
|
2383
|
+
const stopPrice = this.omitZero(this.safeString2(order, 'stopPx', 'stopPxRp'));
|
|
2384
2384
|
const postOnly = (timeInForce === 'PO');
|
|
2385
2385
|
let reduceOnly = this.safeValue(order, 'reduceOnly');
|
|
2386
2386
|
const execInst = this.safeString(order, 'execInst');
|
|
@@ -1195,7 +1195,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
1195
1195
|
// "id": 1700233093414
|
|
1196
1196
|
// }
|
|
1197
1197
|
//
|
|
1198
|
-
const messageHash = this.
|
|
1198
|
+
const messageHash = this.safeString(message, 'id');
|
|
1199
1199
|
const result = this.safeValue(message, 'result', {});
|
|
1200
1200
|
if (Array.isArray(result)) {
|
|
1201
1201
|
const parsedOrders = [];
|
|
@@ -132,9 +132,9 @@ class independentreserve extends independentreserve$1 {
|
|
|
132
132
|
if (limit === undefined) {
|
|
133
133
|
limit = 100;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
const url = this.urls['api']['ws'] + '/orderbook/' +
|
|
137
|
-
const messageHash = 'orderbook:' + symbol + ':' +
|
|
135
|
+
const limitString = this.numberToString(limit);
|
|
136
|
+
const url = this.urls['api']['ws'] + '/orderbook/' + limitString + '?subscribe=' + market['base'] + '-' + market['quote'];
|
|
137
|
+
const messageHash = 'orderbook:' + symbol + ':' + limitString;
|
|
138
138
|
const subscription = {
|
|
139
139
|
'receivedSnapshot': false,
|
|
140
140
|
};
|
|
@@ -314,7 +314,7 @@ class poloniex extends poloniex$1 {
|
|
|
314
314
|
// }]
|
|
315
315
|
// }
|
|
316
316
|
//
|
|
317
|
-
const messageHash = this.
|
|
317
|
+
const messageHash = this.safeString(message, 'id');
|
|
318
318
|
const data = this.safeValue(message, 'data', []);
|
|
319
319
|
const orders = [];
|
|
320
320
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -652,8 +652,8 @@ class poloniex extends poloniex$1 {
|
|
|
652
652
|
'type': this.safeStringLower(trade, 'type'),
|
|
653
653
|
'side': this.safeStringLower2(trade, 'takerSide', 'side'),
|
|
654
654
|
'takerOrMaker': takerMaker,
|
|
655
|
-
'price': this.omitZero(this.
|
|
656
|
-
'amount': this.omitZero(this.
|
|
655
|
+
'price': this.omitZero(this.safeString2(trade, 'tradePrice', 'price')),
|
|
656
|
+
'amount': this.omitZero(this.safeString2(trade, 'filledQuantity', 'quantity')),
|
|
657
657
|
'cost': this.safeString2(trade, 'amount', 'filledAmount'),
|
|
658
658
|
'fee': {
|
|
659
659
|
'rate': undefined,
|
package/js/ccxt.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Precise } from './src/base/Precise.js';
|
|
|
3
3
|
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, Conversion } from './src/base/types.js';
|
|
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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
6
|
+
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
+
declare const version = "4.3.14";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -519,5 +519,5 @@ declare const ccxt: {
|
|
|
519
519
|
zaif: typeof zaif;
|
|
520
520
|
zonda: typeof zonda;
|
|
521
521
|
} & typeof functions & typeof errors;
|
|
522
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, 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, Conversion, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
522
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, 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, Conversion, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
523
523
|
export default ccxt;
|
package/js/ccxt.js
CHANGED
|
@@ -35,10 +35,10 @@ import { Exchange } from './src/base/Exchange.js';
|
|
|
35
35
|
import { Precise } from './src/base/Precise.js';
|
|
36
36
|
import * as functions from './src/base/functions.js';
|
|
37
37
|
import * as errors from './src/base/errors.js';
|
|
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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
38
|
+
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.15';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -392,6 +392,6 @@ pro.exchanges = Object.keys(pro);
|
|
|
392
392
|
pro['Exchange'] = Exchange; // now the same for rest and ts
|
|
393
393
|
//-----------------------------------------------------------------------------
|
|
394
394
|
const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
|
|
395
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, 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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
395
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
396
396
|
export default ccxt;
|
|
397
397
|
//-----------------------------------------------------------------------------
|
|
@@ -30,8 +30,10 @@ interface Exchange {
|
|
|
30
30
|
privatePostWithdrawals(params?: {}): Promise<implicitReturnType>;
|
|
31
31
|
privatePostSend(params?: {}): Promise<implicitReturnType>;
|
|
32
32
|
privatePostOauth2Grant(params?: {}): Promise<implicitReturnType>;
|
|
33
|
+
privatePostBeneficiaries(params?: {}): Promise<implicitReturnType>;
|
|
33
34
|
privatePutAccountsIdName(params?: {}): Promise<implicitReturnType>;
|
|
34
35
|
privateDeleteWithdrawalsId(params?: {}): Promise<implicitReturnType>;
|
|
36
|
+
privateDeleteBeneficiariesId(params?: {}): Promise<implicitReturnType>;
|
|
35
37
|
}
|
|
36
38
|
declare abstract class Exchange extends _Exchange {
|
|
37
39
|
}
|
package/js/src/alpaca.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export default class alpaca extends Exchange {
|
|
|
25
25
|
parseTimeInForce(timeInForce: any): string;
|
|
26
26
|
parseTrade(trade: any, market?: Market): Trade;
|
|
27
27
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
28
|
-
url:
|
|
28
|
+
url: string;
|
|
29
29
|
method: string;
|
|
30
30
|
body: any;
|
|
31
31
|
headers: any;
|
|
@@ -205,8 +205,8 @@ export default class Exchange {
|
|
|
205
205
|
safeInteger: (o: any, k: IndexType, $default?: number) => number;
|
|
206
206
|
sum: (...xs: any[]) => any;
|
|
207
207
|
omitZero: typeof functions.omitZero;
|
|
208
|
-
implodeParams: (string:
|
|
209
|
-
extractParams: (string:
|
|
208
|
+
implodeParams: (string: string, params: any[] | Dictionary<any>) => string;
|
|
209
|
+
extractParams: (string: string) => string[];
|
|
210
210
|
json: (data: any, params?: any) => string;
|
|
211
211
|
vwap: typeof functions.vwap;
|
|
212
212
|
merge: (target: Dictionary<any>, ...args: any) => Dictionary<any>;
|
|
@@ -993,7 +993,7 @@ export default class Exchange {
|
|
|
993
993
|
amountToPrecision(symbol: string, amount: any): any;
|
|
994
994
|
feeToPrecision(symbol: string, fee: any): any;
|
|
995
995
|
currencyToPrecision(code: string, fee: any, networkCode?: any): any;
|
|
996
|
-
forceString(value: any):
|
|
996
|
+
forceString(value: any): string;
|
|
997
997
|
isTickPrecision(): boolean;
|
|
998
998
|
isDecimalPrecision(): boolean;
|
|
999
999
|
isSignificantPrecision(): boolean;
|
|
@@ -1002,7 +1002,7 @@ export default class Exchange {
|
|
|
1002
1002
|
parsePrecision(precision?: string): string;
|
|
1003
1003
|
integerPrecisionToAmount(precision: Str): string;
|
|
1004
1004
|
loadTimeDifference(params?: {}): Promise<any>;
|
|
1005
|
-
implodeHostname(url: string):
|
|
1005
|
+
implodeHostname(url: string): string;
|
|
1006
1006
|
fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<any>;
|
|
1007
1007
|
createPostOnlyOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
1008
1008
|
createPostOnlyOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -3045,15 +3045,15 @@ export default class Exchange {
|
|
|
3045
3045
|
// timestamp and symbol operations don't belong in safeTicker
|
|
3046
3046
|
// they should be done in the derived classes
|
|
3047
3047
|
return this.extend(ticker, {
|
|
3048
|
-
'bid': this.parseNumber(this.omitZero(this.
|
|
3048
|
+
'bid': this.parseNumber(this.omitZero(this.safeString(ticker, 'bid'))),
|
|
3049
3049
|
'bidVolume': this.safeNumber(ticker, 'bidVolume'),
|
|
3050
|
-
'ask': this.parseNumber(this.omitZero(this.
|
|
3050
|
+
'ask': this.parseNumber(this.omitZero(this.safeString(ticker, 'ask'))),
|
|
3051
3051
|
'askVolume': this.safeNumber(ticker, 'askVolume'),
|
|
3052
3052
|
'high': this.parseNumber(this.omitZero(this.safeString(ticker, 'high'))),
|
|
3053
|
-
'low': this.parseNumber(this.omitZero(this.
|
|
3054
|
-
'open': this.parseNumber(this.omitZero(
|
|
3055
|
-
'close': this.parseNumber(this.omitZero(
|
|
3056
|
-
'last': this.parseNumber(this.omitZero(
|
|
3053
|
+
'low': this.parseNumber(this.omitZero(this.safeString(ticker, 'low'))),
|
|
3054
|
+
'open': this.parseNumber(this.omitZero(open)),
|
|
3055
|
+
'close': this.parseNumber(this.omitZero(close)),
|
|
3056
|
+
'last': this.parseNumber(this.omitZero(last)),
|
|
3057
3057
|
'change': this.parseNumber(change),
|
|
3058
3058
|
'percentage': this.parseNumber(percentage),
|
|
3059
3059
|
'average': this.parseNumber(average),
|
package/js/src/base/errors.d.ts
CHANGED
|
@@ -34,6 +34,9 @@ declare class NoChange extends OperationRejected {
|
|
|
34
34
|
declare class MarginModeAlreadySet extends NoChange {
|
|
35
35
|
constructor(message: any);
|
|
36
36
|
}
|
|
37
|
+
declare class MarketClosed extends OperationRejected {
|
|
38
|
+
constructor(message: any);
|
|
39
|
+
}
|
|
37
40
|
declare class BadResponse extends ExchangeError {
|
|
38
41
|
constructor(message: any);
|
|
39
42
|
}
|
|
@@ -106,7 +109,7 @@ declare class InvalidNonce extends NetworkError {
|
|
|
106
109
|
declare class RequestTimeout extends NetworkError {
|
|
107
110
|
constructor(message: any);
|
|
108
111
|
}
|
|
109
|
-
export { 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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
112
|
+
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
110
113
|
declare const _default: {
|
|
111
114
|
BaseError: typeof BaseError;
|
|
112
115
|
ExchangeError: typeof ExchangeError;
|
|
@@ -120,6 +123,7 @@ declare const _default: {
|
|
|
120
123
|
OperationRejected: typeof OperationRejected;
|
|
121
124
|
NoChange: typeof NoChange;
|
|
122
125
|
MarginModeAlreadySet: typeof MarginModeAlreadySet;
|
|
126
|
+
MarketClosed: typeof MarketClosed;
|
|
123
127
|
BadResponse: typeof BadResponse;
|
|
124
128
|
NullResponse: typeof NullResponse;
|
|
125
129
|
InsufficientFunds: typeof InsufficientFunds;
|
package/js/src/base/errors.js
CHANGED
|
@@ -77,6 +77,12 @@ class MarginModeAlreadySet extends NoChange {
|
|
|
77
77
|
this.name = 'MarginModeAlreadySet';
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
class MarketClosed extends OperationRejected {
|
|
81
|
+
constructor(message) {
|
|
82
|
+
super(message);
|
|
83
|
+
this.name = 'MarketClosed';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
80
86
|
class BadResponse extends ExchangeError {
|
|
81
87
|
constructor(message) {
|
|
82
88
|
super(message);
|
|
@@ -221,5 +227,5 @@ class RequestTimeout extends NetworkError {
|
|
|
221
227
|
this.name = 'RequestTimeout';
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
|
-
export { 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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
225
|
-
export default { 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, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
230
|
+
export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
231
|
+
export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Dictionary, Num } from '../types.js';
|
|
1
2
|
declare const parseTimeframe: (timeframe: string) => number;
|
|
2
|
-
declare const roundTimeframe: (timeframe:
|
|
3
|
-
declare const extractParams: (string:
|
|
4
|
-
declare const implodeParams: (string:
|
|
5
|
-
declare function vwap(baseVolume:
|
|
3
|
+
declare const roundTimeframe: (timeframe: string, timestamp: number, direction?: number) => number;
|
|
4
|
+
declare const extractParams: (string: string) => string[];
|
|
5
|
+
declare const implodeParams: (string: string, params: Dictionary<any> | any[]) => string;
|
|
6
|
+
declare function vwap(baseVolume: number, quoteVolume: number): Num;
|
|
6
7
|
declare function aggregate(bidasks: any): number[][];
|
|
7
8
|
export { aggregate, parseTimeframe, roundTimeframe, implodeParams, extractParams, vwap, };
|
|
@@ -82,10 +82,10 @@ function aggregate(bidasks) {
|
|
|
82
82
|
for (let i = 0; i < bidasks.length; i++) {
|
|
83
83
|
const [price, volume] = bidasks[i];
|
|
84
84
|
if (volume > 0) {
|
|
85
|
-
result[price] = (result[price] || 0) + volume;
|
|
85
|
+
result[price] = (result[price] || 0) + volume; // TODO: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{}'.ts(7053)
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
return Object.keys(result).map((price) => [parseFloat(price), parseFloat(result[price])]);
|
|
88
|
+
return Object.keys(result).map((price) => [parseFloat(price), parseFloat(result[price])]); // TODO: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}', No index signature with a parameter of type 'string' was found on type '{}'.ts(7053)
|
|
89
89
|
}
|
|
90
90
|
export { aggregate, parseTimeframe, roundTimeframe, implodeParams, extractParams, vwap, };
|
|
91
91
|
/* ------------------------------------------------------------------------ */
|
|
@@ -18,10 +18,10 @@ declare const precisionConstants: {
|
|
|
18
18
|
NO_PADDING: number;
|
|
19
19
|
PAD_WITH_ZERO: number;
|
|
20
20
|
};
|
|
21
|
-
declare function numberToString(x: any):
|
|
22
|
-
declare const truncate_to_string: (num:
|
|
23
|
-
declare const truncate: (num:
|
|
24
|
-
declare function precisionFromString(str:
|
|
21
|
+
declare function numberToString(x: any): string | undefined;
|
|
22
|
+
declare const truncate_to_string: (num: number | string, precision?: number) => string;
|
|
23
|
+
declare const truncate: (num: number | string, precision?: number) => number;
|
|
24
|
+
declare function precisionFromString(str: string): number;
|
|
25
25
|
declare const decimalToPrecision: (x: any, roundingMode: any, numPrecisionDigits: any, countingMode?: number, paddingMode?: number) => any;
|
|
26
|
-
declare function omitZero(stringNumber:
|
|
26
|
+
declare function omitZero(stringNumber: string): string;
|
|
27
27
|
export { numberToString, precisionFromString, decimalToPrecision, truncate_to_string, truncate, omitZero, precisionConstants, ROUND, TRUNCATE, ROUND_UP, ROUND_DOWN, DECIMAL_PLACES, SIGNIFICANT_DIGITS, TICK_SIZE, NO_PADDING, PAD_WITH_ZERO, };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Future } from './Future.js';
|
|
2
|
+
import { Dictionary, Str } from '../types.js';
|
|
2
3
|
export default class Client {
|
|
3
4
|
connected: Promise<any>;
|
|
4
5
|
disconnected: ReturnType<typeof Future>;
|
|
5
|
-
futures:
|
|
6
|
-
rejections:
|
|
6
|
+
futures: Dictionary<any>;
|
|
7
|
+
rejections: Dictionary<any>;
|
|
7
8
|
keepAlive: number;
|
|
8
9
|
connection: any;
|
|
9
10
|
connectionTimeout: any;
|
|
@@ -23,12 +24,12 @@ export default class Client {
|
|
|
23
24
|
onErrorCallback: any;
|
|
24
25
|
onCloseCallback: any;
|
|
25
26
|
ping: any;
|
|
26
|
-
subscriptions:
|
|
27
|
+
subscriptions: Dictionary<any>;
|
|
27
28
|
throttle: any;
|
|
28
|
-
constructor(url:
|
|
29
|
-
future(messageHash:
|
|
30
|
-
resolve(result: any, messageHash:
|
|
31
|
-
reject(result: any, messageHash?:
|
|
29
|
+
constructor(url: string, onMessageCallback: Function | undefined, onErrorCallback: Function | undefined, onCloseCallback: Function | undefined, onConnectedCallback: Function | undefined, config?: {});
|
|
30
|
+
future(messageHash: string): any;
|
|
31
|
+
resolve(result: any, messageHash: Str): any;
|
|
32
|
+
reject(result: any, messageHash?: Str): any;
|
|
32
33
|
log(...args: any[]): void;
|
|
33
34
|
connect(backoffDelay?: number): void;
|
|
34
35
|
isOpen(): boolean;
|
package/js/src/base/ws/Client.js
CHANGED
|
@@ -11,6 +11,7 @@ import { isNode, isJsonEncodedObject, deepExtend, milliseconds, } from '../../ba
|
|
|
11
11
|
import { utf8 } from '../../static_dependencies/scure-base/index.js';
|
|
12
12
|
export default class Client {
|
|
13
13
|
constructor(url, onMessageCallback, onErrorCallback, onCloseCallback, onConnectedCallback, config = {}) {
|
|
14
|
+
this.verbose = false;
|
|
14
15
|
const defaults = {
|
|
15
16
|
url,
|
|
16
17
|
onMessageCallback,
|
|
@@ -60,7 +61,7 @@ export default class Client {
|
|
|
60
61
|
if (this.verbose && (messageHash === undefined)) {
|
|
61
62
|
this.log(new Date(), 'resolve received undefined messageHash');
|
|
62
63
|
}
|
|
63
|
-
if (messageHash in this.futures) {
|
|
64
|
+
if ((messageHash !== undefined) && (messageHash in this.futures)) {
|
|
64
65
|
const promise = this.futures[messageHash];
|
|
65
66
|
promise.resolve(result);
|
|
66
67
|
delete this.futures[messageHash];
|
package/js/src/binance.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/binance.js';
|
|
9
|
-
import { ExchangeError, ArgumentsRequired, OperationFailed, OperationRejected, InsufficientFunds, OrderNotFound, InvalidOrder, DDoSProtection, InvalidNonce, AuthenticationError, RateLimitExceeded, PermissionDenied, NotSupported, BadRequest, BadSymbol, AccountSuspended, OrderImmediatelyFillable, OnMaintenance, BadResponse, RequestTimeout, OrderNotFillable, MarginModeAlreadySet } from './base/errors.js';
|
|
9
|
+
import { ExchangeError, ArgumentsRequired, OperationFailed, OperationRejected, InsufficientFunds, OrderNotFound, InvalidOrder, DDoSProtection, InvalidNonce, AuthenticationError, RateLimitExceeded, PermissionDenied, NotSupported, BadRequest, BadSymbol, AccountSuspended, OrderImmediatelyFillable, OnMaintenance, BadResponse, RequestTimeout, OrderNotFillable, MarginModeAlreadySet, MarketClosed } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { TRUNCATE, DECIMAL_PLACES } from './base/functions/number.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
@@ -2399,7 +2399,7 @@ export default class binance extends Exchange {
|
|
|
2399
2399
|
'Rest API trading is not enabled.': PermissionDenied,
|
|
2400
2400
|
'This account may not place or cancel orders.': PermissionDenied,
|
|
2401
2401
|
"You don't have permission.": PermissionDenied,
|
|
2402
|
-
'Market is closed.':
|
|
2402
|
+
'Market is closed.': MarketClosed,
|
|
2403
2403
|
'Too many requests. Please try again later.': RateLimitExceeded,
|
|
2404
2404
|
'This action is disabled on this account.': AccountSuspended,
|
|
2405
2405
|
'Limit orders require GTC for this phase.': BadRequest,
|
|
@@ -4002,8 +4002,8 @@ export default class binance extends Exchange {
|
|
|
4002
4002
|
* @name binance#fetchLastPrices
|
|
4003
4003
|
* @description fetches the last price for multiple markets
|
|
4004
4004
|
* @see https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker // spot
|
|
4005
|
-
* @see https://binance-docs.github.io/apidocs/
|
|
4006
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-
|
|
4005
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#symbol-price-ticker // swap
|
|
4006
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-tickers // future
|
|
4007
4007
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4008
4008
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4009
4009
|
* @param {string} [params.subType] "linear" or "inverse"
|
package/js/src/bingx.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export default class bingx extends Exchange {
|
|
|
147
147
|
fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
|
|
148
148
|
parseMarginMode(marginMode: any, market?: any): MarginMode;
|
|
149
149
|
sign(path: any, section?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
150
|
-
url:
|
|
150
|
+
url: string;
|
|
151
151
|
method: string;
|
|
152
152
|
body: any;
|
|
153
153
|
headers: any;
|
package/js/src/bingx.js
CHANGED
package/js/src/bybit.js
CHANGED
|
@@ -6755,20 +6755,20 @@ export default class bybit extends Exchange {
|
|
|
6755
6755
|
const isUsdcSettled = market['settle'] === 'USDC';
|
|
6756
6756
|
// engage in leverage setting
|
|
6757
6757
|
// we reuse the code here instead of having two methods
|
|
6758
|
-
|
|
6758
|
+
const leverageString = this.numberToString(leverage);
|
|
6759
6759
|
const request = {
|
|
6760
6760
|
'symbol': market['id'],
|
|
6761
|
-
'buyLeverage':
|
|
6762
|
-
'sellLeverage':
|
|
6761
|
+
'buyLeverage': leverageString,
|
|
6762
|
+
'sellLeverage': leverageString,
|
|
6763
6763
|
};
|
|
6764
6764
|
let response = undefined;
|
|
6765
6765
|
if (isUsdcSettled && !isUnifiedAccount) {
|
|
6766
|
-
request['leverage'] =
|
|
6766
|
+
request['leverage'] = leverageString;
|
|
6767
6767
|
response = await this.privatePostPerpetualUsdcOpenapiPrivateV1PositionLeverageSave(this.extend(request, params));
|
|
6768
6768
|
}
|
|
6769
6769
|
else {
|
|
6770
|
-
request['buyLeverage'] =
|
|
6771
|
-
request['sellLeverage'] =
|
|
6770
|
+
request['buyLeverage'] = leverageString;
|
|
6771
|
+
request['sellLeverage'] = leverageString;
|
|
6772
6772
|
if (market['linear']) {
|
|
6773
6773
|
request['category'] = 'linear';
|
|
6774
6774
|
}
|
package/js/src/coinex.js
CHANGED
|
@@ -3701,31 +3701,34 @@ export default class coinex extends Exchange {
|
|
|
3701
3701
|
* @method
|
|
3702
3702
|
* @name coinex#createDepositAddress
|
|
3703
3703
|
* @description create a currency deposit address
|
|
3704
|
-
* @see https://
|
|
3704
|
+
* @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/update-deposit-address
|
|
3705
3705
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
3706
3706
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3707
|
+
* @param {string} [params.network] the blockchain network to create a deposit address on
|
|
3707
3708
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
3708
3709
|
*/
|
|
3709
3710
|
await this.loadMarkets();
|
|
3710
3711
|
const currency = this.currency(code);
|
|
3712
|
+
const network = this.safeString2(params, 'chain', 'network');
|
|
3713
|
+
if (network === undefined) {
|
|
3714
|
+
throw new ArgumentsRequired(this.id + ' createDepositAddress() requires a network parameter');
|
|
3715
|
+
}
|
|
3716
|
+
params = this.omit(params, 'network');
|
|
3711
3717
|
const request = {
|
|
3712
|
-
'
|
|
3718
|
+
'ccy': currency['id'],
|
|
3719
|
+
'chain': this.networkCodeToId(network, currency['code']),
|
|
3713
3720
|
};
|
|
3714
|
-
|
|
3715
|
-
const network = this.safeString(params, 'network');
|
|
3716
|
-
params = this.omit(params, 'network');
|
|
3717
|
-
request['smart_contract_name'] = network;
|
|
3718
|
-
}
|
|
3719
|
-
const response = await this.v1PrivatePutBalanceDepositAddressCoinType(this.extend(request, params));
|
|
3721
|
+
const response = await this.v2PrivatePostAssetsRenewalDepositAddress(this.extend(request, params));
|
|
3720
3722
|
//
|
|
3721
3723
|
// {
|
|
3722
3724
|
// "code": 0,
|
|
3723
3725
|
// "data": {
|
|
3724
|
-
// "
|
|
3725
|
-
// "
|
|
3726
|
+
// "address": "0x321bd6479355142334f45653ad5d8b76105a1234",
|
|
3727
|
+
// "memo": ""
|
|
3726
3728
|
// },
|
|
3727
|
-
// "message": "
|
|
3729
|
+
// "message": "OK"
|
|
3728
3730
|
// }
|
|
3731
|
+
//
|
|
3729
3732
|
const data = this.safeDict(response, 'data', {});
|
|
3730
3733
|
return this.parseDepositAddress(data, currency);
|
|
3731
3734
|
}
|
|
@@ -3734,18 +3737,16 @@ export default class coinex extends Exchange {
|
|
|
3734
3737
|
* @method
|
|
3735
3738
|
* @name coinex#fetchDepositAddress
|
|
3736
3739
|
* @description fetch the deposit address for a currency associated with this account
|
|
3737
|
-
* @see https://
|
|
3740
|
+
* @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-address
|
|
3738
3741
|
* @param {string} code unified currency code
|
|
3739
3742
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3743
|
+
* @param {string} [params.network] the blockchain network to create a deposit address on
|
|
3740
3744
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
3741
3745
|
*/
|
|
3742
3746
|
await this.loadMarkets();
|
|
3743
3747
|
const currency = this.currency(code);
|
|
3744
|
-
const
|
|
3745
|
-
|
|
3746
|
-
};
|
|
3747
|
-
const networks = this.safeValue(currency, 'networks', {});
|
|
3748
|
-
const network = this.safeString(params, 'network');
|
|
3748
|
+
const networks = this.safeDict(currency, 'networks', {});
|
|
3749
|
+
const network = this.safeString2(params, 'network', 'chain');
|
|
3749
3750
|
params = this.omit(params, 'network');
|
|
3750
3751
|
const networksKeys = Object.keys(networks);
|
|
3751
3752
|
const numOfNetworks = networksKeys.length;
|
|
@@ -3757,24 +3758,24 @@ export default class coinex extends Exchange {
|
|
|
3757
3758
|
throw new ExchangeError(this.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code);
|
|
3758
3759
|
}
|
|
3759
3760
|
}
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3761
|
+
const request = {
|
|
3762
|
+
'ccy': currency['id'],
|
|
3763
|
+
'chain': network,
|
|
3764
|
+
};
|
|
3765
|
+
const response = await this.v2PrivateGetAssetsDepositAddress(this.extend(request, params));
|
|
3764
3766
|
//
|
|
3765
|
-
//
|
|
3766
|
-
//
|
|
3767
|
-
//
|
|
3768
|
-
//
|
|
3769
|
-
//
|
|
3770
|
-
//
|
|
3771
|
-
//
|
|
3772
|
-
//
|
|
3773
|
-
// }
|
|
3767
|
+
// {
|
|
3768
|
+
// "code": 0,
|
|
3769
|
+
// "data": {
|
|
3770
|
+
// "address": "0x321bd6479355142334f45653ad5d8b76105a1234",
|
|
3771
|
+
// "memo": ""
|
|
3772
|
+
// },
|
|
3773
|
+
// "message": "OK"
|
|
3774
|
+
// }
|
|
3774
3775
|
//
|
|
3775
|
-
const data = this.
|
|
3776
|
+
const data = this.safeDict(response, 'data', {});
|
|
3776
3777
|
const depositAddress = this.parseDepositAddress(data, currency);
|
|
3777
|
-
const options = this.
|
|
3778
|
+
const options = this.safeDict(this.options, 'fetchDepositAddress', {});
|
|
3778
3779
|
const fillResponseFromRequest = this.safeBool(options, 'fillResponseFromRequest', true);
|
|
3779
3780
|
if (fillResponseFromRequest) {
|
|
3780
3781
|
depositAddress['network'] = this.safeNetworkCode(network, currency);
|
|
@@ -3800,11 +3801,11 @@ export default class coinex extends Exchange {
|
|
|
3800
3801
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
3801
3802
|
//
|
|
3802
3803
|
// {
|
|
3803
|
-
// "
|
|
3804
|
-
// "
|
|
3804
|
+
// "address": "1P1JqozxioQwaqPwgMAQdNDYNyaVSqgARq",
|
|
3805
|
+
// "memo": ""
|
|
3805
3806
|
// }
|
|
3806
3807
|
//
|
|
3807
|
-
const coinAddress = this.safeString(depositAddress, '
|
|
3808
|
+
const coinAddress = this.safeString(depositAddress, 'address');
|
|
3808
3809
|
const parts = coinAddress.split(':');
|
|
3809
3810
|
let address = undefined;
|
|
3810
3811
|
let tag = undefined;
|
package/js/src/cryptocom.js
CHANGED
|
@@ -499,7 +499,8 @@ export default class cryptocom extends Exchange {
|
|
|
499
499
|
const strike = this.safeString(market, 'strike');
|
|
500
500
|
const marginBuyEnabled = this.safeValue(market, 'margin_buy_enabled');
|
|
501
501
|
const marginSellEnabled = this.safeValue(market, 'margin_sell_enabled');
|
|
502
|
-
const
|
|
502
|
+
const expiryString = this.omitZero(this.safeString(market, 'expiry_timestamp_ms'));
|
|
503
|
+
const expiry = (expiryString !== undefined) ? parseInt(expiryString) : undefined;
|
|
503
504
|
let symbol = base + '/' + quote;
|
|
504
505
|
let type = undefined;
|
|
505
506
|
let contract = undefined;
|
package/js/src/hitbtc.js
CHANGED
package/js/src/luno.js
CHANGED
|
@@ -150,6 +150,7 @@ export default class luno extends Exchange {
|
|
|
150
150
|
'withdrawals': 1,
|
|
151
151
|
'send': 1,
|
|
152
152
|
'oauth2/grant': 1,
|
|
153
|
+
'beneficiaries': 1,
|
|
153
154
|
// POST /api/exchange/1/move
|
|
154
155
|
},
|
|
155
156
|
'put': {
|
|
@@ -157,6 +158,7 @@ export default class luno extends Exchange {
|
|
|
157
158
|
},
|
|
158
159
|
'delete': {
|
|
159
160
|
'withdrawals/{id}': 1,
|
|
161
|
+
'beneficiaries/{id}': 1,
|
|
160
162
|
},
|
|
161
163
|
},
|
|
162
164
|
},
|
package/js/src/phemex.js
CHANGED
|
@@ -2383,7 +2383,7 @@ export default class phemex extends Exchange {
|
|
|
2383
2383
|
lastTradeTimestamp = undefined;
|
|
2384
2384
|
}
|
|
2385
2385
|
const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
|
|
2386
|
-
const stopPrice = this.omitZero(this.
|
|
2386
|
+
const stopPrice = this.omitZero(this.safeString2(order, 'stopPx', 'stopPxRp'));
|
|
2387
2387
|
const postOnly = (timeInForce === 'PO');
|
|
2388
2388
|
let reduceOnly = this.safeValue(order, 'reduceOnly');
|
|
2389
2389
|
const execInst = this.safeString(order, 'execInst');
|
package/js/src/pro/hitbtc.js
CHANGED
|
@@ -1198,7 +1198,7 @@ export default class hitbtc extends hitbtcRest {
|
|
|
1198
1198
|
// "id": 1700233093414
|
|
1199
1199
|
// }
|
|
1200
1200
|
//
|
|
1201
|
-
const messageHash = this.
|
|
1201
|
+
const messageHash = this.safeString(message, 'id');
|
|
1202
1202
|
const result = this.safeValue(message, 'result', {});
|
|
1203
1203
|
if (Array.isArray(result)) {
|
|
1204
1204
|
const parsedOrders = [];
|
|
@@ -135,9 +135,9 @@ export default class independentreserve extends independentreserveRest {
|
|
|
135
135
|
if (limit === undefined) {
|
|
136
136
|
limit = 100;
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
const url = this.urls['api']['ws'] + '/orderbook/' +
|
|
140
|
-
const messageHash = 'orderbook:' + symbol + ':' +
|
|
138
|
+
const limitString = this.numberToString(limit);
|
|
139
|
+
const url = this.urls['api']['ws'] + '/orderbook/' + limitString + '?subscribe=' + market['base'] + '-' + market['quote'];
|
|
140
|
+
const messageHash = 'orderbook:' + symbol + ':' + limitString;
|
|
141
141
|
const subscription = {
|
|
142
142
|
'receivedSnapshot': false,
|
|
143
143
|
};
|
package/js/src/pro/poloniex.js
CHANGED
|
@@ -317,7 +317,7 @@ export default class poloniex extends poloniexRest {
|
|
|
317
317
|
// }]
|
|
318
318
|
// }
|
|
319
319
|
//
|
|
320
|
-
const messageHash = this.
|
|
320
|
+
const messageHash = this.safeString(message, 'id');
|
|
321
321
|
const data = this.safeValue(message, 'data', []);
|
|
322
322
|
const orders = [];
|
|
323
323
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -655,8 +655,8 @@ export default class poloniex extends poloniexRest {
|
|
|
655
655
|
'type': this.safeStringLower(trade, 'type'),
|
|
656
656
|
'side': this.safeStringLower2(trade, 'takerSide', 'side'),
|
|
657
657
|
'takerOrMaker': takerMaker,
|
|
658
|
-
'price': this.omitZero(this.
|
|
659
|
-
'amount': this.omitZero(this.
|
|
658
|
+
'price': this.omitZero(this.safeString2(trade, 'tradePrice', 'price')),
|
|
659
|
+
'amount': this.omitZero(this.safeString2(trade, 'filledQuantity', 'quantity')),
|
|
660
660
|
'cost': this.safeString2(trade, 'amount', 'filledAmount'),
|
|
661
661
|
'fee': {
|
|
662
662
|
'rate': undefined,
|
package/js/src/upbit.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ export default class upbit extends Exchange {
|
|
|
92
92
|
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
93
93
|
nonce(): number;
|
|
94
94
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
95
|
-
url:
|
|
95
|
+
url: string;
|
|
96
96
|
method: string;
|
|
97
97
|
body: any;
|
|
98
98
|
headers: any;
|
package/js/src/woo.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export default class woo extends Exchange {
|
|
|
111
111
|
};
|
|
112
112
|
nonce(): number;
|
|
113
113
|
sign(path: any, section?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
114
|
-
url:
|
|
114
|
+
url: string;
|
|
115
115
|
method: string;
|
|
116
116
|
body: any;
|
|
117
117
|
headers: any;
|
package/js/src/zonda.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export default class zonda extends Exchange {
|
|
|
74
74
|
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
75
75
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
76
76
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
77
|
-
url:
|
|
77
|
+
url: string;
|
|
78
78
|
method: string;
|
|
79
79
|
body: any;
|
|
80
80
|
headers: any;
|
package/package.json
CHANGED