Skip to content

TypeError: Address has mismatched network type. #43

@saritvakrat

Description

@saritvakrat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions