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/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.16/dist/ccxt.browser.js
|
|
217
|
+
* unpkg: https://unpkg.com/ccxt@4.3.16/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.16/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.16';
|
|
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;
|
package/dist/cjs/src/alpaca.js
CHANGED
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -366,6 +366,7 @@ class Exchange {
|
|
|
366
366
|
'publicAPI': true,
|
|
367
367
|
'privateAPI': true,
|
|
368
368
|
'CORS': undefined,
|
|
369
|
+
'sandbox': undefined,
|
|
369
370
|
'spot': undefined,
|
|
370
371
|
'margin': undefined,
|
|
371
372
|
'swap': undefined,
|
|
@@ -3058,15 +3059,15 @@ class Exchange {
|
|
|
3058
3059
|
// timestamp and symbol operations don't belong in safeTicker
|
|
3059
3060
|
// they should be done in the derived classes
|
|
3060
3061
|
return this.extend(ticker, {
|
|
3061
|
-
'bid': this.parseNumber(this.omitZero(this.
|
|
3062
|
+
'bid': this.parseNumber(this.omitZero(this.safeString(ticker, 'bid'))),
|
|
3062
3063
|
'bidVolume': this.safeNumber(ticker, 'bidVolume'),
|
|
3063
|
-
'ask': this.parseNumber(this.omitZero(this.
|
|
3064
|
+
'ask': this.parseNumber(this.omitZero(this.safeString(ticker, 'ask'))),
|
|
3064
3065
|
'askVolume': this.safeNumber(ticker, 'askVolume'),
|
|
3065
3066
|
'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(
|
|
3067
|
+
'low': this.parseNumber(this.omitZero(this.safeString(ticker, 'low'))),
|
|
3068
|
+
'open': this.parseNumber(this.omitZero(open)),
|
|
3069
|
+
'close': this.parseNumber(this.omitZero(close)),
|
|
3070
|
+
'last': this.parseNumber(this.omitZero(last)),
|
|
3070
3071
|
'change': this.parseNumber(change),
|
|
3071
3072
|
'percentage': this.parseNumber(percentage),
|
|
3072
3073
|
'average': this.parseNumber(average),
|
|
@@ -5848,24 +5849,26 @@ class Exchange {
|
|
|
5848
5849
|
let maxRetries = undefined;
|
|
5849
5850
|
[maxRetries, params] = this.handleOptionAndParams(params, method, 'maxRetries', 3);
|
|
5850
5851
|
let errors$1 = 0;
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
catch (e) {
|
|
5860
|
-
if (e instanceof errors.RateLimitExceeded) {
|
|
5861
|
-
throw e; // if we are rate limited, we should not retry and fail fast
|
|
5852
|
+
while (errors$1 <= maxRetries) {
|
|
5853
|
+
try {
|
|
5854
|
+
if (timeframe && method !== 'fetchFundingRateHistory') {
|
|
5855
|
+
return await this[method](symbol, timeframe, since, limit, params);
|
|
5856
|
+
}
|
|
5857
|
+
else {
|
|
5858
|
+
return await this[method](symbol, since, limit, params);
|
|
5859
|
+
}
|
|
5862
5860
|
}
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5861
|
+
catch (e) {
|
|
5862
|
+
if (e instanceof errors.RateLimitExceeded) {
|
|
5863
|
+
throw e; // if we are rate limited, we should not retry and fail fast
|
|
5864
|
+
}
|
|
5865
|
+
errors$1 += 1;
|
|
5866
|
+
if (errors$1 > maxRetries) {
|
|
5867
|
+
throw e;
|
|
5868
|
+
}
|
|
5866
5869
|
}
|
|
5867
5870
|
}
|
|
5868
|
-
return
|
|
5871
|
+
return [];
|
|
5869
5872
|
}
|
|
5870
5873
|
async fetchPaginatedCallDeterministic(method, symbol = undefined, since = undefined, limit = undefined, timeframe = undefined, params = {}, maxEntriesPerRequest = undefined) {
|
|
5871
5874
|
let maxCalls = undefined;
|
|
@@ -5879,6 +5882,9 @@ class Exchange {
|
|
|
5879
5882
|
if (since !== undefined) {
|
|
5880
5883
|
currentSince = Math.max(currentSince, since);
|
|
5881
5884
|
}
|
|
5885
|
+
else {
|
|
5886
|
+
currentSince = Math.max(currentSince, 1241440531000); // avoid timestamps older than 2009
|
|
5887
|
+
}
|
|
5882
5888
|
const until = this.safeInteger2(params, 'until', 'till'); // do not omit it here
|
|
5883
5889
|
if (until !== undefined) {
|
|
5884
5890
|
const requiredCalls = Math.ceil((until - since) / step);
|
|
@@ -5890,6 +5896,9 @@ class Exchange {
|
|
|
5890
5896
|
if ((until !== undefined) && (currentSince >= until)) {
|
|
5891
5897
|
break;
|
|
5892
5898
|
}
|
|
5899
|
+
if (currentSince >= current) {
|
|
5900
|
+
break;
|
|
5901
|
+
}
|
|
5893
5902
|
tasks.push(this.safeDeterministicCall(method, symbol, currentSince, maxEntriesPerRequest, timeframe, params));
|
|
5894
5903
|
currentSince = this.sum(currentSince, step) - 1;
|
|
5895
5904
|
}
|
|
@@ -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];
|
|
@@ -16,6 +16,10 @@ var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket);
|
|
|
16
16
|
// eslint-disable-next-line no-restricted-globals
|
|
17
17
|
const WebSocketPlatform = platform.isNode ? WebSocket__default["default"] : self.WebSocket;
|
|
18
18
|
class WsClient extends Client {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.startedConnecting = false;
|
|
22
|
+
}
|
|
19
23
|
createConnection() {
|
|
20
24
|
if (this.verbose) {
|
|
21
25
|
this.log(new Date(), 'connecting to', this.url);
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -154,6 +154,7 @@ class binance extends binance$1 {
|
|
|
154
154
|
'reduceMargin': true,
|
|
155
155
|
'repayCrossMargin': true,
|
|
156
156
|
'repayIsolatedMargin': true,
|
|
157
|
+
'sandbox': true,
|
|
157
158
|
'setLeverage': true,
|
|
158
159
|
'setMargin': false,
|
|
159
160
|
'setMarginMode': true,
|
|
@@ -2396,7 +2397,7 @@ class binance extends binance$1 {
|
|
|
2396
2397
|
'Rest API trading is not enabled.': errors.PermissionDenied,
|
|
2397
2398
|
'This account may not place or cancel orders.': errors.PermissionDenied,
|
|
2398
2399
|
"You don't have permission.": errors.PermissionDenied,
|
|
2399
|
-
'Market is closed.': errors.
|
|
2400
|
+
'Market is closed.': errors.MarketClosed,
|
|
2400
2401
|
'Too many requests. Please try again later.': errors.RateLimitExceeded,
|
|
2401
2402
|
'This action is disabled on this account.': errors.AccountSuspended,
|
|
2402
2403
|
'Limit orders require GTC for this phase.': errors.BadRequest,
|
|
@@ -3999,8 +4000,8 @@ class binance extends binance$1 {
|
|
|
3999
4000
|
* @name binance#fetchLastPrices
|
|
4000
4001
|
* @description fetches the last price for multiple markets
|
|
4001
4002
|
* @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-
|
|
4003
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#symbol-price-ticker // swap
|
|
4004
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-tickers // future
|
|
4004
4005
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4005
4006
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4006
4007
|
* @param {string} [params.subType] "linear" or "inverse"
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -83,6 +83,7 @@ class bingx extends bingx$1 {
|
|
|
83
83
|
'fetchTransfers': true,
|
|
84
84
|
'fetchWithdrawals': true,
|
|
85
85
|
'reduceMargin': true,
|
|
86
|
+
'sandbox': true,
|
|
86
87
|
'setLeverage': true,
|
|
87
88
|
'setMargin': true,
|
|
88
89
|
'setMarginMode': true,
|
|
@@ -386,6 +387,7 @@ class bingx extends bingx$1 {
|
|
|
386
387
|
'100202': errors.InsufficientFunds,
|
|
387
388
|
'100204': errors.BadRequest,
|
|
388
389
|
'100400': errors.BadRequest,
|
|
390
|
+
'100410': errors.OperationFailed,
|
|
389
391
|
'100421': errors.BadSymbol,
|
|
390
392
|
'100440': errors.ExchangeError,
|
|
391
393
|
'100500': errors.OperationFailed,
|
package/dist/cjs/src/bitmex.js
CHANGED
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -119,6 +119,7 @@ class bybit extends bybit$1 {
|
|
|
119
119
|
'fetchVolatilityHistory': true,
|
|
120
120
|
'fetchWithdrawals': true,
|
|
121
121
|
'repayCrossMargin': true,
|
|
122
|
+
'sandbox': true,
|
|
122
123
|
'setLeverage': true,
|
|
123
124
|
'setMarginMode': true,
|
|
124
125
|
'setPositionMode': true,
|
|
@@ -6752,20 +6753,20 @@ class bybit extends bybit$1 {
|
|
|
6752
6753
|
const isUsdcSettled = market['settle'] === 'USDC';
|
|
6753
6754
|
// engage in leverage setting
|
|
6754
6755
|
// we reuse the code here instead of having two methods
|
|
6755
|
-
|
|
6756
|
+
const leverageString = this.numberToString(leverage);
|
|
6756
6757
|
const request = {
|
|
6757
6758
|
'symbol': market['id'],
|
|
6758
|
-
'buyLeverage':
|
|
6759
|
-
'sellLeverage':
|
|
6759
|
+
'buyLeverage': leverageString,
|
|
6760
|
+
'sellLeverage': leverageString,
|
|
6760
6761
|
};
|
|
6761
6762
|
let response = undefined;
|
|
6762
6763
|
if (isUsdcSettled && !isUnifiedAccount) {
|
|
6763
|
-
request['leverage'] =
|
|
6764
|
+
request['leverage'] = leverageString;
|
|
6764
6765
|
response = await this.privatePostPerpetualUsdcOpenapiPrivateV1PositionLeverageSave(this.extend(request, params));
|
|
6765
6766
|
}
|
|
6766
6767
|
else {
|
|
6767
|
-
request['buyLeverage'] =
|
|
6768
|
-
request['sellLeverage'] =
|
|
6768
|
+
request['buyLeverage'] = leverageString;
|
|
6769
|
+
request['sellLeverage'] = leverageString;
|
|
6769
6770
|
if (market['linear']) {
|
|
6770
6771
|
request['category'] = 'linear';
|
|
6771
6772
|
}
|
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;
|
|
@@ -102,6 +102,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
102
102
|
'reduceMargin': false,
|
|
103
103
|
'repayCrossMargin': false,
|
|
104
104
|
'repayIsolatedMargin': false,
|
|
105
|
+
'sandbox': true,
|
|
105
106
|
'setLeverage': false,
|
|
106
107
|
'setMarginMode': false,
|
|
107
108
|
'setPositionMode': false,
|
|
@@ -496,7 +497,8 @@ class cryptocom extends cryptocom$1 {
|
|
|
496
497
|
const strike = this.safeString(market, 'strike');
|
|
497
498
|
const marginBuyEnabled = this.safeValue(market, 'margin_buy_enabled');
|
|
498
499
|
const marginSellEnabled = this.safeValue(market, 'margin_sell_enabled');
|
|
499
|
-
const
|
|
500
|
+
const expiryString = this.omitZero(this.safeString(market, 'expiry_timestamp_ms'));
|
|
501
|
+
const expiry = (expiryString !== undefined) ? parseInt(expiryString) : undefined;
|
|
500
502
|
let symbol = base + '/' + quote;
|
|
501
503
|
let type = undefined;
|
|
502
504
|
let contract = undefined;
|
package/dist/cjs/src/deribit.js
CHANGED
package/dist/cjs/src/gate.js
CHANGED
package/dist/cjs/src/gemini.js
CHANGED
package/dist/cjs/src/hitbtc.js
CHANGED
|
@@ -91,6 +91,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
91
91
|
'fetchTransactions': 'emulated',
|
|
92
92
|
'fetchWithdrawals': true,
|
|
93
93
|
'reduceMargin': true,
|
|
94
|
+
'sandbox': true,
|
|
94
95
|
'setLeverage': true,
|
|
95
96
|
'setMargin': false,
|
|
96
97
|
'setMarginMode': false,
|
|
@@ -615,6 +616,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
615
616
|
'accountsByType': {
|
|
616
617
|
'spot': 'spot',
|
|
617
618
|
'funding': 'wallet',
|
|
619
|
+
'swap': 'derivatives',
|
|
618
620
|
'future': 'derivatives',
|
|
619
621
|
},
|
|
620
622
|
'withdraw': {
|
package/dist/cjs/src/hollaex.js
CHANGED
|
@@ -106,6 +106,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
106
106
|
'reduceMargin': true,
|
|
107
107
|
'repayCrossMargin': false,
|
|
108
108
|
'repayIsolatedMargin': false,
|
|
109
|
+
'sandbox': true,
|
|
109
110
|
'setLeverage': true,
|
|
110
111
|
'setMarginMode': true,
|
|
111
112
|
'setPositionMode': false,
|
|
@@ -440,6 +441,10 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
440
441
|
for (let i = 0; i < meta.length; i++) {
|
|
441
442
|
const market = this.safeDict(meta, i, {});
|
|
442
443
|
const marketName = this.safeString(market, 'name');
|
|
444
|
+
if (marketName.indexOf('/') < 0) {
|
|
445
|
+
// there are some weird spot markets in testnet, eg @2
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
443
448
|
const marketParts = marketName.split('/');
|
|
444
449
|
const baseName = this.safeString(marketParts, 0);
|
|
445
450
|
const quoteId = this.safeString(marketParts, 1);
|
package/dist/cjs/src/idex.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/ndax.js
CHANGED