Commit 3ebac6da authored by Mahdi Yari's avatar Mahdi Yari

Merge branch 'fix-hive-errors-1' into 'master'

Fix hive errors - formatter errors

See merge request !3
parents 7201efe3 ecf38de5
{
"name": "@hiveio/hive-js",
"version": "0.0.2",
"version": "0.0.5",
"description": "Hive.js the JavaScript API for Hive blockchain",
"main": "lib/index.js",
"scripts": {
......@@ -17,20 +17,20 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/steemit/steem-js.git"
"url": "git+https://gitlab.syncad.com/hive/hive-js.git"
},
"keywords": [
"steem",
"steemit",
"hive",
"hiveblog",
"blockchain",
"steemjs"
"hivejs"
],
"author": "Fabien (https://github.com/bonustrack)",
"license": "MIT",
"bugs": {
"url": "https://github.com/steemit/steem-js/issues"
"url": "https://gitlab.syncad.com/hive/hive-js/issues"
},
"homepage": "https://github.com/steemit/steem-js#readme",
"homepage": "https://gitlab.syncad.com/hive/hive-js#readme",
"dependencies": {
"@steemit/rpc-auth": "^1.1.1",
"bigi": "^1.4.2",
......
......@@ -157,6 +157,9 @@ Types.asset = {
amount = res[0]
symbol = res[1]
// Hive workaround for now
symbol = symbol == "HIVE" ? "STEEM" : symbol == "HBD" ? "SBD" : symbol
if(symbol.startsWith("@@"))
{
// NAI Case
......
......@@ -20,7 +20,7 @@ module.exports = steemAPI => {
const sbdOrders = !open_orders
? 0
: open_orders.reduce((o, order) => {
if (order.sell_price.base.indexOf("SBD") !== -1) {
if (order.sell_price.base.indexOf("HBD") !== -1) {
o += order.for_sale;
}
return o;
......@@ -29,7 +29,7 @@ module.exports = steemAPI => {
const steemOrders = !open_orders
? 0
: open_orders.reduce((o, order) => {
if (order.sell_price.base.indexOf("STEEM") !== -1) {
if (order.sell_price.base.indexOf("HIVE") !== -1) {
o += order.for_sale;
}
return o;
......@@ -43,9 +43,9 @@ module.exports = steemAPI => {
let savings_sbd_pending = 0;
savings_withdraws.forEach(withdraw => {
const [amount, asset] = withdraw.amount.split(" ");
if (asset === "STEEM") savings_pending += parseFloat(amount);
if (asset === "HIVE") savings_pending += parseFloat(amount);
else {
if (asset === "SBD") savings_sbd_pending += parseFloat(amount);
if (asset === "HBD") savings_sbd_pending += parseFloat(amount);
}
});
return { savings_pending, savings_sbd_pending };
......@@ -54,7 +54,7 @@ module.exports = steemAPI => {
function pricePerSteem(feed_price) {
let price_per_steem = undefined;
const { base, quote } = feed_price;
if (/ SBD$/.test(base) && / STEEM$/.test(quote)) {
if (/ HBD$/.test(base) && / HIVE$/.test(quote)) {
price_per_steem = parseFloat(base.split(" ")[0]) / parseFloat(quote.split(" ")[0]);
}
return price_per_steem;
......@@ -125,7 +125,7 @@ module.exports = steemAPI => {
if (finishTime < currentTime) return out;
const amount = parseFloat(
get(item, [1, "op", 1, "amount"]).replace(" SBD", "")
get(item, [1, "op", 1, "amount"]).replace(" HBD", "")
);
conversionValue += amount;
}, []);
......
......@@ -72,8 +72,8 @@ function makeConfig(options) {
return {
devtool: isDevelopment ? 'cheap-eval-source-map' : 'source-map',
entry: {
steem: path.join(options.baseDir, 'src/browser.js'),
'steem-tests': path.join(options.baseDir, 'test/api.test.js'),
hive: path.join(options.baseDir, 'src/browser.js'),
'hive-tests': path.join(options.baseDir, 'test/api.test.js'),
},
output: {
path: path.join(options.baseDir, 'dist'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment