Snapshots
This commit is contained in:
1 parent
e91125801d
commit
6368221937
75 files changed
+8943
-4332
No files matched your search
+27
-1
@@ -163,12 +163,14 @@ module.exports = class huobipro extends Exchange {
|
||||
'exceptions': {
|
||||
'exact': {
|
||||
// err-code
|
||||
'bad-request': BadRequest,
|
||||
'api-not-support-temp-addr': PermissionDenied, // {"status":"error","err-code":"api-not-support-temp-addr","err-msg":"API withdrawal does not support temporary addresses","data":null}
|
||||
'timeout': RequestTimeout, // {"ts":1571653730865,"status":"error","err-code":"timeout","err-msg":"Request Timeout"}
|
||||
'gateway-internal-error': ExchangeNotAvailable, // {"status":"error","err-code":"gateway-internal-error","err-msg":"Failed to load data. Try again later.","data":null}
|
||||
'account-frozen-balance-insufficient-error': InsufficientFunds, // {"status":"error","err-code":"account-frozen-balance-insufficient-error","err-msg":"trade account balance is not enough, left: `0.0027`","data":null}
|
||||
'invalid-amount': InvalidOrder, // eg "Paramemter `amount` is invalid."
|
||||
'order-limitorder-amount-min-error': InvalidOrder, // limit order amount error, min: `0.001`
|
||||
'order-limitorder-amount-max-error': InvalidOrder, // market order amount error, max: `1000000`
|
||||
'order-marketorder-amount-min-error': InvalidOrder, // market order amount error, min: `0.01`
|
||||
'order-limitorder-price-min-error': InvalidOrder, // limit order price error
|
||||
'order-limitorder-price-max-error': InvalidOrder, // limit order price error
|
||||
@@ -331,6 +333,8 @@ module.exports = class huobipro extends Exchange {
|
||||
}
|
||||
|
||||
parseTicker (ticker, market = undefined) {
|
||||
//
|
||||
// fetchTicker
|
||||
//
|
||||
// {
|
||||
// "amount": 26228.672978342216,
|
||||
@@ -346,25 +350,47 @@ module.exports = class huobipro extends Exchange {
|
||||
// "bid": [ 9146.86, 0.080758 ],
|
||||
// }
|
||||
//
|
||||
// fetchTickers
|
||||
// {
|
||||
// symbol: "bhdht",
|
||||
// open: 2.3938,
|
||||
// high: 2.4151,
|
||||
// low: 2.3323,
|
||||
// close: 2.3909,
|
||||
// amount: 628.992,
|
||||
// vol: 1493.71841095,
|
||||
// count: 2088,
|
||||
// bid: 2.3643,
|
||||
// bidSize: 0.7136,
|
||||
// ask: 2.4061,
|
||||
// askSize: 0.4156
|
||||
// }
|
||||
//
|
||||
let symbol = undefined;
|
||||
if (market !== undefined) {
|
||||
symbol = market['symbol'];
|
||||
}
|
||||
const timestamp = this.safeInteger (ticker, 'ts');
|
||||
let bid = undefined;
|
||||
let ask = undefined;
|
||||
let bidVolume = undefined;
|
||||
let ask = undefined;
|
||||
let askVolume = undefined;
|
||||
if ('bid' in ticker) {
|
||||
if (Array.isArray (ticker['bid'])) {
|
||||
bid = this.safeFloat (ticker['bid'], 0);
|
||||
bidVolume = this.safeFloat (ticker['bid'], 1);
|
||||
} else {
|
||||
bid = this.safeFloat (ticker, 'bid');
|
||||
bidVolume = this.safeValue (ticker, 'bidSize');
|
||||
}
|
||||
}
|
||||
if ('ask' in ticker) {
|
||||
if (Array.isArray (ticker['ask'])) {
|
||||
ask = this.safeFloat (ticker['ask'], 0);
|
||||
askVolume = this.safeFloat (ticker['ask'], 1);
|
||||
} else {
|
||||
ask = this.safeFloat (ticker, 'ask');
|
||||
askVolume = this.safeValue (ticker, 'askSize');
|
||||
}
|
||||
}
|
||||
const open = this.safeFloat (ticker, 'open');
|
||||
|
||||
Reference in new issue
Block a user