psbt

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(p *Packet) (*wire.MsgTx, error)

func MaybeFinalize

func MaybeFinalize(p *Packet, inIndex int) (bool, error)

func MaybeFinalizeAll

func MaybeFinalizeAll(p *Packet) error

func SumUtxoInputValues added in v0.5.0

func SumUtxoInputValues(packet *Packet) (int64, error)

SumUtxoInputValues tries to extract the sum of all inputs specified in the UTXO fields of the PSBT. An error is returned if an input is specified that does not contain any UTXO information.

func TxOutsEqual added in v0.5.0

func TxOutsEqual(out1, out2 *wire.TxOut) bool

TxOutsEqual returns true if two transaction outputs are equal.

func VerifyInputPrevOutpointsEqual added in v0.5.0

func VerifyInputPrevOutpointsEqual(ins1, ins2 []*wire.TxIn) error

VerifyInputPrevOutpointsEqual verifies that the previous outpoints of the two slices of transaction inputs are deep equal to each other. We do the length check and manual loop to provide better error messages to the user than just returning "not equal".

func VerifyOutputsEqual added in v0.5.0

func VerifyOutputsEqual(outs1, outs2 []*wire.TxOut) error

VerifyOutputsEqual verifies that the two slices of transaction outputs are deep equal to each other. We do the length check and manual loop to provide better error messages to the user than just returning "not equal".

Types

type PInput

type PInput struct {
	WitnessUtxo        *wire.TxOut
	NonWitnessUtxo     *wire.MsgTx
	FinalScriptSig     []byte
	FinalScriptWitness []byte
}

type POutput

type POutput struct{}

type Packet

type Packet struct {
	UnsignedTx *wire.MsgTx
	Inputs     []PInput
	Outputs    []POutput
}

func New

func New(inputs []*wire.OutPoint,
	outputs []*wire.TxOut, version int32, nLockTime uint32,
	nSequences []uint32) (*Packet, error)

func NewFromRawBytes

func NewFromRawBytes(r io.Reader, b64 bool) (*Packet, error)

func NewFromUnsignedTx

func NewFromUnsignedTx(tx *wire.MsgTx) (*Packet, error)

func (*Packet) Serialize

func (p *Packet) Serialize(w io.Writer) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL