MCPcopy Create free account
hub / github.com/NoteProtocol/NoteWallet / addNoteInput

Function addNoteInput

src/btc/btc-p2tr-note.ts:144–162  ·  view source on GitHub ↗
(
  psbt: bitcoin.Psbt,
  utxo: IUtxo,
  p2tr: any,
  tapLeafScript: any
)

Source from the content-addressed store, hash-verified

142}
143
144function addNoteInput(
145 psbt: bitcoin.Psbt,
146 utxo: IUtxo,
147 p2tr: any,
148 tapLeafScript: any
149) {
150 const input = {
151 hash: utxo.txId,
152 index: utxo.outputIndex,
153 sequence: MAX_SEQUENCE,
154 witnessUtxo: {
155 script: p2tr.output!,
156 value: utxo.satoshis,
157 },
158 tapLeafScript: [tapLeafScript],
159 };
160 psbt.addInput(input);
161 return utxo.satoshis;
162}
163
164function addOutputs(psbt: bitcoin.Psbt, toAddresses: ISendToAddress[]) {
165 let totalOutput = 0;

Callers 1

createP2TRNotePsbtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected