question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on tbtc address creation

See original GitHub issue

On doing a simple wallet.createAddress({label: ‘example1’}), I get an error from the SDK that goes like this:

TypeError: Cannot read property 'address' of undefined at Wallet.createAndVerifyAddress (/home/bosko/Work/bitgo-profile/node_modules/bitgo/src/v2/wallet.js:601:99) at createAndVerifyAddress.next (<anonymous>) at createAndVerifyAddress.tryCatcher (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/util.js:16:23) at PromiseSpawn._promiseFulfilled (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/generators.js:97:49) at Promise._settlePromise (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/promise.js:574:26) at Promise._settlePromise0 (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/promise.js:693:18) at Async._drainQueue (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues [as _onImmediate] (/home/bosko/Work/bitgo-profile/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:696:18) at tryOnImmediate (timers.js:667:5) at processImmediate (timers.js:649:5) at process.topLevelDomainCallback (domain.js:121:23)

The address, however, is correctly created and assigned the ID given.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nnboskocommented, Aug 21, 2018

If anyone ever gets this error, it might be because you’re doing this (the lines were input through the CLI manually, so all async results were resolved properly)

const bg = require('bitgo');

const bitgojs = new bg.BitGo({env: 'test', accessToken: process.env.ACCESS_TOKEN});

let coin = bitgojs.coin('tbtc');

let wallets = {};

coin.wallets().list({}).then((ts) => {wallets = ts}); // the error is here; use coin.wallets().get({id:walletid})...

let wallet = wallets.wallets[0];

wallet.createAddress({label: 'addressid8'}).catch((err) => {console.dir(err)});

Using wallets().get(…) cleared it up.

0reactions
nnboskocommented, Aug 21, 2018

I was fetching the wallets a different way, @LeoKotschenreuther suggested a proper path and it worked! Closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If an error is made when typing the destination address of a ...
If an error is made when typing the destination address of a Bitcoin transaction, what will happen?
Read more >
Solve a synchronization error - Ledger Support
A synchronization error may occur in Ledger Live when there is or has been a temporary problem with Ledger's blockchain explorers or network ......
Read more >
Why am I receiving an "invalid address" error?
The "invalid address" error occurs when the address you try to send to does not match the network of your wallet. For example...
Read more >
Technical Problems and Solutions - Paxful Help Center
You have entered an incorrect wallet address. · You have entered a non-existing wallet address. · You have entered an address that is...
Read more >
4. Keys, Addresses, Wallets - Mastering Bitcoin [Book] - O'Reilly
When spending bitcoins, the current bitcoin owner presents her public key and a signature (different each time, but created from the same private...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found