bitcore-explorers icon indicating copy to clipboard operation
bitcore-explorers copied to clipboard

TypeError: Address has mismatched network type.

Open saritvakrat opened this issue 6 years ago • 1 comments

Running insight to getUnspentUtxos for a testnet address shows the following error: throw new TypeError('Address has mismatched network type.'); ^TypeError: Address has mismatched network type.

Code: var Insight = require('bitcore-explorers').Insight; var insight = new Insight('testnet'); return insight.getUnspentUtxos(address, function (err, utxos) { if (err) { console.err(err) } console.log(utxos); });

Code for testnet address: let privateKey = new bitcore.PrivateKey(), hexa = privateKey.toString(), publicKey = new bitcore.PublicKey(privateKey); address = new bitcore.Address(publicKey, Networks.testnet);

saritvakrat avatar Jul 16 '18 07:07 saritvakrat

@saritvakrat: Did you get the solution for the same?

Lalitpatadiya12 avatar May 21 '20 04:05 Lalitpatadiya12