K
K
kikibyk2019-12-29 20:07:07
API
kikibyk, 2019-12-29 20:07:07

How to get Qiwi balance?

Hello. I have a problem that I can't get my QIWI wallet balance.
Library: node-qiwi-api
Code:

var Qiwi = require('node-qiwi-api').Qiwi;
var Wallet = new Qiwi(token);
Wallet.getBalance((balance) => {
  console.log(balance);
})

The code is taken from the documentation of the library
. It displays to me in the console:
5e08dd09b4624773055993.png
Only now I did not understand how to get the balance itself. Tell me what I'm doing wrong or which library is better to use.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Venus311, 2020-01-25
@Venus311

Easily!
const Qiwi = await Wallet.getBalance();
console log(qiwi);
If you want to get your Qiwi balance every 10 seconds on the command line:
setInterval(async () => {
var balan = await Wallet.getBalance();
console.log(balan)
}, 10000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question