ccxt 4.3.14 → 4.3.16
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/alpaca.js +1 -0
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/base/Exchange.js +30 -21
- 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/base/ws/WsClient.js +4 -0
- package/dist/cjs/src/binance.js +4 -3
- package/dist/cjs/src/bingx.js +2 -0
- package/dist/cjs/src/bitmex.js +1 -0
- package/dist/cjs/src/bybit.js +7 -6
- package/dist/cjs/src/coinbaseinternational.js +1 -0
- package/dist/cjs/src/coinex.js +36 -35
- package/dist/cjs/src/coinmetro.js +1 -0
- package/dist/cjs/src/cryptocom.js +3 -1
- package/dist/cjs/src/currencycom.js +1 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/gate.js +1 -0
- package/dist/cjs/src/gemini.js +1 -0
- package/dist/cjs/src/hitbtc.js +2 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/hyperliquid.js +5 -0
- package/dist/cjs/src/idex.js +1 -0
- package/dist/cjs/src/krakenfutures.js +1 -0
- package/dist/cjs/src/luno.js +2 -0
- package/dist/cjs/src/ndax.js +1 -0
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/poloniex.js +1 -0
- 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/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/wavesexchange.js +1 -0
- package/dist/cjs/src/woo.js +1 -0
- package/dist/cjs/src/zaif.js +1 -1
- 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/alpaca.js +1 -0
- package/js/src/ascendex.js +1 -0
- package/js/src/base/Exchange.d.ts +5 -4
- package/js/src/base/Exchange.js +30 -21
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +41 -37
- 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/base/ws/WsClient.d.ts +1 -1
- package/js/src/base/ws/WsClient.js +4 -0
- package/js/src/binance.js +5 -4
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +2 -0
- package/js/src/bitmex.js +1 -0
- package/js/src/bybit.js +7 -6
- package/js/src/coinbaseinternational.js +1 -0
- package/js/src/coinex.js +36 -35
- package/js/src/coinmetro.js +1 -0
- package/js/src/cryptocom.js +3 -1
- package/js/src/currencycom.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/gate.js +1 -0
- package/js/src/gemini.js +1 -0
- package/js/src/hitbtc.js +2 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/hyperliquid.js +5 -0
- package/js/src/idex.js +1 -0
- package/js/src/krakenfutures.js +1 -0
- package/js/src/luno.js +2 -0
- package/js/src/ndax.js +1 -0
- package/js/src/okx.js +1 -0
- package/js/src/phemex.js +2 -1
- package/js/src/poloniex.js +1 -0
- 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/probit.js +1 -0
- package/js/src/upbit.d.ts +1 -1
- package/js/src/wavesexchange.js +1 -0
- package/js/src/woo.d.ts +1 -1
- package/js/src/woo.js +1 -0
- package/js/src/zaif.js +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/package.json +1 -1
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];
|
|
@@ -12,6 +12,10 @@ import { Future } from './Future.js';
|
|
|
12
12
|
// eslint-disable-next-line no-restricted-globals
|
|
13
13
|
const WebSocketPlatform = isNode ? WebSocket : self.WebSocket;
|
|
14
14
|
export default class WsClient extends Client {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.startedConnecting = false;
|
|
18
|
+
}
|
|
15
19
|
createConnection() {
|
|
16
20
|
if (this.verbose) {
|
|
17
21
|
this.log(new Date(), 'connecting to', this.url);
|
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';
|
|
@@ -157,6 +157,7 @@ export default class binance extends Exchange {
|
|
|
157
157
|
'reduceMargin': true,
|
|
158
158
|
'repayCrossMargin': true,
|
|
159
159
|
'repayIsolatedMargin': true,
|
|
160
|
+
'sandbox': true,
|
|
160
161
|
'setLeverage': true,
|
|
161
162
|
'setMargin': false,
|
|
162
163
|
'setMarginMode': true,
|
|
@@ -2399,7 +2400,7 @@ export default class binance extends Exchange {
|
|
|
2399
2400
|
'Rest API trading is not enabled.': PermissionDenied,
|
|
2400
2401
|
'This account may not place or cancel orders.': PermissionDenied,
|
|
2401
2402
|
"You don't have permission.": PermissionDenied,
|
|
2402
|
-
'Market is closed.':
|
|
2403
|
+
'Market is closed.': MarketClosed,
|
|
2403
2404
|
'Too many requests. Please try again later.': RateLimitExceeded,
|
|
2404
2405
|
'This action is disabled on this account.': AccountSuspended,
|
|
2405
2406
|
'Limit orders require GTC for this phase.': BadRequest,
|
|
@@ -4002,8 +4003,8 @@ export default class binance extends Exchange {
|
|
|
4002
4003
|
* @name binance#fetchLastPrices
|
|
4003
4004
|
* @description fetches the last price for multiple markets
|
|
4004
4005
|
* @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-
|
|
4006
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#symbol-price-ticker // swap
|
|
4007
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-tickers // future
|
|
4007
4008
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4008
4009
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4009
4010
|
* @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
|
@@ -86,6 +86,7 @@ export default class bingx extends Exchange {
|
|
|
86
86
|
'fetchTransfers': true,
|
|
87
87
|
'fetchWithdrawals': true,
|
|
88
88
|
'reduceMargin': true,
|
|
89
|
+
'sandbox': true,
|
|
89
90
|
'setLeverage': true,
|
|
90
91
|
'setMargin': true,
|
|
91
92
|
'setMarginMode': true,
|
|
@@ -389,6 +390,7 @@ export default class bingx extends Exchange {
|
|
|
389
390
|
'100202': InsufficientFunds,
|
|
390
391
|
'100204': BadRequest,
|
|
391
392
|
'100400': BadRequest,
|
|
393
|
+
'100410': OperationFailed,
|
|
392
394
|
'100421': BadSymbol,
|
|
393
395
|
'100440': ExchangeError,
|
|
394
396
|
'100500': OperationFailed,
|
package/js/src/bitmex.js
CHANGED
package/js/src/bybit.js
CHANGED
|
@@ -122,6 +122,7 @@ export default class bybit extends Exchange {
|
|
|
122
122
|
'fetchVolatilityHistory': true,
|
|
123
123
|
'fetchWithdrawals': true,
|
|
124
124
|
'repayCrossMargin': true,
|
|
125
|
+
'sandbox': true,
|
|
125
126
|
'setLeverage': true,
|
|
126
127
|
'setMarginMode': true,
|
|
127
128
|
'setPositionMode': true,
|
|
@@ -6755,20 +6756,20 @@ export default class bybit extends Exchange {
|
|
|
6755
6756
|
const isUsdcSettled = market['settle'] === 'USDC';
|
|
6756
6757
|
// engage in leverage setting
|
|
6757
6758
|
// we reuse the code here instead of having two methods
|
|
6758
|
-
|
|
6759
|
+
const leverageString = this.numberToString(leverage);
|
|
6759
6760
|
const request = {
|
|
6760
6761
|
'symbol': market['id'],
|
|
6761
|
-
'buyLeverage':
|
|
6762
|
-
'sellLeverage':
|
|
6762
|
+
'buyLeverage': leverageString,
|
|
6763
|
+
'sellLeverage': leverageString,
|
|
6763
6764
|
};
|
|
6764
6765
|
let response = undefined;
|
|
6765
6766
|
if (isUsdcSettled && !isUnifiedAccount) {
|
|
6766
|
-
request['leverage'] =
|
|
6767
|
+
request['leverage'] = leverageString;
|
|
6767
6768
|
response = await this.privatePostPerpetualUsdcOpenapiPrivateV1PositionLeverageSave(this.extend(request, params));
|
|
6768
6769
|
}
|
|
6769
6770
|
else {
|
|
6770
|
-
request['buyLeverage'] =
|
|
6771
|
-
request['sellLeverage'] =
|
|
6771
|
+
request['buyLeverage'] = leverageString;
|
|
6772
|
+
request['sellLeverage'] = leverageString;
|
|
6772
6773
|
if (market['linear']) {
|
|
6773
6774
|
request['category'] = 'linear';
|
|
6774
6775
|
}
|
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/coinmetro.js
CHANGED
package/js/src/cryptocom.js
CHANGED
|
@@ -105,6 +105,7 @@ export default class cryptocom extends Exchange {
|
|
|
105
105
|
'reduceMargin': false,
|
|
106
106
|
'repayCrossMargin': false,
|
|
107
107
|
'repayIsolatedMargin': false,
|
|
108
|
+
'sandbox': true,
|
|
108
109
|
'setLeverage': false,
|
|
109
110
|
'setMarginMode': false,
|
|
110
111
|
'setPositionMode': false,
|
|
@@ -499,7 +500,8 @@ export default class cryptocom extends Exchange {
|
|
|
499
500
|
const strike = this.safeString(market, 'strike');
|
|
500
501
|
const marginBuyEnabled = this.safeValue(market, 'margin_buy_enabled');
|
|
501
502
|
const marginSellEnabled = this.safeValue(market, 'margin_sell_enabled');
|
|
502
|
-
const
|
|
503
|
+
const expiryString = this.omitZero(this.safeString(market, 'expiry_timestamp_ms'));
|
|
504
|
+
const expiry = (expiryString !== undefined) ? parseInt(expiryString) : undefined;
|
|
503
505
|
let symbol = base + '/' + quote;
|
|
504
506
|
let type = undefined;
|
|
505
507
|
let contract = undefined;
|
package/js/src/currencycom.js
CHANGED
|
@@ -104,6 +104,7 @@ export default class currencycom extends Exchange {
|
|
|
104
104
|
'fetchWithdrawal': undefined,
|
|
105
105
|
'fetchWithdrawals': true,
|
|
106
106
|
'reduceMargin': undefined,
|
|
107
|
+
'sandbox': true,
|
|
107
108
|
'setLeverage': undefined,
|
|
108
109
|
'setMarginMode': undefined,
|
|
109
110
|
'setPositionMode': undefined,
|
package/js/src/deribit.js
CHANGED
package/js/src/gate.js
CHANGED
package/js/src/gemini.js
CHANGED
package/js/src/hitbtc.js
CHANGED
|
@@ -94,6 +94,7 @@ export default class hitbtc extends Exchange {
|
|
|
94
94
|
'fetchTransactions': 'emulated',
|
|
95
95
|
'fetchWithdrawals': true,
|
|
96
96
|
'reduceMargin': true,
|
|
97
|
+
'sandbox': true,
|
|
97
98
|
'setLeverage': true,
|
|
98
99
|
'setMargin': false,
|
|
99
100
|
'setMarginMode': false,
|
|
@@ -618,6 +619,7 @@ export default class hitbtc extends Exchange {
|
|
|
618
619
|
'accountsByType': {
|
|
619
620
|
'spot': 'spot',
|
|
620
621
|
'funding': 'wallet',
|
|
622
|
+
'swap': 'derivatives',
|
|
621
623
|
'future': 'derivatives',
|
|
622
624
|
},
|
|
623
625
|
'withdraw': {
|
package/js/src/hollaex.js
CHANGED
package/js/src/hyperliquid.js
CHANGED
|
@@ -109,6 +109,7 @@ export default class hyperliquid extends Exchange {
|
|
|
109
109
|
'reduceMargin': true,
|
|
110
110
|
'repayCrossMargin': false,
|
|
111
111
|
'repayIsolatedMargin': false,
|
|
112
|
+
'sandbox': true,
|
|
112
113
|
'setLeverage': true,
|
|
113
114
|
'setMarginMode': true,
|
|
114
115
|
'setPositionMode': false,
|
|
@@ -443,6 +444,10 @@ export default class hyperliquid extends Exchange {
|
|
|
443
444
|
for (let i = 0; i < meta.length; i++) {
|
|
444
445
|
const market = this.safeDict(meta, i, {});
|
|
445
446
|
const marketName = this.safeString(market, 'name');
|
|
447
|
+
if (marketName.indexOf('/') < 0) {
|
|
448
|
+
// there are some weird spot markets in testnet, eg @2
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
446
451
|
const marketParts = marketName.split('/');
|
|
447
452
|
const baseName = this.safeString(marketParts, 0);
|
|
448
453
|
const quoteId = this.safeString(marketParts, 1);
|
package/js/src/idex.js
CHANGED
package/js/src/krakenfutures.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/ndax.js
CHANGED
package/js/src/okx.js
CHANGED
package/js/src/phemex.js
CHANGED
|
@@ -82,6 +82,7 @@ export default class phemex extends Exchange {
|
|
|
82
82
|
'fetchTransfers': true,
|
|
83
83
|
'fetchWithdrawals': true,
|
|
84
84
|
'reduceMargin': false,
|
|
85
|
+
'sandbox': true,
|
|
85
86
|
'setLeverage': true,
|
|
86
87
|
'setMargin': true,
|
|
87
88
|
'setMarginMode': true,
|
|
@@ -2383,7 +2384,7 @@ export default class phemex extends Exchange {
|
|
|
2383
2384
|
lastTradeTimestamp = undefined;
|
|
2384
2385
|
}
|
|
2385
2386
|
const timeInForce = this.parseTimeInForce(this.safeString(order, 'timeInForce'));
|
|
2386
|
-
const stopPrice = this.omitZero(this.
|
|
2387
|
+
const stopPrice = this.omitZero(this.safeString2(order, 'stopPx', 'stopPxRp'));
|
|
2387
2388
|
const postOnly = (timeInForce === 'PO');
|
|
2388
2389
|
let reduceOnly = this.safeValue(order, 'reduceOnly');
|
|
2389
2390
|
const execInst = this.safeString(order, 'execInst');
|
package/js/src/poloniex.js
CHANGED
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/probit.js
CHANGED
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/wavesexchange.js
CHANGED
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/woo.js
CHANGED
package/js/src/zaif.js
CHANGED
|
@@ -678,7 +678,7 @@ export default class zaif extends Exchange {
|
|
|
678
678
|
};
|
|
679
679
|
}
|
|
680
680
|
customNonce() {
|
|
681
|
-
const num = (this.milliseconds() / 1000)
|
|
681
|
+
const num = this.numberToString(this.milliseconds() / 1000);
|
|
682
682
|
const nonce = parseFloat(num);
|
|
683
683
|
return nonce.toFixed(8);
|
|
684
684
|
}
|
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