handshakeTransaction

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxVersion      = uint32(0)
	AddressPrefix  = "hs"
	AddressVersion = byte(0)
	TypeSend       = byte(0)
	ActionNone     = byte(0)
	SigHashAll     = byte(1)
	OP_DUP         = byte(0x76)
	OP_BLAKE160    = byte(0xc0)
	OP_EQUALVERIFY = byte(0x88)
	OP_CHECKSIG    = byte(0xac)
)

Variables

View Source
var (
	ErrorInvalidAddress = errors.New("Invalid address!")

	BTCBech32Alphabet = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"

	CHARSET_REV = []int8{}/* 128 elements not displayed */

)

Functions

func AddressDecode

func AddressDecode(address string) ([]byte, error)

func AddressEncode

func AddressEncode(payload []byte) string

func CombineAndVerifyRawTransaction

func CombineAndVerifyRawTransaction(emptyTrans string, hashs []TxHash) (string, bool)

func SignRawTransactionHash

func SignRawTransactionHash(txHash string, prikey []byte) ([]byte, error)

Types

type Transaction

type Transaction struct {
	Version  []byte
	Vins     []TxIn
	Vouts    []TxOut
	LockTime []byte
}

func DecodeEmptyTransaction

func DecodeEmptyTransaction(emptyTrans string) (*Transaction, error)

type TxHash

type TxHash struct {
	Hash      string
	Address   string
	Signature []byte
	PublicKey []byte
}

func CreateEmptyRawTransactionAndHash

func CreateEmptyRawTransactionAndHash(vins []Vin, vouts []Vout, lockTime uint32) (string, []TxHash, error)

func (TxHash) GetTxAddress

func (tx TxHash) GetTxAddress() string

func (TxHash) GetTxHashHex

func (tx TxHash) GetTxHashHex() string

type TxIn

type TxIn struct {
	TxID     []byte
	Vout     []byte
	Sequence []byte
	Script   []byte
	Amount   []byte
}

func (TxIn) GetTxID

func (in TxIn) GetTxID() string

func (TxIn) GetVout

func (in TxIn) GetVout() uint32

type TxOut

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

type Vin

type Vin struct {
	TxID       string
	Vout       uint32
	LockScript string
	Amount     uint64
}

type Vout

type Vout struct {
	Address string
	Amount  uint64
}

Jump to

Keyboard shortcuts

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