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
package/js/src/hyperliquid.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import Exchange from './abstract/hyperliquid.js';
|
|
9
9
|
import { ExchangeError, ArgumentsRequired, NotSupported, InvalidOrder, OrderNotFound, BadRequest } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
|
-
import {
|
|
11
|
+
import { ROUND, SIGNIFICANT_DIGITS, DECIMAL_PLACES } from './base/functions/number.js';
|
|
12
12
|
import { keccak_256 as keccak } from './static_dependencies/noble-hashes/sha3.js';
|
|
13
13
|
import { secp256k1 } from './static_dependencies/noble-curves/secp256k1.js';
|
|
14
14
|
import { ecdsa } from './base/functions/crypto.js';
|
|
@@ -191,9 +191,11 @@ export default class hyperliquid extends Exchange {
|
|
|
191
191
|
'No liquidity available for market order.': InvalidOrder,
|
|
192
192
|
'Order was never placed, already canceled, or filled.': OrderNotFound,
|
|
193
193
|
'User or API Wallet ': InvalidOrder,
|
|
194
|
+
'Order has invalid size': InvalidOrder,
|
|
195
|
+
'Order price cannot be more than 80% away from the reference price': InvalidOrder,
|
|
194
196
|
},
|
|
195
197
|
},
|
|
196
|
-
'precisionMode':
|
|
198
|
+
'precisionMode': DECIMAL_PLACES,
|
|
197
199
|
'commonCurrencies': {},
|
|
198
200
|
'options': {
|
|
199
201
|
'defaultType': 'swap',
|
|
@@ -212,7 +214,7 @@ export default class hyperliquid extends Exchange {
|
|
|
212
214
|
* @method
|
|
213
215
|
* @name hyperliquid#fetchCurrencies
|
|
214
216
|
* @description fetches all available currencies on an exchange
|
|
215
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-
|
|
217
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata
|
|
216
218
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
217
219
|
* @returns {object} an associative dictionary of currencies
|
|
218
220
|
*/
|
|
@@ -271,7 +273,8 @@ export default class hyperliquid extends Exchange {
|
|
|
271
273
|
* @method
|
|
272
274
|
* @name hyperliquid#fetchMarkets
|
|
273
275
|
* @description retrieves data on all markets for hyperliquid
|
|
274
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
276
|
+
* @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
|
|
277
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
275
278
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
276
279
|
* @returns {object[]} an array of objects representing market data
|
|
277
280
|
*/
|
|
@@ -289,7 +292,7 @@ export default class hyperliquid extends Exchange {
|
|
|
289
292
|
* @method
|
|
290
293
|
* @name hyperliquid#fetchMarkets
|
|
291
294
|
* @description retrieves data on all swap markets for hyperliquid
|
|
292
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
295
|
+
* @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
|
|
293
296
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
294
297
|
* @returns {object[]} an array of objects representing market data
|
|
295
298
|
*/
|
|
@@ -344,7 +347,7 @@ export default class hyperliquid extends Exchange {
|
|
|
344
347
|
* @method
|
|
345
348
|
* @name hyperliquid#fetchMarkets
|
|
346
349
|
* @description retrieves data on all spot markets for hyperliquid
|
|
347
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-asset-contexts
|
|
350
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
348
351
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
349
352
|
* @returns {object[]} an array of objects representing market data
|
|
350
353
|
*/
|
|
@@ -355,102 +358,51 @@ export default class hyperliquid extends Exchange {
|
|
|
355
358
|
//
|
|
356
359
|
// [
|
|
357
360
|
// {
|
|
358
|
-
//
|
|
361
|
+
// "tokens": [
|
|
359
362
|
// {
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
+
// "name": "USDC",
|
|
364
|
+
// "szDecimals": 8,
|
|
365
|
+
// "weiDecimals" 8,
|
|
366
|
+
// "index": 0,
|
|
367
|
+
// "tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
|
|
368
|
+
// "isCanonical": true,
|
|
369
|
+
// "evmContract":null,
|
|
370
|
+
// "fullName":null
|
|
363
371
|
// },
|
|
364
372
|
// {
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
373
|
+
// "name": "PURR",
|
|
374
|
+
// "szDecimals": 0,
|
|
375
|
+
// "weiDecimals": 5,
|
|
376
|
+
// "index": 1,
|
|
377
|
+
// "tokenId": "0xc1fb593aeffbeb02f85e0308e9956a90",
|
|
378
|
+
// "isCanonical": true,
|
|
379
|
+
// "evmContract":null,
|
|
380
|
+
// "fullName":null
|
|
381
|
+
// }
|
|
369
382
|
// ],
|
|
370
|
-
//
|
|
383
|
+
// "universe": [
|
|
371
384
|
// {
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
//
|
|
377
|
-
//
|
|
378
|
-
// ],
|
|
385
|
+
// "name": "PURR/USDC",
|
|
386
|
+
// "tokens": [1, 0],
|
|
387
|
+
// "index": 0,
|
|
388
|
+
// "isCanonical": true
|
|
389
|
+
// }
|
|
390
|
+
// ]
|
|
379
391
|
// },
|
|
380
392
|
// [
|
|
381
393
|
// {
|
|
382
|
-
//
|
|
383
|
-
//
|
|
384
|
-
//
|
|
385
|
-
//
|
|
386
|
-
// }
|
|
387
|
-
// ],
|
|
388
|
-
// ];
|
|
389
|
-
// mainnet
|
|
390
|
-
// [
|
|
391
|
-
// {
|
|
392
|
-
// "canonical_tokens2":[
|
|
393
|
-
// 0,
|
|
394
|
-
// 1
|
|
395
|
-
// ],
|
|
396
|
-
// "spot_infos":[
|
|
397
|
-
// {
|
|
398
|
-
// "name":"PURR/USDC",
|
|
399
|
-
// "tokens":[
|
|
400
|
-
// 1,
|
|
401
|
-
// 0
|
|
402
|
-
// ]
|
|
403
|
-
// }
|
|
404
|
-
// ],
|
|
405
|
-
// "token_id_to_token":[
|
|
406
|
-
// [
|
|
407
|
-
// "0x6d1e7cde53ba9467b783cb7c530ce054",
|
|
408
|
-
// 0
|
|
409
|
-
// ],
|
|
410
|
-
// [
|
|
411
|
-
// "0xc1fb593aeffbeb02f85e0308e9956a90",
|
|
412
|
-
// 1
|
|
413
|
-
// ]
|
|
414
|
-
// ],
|
|
415
|
-
// "token_infos":[
|
|
416
|
-
// {
|
|
417
|
-
// "deployer":null,
|
|
418
|
-
// "spec":{
|
|
419
|
-
// "name":"USDC",
|
|
420
|
-
// "szDecimals":"8",
|
|
421
|
-
// "weiDecimals":"8"
|
|
422
|
-
// },
|
|
423
|
-
// "spots":[
|
|
424
|
-
// ]
|
|
425
|
-
// },
|
|
426
|
-
// {
|
|
427
|
-
// "deployer":null,
|
|
428
|
-
// "spec":{
|
|
429
|
-
// "name":"PURR",
|
|
430
|
-
// "szDecimals":"0",
|
|
431
|
-
// "weiDecimals":"5"
|
|
432
|
-
// },
|
|
433
|
-
// "spots":[
|
|
434
|
-
// 0
|
|
435
|
-
// ]
|
|
436
|
-
// }
|
|
437
|
-
// ]
|
|
438
|
-
// },
|
|
439
|
-
// [
|
|
440
|
-
// {
|
|
441
|
-
// "dayNtlVlm":"35001170.16631",
|
|
442
|
-
// "markPx":"0.15743",
|
|
443
|
-
// "midPx":"0.157555",
|
|
444
|
-
// "prevDayPx":"0.158"
|
|
445
|
-
// }
|
|
394
|
+
// "dayNtlVlm":"8906.0",
|
|
395
|
+
// "markPx":"0.14",
|
|
396
|
+
// "midPx":"0.209265",
|
|
397
|
+
// "prevDayPx":"0.20432"
|
|
398
|
+
// }
|
|
446
399
|
// ]
|
|
447
400
|
// ]
|
|
448
401
|
//
|
|
449
|
-
// response differs depending on the environment (mainnet vs sandbox)
|
|
450
402
|
const first = this.safeDict(response, 0, {});
|
|
451
403
|
const second = this.safeList(response, 1, []);
|
|
452
|
-
const meta = this.
|
|
453
|
-
const tokens = this.
|
|
404
|
+
const meta = this.safeList(first, 'universe', []);
|
|
405
|
+
const tokens = this.safeList(first, 'tokens', []);
|
|
454
406
|
const markets = [];
|
|
455
407
|
for (let i = 0; i < meta.length; i++) {
|
|
456
408
|
const market = this.safeDict(meta, i, {});
|
|
@@ -478,7 +430,7 @@ export default class hyperliquid extends Exchange {
|
|
|
478
430
|
const symbol = base + '/' + quote;
|
|
479
431
|
const innerBaseTokenInfo = this.safeDict(baseTokenInfo, 'spec', baseTokenInfo);
|
|
480
432
|
// const innerQuoteTokenInfo = this.safeDict (quoteTokenInfo, 'spec', quoteTokenInfo);
|
|
481
|
-
const amountPrecision = this.
|
|
433
|
+
const amountPrecision = this.safeInteger(innerBaseTokenInfo, 'szDecimals');
|
|
482
434
|
// const quotePrecision = this.parseNumber (this.parsePrecision (this.safeString (innerQuoteTokenInfo, 'szDecimals')));
|
|
483
435
|
const baseId = this.numberToString(i + 10000);
|
|
484
436
|
markets.push(this.safeMarketStructure({
|
|
@@ -510,7 +462,7 @@ export default class hyperliquid extends Exchange {
|
|
|
510
462
|
'optionType': undefined,
|
|
511
463
|
'precision': {
|
|
512
464
|
'amount': amountPrecision,
|
|
513
|
-
'price':
|
|
465
|
+
'price': 8 - amountPrecision, // MAX_DECIMALS is 8
|
|
514
466
|
},
|
|
515
467
|
'limits': {
|
|
516
468
|
'leverage': {
|
|
@@ -526,7 +478,7 @@ export default class hyperliquid extends Exchange {
|
|
|
526
478
|
'max': undefined,
|
|
527
479
|
},
|
|
528
480
|
'cost': {
|
|
529
|
-
'min':
|
|
481
|
+
'min': this.parseNumber('10'),
|
|
530
482
|
'max': undefined,
|
|
531
483
|
},
|
|
532
484
|
},
|
|
@@ -574,7 +526,8 @@ export default class hyperliquid extends Exchange {
|
|
|
574
526
|
const fees = this.safeDict(this.fees, 'swap', {});
|
|
575
527
|
const taker = this.safeNumber(fees, 'taker');
|
|
576
528
|
const maker = this.safeNumber(fees, 'maker');
|
|
577
|
-
|
|
529
|
+
const amountPrecision = this.safeInteger(market, 'szDecimals');
|
|
530
|
+
return this.safeMarketStructure({
|
|
578
531
|
'id': baseId,
|
|
579
532
|
'symbol': symbol,
|
|
580
533
|
'base': base,
|
|
@@ -601,8 +554,8 @@ export default class hyperliquid extends Exchange {
|
|
|
601
554
|
'strike': undefined,
|
|
602
555
|
'optionType': undefined,
|
|
603
556
|
'precision': {
|
|
604
|
-
'amount':
|
|
605
|
-
'price':
|
|
557
|
+
'amount': amountPrecision,
|
|
558
|
+
'price': 6 - amountPrecision, // MAX_DECIMALS is 6
|
|
606
559
|
},
|
|
607
560
|
'limits': {
|
|
608
561
|
'leverage': {
|
|
@@ -618,20 +571,21 @@ export default class hyperliquid extends Exchange {
|
|
|
618
571
|
'max': undefined,
|
|
619
572
|
},
|
|
620
573
|
'cost': {
|
|
621
|
-
'min':
|
|
574
|
+
'min': this.parseNumber('10'),
|
|
622
575
|
'max': undefined,
|
|
623
576
|
},
|
|
624
577
|
},
|
|
625
578
|
'created': undefined,
|
|
626
579
|
'info': market,
|
|
627
|
-
};
|
|
580
|
+
});
|
|
628
581
|
}
|
|
629
582
|
async fetchBalance(params = {}) {
|
|
630
583
|
/**
|
|
631
584
|
* @method
|
|
632
585
|
* @name hyperliquid#fetchBalance
|
|
633
586
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
634
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-
|
|
587
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
|
|
588
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
635
589
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
636
590
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
637
591
|
* @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
|
|
@@ -716,7 +670,7 @@ export default class hyperliquid extends Exchange {
|
|
|
716
670
|
* @method
|
|
717
671
|
* @name hyperliquid#fetchOrderBook
|
|
718
672
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
719
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#
|
|
673
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
|
|
720
674
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
721
675
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
722
676
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -764,7 +718,8 @@ export default class hyperliquid extends Exchange {
|
|
|
764
718
|
* @method
|
|
765
719
|
* @name hyperliquid#fetchTickers
|
|
766
720
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
767
|
-
* @see https://
|
|
721
|
+
* @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
|
|
722
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
768
723
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
769
724
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
770
725
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -818,7 +773,7 @@ export default class hyperliquid extends Exchange {
|
|
|
818
773
|
* @method
|
|
819
774
|
* @name hyperliquid#fetchOHLCV
|
|
820
775
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
821
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#
|
|
776
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
|
|
822
777
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
823
778
|
* @param {string} timeframe the length of time each candle represents, support '1m', '15m', '1h', '1d'
|
|
824
779
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -947,15 +902,13 @@ export default class hyperliquid extends Exchange {
|
|
|
947
902
|
}
|
|
948
903
|
amountToPrecision(symbol, amount) {
|
|
949
904
|
const market = this.market(symbol);
|
|
950
|
-
|
|
951
|
-
return super.amountToPrecision(symbol, amount);
|
|
952
|
-
}
|
|
953
|
-
return this.decimalToPrecision(amount, ROUND, this.markets[symbol]['precision']['amount'], this.precisionMode);
|
|
905
|
+
return this.decimalToPrecision(amount, ROUND, market['precision']['amount'], this.precisionMode, this.paddingMode);
|
|
954
906
|
}
|
|
955
907
|
priceToPrecision(symbol, price) {
|
|
956
908
|
const market = this.market(symbol);
|
|
957
|
-
|
|
958
|
-
const
|
|
909
|
+
// https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/tick-and-lot-size
|
|
910
|
+
const result = this.decimalToPrecision(price, ROUND, 5, SIGNIFICANT_DIGITS, this.paddingMode);
|
|
911
|
+
const decimalParsedResult = this.decimalToPrecision(result, ROUND, market['precision']['price'], this.precisionMode, this.paddingMode);
|
|
959
912
|
return decimalParsedResult;
|
|
960
913
|
}
|
|
961
914
|
hashMessage(message) {
|
|
@@ -1647,7 +1600,7 @@ export default class hyperliquid extends Exchange {
|
|
|
1647
1600
|
* @method
|
|
1648
1601
|
* @name hyperliquid#fetchFundingRateHistory
|
|
1649
1602
|
* @description fetches historical funding rate prices
|
|
1650
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-historical-funding-rates
|
|
1603
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
|
|
1651
1604
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1652
1605
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1653
1606
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
@@ -2152,7 +2105,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2152
2105
|
* @method
|
|
2153
2106
|
* @name hyperliquid#fetchPosition
|
|
2154
2107
|
* @description fetch data on an open position
|
|
2155
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-
|
|
2108
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2156
2109
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2157
2110
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2158
2111
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
@@ -2166,7 +2119,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2166
2119
|
* @method
|
|
2167
2120
|
* @name hyperliquid#fetchPositions
|
|
2168
2121
|
* @description fetch all open positions
|
|
2169
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-
|
|
2122
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2170
2123
|
* @param {string[]} [symbols] list of unified market symbols
|
|
2171
2124
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2172
2125
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
@@ -2797,9 +2750,9 @@ export default class hyperliquid extends Exchange {
|
|
|
2797
2750
|
* @method
|
|
2798
2751
|
* @name hyperliquid#fetchLedger
|
|
2799
2752
|
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2800
|
-
* @param {string} code unified currency code
|
|
2753
|
+
* @param {string} [code] unified currency code
|
|
2801
2754
|
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
2802
|
-
* @param {int} [limit] max number of ledger
|
|
2755
|
+
* @param {int} [limit] max number of ledger entries to return
|
|
2803
2756
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2804
2757
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2805
2758
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
@@ -2859,7 +2812,8 @@ export default class hyperliquid extends Exchange {
|
|
|
2859
2812
|
}
|
|
2860
2813
|
const type = this.safeString(delta, 'type');
|
|
2861
2814
|
const amount = this.safeString(delta, 'usdc');
|
|
2862
|
-
return {
|
|
2815
|
+
return this.safeLedgerEntry({
|
|
2816
|
+
'info': item,
|
|
2863
2817
|
'id': this.safeString(item, 'hash'),
|
|
2864
2818
|
'direction': undefined,
|
|
2865
2819
|
'account': undefined,
|
|
@@ -2874,8 +2828,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2874
2828
|
'after': undefined,
|
|
2875
2829
|
'status': undefined,
|
|
2876
2830
|
'fee': fee,
|
|
2877
|
-
|
|
2878
|
-
};
|
|
2831
|
+
}, currency);
|
|
2879
2832
|
}
|
|
2880
2833
|
parseLedgerEntryType(type) {
|
|
2881
2834
|
const ledgerType = {
|
package/js/src/kraken.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/kraken.js';
|
|
2
|
-
import type { IndexType, Int, OrderSide, OrderType, OHLCV, Trade, Order, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, int } from './base/types.js';
|
|
2
|
+
import type { IndexType, Int, OrderSide, OrderType, OHLCV, Trade, Order, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, int, LedgerEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class kraken
|
|
5
5
|
* @augments Exchange
|
|
@@ -36,29 +36,10 @@ export default class kraken extends Exchange {
|
|
|
36
36
|
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
37
37
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
|
38
38
|
parseLedgerEntryType(type: any): string;
|
|
39
|
-
parseLedgerEntry(item: Dict, currency?: Currency):
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
account: any;
|
|
44
|
-
referenceId: string;
|
|
45
|
-
referenceAccount: any;
|
|
46
|
-
type: string;
|
|
47
|
-
currency: string;
|
|
48
|
-
amount: number;
|
|
49
|
-
before: any;
|
|
50
|
-
after: number;
|
|
51
|
-
status: string;
|
|
52
|
-
timestamp: number;
|
|
53
|
-
datetime: string;
|
|
54
|
-
fee: {
|
|
55
|
-
cost: number;
|
|
56
|
-
currency: string;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
60
|
-
fetchLedgerEntriesByIds(ids: any, code?: Str, params?: {}): Promise<any>;
|
|
61
|
-
fetchLedgerEntry(id: string, code?: Str, params?: {}): Promise<any>;
|
|
39
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
40
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
41
|
+
fetchLedgerEntriesByIds(ids: any, code?: Str, params?: {}): Promise<LedgerEntry[]>;
|
|
42
|
+
fetchLedgerEntry(id: string, code?: Str, params?: {}): Promise<LedgerEntry>;
|
|
62
43
|
parseTrade(trade: Dict, market?: Market): Trade;
|
|
63
44
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
64
45
|
parseBalance(response: any): Balances;
|
package/js/src/kraken.js
CHANGED
|
@@ -1070,7 +1070,9 @@ export default class kraken extends Exchange {
|
|
|
1070
1070
|
const referenceId = this.safeString(item, 'refid');
|
|
1071
1071
|
const referenceAccount = undefined;
|
|
1072
1072
|
const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
|
|
1073
|
-
const
|
|
1073
|
+
const currencyId = this.safeString(item, 'asset');
|
|
1074
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1075
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
1074
1076
|
let amount = this.safeString(item, 'amount');
|
|
1075
1077
|
if (Precise.stringLt(amount, '0')) {
|
|
1076
1078
|
direction = 'out';
|
|
@@ -1080,7 +1082,7 @@ export default class kraken extends Exchange {
|
|
|
1080
1082
|
direction = 'in';
|
|
1081
1083
|
}
|
|
1082
1084
|
const timestamp = this.safeIntegerProduct(item, 'time', 1000);
|
|
1083
|
-
return {
|
|
1085
|
+
return this.safeLedgerEntry({
|
|
1084
1086
|
'info': item,
|
|
1085
1087
|
'id': id,
|
|
1086
1088
|
'direction': direction,
|
|
@@ -1099,17 +1101,17 @@ export default class kraken extends Exchange {
|
|
|
1099
1101
|
'cost': this.safeNumber(item, 'fee'),
|
|
1100
1102
|
'currency': code,
|
|
1101
1103
|
},
|
|
1102
|
-
};
|
|
1104
|
+
}, currency);
|
|
1103
1105
|
}
|
|
1104
1106
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1105
1107
|
/**
|
|
1106
1108
|
* @method
|
|
1107
1109
|
* @name kraken#fetchLedger
|
|
1108
|
-
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1110
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
1109
1111
|
* @see https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers
|
|
1110
|
-
* @param {string} code unified currency code, default is undefined
|
|
1112
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
1111
1113
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1112
|
-
* @param {int} [limit] max number of ledger
|
|
1114
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1113
1115
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1114
1116
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
1115
1117
|
* @param {int} [params.end] timestamp in seconds of the latest ledger entry
|
package/js/src/kucoin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/kucoin.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, Balances, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, Num, Account, Dict, TradingFeeInterface, Currencies, int } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, Balances, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, Num, Account, Dict, TradingFeeInterface, Currencies, int, LedgerEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class kucoin
|
|
5
5
|
* @augments Exchange
|
|
@@ -89,24 +89,8 @@ export default class kucoin extends Exchange {
|
|
|
89
89
|
parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
|
|
90
90
|
parseTransferStatus(status: Str): Str;
|
|
91
91
|
parseLedgerEntryType(type: any): string;
|
|
92
|
-
parseLedgerEntry(item: Dict, currency?: Currency):
|
|
93
|
-
|
|
94
|
-
direction: string;
|
|
95
|
-
account: string;
|
|
96
|
-
referenceId: any;
|
|
97
|
-
referenceAccount: string;
|
|
98
|
-
type: string;
|
|
99
|
-
currency: string;
|
|
100
|
-
amount: number;
|
|
101
|
-
timestamp: number;
|
|
102
|
-
datetime: string;
|
|
103
|
-
before: any;
|
|
104
|
-
after: any;
|
|
105
|
-
status: any;
|
|
106
|
-
fee: any;
|
|
107
|
-
info: Dict;
|
|
108
|
-
};
|
|
109
|
-
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
92
|
+
parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
|
|
93
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
110
94
|
calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
|
|
111
95
|
parseBorrowRateHistory(response: any, code: any, since: any, limit: any): any;
|
|
112
96
|
parseBorrowRate(info: any, currency?: Currency): {
|
package/js/src/kucoin.js
CHANGED
|
@@ -4202,6 +4202,7 @@ export default class kucoin extends Exchange {
|
|
|
4202
4202
|
const id = this.safeString(item, 'id');
|
|
4203
4203
|
const currencyId = this.safeString(item, 'currency');
|
|
4204
4204
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4205
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
4205
4206
|
const amount = this.safeNumber(item, 'amount');
|
|
4206
4207
|
const balanceAfter = undefined;
|
|
4207
4208
|
// const balanceAfter = this.safeNumber (item, 'balance'); only returns zero string
|
|
@@ -4250,7 +4251,8 @@ export default class kucoin extends Exchange {
|
|
|
4250
4251
|
feeCurrency = code;
|
|
4251
4252
|
fee = { 'cost': this.parseNumber(feeCost), 'currency': feeCurrency };
|
|
4252
4253
|
}
|
|
4253
|
-
return {
|
|
4254
|
+
return this.safeLedgerEntry({
|
|
4255
|
+
'info': item,
|
|
4254
4256
|
'id': id,
|
|
4255
4257
|
'direction': direction,
|
|
4256
4258
|
'account': account,
|
|
@@ -4265,24 +4267,23 @@ export default class kucoin extends Exchange {
|
|
|
4265
4267
|
'after': balanceAfter,
|
|
4266
4268
|
'status': undefined,
|
|
4267
4269
|
'fee': fee,
|
|
4268
|
-
|
|
4269
|
-
};
|
|
4270
|
+
}, currency);
|
|
4270
4271
|
}
|
|
4271
4272
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4272
4273
|
/**
|
|
4273
4274
|
* @method
|
|
4274
4275
|
* @name kucoin#fetchLedger
|
|
4276
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
4275
4277
|
* @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
|
|
4276
4278
|
* @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
|
|
4277
4279
|
* @see https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
|
|
4278
|
-
* @
|
|
4279
|
-
* @param {string} code unified currency code, default is undefined
|
|
4280
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
4280
4281
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
4281
|
-
* @param {int} [limit] max number of ledger
|
|
4282
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
4282
4283
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4283
4284
|
* @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
|
|
4284
4285
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4285
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
4286
|
+
* @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)
|
|
4286
4287
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
4287
4288
|
*/
|
|
4288
4289
|
await this.loadMarkets();
|
|
@@ -5064,7 +5065,7 @@ export default class kucoin extends Exchange {
|
|
|
5064
5065
|
//
|
|
5065
5066
|
const errorCode = this.safeString(response, 'code');
|
|
5066
5067
|
const message = this.safeString2(response, 'msg', 'data', '');
|
|
5067
|
-
const feedback = this.id + ' ' +
|
|
5068
|
+
const feedback = this.id + ' ' + body;
|
|
5068
5069
|
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
5069
5070
|
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
|
|
5070
5071
|
this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
|
package/js/src/luno.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/luno.js';
|
|
2
|
-
import type { Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, OHLCV, Num, Account, TradingFeeInterface, Dict, int } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, OHLCV, Num, Account, TradingFeeInterface, Dict, int, LedgerEntry } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class luno
|
|
5
5
|
* @augments Exchange
|
|
@@ -29,29 +29,13 @@ export default class luno extends Exchange {
|
|
|
29
29
|
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
30
30
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
31
31
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
32
|
-
fetchLedgerByEntries(code?: Str, entry?: any, limit?: any, params?: {}): Promise<
|
|
33
|
-
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<
|
|
32
|
+
fetchLedgerByEntries(code?: Str, entry?: any, limit?: any, params?: {}): Promise<LedgerEntry[]>;
|
|
33
|
+
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
34
34
|
parseLedgerComment(comment: any): {
|
|
35
35
|
type: string;
|
|
36
36
|
referenceId: any;
|
|
37
37
|
};
|
|
38
|
-
parseLedgerEntry(entry: any, currency?: Currency):
|
|
39
|
-
id: string;
|
|
40
|
-
direction: any;
|
|
41
|
-
account: string;
|
|
42
|
-
referenceId: any;
|
|
43
|
-
referenceAccount: any;
|
|
44
|
-
type: string;
|
|
45
|
-
currency: string;
|
|
46
|
-
amount: number;
|
|
47
|
-
timestamp: number;
|
|
48
|
-
datetime: string;
|
|
49
|
-
before: number;
|
|
50
|
-
after: number;
|
|
51
|
-
status: any;
|
|
52
|
-
fee: any;
|
|
53
|
-
info: any;
|
|
54
|
-
};
|
|
38
|
+
parseLedgerEntry(entry: any, currency?: Currency): LedgerEntry;
|
|
55
39
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
56
40
|
url: string;
|
|
57
41
|
method: string;
|
package/js/src/luno.js
CHANGED
|
@@ -993,11 +993,11 @@ export default class luno extends Exchange {
|
|
|
993
993
|
/**
|
|
994
994
|
* @method
|
|
995
995
|
* @name luno#fetchLedger
|
|
996
|
-
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
996
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
997
997
|
* @see https://www.luno.com/en/developers/api#tag/Accounts/operation/ListTransactions
|
|
998
|
-
* @param {string} code unified currency code, default is undefined
|
|
998
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
999
999
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1000
|
-
* @param {int} [limit] max number of ledger
|
|
1000
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1001
1001
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1002
1002
|
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
1003
1003
|
*/
|
|
@@ -1084,6 +1084,7 @@ export default class luno extends Exchange {
|
|
|
1084
1084
|
const timestamp = this.safeInteger(entry, 'timestamp');
|
|
1085
1085
|
const currencyId = this.safeString(entry, 'currency');
|
|
1086
1086
|
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1087
|
+
currency = this.safeCurrency(currencyId, currency);
|
|
1087
1088
|
const available_delta = this.safeString(entry, 'available_delta');
|
|
1088
1089
|
const balance_delta = this.safeString(entry, 'balance_delta');
|
|
1089
1090
|
const after = this.safeString(entry, 'balance');
|
|
@@ -1114,7 +1115,8 @@ export default class luno extends Exchange {
|
|
|
1114
1115
|
else if (Precise.stringLt(balance_delta, '0') || Precise.stringLt(available_delta, '0')) {
|
|
1115
1116
|
direction = 'out';
|
|
1116
1117
|
}
|
|
1117
|
-
return {
|
|
1118
|
+
return this.safeLedgerEntry({
|
|
1119
|
+
'info': entry,
|
|
1118
1120
|
'id': id,
|
|
1119
1121
|
'direction': direction,
|
|
1120
1122
|
'account': account_id,
|
|
@@ -1122,15 +1124,14 @@ export default class luno extends Exchange {
|
|
|
1122
1124
|
'referenceAccount': undefined,
|
|
1123
1125
|
'type': type,
|
|
1124
1126
|
'currency': code,
|
|
1125
|
-
'amount': this.
|
|
1127
|
+
'amount': this.parseToNumeric(amount),
|
|
1126
1128
|
'timestamp': timestamp,
|
|
1127
1129
|
'datetime': this.iso8601(timestamp),
|
|
1128
|
-
'before': this.
|
|
1129
|
-
'after': this.
|
|
1130
|
+
'before': this.parseToNumeric(before),
|
|
1131
|
+
'after': this.parseToNumeric(after),
|
|
1130
1132
|
'status': status,
|
|
1131
1133
|
'fee': undefined,
|
|
1132
|
-
|
|
1133
|
-
};
|
|
1134
|
+
}, currency);
|
|
1134
1135
|
}
|
|
1135
1136
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
1136
1137
|
let url = this.urls['api'][api] + '/' + this.version + '/' + this.implodeParams(path, params);
|