const publicKey = req.body;
try {
//connect to daemon
let daemon = await monerojs.connectToDaemonRpc("http://localhost:28081", "pinkumonero", "1234");
let height = await daemon.getHeight();
console.log("Height is:", height);
const response = axios.post("http://localhost:28082",
publicKey,
{
headers: {
'Content-Type': 'application/json'
},
}).then((responseData) => {
dataFetched = responseData.data;
console.log("Result of fetching balance", dataFetched);
res.status(200).json({ Balance: dataFetched });
})
} catch (err) {
console.log("Error in fetching balance of XMR", err);
res.status(500).json({ StatusCode: "0", Message: "Error in XMR balance fetching", error: err.message })
}
})