bitpay / bitcore-explorers

Blockchain APIs for bitcore
http://bitcore.io
MIT License
67 stars 95 forks source link

TypeError: Address has mismatched network type. #43

Open saritvakrat opened 6 years ago

saritvakrat commented 6 years ago

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);

Lalitpatadiya12 commented 4 years ago

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