我正在使用文档中给出的代码来创建一个新钱包,它说我收到了一个:TypeError: Cannot read property 'name' of null 错误。
我的代码如下:
var Client = require('coinbase').Client;
// blank intentionally, but completed actually
var client = new Client({
'apiKey': '',
'apiSecret': '',
});
client.createAccount({'name': 'New Wallet'}, function(err, acct) {
console.log(acct.name + ': ' + acct.balance.amount + ' ' + acct.balance.currency);
});
我做错了什么?
最佳答案
acct
为空,可能是因为 createAccount
给你一个错误。尝试
if(err){
//handle err
console.log(err)
}
这应该提供有关正在发生的事情的更多信息
关于javascript - 类型错误 : Cannot read property 'name' of null when creating new wallet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50683539/