diff --git a/telegram/handlers/handler.js b/telegram/handlers/handler.js index 6b522ab..4a206a7 100644 --- a/telegram/handlers/handler.js +++ b/telegram/handlers/handler.js @@ -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`; diff --git a/telegram/request/request.js b/telegram/request/request.js index b0be04c..d0af82f 100644 --- a/telegram/request/request.js +++ b/telegram/request/request.js @@ -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) {