how to sign a PSBT with bitcoinjs-lib in node js?

561 Views Asked by At

I am trying to sign a PSBT that is generated by magicEden (NFT marketplace) so I can purchase ordinals NFT from it using code,

am using node js, and I was able to debug the site to find how they generate the PSBT by using this Code.

import { Psbt } from 'bitcoinjs-lib'
const PsbtInstance = new Psbt();
// unsignedBase64 is the site endpoint response 
const psbt = Psbt.fromBase64(unsignedBase64);

but what I am failing to locate is how they sign this PSBT so they can initiate the Transaction since as I was debugging the site I noticed that they send the PSBT to UNISAT extension which will sign the PSBT and return it

any help is appreciated,

Quick notice am not trying to do any malicious or unethical automation on magiceden , all of this is just for sake of learning

0

There are 0 best solutions below