Skip to main content
edited title
Link

Getting Error while trying to convertdecode psbt base64 to json using bitcoinjs/bip174 library

edited tags
Link
Vojtěch Strnad
  • 10.4k
  • 3
  • 14
  • 43
Source Link

Getting Error while trying to convert psbt base64 to json using bitcoinjs/bip174 library

const base64PSBT = 'base_64';

// Decode the base64 PSBT to a Buffer
const psbtBuffer = Buffer.from(base64PSBT, 'base64');

// Parse the PSBT
const psbt = bip174.Psbt.fromBuffer(psbtBuffer);

// Convert the PSBT to a JSON object
const psbtJSON = psbt.data;

console.log(JSON.stringify(psbtJSON, null, 2));

error: const unsignedTx = txGetter(unsignedTxMaps[0].value); ^ TypeError: txGetter is not a function