ccxt 4.0.84 → 4.0.86
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 +3 -3
- package/dist/ccxt.browser.js +118 -56
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bitget.js +30 -7
- package/dist/cjs/src/kucoinfutures.js +9 -2
- package/dist/cjs/src/latoken.js +67 -45
- package/dist/cjs/src/pro/binance.js +11 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/bitget.js +30 -7
- package/js/src/kucoinfutures.js +9 -2
- package/js/src/latoken.js +67 -45
- package/js/src/pro/binance.js +11 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -180,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
180
180
|
|
|
181
181
|
//-----------------------------------------------------------------------------
|
|
182
182
|
// this is updated by vss.js when building
|
|
183
|
-
const version = '4.0.
|
|
183
|
+
const version = '4.0.86';
|
|
184
184
|
Exchange["default"].ccxtVersion = version;
|
|
185
185
|
const exchanges = {
|
|
186
186
|
'ace': ace,
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -2562,6 +2562,8 @@ class bitget extends bitget$1 {
|
|
|
2562
2562
|
/**
|
|
2563
2563
|
* @method
|
|
2564
2564
|
* @name bitget#fetchBalance
|
|
2565
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
|
|
2566
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
|
|
2565
2567
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
2566
2568
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
2567
2569
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
@@ -2626,13 +2628,32 @@ class bitget extends bitget$1 {
|
|
|
2626
2628
|
parseBalance(balance) {
|
|
2627
2629
|
const result = { 'info': balance };
|
|
2628
2630
|
//
|
|
2631
|
+
// spot
|
|
2632
|
+
//
|
|
2633
|
+
// {
|
|
2634
|
+
// coinId: '1',
|
|
2635
|
+
// coinName: 'BTC',
|
|
2636
|
+
// available: '0.00099900',
|
|
2637
|
+
// frozen: '0.00000000',
|
|
2638
|
+
// lock: '0.00000000',
|
|
2639
|
+
// uTime: '1661595535000'
|
|
2640
|
+
// }
|
|
2641
|
+
//
|
|
2642
|
+
// swap
|
|
2643
|
+
//
|
|
2629
2644
|
// {
|
|
2630
|
-
//
|
|
2631
|
-
//
|
|
2632
|
-
//
|
|
2633
|
-
//
|
|
2634
|
-
//
|
|
2635
|
-
//
|
|
2645
|
+
// marginCoin: 'BTC',
|
|
2646
|
+
// locked: '0.00001948',
|
|
2647
|
+
// available: '0.00006622',
|
|
2648
|
+
// crossMaxAvailable: '0.00004674',
|
|
2649
|
+
// fixedMaxAvailable: '0.00004674',
|
|
2650
|
+
// maxTransferOut: '0.00004674',
|
|
2651
|
+
// equity: '0.00006622',
|
|
2652
|
+
// usdtEquity: '1.734307497491',
|
|
2653
|
+
// btcEquity: '0.000066229058',
|
|
2654
|
+
// crossRiskRate: '0.066308887072',
|
|
2655
|
+
// unrealizedPL: '0',
|
|
2656
|
+
// bonus: '0'
|
|
2636
2657
|
// }
|
|
2637
2658
|
//
|
|
2638
2659
|
for (let i = 0; i < balance.length; i++) {
|
|
@@ -2640,10 +2661,12 @@ class bitget extends bitget$1 {
|
|
|
2640
2661
|
const currencyId = this.safeString2(entry, 'coinName', 'marginCoin');
|
|
2641
2662
|
const code = this.safeCurrencyCode(currencyId);
|
|
2642
2663
|
const account = this.account();
|
|
2664
|
+
const spotAccountFree = this.safeString(entry, 'available');
|
|
2665
|
+
const contractAccountFree = this.safeString(entry, 'maxTransferOut');
|
|
2666
|
+
account['free'] = (contractAccountFree !== undefined) ? contractAccountFree : spotAccountFree;
|
|
2643
2667
|
const frozen = this.safeString(entry, 'frozen');
|
|
2644
2668
|
const locked = this.safeString2(entry, 'lock', 'locked');
|
|
2645
2669
|
account['used'] = Precise["default"].stringAdd(frozen, locked);
|
|
2646
|
-
account['free'] = this.safeString(entry, 'available');
|
|
2647
2670
|
result[code] = account;
|
|
2648
2671
|
}
|
|
2649
2672
|
return this.safeBalance(result);
|
|
@@ -1125,11 +1125,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1125
1125
|
'leverage': 1,
|
|
1126
1126
|
};
|
|
1127
1127
|
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
1128
|
+
const triggerPriceTypes = {
|
|
1129
|
+
'mark': 'MP',
|
|
1130
|
+
'last': 'TP',
|
|
1131
|
+
'index': 'IP',
|
|
1132
|
+
};
|
|
1133
|
+
const triggerPriceType = this.safeString(params, 'triggerPriceType', 'mark');
|
|
1134
|
+
const triggerPriceTypeValue = this.safeString(triggerPriceTypes, triggerPriceType, triggerPriceType);
|
|
1128
1135
|
params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice']);
|
|
1129
1136
|
if (triggerPrice) {
|
|
1130
1137
|
request['stop'] = (side === 'buy') ? 'up' : 'down';
|
|
1131
1138
|
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1132
|
-
request['stopPriceType'] =
|
|
1139
|
+
request['stopPriceType'] = triggerPriceTypeValue;
|
|
1133
1140
|
}
|
|
1134
1141
|
else if (stopLossPrice || takeProfitPrice) {
|
|
1135
1142
|
if (stopLossPrice) {
|
|
@@ -1141,7 +1148,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1141
1148
|
request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
|
|
1142
1149
|
}
|
|
1143
1150
|
request['reduceOnly'] = true;
|
|
1144
|
-
request['stopPriceType'] =
|
|
1151
|
+
request['stopPriceType'] = triggerPriceTypeValue;
|
|
1145
1152
|
}
|
|
1146
1153
|
const uppercaseType = type.toUpperCase();
|
|
1147
1154
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
package/dist/cjs/src/latoken.js
CHANGED
|
@@ -573,41 +573,47 @@ class latoken extends latoken$1 {
|
|
|
573
573
|
}
|
|
574
574
|
parseTicker(ticker, market = undefined) {
|
|
575
575
|
//
|
|
576
|
-
//
|
|
577
|
-
//
|
|
578
|
-
//
|
|
579
|
-
//
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
//
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
576
|
+
// {
|
|
577
|
+
// symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
578
|
+
// baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
|
|
579
|
+
// quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
580
|
+
// volume24h: '165723597.189022176000000000',
|
|
581
|
+
// volume7d: '934505768.625109571000000000',
|
|
582
|
+
// change24h: '0.0200',
|
|
583
|
+
// change7d: '-6.4200',
|
|
584
|
+
// amount24h: '6438.457663100000000000',
|
|
585
|
+
// amount7d: '35657.785013800000000000',
|
|
586
|
+
// lastPrice: '25779.16',
|
|
587
|
+
// lastQuantity: '0.248403300000000000',
|
|
588
|
+
// bestBid: '25778.74',
|
|
589
|
+
// bestBidQuantity: '0.6520232',
|
|
590
|
+
// bestAsk: '25779.17',
|
|
591
|
+
// bestAskQuantity: '0.4956043',
|
|
592
|
+
// updateTimestamp: '1693965231406'
|
|
593
|
+
// }
|
|
586
594
|
//
|
|
587
595
|
const marketId = this.safeString(ticker, 'symbol');
|
|
588
|
-
const symbol = this.safeSymbol(marketId, market);
|
|
589
596
|
const last = this.safeString(ticker, 'lastPrice');
|
|
590
|
-
const
|
|
591
|
-
const timestamp = this.nonce();
|
|
597
|
+
const timestamp = this.safeInteger(ticker, 'updateTimestamp');
|
|
592
598
|
return this.safeTicker({
|
|
593
|
-
'symbol':
|
|
599
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
594
600
|
'timestamp': timestamp,
|
|
595
601
|
'datetime': this.iso8601(timestamp),
|
|
596
|
-
'low':
|
|
597
|
-
'high':
|
|
598
|
-
'bid':
|
|
599
|
-
'bidVolume':
|
|
600
|
-
'ask':
|
|
601
|
-
'askVolume':
|
|
602
|
+
'low': undefined,
|
|
603
|
+
'high': undefined,
|
|
604
|
+
'bid': this.safeString(ticker, 'bestBid'),
|
|
605
|
+
'bidVolume': this.safeString(ticker, 'bestBidQuantity'),
|
|
606
|
+
'ask': this.safeString(ticker, 'bestAsk'),
|
|
607
|
+
'askVolume': this.safeString(ticker, 'bestAskQuantity'),
|
|
602
608
|
'vwap': undefined,
|
|
603
609
|
'open': undefined,
|
|
604
610
|
'close': last,
|
|
605
611
|
'last': last,
|
|
606
612
|
'previousClose': undefined,
|
|
607
|
-
'change':
|
|
608
|
-
'percentage':
|
|
613
|
+
'change': undefined,
|
|
614
|
+
'percentage': this.safeString(ticker, 'change24h'),
|
|
609
615
|
'average': undefined,
|
|
610
|
-
'baseVolume':
|
|
616
|
+
'baseVolume': this.safeString(ticker, 'amount24h'),
|
|
611
617
|
'quoteVolume': this.safeString(ticker, 'volume24h'),
|
|
612
618
|
'info': ticker,
|
|
613
619
|
}, market);
|
|
@@ -629,16 +635,24 @@ class latoken extends latoken$1 {
|
|
|
629
635
|
};
|
|
630
636
|
const response = await this.publicGetTickerBaseQuote(this.extend(request, params));
|
|
631
637
|
//
|
|
632
|
-
//
|
|
633
|
-
//
|
|
634
|
-
//
|
|
635
|
-
//
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
//
|
|
638
|
+
// {
|
|
639
|
+
// symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
640
|
+
// baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
|
|
641
|
+
// quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
642
|
+
// volume24h: '165723597.189022176000000000',
|
|
643
|
+
// volume7d: '934505768.625109571000000000',
|
|
644
|
+
// change24h: '0.0200',
|
|
645
|
+
// change7d: '-6.4200',
|
|
646
|
+
// amount24h: '6438.457663100000000000',
|
|
647
|
+
// amount7d: '35657.785013800000000000',
|
|
648
|
+
// lastPrice: '25779.16',
|
|
649
|
+
// lastQuantity: '0.248403300000000000',
|
|
650
|
+
// bestBid: '25778.74',
|
|
651
|
+
// bestBidQuantity: '0.6520232',
|
|
652
|
+
// bestAsk: '25779.17',
|
|
653
|
+
// bestAskQuantity: '0.4956043',
|
|
654
|
+
// updateTimestamp: '1693965231406'
|
|
655
|
+
// }
|
|
642
656
|
//
|
|
643
657
|
return this.parseTicker(response, market);
|
|
644
658
|
}
|
|
@@ -654,18 +668,26 @@ class latoken extends latoken$1 {
|
|
|
654
668
|
await this.loadMarkets();
|
|
655
669
|
const response = await this.publicGetTicker(params);
|
|
656
670
|
//
|
|
657
|
-
//
|
|
658
|
-
//
|
|
659
|
-
//
|
|
660
|
-
//
|
|
661
|
-
//
|
|
662
|
-
//
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
//
|
|
666
|
-
//
|
|
667
|
-
//
|
|
668
|
-
//
|
|
671
|
+
// [
|
|
672
|
+
// {
|
|
673
|
+
// symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
674
|
+
// baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
|
|
675
|
+
// quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
676
|
+
// volume24h: '165723597.189022176000000000',
|
|
677
|
+
// volume7d: '934505768.625109571000000000',
|
|
678
|
+
// change24h: '0.0200',
|
|
679
|
+
// change7d: '-6.4200',
|
|
680
|
+
// amount24h: '6438.457663100000000000',
|
|
681
|
+
// amount7d: '35657.785013800000000000',
|
|
682
|
+
// lastPrice: '25779.16',
|
|
683
|
+
// lastQuantity: '0.248403300000000000',
|
|
684
|
+
// bestBid: '25778.74',
|
|
685
|
+
// bestBidQuantity: '0.6520232',
|
|
686
|
+
// bestAsk: '25779.17',
|
|
687
|
+
// bestAskQuantity: '0.4956043',
|
|
688
|
+
// updateTimestamp: '1693965231406'
|
|
689
|
+
// }
|
|
690
|
+
// ]
|
|
669
691
|
//
|
|
670
692
|
return this.parseTickers(response, symbols);
|
|
671
693
|
}
|
|
@@ -977,7 +977,17 @@ class binance extends binance$1 {
|
|
|
977
977
|
client.resolve(result, messageHash);
|
|
978
978
|
if (event === 'bookTicker') {
|
|
979
979
|
// watch bookTickers
|
|
980
|
-
client.resolve(
|
|
980
|
+
client.resolve(result, '!' + 'bookTicker@arr');
|
|
981
|
+
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
982
|
+
for (let i = 0; i < messageHashes.length; i++) {
|
|
983
|
+
const messageHash = messageHashes[i];
|
|
984
|
+
const parts = messageHash.split('::');
|
|
985
|
+
const symbolsString = parts[1];
|
|
986
|
+
const symbols = symbolsString.split(',');
|
|
987
|
+
if (this.inArray(symbol, symbols)) {
|
|
988
|
+
client.resolve(result, messageHash);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
981
991
|
}
|
|
982
992
|
}
|
|
983
993
|
handleTickers(client, message) {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.0.
|
|
7
|
+
declare const version = "4.0.85";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.0.
|
|
41
|
+
const version = '4.0.86';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
package/js/src/bitget.js
CHANGED
|
@@ -2565,6 +2565,8 @@ export default class bitget extends Exchange {
|
|
|
2565
2565
|
/**
|
|
2566
2566
|
* @method
|
|
2567
2567
|
* @name bitget#fetchBalance
|
|
2568
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
|
|
2569
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
|
|
2568
2570
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
2569
2571
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
2570
2572
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
@@ -2629,13 +2631,32 @@ export default class bitget extends Exchange {
|
|
|
2629
2631
|
parseBalance(balance) {
|
|
2630
2632
|
const result = { 'info': balance };
|
|
2631
2633
|
//
|
|
2634
|
+
// spot
|
|
2635
|
+
//
|
|
2636
|
+
// {
|
|
2637
|
+
// coinId: '1',
|
|
2638
|
+
// coinName: 'BTC',
|
|
2639
|
+
// available: '0.00099900',
|
|
2640
|
+
// frozen: '0.00000000',
|
|
2641
|
+
// lock: '0.00000000',
|
|
2642
|
+
// uTime: '1661595535000'
|
|
2643
|
+
// }
|
|
2644
|
+
//
|
|
2645
|
+
// swap
|
|
2646
|
+
//
|
|
2632
2647
|
// {
|
|
2633
|
-
//
|
|
2634
|
-
//
|
|
2635
|
-
//
|
|
2636
|
-
//
|
|
2637
|
-
//
|
|
2638
|
-
//
|
|
2648
|
+
// marginCoin: 'BTC',
|
|
2649
|
+
// locked: '0.00001948',
|
|
2650
|
+
// available: '0.00006622',
|
|
2651
|
+
// crossMaxAvailable: '0.00004674',
|
|
2652
|
+
// fixedMaxAvailable: '0.00004674',
|
|
2653
|
+
// maxTransferOut: '0.00004674',
|
|
2654
|
+
// equity: '0.00006622',
|
|
2655
|
+
// usdtEquity: '1.734307497491',
|
|
2656
|
+
// btcEquity: '0.000066229058',
|
|
2657
|
+
// crossRiskRate: '0.066308887072',
|
|
2658
|
+
// unrealizedPL: '0',
|
|
2659
|
+
// bonus: '0'
|
|
2639
2660
|
// }
|
|
2640
2661
|
//
|
|
2641
2662
|
for (let i = 0; i < balance.length; i++) {
|
|
@@ -2643,10 +2664,12 @@ export default class bitget extends Exchange {
|
|
|
2643
2664
|
const currencyId = this.safeString2(entry, 'coinName', 'marginCoin');
|
|
2644
2665
|
const code = this.safeCurrencyCode(currencyId);
|
|
2645
2666
|
const account = this.account();
|
|
2667
|
+
const spotAccountFree = this.safeString(entry, 'available');
|
|
2668
|
+
const contractAccountFree = this.safeString(entry, 'maxTransferOut');
|
|
2669
|
+
account['free'] = (contractAccountFree !== undefined) ? contractAccountFree : spotAccountFree;
|
|
2646
2670
|
const frozen = this.safeString(entry, 'frozen');
|
|
2647
2671
|
const locked = this.safeString2(entry, 'lock', 'locked');
|
|
2648
2672
|
account['used'] = Precise.stringAdd(frozen, locked);
|
|
2649
|
-
account['free'] = this.safeString(entry, 'available');
|
|
2650
2673
|
result[code] = account;
|
|
2651
2674
|
}
|
|
2652
2675
|
return this.safeBalance(result);
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -1128,11 +1128,18 @@ export default class kucoinfutures extends kucoin {
|
|
|
1128
1128
|
'leverage': 1,
|
|
1129
1129
|
};
|
|
1130
1130
|
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
1131
|
+
const triggerPriceTypes = {
|
|
1132
|
+
'mark': 'MP',
|
|
1133
|
+
'last': 'TP',
|
|
1134
|
+
'index': 'IP',
|
|
1135
|
+
};
|
|
1136
|
+
const triggerPriceType = this.safeString(params, 'triggerPriceType', 'mark');
|
|
1137
|
+
const triggerPriceTypeValue = this.safeString(triggerPriceTypes, triggerPriceType, triggerPriceType);
|
|
1131
1138
|
params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'stopPrice']);
|
|
1132
1139
|
if (triggerPrice) {
|
|
1133
1140
|
request['stop'] = (side === 'buy') ? 'up' : 'down';
|
|
1134
1141
|
request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
1135
|
-
request['stopPriceType'] =
|
|
1142
|
+
request['stopPriceType'] = triggerPriceTypeValue;
|
|
1136
1143
|
}
|
|
1137
1144
|
else if (stopLossPrice || takeProfitPrice) {
|
|
1138
1145
|
if (stopLossPrice) {
|
|
@@ -1144,7 +1151,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
1144
1151
|
request['stopPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
|
|
1145
1152
|
}
|
|
1146
1153
|
request['reduceOnly'] = true;
|
|
1147
|
-
request['stopPriceType'] =
|
|
1154
|
+
request['stopPriceType'] = triggerPriceTypeValue;
|
|
1148
1155
|
}
|
|
1149
1156
|
const uppercaseType = type.toUpperCase();
|
|
1150
1157
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
package/js/src/latoken.js
CHANGED
|
@@ -576,41 +576,47 @@ export default class latoken extends Exchange {
|
|
|
576
576
|
}
|
|
577
577
|
parseTicker(ticker, market = undefined) {
|
|
578
578
|
//
|
|
579
|
-
//
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
//
|
|
583
|
-
//
|
|
584
|
-
//
|
|
585
|
-
//
|
|
586
|
-
//
|
|
587
|
-
//
|
|
588
|
-
//
|
|
579
|
+
// {
|
|
580
|
+
// symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
581
|
+
// baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
|
|
582
|
+
// quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
583
|
+
// volume24h: '165723597.189022176000000000',
|
|
584
|
+
// volume7d: '934505768.625109571000000000',
|
|
585
|
+
// change24h: '0.0200',
|
|
586
|
+
// change7d: '-6.4200',
|
|
587
|
+
// amount24h: '6438.457663100000000000',
|
|
588
|
+
// amount7d: '35657.785013800000000000',
|
|
589
|
+
// lastPrice: '25779.16',
|
|
590
|
+
// lastQuantity: '0.248403300000000000',
|
|
591
|
+
// bestBid: '25778.74',
|
|
592
|
+
// bestBidQuantity: '0.6520232',
|
|
593
|
+
// bestAsk: '25779.17',
|
|
594
|
+
// bestAskQuantity: '0.4956043',
|
|
595
|
+
// updateTimestamp: '1693965231406'
|
|
596
|
+
// }
|
|
589
597
|
//
|
|
590
598
|
const marketId = this.safeString(ticker, 'symbol');
|
|
591
|
-
const symbol = this.safeSymbol(marketId, market);
|
|
592
599
|
const last = this.safeString(ticker, 'lastPrice');
|
|
593
|
-
const
|
|
594
|
-
const timestamp = this.nonce();
|
|
600
|
+
const timestamp = this.safeInteger(ticker, 'updateTimestamp');
|
|
595
601
|
return this.safeTicker({
|
|
596
|
-
'symbol':
|
|
602
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
597
603
|
'timestamp': timestamp,
|
|
598
604
|
'datetime': this.iso8601(timestamp),
|
|
599
|
-
'low':
|
|
600
|
-
'high':
|
|
601
|
-
'bid':
|
|
602
|
-
'bidVolume':
|
|
603
|
-
'ask':
|
|
604
|
-
'askVolume':
|
|
605
|
+
'low': undefined,
|
|
606
|
+
'high': undefined,
|
|
607
|
+
'bid': this.safeString(ticker, 'bestBid'),
|
|
608
|
+
'bidVolume': this.safeString(ticker, 'bestBidQuantity'),
|
|
609
|
+
'ask': this.safeString(ticker, 'bestAsk'),
|
|
610
|
+
'askVolume': this.safeString(ticker, 'bestAskQuantity'),
|
|
605
611
|
'vwap': undefined,
|
|
606
612
|
'open': undefined,
|
|
607
613
|
'close': last,
|
|
608
614
|
'last': last,
|
|
609
615
|
'previousClose': undefined,
|
|
610
|
-
'change':
|
|
611
|
-
'percentage':
|
|
616
|
+
'change': undefined,
|
|
617
|
+
'percentage': this.safeString(ticker, 'change24h'),
|
|
612
618
|
'average': undefined,
|
|
613
|
-
'baseVolume':
|
|
619
|
+
'baseVolume': this.safeString(ticker, 'amount24h'),
|
|
614
620
|
'quoteVolume': this.safeString(ticker, 'volume24h'),
|
|
615
621
|
'info': ticker,
|
|
616
622
|
}, market);
|
|
@@ -632,16 +638,24 @@ export default class latoken extends Exchange {
|
|
|
632
638
|
};
|
|
633
639
|
const response = await this.publicGetTickerBaseQuote(this.extend(request, params));
|
|
634
640
|
//
|
|
635
|
-
//
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
//
|
|
642
|
-
//
|
|
643
|
-
//
|
|
644
|
-
//
|
|
641
|
+
// {
|
|
642
|
+
// symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
643
|
+
// baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
|
|
644
|
+
// quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
645
|
+
// volume24h: '165723597.189022176000000000',
|
|
646
|
+
// volume7d: '934505768.625109571000000000',
|
|
647
|
+
// change24h: '0.0200',
|
|
648
|
+
// change7d: '-6.4200',
|
|
649
|
+
// amount24h: '6438.457663100000000000',
|
|
650
|
+
// amount7d: '35657.785013800000000000',
|
|
651
|
+
// lastPrice: '25779.16',
|
|
652
|
+
// lastQuantity: '0.248403300000000000',
|
|
653
|
+
// bestBid: '25778.74',
|
|
654
|
+
// bestBidQuantity: '0.6520232',
|
|
655
|
+
// bestAsk: '25779.17',
|
|
656
|
+
// bestAskQuantity: '0.4956043',
|
|
657
|
+
// updateTimestamp: '1693965231406'
|
|
658
|
+
// }
|
|
645
659
|
//
|
|
646
660
|
return this.parseTicker(response, market);
|
|
647
661
|
}
|
|
@@ -657,18 +671,26 @@ export default class latoken extends Exchange {
|
|
|
657
671
|
await this.loadMarkets();
|
|
658
672
|
const response = await this.publicGetTicker(params);
|
|
659
673
|
//
|
|
660
|
-
//
|
|
661
|
-
//
|
|
662
|
-
//
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
//
|
|
666
|
-
//
|
|
667
|
-
//
|
|
668
|
-
//
|
|
669
|
-
//
|
|
670
|
-
//
|
|
671
|
-
//
|
|
674
|
+
// [
|
|
675
|
+
// {
|
|
676
|
+
// symbol: '92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
677
|
+
// baseCurrency: '92151d82-df98-4d88-9a4d-284fa9eca49f',
|
|
678
|
+
// quoteCurrency: '0c3a106d-bde3-4c13-a26e-3fd2394529e5',
|
|
679
|
+
// volume24h: '165723597.189022176000000000',
|
|
680
|
+
// volume7d: '934505768.625109571000000000',
|
|
681
|
+
// change24h: '0.0200',
|
|
682
|
+
// change7d: '-6.4200',
|
|
683
|
+
// amount24h: '6438.457663100000000000',
|
|
684
|
+
// amount7d: '35657.785013800000000000',
|
|
685
|
+
// lastPrice: '25779.16',
|
|
686
|
+
// lastQuantity: '0.248403300000000000',
|
|
687
|
+
// bestBid: '25778.74',
|
|
688
|
+
// bestBidQuantity: '0.6520232',
|
|
689
|
+
// bestAsk: '25779.17',
|
|
690
|
+
// bestAskQuantity: '0.4956043',
|
|
691
|
+
// updateTimestamp: '1693965231406'
|
|
692
|
+
// }
|
|
693
|
+
// ]
|
|
672
694
|
//
|
|
673
695
|
return this.parseTickers(response, symbols);
|
|
674
696
|
}
|
package/js/src/pro/binance.js
CHANGED
|
@@ -980,7 +980,17 @@ export default class binance extends binanceRest {
|
|
|
980
980
|
client.resolve(result, messageHash);
|
|
981
981
|
if (event === 'bookTicker') {
|
|
982
982
|
// watch bookTickers
|
|
983
|
-
client.resolve(
|
|
983
|
+
client.resolve(result, '!' + 'bookTicker@arr');
|
|
984
|
+
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
985
|
+
for (let i = 0; i < messageHashes.length; i++) {
|
|
986
|
+
const messageHash = messageHashes[i];
|
|
987
|
+
const parts = messageHash.split('::');
|
|
988
|
+
const symbolsString = parts[1];
|
|
989
|
+
const symbols = symbolsString.split(',');
|
|
990
|
+
if (this.inArray(symbol, symbols)) {
|
|
991
|
+
client.resolve(result, messageHash);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
984
994
|
}
|
|
985
995
|
}
|
|
986
996
|
handleTickers(client, message) {
|
package/package.json
CHANGED