The example code for psbt.addOutput() with address '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp' works as expected. But if I change this to an testnet address I get this error: ' has no matching script'. I expect I need to specify testnet somewhere, but do not know where.
const psbt = new bitcoin.Psbt();
psbt.addInput({
hash: 'b881ecef041a7396f3c225644507955732ae98d4a736de7b9ac235c69e1eb182',
nonWitnessUtxo: Buffer.from(
'020000000001012aa24043833303b066cf10...1a1800',
'hex',
),
});
psbt.addOutput({
//address: '1KRMKfeZcmosxALVYESdPNez1AP1mEtywp', <- works
address: 'mhm89vYkAjmU3MWUtyCUcsYYUvkgXT1FAw',
value: 7240446, //was 7250446
});