We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, i am trying to sign a psbt for an ordinal but i keep getting this error:
PSBT generator:
async function generatePSBTForSale(ordinalUtxoTxId, ordinalUtxoVout, price, paymentAddress) { let psbt = new bitcoin.Psbt({ network }); const tx = bitcoin.Transaction.fromHex(await getTxHexById(ordinalUtxoTxId)) for (const output in tx.outs) { try { tx.setWitness(parseInt(output), []) } catch { } } const input = { hash: ordinalUtxoTxId, index: parseInt(ordinalUtxoVout), nonWitnessUtxo: tx.toBuffer(), witnessUtxo: tx.outs[ordinalUtxoVout], sighashType: bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY, } psbt.addInput(input); psbt.addOutput({ address: paymentAddress, value: price, }); return psbt.toBase64(); } const formattedPsbt = await generatePSBTForSale("7c60d897c2637c1d811eec393f3c2c5d120cf9bb5502ad17e76c96acdd961a89", 0, 10000, segwitAddress1)
PSBT formatting and signing:
const wallet = new Wallet(key1, NetworkType.MAINNET, AddressType.P2TR); const bufferPsbt = Buffer.from(formattedPsbt, 'base64') const hexpsbt = bufferPsbt.toString('hex') const signedPsbtHex = await wallet.signPsbt(hexpsbt, [ { index: 0, publicKey: await wallet.getPublicKey(), sighashTypes: [ bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY, ], }, ]);
I however get this error when trying to sign:
if (!allHashses.length) throw new Error('No signatures for this pubkey'); ^ Error: No signatures for this pubkey
May i ask if this an issue with my formatting or is this an issue with the local wallet?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, i am trying to sign a psbt for an ordinal but i keep getting this error:
PSBT generator:
PSBT formatting and signing:
I however get this error when trying to sign:
May i ask if this an issue with my formatting or is this an issue with the local wallet?
The text was updated successfully, but these errors were encountered: