Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
add BUFF
Browse files Browse the repository at this point in the history
  • Loading branch information
krboktv committed Feb 17, 2019
1 parent b2536ed commit 018146f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions telegram/handlers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ async function getBalances(ctx) {
const buffBalance = await rp.getBuffBalance(user.ethereumAddress);
const btcBalance = await rp.getBTCBalance(user.bitcoinAddress);
console.log(tokenBalances);
let msg = `*Mainnet Ethereum:* ${balanceETHMain/1e18} or ${(Number(await utils.course.convert("ETH", "USD", balanceETHMain/1e18)))}$ \n\n
*Ropsten Ethereum:* ${balanceETHRopsten/1e18} or ${(Number(await utils.course.convert("ETH", "USD", balanceETHRopsten/1e18)))}$\n\n
*BTC:* ${btcBalance} or ${(Number(await utils.course.convert("BTC", "USD", btcBalance)))}$\n\n
*xDAI:* ${balanceXDai/1e18} or ${(Number(await utils.course.convert("XDAI", "USD", balanceXDai/1e18)))}$\n\n
*BUFF:* ${buffBalance} or ${Number(buffBalance)}$\n\\n`;
let msg = `*Mainnet Ethereum:* ${balanceETHMain/1e18} or ${(Number(await utils.course.convert("ETH", "USD", balanceETHMain/1e18)))}$ \n\n`+
`*Ropsten Ethereum:* ${balanceETHRopsten/1e18} or ${(Number(await utils.course.convert("ETH", "USD", balanceETHRopsten/1e18)))}$\n\n`+
`*BTC:* ${btcBalance} or ${(Number(await utils.course.convert("BTC", "USD", btcBalance)))}$\n\n`+
`*xDAI:* ${balanceXDai/1e18} or ${(Number(await utils.course.convert("XDAI", "USD", balanceXDai/1e18)))}$\n\n`+
`*BUFF:* ${buffBalance} or ${Number(buffBalance)}$\n\\n`;
let counter = 0;
for (let i in tokensTickers) {
msg += `*${tokensTickers[i]}:* ${Number(tokenBalances[counter])/1e18}\n\n`;
Expand Down
2 changes: 1 addition & 1 deletion telegram/request/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function getRhombusExchangeRate(firstCurrency, secondCurrency) {
}

async function getBuffBalance(userAddress) {
return JSON.parse(await rp.get(`http://localhost:9090/balance/${userAddress}`));
return JSON.parse(await rp.get(`http://127.0.0.1:9090/balance/${userAddress}`)).balance;
}

async function getBTCBalance(userAddress) {
Expand Down

0 comments on commit 018146f

Please sign in to comment.