tx

package
v0.0.0-...-4f6eca2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeEcdsaSignature

func DecodeEcdsaSignature(signature xc.TxSignature) (btcec.ModNScalar, btcec.ModNScalar, error)

returns (r, s, err)

func DetectFrom

func DetectFrom(inputs []Input) (string, xc.AmountBlockchain)

Heuristic to determine the sender of a transaction by using the largest utxo input and taking it's spender.

Types

type Input

type Input struct {
	tx_input.Output `json:"output"`
	Address         xc.Address `json:"address,omitempty"`
}

type Recipient

type Recipient struct {
	To    xc.Address          `json:"to"`
	Value xc.AmountBlockchain `json:"value"`
}

type Tx

type Tx struct {
	MsgTx      *wire.MsgTx
	Signed     bool
	Recipients []Recipient
	Signatures []xc.TxSignature

	Amount xc.AmountBlockchain
	Input  *tx_input.TxInput
	From   xc.Address
	To     xc.Address
}

Tx for Bitcoin

func (*Tx) AddSignatures

func (tx *Tx) AddSignatures(signatures ...xc.TxSignature) error

AddSignatures adds a signature to Tx

func (*Tx) DetectToAndAmount

func (tx *Tx) DetectToAndAmount(from string, expectedTo string) (string, xc.AmountBlockchain, xc.AmountBlockchain)

func (*Tx) GetSignatures

func (tx *Tx) GetSignatures() []xc.TxSignature

func (*Tx) Hash

func (tx *Tx) Hash() xc.TxHash

Hash returns the tx hash or id

func (*Tx) Outputs

func (tx *Tx) Outputs() ([]tx_input.Output, error)

Outputs returns the UTXO outputs in the underlying transaction.

func (*Tx) Serialize

func (tx *Tx) Serialize() ([]byte, error)

func (*Tx) Sighashes

func (tx *Tx) Sighashes() ([]xc.TxDataToSign, error)

Sighashes returns the tx payload to sign, aka sighash

Jump to

Keyboard shortcuts

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