ccxt 4.4.3 → 4.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +2 -2
- package/dist/cjs/src/base/functions/misc.js +11 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/base/ws/WsClient.js +2 -1
- package/dist/cjs/src/binance.js +39 -12
- package/dist/cjs/src/bingx.js +1 -0
- package/dist/cjs/src/bitfinex2.js +7 -6
- package/dist/cjs/src/bitget.js +10 -6
- package/dist/cjs/src/bitmex.js +11 -10
- package/dist/cjs/src/bitso.js +5 -4
- package/dist/cjs/src/bitstamp.js +9 -9
- package/dist/cjs/src/blofin.js +21 -23
- package/dist/cjs/src/bybit.js +21 -20
- package/dist/cjs/src/coinbase.js +28 -7
- package/dist/cjs/src/coinbaseexchange.js +11 -11
- package/dist/cjs/src/coinlist.js +6 -5
- package/dist/cjs/src/coinmetro.js +3 -3
- package/dist/cjs/src/cryptocom.js +7 -5
- package/dist/cjs/src/currencycom.js +6 -6
- package/dist/cjs/src/delta.js +5 -5
- package/dist/cjs/src/digifinex.js +8 -6
- package/dist/cjs/src/gate.js +6 -5
- package/dist/cjs/src/hashkey.js +9 -7
- package/dist/cjs/src/htx.js +13 -16
- package/dist/cjs/src/hyperliquid.js +67 -114
- package/dist/cjs/src/kraken.js +8 -6
- package/dist/cjs/src/kucoin.js +9 -8
- package/dist/cjs/src/luno.js +10 -9
- package/dist/cjs/src/mexc.js +35 -2
- package/dist/cjs/src/ndax.js +6 -5
- package/dist/cjs/src/okcoin.js +18 -27
- package/dist/cjs/src/okx.js +18 -26
- package/dist/cjs/src/p2b.js +2 -2
- package/dist/cjs/src/pro/bybit.js +56 -0
- package/dist/cjs/src/pro/mexc.js +83 -0
- package/dist/cjs/src/woo.js +7 -6
- package/dist/cjs/src/woofipro.js +8 -6
- package/dist/cjs/src/xt.js +4 -3
- package/dist/cjs/src/zonda.js +6 -5
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +2 -2
- package/js/src/base/Exchange.js +2 -2
- package/js/src/base/functions/misc.d.ts +2 -1
- package/js/src/base/functions/misc.js +11 -1
- package/js/src/base/types.d.ts +1 -1
- package/js/src/base/ws/WsClient.js +2 -2
- package/js/src/binance.d.ts +4 -20
- package/js/src/binance.js +39 -12
- package/js/src/bingx.js +1 -0
- package/js/src/bitfinex2.d.ts +3 -19
- package/js/src/bitfinex2.js +7 -6
- package/js/src/bitget.d.ts +3 -19
- package/js/src/bitget.js +10 -6
- package/js/src/bitmex.d.ts +3 -22
- package/js/src/bitmex.js +11 -10
- package/js/src/bitso.d.ts +3 -19
- package/js/src/bitso.js +5 -4
- package/js/src/bitstamp.d.ts +3 -35
- package/js/src/bitstamp.js +9 -9
- package/js/src/blofin.d.ts +3 -15
- package/js/src/blofin.js +21 -23
- package/js/src/bybit.d.ts +3 -19
- package/js/src/bybit.js +21 -20
- package/js/src/coinbase.d.ts +3 -19
- package/js/src/coinbase.js +28 -7
- package/js/src/coinbaseexchange.d.ts +3 -19
- package/js/src/coinbaseexchange.js +11 -11
- package/js/src/coinlist.d.ts +3 -19
- package/js/src/coinlist.js +6 -5
- package/js/src/coinmetro.d.ts +3 -19
- package/js/src/coinmetro.js +3 -3
- package/js/src/cryptocom.d.ts +3 -22
- package/js/src/cryptocom.js +7 -5
- package/js/src/currencycom.d.ts +3 -3
- package/js/src/currencycom.js +6 -6
- package/js/src/delta.d.ts +3 -19
- package/js/src/delta.js +5 -5
- package/js/src/digifinex.d.ts +3 -19
- package/js/src/digifinex.js +8 -6
- package/js/src/gate.d.ts +3 -19
- package/js/src/gate.js +6 -5
- package/js/src/hashkey.d.ts +3 -20
- package/js/src/hashkey.js +9 -7
- package/js/src/htx.d.ts +3 -19
- package/js/src/htx.js +13 -16
- package/js/src/hyperliquid.d.ts +3 -19
- package/js/src/hyperliquid.js +68 -115
- package/js/src/kraken.d.ts +5 -24
- package/js/src/kraken.js +8 -6
- package/js/src/kucoin.d.ts +3 -19
- package/js/src/kucoin.js +9 -8
- package/js/src/luno.d.ts +4 -20
- package/js/src/luno.js +10 -9
- package/js/src/mexc.js +35 -2
- package/js/src/ndax.d.ts +3 -19
- package/js/src/ndax.js +6 -5
- package/js/src/okcoin.d.ts +3 -19
- package/js/src/okcoin.js +18 -27
- package/js/src/okx.d.ts +3 -19
- package/js/src/okx.js +18 -26
- package/js/src/p2b.js +2 -2
- package/js/src/pro/bybit.d.ts +2 -0
- package/js/src/pro/bybit.js +56 -0
- package/js/src/pro/mexc.d.ts +4 -1
- package/js/src/pro/mexc.js +84 -1
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
- package/js/src/woo.d.ts +3 -19
- package/js/src/woo.js +7 -6
- package/js/src/woofipro.d.ts +3 -19
- package/js/src/woofipro.js +8 -6
- package/js/src/xt.d.ts +3 -22
- package/js/src/xt.js +4 -3
- package/js/src/zonda.d.ts +3 -19
- package/js/src/zonda.js +6 -5
- package/package.json +1 -1
|
@@ -188,9 +188,11 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
188
188
|
'No liquidity available for market order.': errors.InvalidOrder,
|
|
189
189
|
'Order was never placed, already canceled, or filled.': errors.OrderNotFound,
|
|
190
190
|
'User or API Wallet ': errors.InvalidOrder,
|
|
191
|
+
'Order has invalid size': errors.InvalidOrder,
|
|
192
|
+
'Order price cannot be more than 80% away from the reference price': errors.InvalidOrder,
|
|
191
193
|
},
|
|
192
194
|
},
|
|
193
|
-
'precisionMode': number.
|
|
195
|
+
'precisionMode': number.DECIMAL_PLACES,
|
|
194
196
|
'commonCurrencies': {},
|
|
195
197
|
'options': {
|
|
196
198
|
'defaultType': 'swap',
|
|
@@ -209,7 +211,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
209
211
|
* @method
|
|
210
212
|
* @name hyperliquid#fetchCurrencies
|
|
211
213
|
* @description fetches all available currencies on an exchange
|
|
212
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-
|
|
214
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata
|
|
213
215
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
214
216
|
* @returns {object} an associative dictionary of currencies
|
|
215
217
|
*/
|
|
@@ -268,7 +270,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
268
270
|
* @method
|
|
269
271
|
* @name hyperliquid#fetchMarkets
|
|
270
272
|
* @description retrieves data on all markets for hyperliquid
|
|
271
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
273
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
274
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
272
275
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
273
276
|
* @returns {object[]} an array of objects representing market data
|
|
274
277
|
*/
|
|
@@ -286,7 +289,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
286
289
|
* @method
|
|
287
290
|
* @name hyperliquid#fetchMarkets
|
|
288
291
|
* @description retrieves data on all swap markets for hyperliquid
|
|
289
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
292
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
290
293
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
291
294
|
* @returns {object[]} an array of objects representing market data
|
|
292
295
|
*/
|
|
@@ -341,7 +344,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
341
344
|
* @method
|
|
342
345
|
* @name hyperliquid#fetchMarkets
|
|
343
346
|
* @description retrieves data on all spot markets for hyperliquid
|
|
344
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts
|
|
347
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
345
348
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
346
349
|
* @returns {object[]} an array of objects representing market data
|
|
347
350
|
*/
|
|
@@ -352,102 +355,51 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
352
355
|
//
|
|
353
356
|
// [
|
|
354
357
|
// {
|
|
355
|
-
//
|
|
358
|
+
// "tokens": [
|
|
356
359
|
// {
|
|
357
|
-
//
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
+
// "name": "USDC",
|
|
361
|
+
// "szDecimals": 8,
|
|
362
|
+
// "weiDecimals" 8,
|
|
363
|
+
// "index": 0,
|
|
364
|
+
// "tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
|
|
365
|
+
// "isCanonical": true,
|
|
366
|
+
// "evmContract":null,
|
|
367
|
+
// "fullName":null
|
|
360
368
|
// },
|
|
361
369
|
// {
|
|
362
|
-
//
|
|
363
|
-
//
|
|
364
|
-
//
|
|
365
|
-
//
|
|
370
|
+
// "name": "PURR",
|
|
371
|
+
// "szDecimals": 0,
|
|
372
|
+
// "weiDecimals": 5,
|
|
373
|
+
// "index": 1,
|
|
374
|
+
// "tokenId": "0xc1fb593aeffbeb02f85e0308e9956a90",
|
|
375
|
+
// "isCanonical": true,
|
|
376
|
+
// "evmContract":null,
|
|
377
|
+
// "fullName":null
|
|
378
|
+
// }
|
|
366
379
|
// ],
|
|
367
|
-
//
|
|
380
|
+
// "universe": [
|
|
368
381
|
// {
|
|
369
|
-
//
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
// ],
|
|
382
|
+
// "name": "PURR/USDC",
|
|
383
|
+
// "tokens": [1, 0],
|
|
384
|
+
// "index": 0,
|
|
385
|
+
// "isCanonical": true
|
|
386
|
+
// }
|
|
387
|
+
// ]
|
|
376
388
|
// },
|
|
377
389
|
// [
|
|
378
390
|
// {
|
|
379
|
-
//
|
|
380
|
-
//
|
|
381
|
-
//
|
|
382
|
-
//
|
|
383
|
-
// }
|
|
384
|
-
// ],
|
|
385
|
-
// ];
|
|
386
|
-
// mainnet
|
|
387
|
-
// [
|
|
388
|
-
// {
|
|
389
|
-
// "canonical_tokens2":[
|
|
390
|
-
// 0,
|
|
391
|
-
// 1
|
|
392
|
-
// ],
|
|
393
|
-
// "spot_infos":[
|
|
394
|
-
// {
|
|
395
|
-
// "name":"PURR/USDC",
|
|
396
|
-
// "tokens":[
|
|
397
|
-
// 1,
|
|
398
|
-
// 0
|
|
399
|
-
// ]
|
|
400
|
-
// }
|
|
401
|
-
// ],
|
|
402
|
-
// "token_id_to_token":[
|
|
403
|
-
// [
|
|
404
|
-
// "0x6d1e7cde53ba9467b783cb7c530ce054",
|
|
405
|
-
// 0
|
|
406
|
-
// ],
|
|
407
|
-
// [
|
|
408
|
-
// "0xc1fb593aeffbeb02f85e0308e9956a90",
|
|
409
|
-
// 1
|
|
410
|
-
// ]
|
|
411
|
-
// ],
|
|
412
|
-
// "token_infos":[
|
|
413
|
-
// {
|
|
414
|
-
// "deployer":null,
|
|
415
|
-
// "spec":{
|
|
416
|
-
// "name":"USDC",
|
|
417
|
-
// "szDecimals":"8",
|
|
418
|
-
// "weiDecimals":"8"
|
|
419
|
-
// },
|
|
420
|
-
// "spots":[
|
|
421
|
-
// ]
|
|
422
|
-
// },
|
|
423
|
-
// {
|
|
424
|
-
// "deployer":null,
|
|
425
|
-
// "spec":{
|
|
426
|
-
// "name":"PURR",
|
|
427
|
-
// "szDecimals":"0",
|
|
428
|
-
// "weiDecimals":"5"
|
|
429
|
-
// },
|
|
430
|
-
// "spots":[
|
|
431
|
-
// 0
|
|
432
|
-
// ]
|
|
433
|
-
// }
|
|
434
|
-
// ]
|
|
435
|
-
// },
|
|
436
|
-
// [
|
|
437
|
-
// {
|
|
438
|
-
// "dayNtlVlm":"35001170.16631",
|
|
439
|
-
// "markPx":"0.15743",
|
|
440
|
-
// "midPx":"0.157555",
|
|
441
|
-
// "prevDayPx":"0.158"
|
|
442
|
-
// }
|
|
391
|
+
// "dayNtlVlm":"8906.0",
|
|
392
|
+
// "markPx":"0.14",
|
|
393
|
+
// "midPx":"0.209265",
|
|
394
|
+
// "prevDayPx":"0.20432"
|
|
395
|
+
// }
|
|
443
396
|
// ]
|
|
444
397
|
// ]
|
|
445
398
|
//
|
|
446
|
-
// response differs depending on the environment (mainnet vs sandbox)
|
|
447
399
|
const first = this.safeDict(response, 0, {});
|
|
448
400
|
const second = this.safeList(response, 1, []);
|
|
449
|
-
const meta = this.
|
|
450
|
-
const tokens = this.
|
|
401
|
+
const meta = this.safeList(first, 'universe', []);
|
|
402
|
+
const tokens = this.safeList(first, 'tokens', []);
|
|
451
403
|
const markets = [];
|
|
452
404
|
for (let i = 0; i < meta.length; i++) {
|
|
453
405
|
const market = this.safeDict(meta, i, {});
|
|
@@ -475,7 +427,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
475
427
|
const symbol = base + '/' + quote;
|
|
476
428
|
const innerBaseTokenInfo = this.safeDict(baseTokenInfo, 'spec', baseTokenInfo);
|
|
477
429
|
// const innerQuoteTokenInfo = this.safeDict (quoteTokenInfo, 'spec', quoteTokenInfo);
|
|
478
|
-
const amountPrecision = this.
|
|
430
|
+
const amountPrecision = this.safeInteger(innerBaseTokenInfo, 'szDecimals');
|
|
479
431
|
// const quotePrecision = this.parseNumber (this.parsePrecision (this.safeString (innerQuoteTokenInfo, 'szDecimals')));
|
|
480
432
|
const baseId = this.numberToString(i + 10000);
|
|
481
433
|
markets.push(this.safeMarketStructure({
|
|
@@ -507,7 +459,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
507
459
|
'optionType': undefined,
|
|
508
460
|
'precision': {
|
|
509
461
|
'amount': amountPrecision,
|
|
510
|
-
'price':
|
|
462
|
+
'price': 8 - amountPrecision, // MAX_DECIMALS is 8
|
|
511
463
|
},
|
|
512
464
|
'limits': {
|
|
513
465
|
'leverage': {
|
|
@@ -523,7 +475,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
523
475
|
'max': undefined,
|
|
524
476
|
},
|
|
525
477
|
'cost': {
|
|
526
|
-
'min':
|
|
478
|
+
'min': this.parseNumber('10'),
|
|
527
479
|
'max': undefined,
|
|
528
480
|
},
|
|
529
481
|
},
|
|
@@ -571,7 +523,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
571
523
|
const fees = this.safeDict(this.fees, 'swap', {});
|
|
572
524
|
const taker = this.safeNumber(fees, 'taker');
|
|
573
525
|
const maker = this.safeNumber(fees, 'maker');
|
|
574
|
-
|
|
526
|
+
const amountPrecision = this.safeInteger(market, 'szDecimals');
|
|
527
|
+
return this.safeMarketStructure({
|
|
575
528
|
'id': baseId,
|
|
576
529
|
'symbol': symbol,
|
|
577
530
|
'base': base,
|
|
@@ -598,8 +551,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
598
551
|
'strike': undefined,
|
|
599
552
|
'optionType': undefined,
|
|
600
553
|
'precision': {
|
|
601
|
-
'amount':
|
|
602
|
-
'price':
|
|
554
|
+
'amount': amountPrecision,
|
|
555
|
+
'price': 6 - amountPrecision, // MAX_DECIMALS is 6
|
|
603
556
|
},
|
|
604
557
|
'limits': {
|
|
605
558
|
'leverage': {
|
|
@@ -615,20 +568,21 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
615
568
|
'max': undefined,
|
|
616
569
|
},
|
|
617
570
|
'cost': {
|
|
618
|
-
'min':
|
|
571
|
+
'min': this.parseNumber('10'),
|
|
619
572
|
'max': undefined,
|
|
620
573
|
},
|
|
621
574
|
},
|
|
622
575
|
'created': undefined,
|
|
623
576
|
'info': market,
|
|
624
|
-
};
|
|
577
|
+
});
|
|
625
578
|
}
|
|
626
579
|
async fetchBalance(params = {}) {
|
|
627
580
|
/**
|
|
628
581
|
* @method
|
|
629
582
|
* @name hyperliquid#fetchBalance
|
|
630
583
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
631
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-
|
|
584
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
|
|
585
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
632
586
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
633
587
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
634
588
|
* @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
|
|
@@ -713,7 +667,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
713
667
|
* @method
|
|
714
668
|
* @name hyperliquid#fetchOrderBook
|
|
715
669
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
716
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#
|
|
670
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
|
|
717
671
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
718
672
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
719
673
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -761,7 +715,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
761
715
|
* @method
|
|
762
716
|
* @name hyperliquid#fetchTickers
|
|
763
717
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
764
|
-
* @see https://
|
|
718
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
719
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
765
720
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
766
721
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
767
722
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -815,7 +770,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
815
770
|
* @method
|
|
816
771
|
* @name hyperliquid#fetchOHLCV
|
|
817
772
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
818
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#
|
|
773
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
|
|
819
774
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
820
775
|
* @param {string} timeframe the length of time each candle represents, support '1m', '15m', '1h', '1d'
|
|
821
776
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -944,15 +899,13 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
944
899
|
}
|
|
945
900
|
amountToPrecision(symbol, amount) {
|
|
946
901
|
const market = this.market(symbol);
|
|
947
|
-
|
|
948
|
-
return super.amountToPrecision(symbol, amount);
|
|
949
|
-
}
|
|
950
|
-
return this.decimalToPrecision(amount, number.ROUND, this.markets[symbol]['precision']['amount'], this.precisionMode);
|
|
902
|
+
return this.decimalToPrecision(amount, number.ROUND, market['precision']['amount'], this.precisionMode, this.paddingMode);
|
|
951
903
|
}
|
|
952
904
|
priceToPrecision(symbol, price) {
|
|
953
905
|
const market = this.market(symbol);
|
|
954
|
-
|
|
955
|
-
const
|
|
906
|
+
// https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/tick-and-lot-size
|
|
907
|
+
const result = this.decimalToPrecision(price, number.ROUND, 5, number.SIGNIFICANT_DIGITS, this.paddingMode);
|
|
908
|
+
const decimalParsedResult = this.decimalToPrecision(result, number.ROUND, market['precision']['price'], this.precisionMode, this.paddingMode);
|
|
956
909
|
return decimalParsedResult;
|
|
957
910
|
}
|
|
958
911
|
hashMessage(message) {
|
|
@@ -1644,7 +1597,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1644
1597
|
* @method
|
|
1645
1598
|
* @name hyperliquid#fetchFundingRateHistory
|
|
1646
1599
|
* @description fetches historical funding rate prices
|
|
1647
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-historical-funding-rates
|
|
1600
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
|
|
1648
1601
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1649
1602
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1650
1603
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
@@ -2149,7 +2102,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2149
2102
|
* @method
|
|
2150
2103
|
* @name hyperliquid#fetchPosition
|
|
2151
2104
|
* @description fetch data on an open position
|
|
2152
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-
|
|
2105
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2153
2106
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2154
2107
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2155
2108
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
@@ -2163,7 +2116,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2163
2116
|
* @method
|
|
2164
2117
|
* @name hyperliquid#fetchPositions
|
|
2165
2118
|
* @description fetch all open positions
|
|
2166
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-
|
|
2119
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2167
2120
|
* @param {string[]} [symbols] list of unified market symbols
|
|
2168
2121
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2169
2122
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
@@ -2794,9 +2747,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2794
2747
|
* @method
|
|
2795
2748
|
* @name hyperliquid#fetchLedger
|
|
2796
2749
|
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2797
|
-
* @param {string} code unified currency code
|
|
2750
|
+
* @param {string} [code] unified currency code
|
|
2798
2751
|
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
2799
|
-
* @param {int} [limit] max number of ledger
|
|
2752
|
+
* @param {int} [limit] max number of ledger entries to return
|
|
2800
2753
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2801
2754
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2802
2755
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
@@ -2856,7 +2809,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2856
2809
|
}
|
|
2857
2810
|
const type = this.safeString(delta, 'type');
|
|
2858
2811
|
const amount = this.safeString(delta, 'usdc');
|
|
2859
|
-
return {
|
|
2812
|
+
return this.safeLedgerEntry({
|
|
2813
|
+
'info': item,
|
|
2860
2814
|
'id': this.safeString(item, 'hash'),
|
|
2861
2815
|
'direction': undefined,
|
|
2862
2816
|
'account': undefined,
|
|
@@ -2871,8 +2825,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2871
2825
|
'after': undefined,
|
|
2872
2826
|
'status': undefined,
|
|
2873
2827
|
'fee': fee,
|
|
2874
|
-
|
|
2875
|
-
};
|
|
2828
|
+
}, currency);
|
|
2876
2829
|
}
|
|
2877
2830
|
parseLedgerEntryType(type) {
|
|
2878
2831
|
const ledgerType = {
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -1067,7 +1067,9 @@ class kraken extends kraken$1 {
|
|
|
1067
1067
|
const referenceId = this.safeString(item, 'refid');
|
|
1068
1068
|
const referenceAccount = undefined;
|
|
1069
1069
|
const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
|
|
1070
|
-
const
|
|
1070
|
+
const currencyId = this.safeString(item, 'asset');
|
|
1071
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1072
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
1071
1073
|
let amount = this.safeString(item, 'amount');
|
|
1072
1074
|
if (Precise["default"].stringLt(amount, '0')) {
|
|
1073
1075
|
direction = 'out';
|
|
@@ -1077,7 +1079,7 @@ class kraken extends kraken$1 {
|
|
|
1077
1079
|
direction = 'in';
|
|
1078
1080
|
}
|
|
1079
1081
|
const timestamp = this.safeIntegerProduct(item, 'time', 1000);
|
|
1080
|
-
return {
|
|
1082
|
+
return this.safeLedgerEntry({
|
|
1081
1083
|
'info': item,
|
|
1082
1084
|
'id': id,
|
|
1083
1085
|
'direction': direction,
|
|
@@ -1096,17 +1098,17 @@ class kraken extends kraken$1 {
|
|
|
1096
1098
|
'cost': this.safeNumber(item, 'fee'),
|
|
1097
1099
|
'currency': code,
|
|
1098
1100
|
},
|
|
1099
|
-
};
|
|
1101
|
+
}, currency);
|
|
1100
1102
|
}
|
|
1101
1103
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1102
1104
|
/**
|
|
1103
1105
|
* @method
|
|
1104
1106
|
* @name kraken#fetchLedger
|
|
1105
|
-
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1107
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
1106
1108
|
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers
|
|
1107
|
-
* @param {string} code unified currency code, default is undefined
|
|
1109
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
1108
1110
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1109
|
-
* @param {int} [limit] max number of ledger
|
|
1111
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1110
1112
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1111
1113
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
1112
1114
|
* @param {int} [params.end] timestamp in seconds of the latest ledger entry
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -4199,6 +4199,7 @@ class kucoin extends kucoin$1 {
|
|
|
4199
4199
|
const id = this.safeString(item, 'id');
|
|
4200
4200
|
const currencyId = this.safeString(item, 'currency');
|
|
4201
4201
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4202
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
4202
4203
|
const amount = this.safeNumber(item, 'amount');
|
|
4203
4204
|
const balanceAfter = undefined;
|
|
4204
4205
|
// const balanceAfter = this.safeNumber (item, 'balance'); only returns zero string
|
|
@@ -4247,7 +4248,8 @@ class kucoin extends kucoin$1 {
|
|
|
4247
4248
|
feeCurrency = code;
|
|
4248
4249
|
fee = { 'cost': this.parseNumber(feeCost), 'currency': feeCurrency };
|
|
4249
4250
|
}
|
|
4250
|
-
return {
|
|
4251
|
+
return this.safeLedgerEntry({
|
|
4252
|
+
'info': item,
|
|
4251
4253
|
'id': id,
|
|
4252
4254
|
'direction': direction,
|
|
4253
4255
|
'account': account,
|
|
@@ -4262,24 +4264,23 @@ class kucoin extends kucoin$1 {
|
|
|
4262
4264
|
'after': balanceAfter,
|
|
4263
4265
|
'status': undefined,
|
|
4264
4266
|
'fee': fee,
|
|
4265
|
-
|
|
4266
|
-
};
|
|
4267
|
+
}, currency);
|
|
4267
4268
|
}
|
|
4268
4269
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4269
4270
|
/**
|
|
4270
4271
|
* @method
|
|
4271
4272
|
* @name kucoin#fetchLedger
|
|
4273
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
4272
4274
|
* @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
|
|
4273
4275
|
* @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
|
|
4274
4276
|
* @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
|
|
4275
|
-
* @
|
|
4276
|
-
* @param {string} code unified currency code, default is undefined
|
|
4277
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
4277
4278
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
4278
|
-
* @param {int} [limit] max number of ledger
|
|
4279
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
4279
4280
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4280
4281
|
* @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
|
|
4281
4282
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4282
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
4283
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4283
4284
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
4284
4285
|
*/
|
|
4285
4286
|
await this.loadMarkets();
|
|
@@ -5061,7 +5062,7 @@ class kucoin extends kucoin$1 {
|
|
|
5061
5062
|
//
|
|
5062
5063
|
const errorCode = this.safeString(response, 'code');
|
|
5063
5064
|
const message = this.safeString2(response, 'msg', 'data', '');
|
|
5064
|
-
const feedback = this.id + ' ' +
|
|
5065
|
+
const feedback = this.id + ' ' + body;
|
|
5065
5066
|
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
5066
5067
|
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
|
|
5067
5068
|
this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
|
package/dist/cjs/src/luno.js
CHANGED
|
@@ -990,11 +990,11 @@ class luno extends luno$1 {
|
|
|
990
990
|
/**
|
|
991
991
|
* @method
|
|
992
992
|
* @name luno#fetchLedger
|
|
993
|
-
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
993
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
994
994
|
* @see https://www.luno.com/en/developers/api#tag/Accounts/operation/ListTransactions
|
|
995
|
-
* @param {string} code unified currency code, default is undefined
|
|
995
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
996
996
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
997
|
-
* @param {int} [limit] max number of ledger
|
|
997
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
998
998
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
999
999
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
1000
1000
|
*/
|
|
@@ -1081,6 +1081,7 @@ class luno extends luno$1 {
|
|
|
1081
1081
|
const timestamp = this.safeInteger(entry, 'timestamp');
|
|
1082
1082
|
const currencyId = this.safeString(entry, 'currency');
|
|
1083
1083
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1084
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
1084
1085
|
const available_delta = this.safeString(entry, 'available_delta');
|
|
1085
1086
|
const balance_delta = this.safeString(entry, 'balance_delta');
|
|
1086
1087
|
const after = this.safeString(entry, 'balance');
|
|
@@ -1111,7 +1112,8 @@ class luno extends luno$1 {
|
|
|
1111
1112
|
else if (Precise["default"].stringLt(balance_delta, '0') || Precise["default"].stringLt(available_delta, '0')) {
|
|
1112
1113
|
direction = 'out';
|
|
1113
1114
|
}
|
|
1114
|
-
return {
|
|
1115
|
+
return this.safeLedgerEntry({
|
|
1116
|
+
'info': entry,
|
|
1115
1117
|
'id': id,
|
|
1116
1118
|
'direction': direction,
|
|
1117
1119
|
'account': account_id,
|
|
@@ -1119,15 +1121,14 @@ class luno extends luno$1 {
|
|
|
1119
1121
|
'referenceAccount': undefined,
|
|
1120
1122
|
'type': type,
|
|
1121
1123
|
'currency': code,
|
|
1122
|
-
'amount': this.
|
|
1124
|
+
'amount': this.parseToNumeric(amount),
|
|
1123
1125
|
'timestamp': timestamp,
|
|
1124
1126
|
'datetime': this.iso8601(timestamp),
|
|
1125
|
-
'before': this.
|
|
1126
|
-
'after': this.
|
|
1127
|
+
'before': this.parseToNumeric(before),
|
|
1128
|
+
'after': this.parseToNumeric(after),
|
|
1127
1129
|
'status': status,
|
|
1128
1130
|
'fee': undefined,
|
|
1129
|
-
|
|
1130
|
-
};
|
|
1131
|
+
}, currency);
|
|
1131
1132
|
}
|
|
1132
1133
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1133
1134
|
let url = this.urls['api'][api] + '/' + this.version + '/' + this.implodeParams(path, params);
|