src

package
v0.0.0-...-566e3ff Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBtcAddress

func GenerateBtcAddress() (string, *secp256k1.PrivateKey, error)

GenerateBtcAddress: Generate new BTC address

func SigTransaction

func SigTransaction(txSerialized []byte, privateKey *secp256k1.PrivateKey) ([]byte, error)

func VarIntConverter

func VarIntConverter(count int) []byte

Types

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

transation struct

func InitializeTransaction

func InitializeTransaction() (tx Tx)

func Transaction

func Transaction(pubKey, destAddress, txHash string, amount int64, out *TxOut) (Tx, error)

func (*Tx) AddInput

func (tx *Tx) AddInput(input *TxIn)

func (*Tx) AddOutput

func (tx *Tx) AddOutput(out *TxOut)

func (*Tx) Serialize

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

func (*Tx) SerializeSignature

func (tx *Tx) SerializeSignature(privateKey *secp256k1.PrivateKey) ([]byte, error)

type TxIn

type TxIn struct {
	// contains filtered or unexported fields
}

txIn struct

type TxOut

type TxOut struct {
	Value          []byte
	TxOutScriptLen []byte
	ScriptPubKey   []byte
}

txOut struct

Jump to

Keyboard shortcuts

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