ruimarinho / bitcoin-core

A modern Bitcoin Core REST and RPC client.
477 stars 186 forks source link

client.getBalance() is error . why #70

Closed LeonYanghaha closed 6 years ago

LeonYanghaha commented 6 years ago

I tried to get the balance with this code, but there were these errors, right? Who can tell me what to do? Thank you very much

CODE:

` let BTCHelper = {}; let client;

BTCHelper.initlize = function(){

client = new Client({
    host:config.provider_ip,
    port: config.provider_port,
    username: config.username,
    password: config.password,
    timeout: 30000
});

};

(async ()=>{

BTCHelper.initlize();

const mainWalletBalance = await client.getBalance({ account: '*', minconf: 0 });

console.log(mainWalletBalance);

})() `

ERROR:

_20180613135421

LeonYanghaha commented 6 years ago

This code, it's ok

const mainWalletBalance = await client.getBalance();