transaction

package
v0.101.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 6 Imported by: 10

Documentation

Index

Constants

View Source
const (
	SECP256K1_BLAKE160_SIGHASH_ALL_DATA_HASH  = "0x973bdb373cbb1d752b4ac006e2bb5bdcb63431ed2b6e394b22721c8906a2ad72"
	SECP256K1_BLAKE160_SIGHASH_ALL_TYPE_HASH  = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"
	SECP256K1_BLAKE160_MULTISIG_ALL_TYPE_HASH = "0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8"
)

Variables

View Source
var (
	EmptyWitnessArg = &types.WitnessArgs{
		Lock:       make([]byte, 65),
		InputType:  nil,
		OutputType: nil,
	}
	EmptyWitnessArgPlaceholder = make([]byte, 89)
	SignaturePlaceholder       = make([]byte, 65)
)

Functions

func AddInputsForTransaction

func AddInputsForTransaction(transaction *types.Transaction, inputs []*types.CellInput) ([]int, *types.WitnessArgs, error)

func CalculateTransactionFee

func CalculateTransactionFee(tx *types.Transaction, feeRate uint64) (uint64, error)

func MultiSignTransaction

func MultiSignTransaction(transaction *types.Transaction, group []int, witnessArgs *types.WitnessArgs, serialize []byte, keys ...crypto.Key) error

func NewSecp256k1HybirdSigTx

func NewSecp256k1HybirdSigTx(scripts *utils.SystemScripts) *types.Transaction

func NewSecp256k1MultiSigTx

func NewSecp256k1MultiSigTx(scripts *utils.SystemScripts) *types.Transaction

func NewSecp256k1SingleSigTx

func NewSecp256k1SingleSigTx(scripts *utils.SystemScripts) *types.Transaction

func SingleSegmentSignMessage

func SingleSegmentSignMessage(transaction *types.Transaction, start int, end int, witnessArgs *types.WitnessArgs) ([]byte, error)

func SingleSegmentSignTransaction

func SingleSegmentSignTransaction(transaction *types.Transaction, start int, end int, witnessArgs *types.WitnessArgs, key crypto.Key) error

func SingleSignTransaction

func SingleSignTransaction(transaction *types.Transaction, group []int, witnessArgs *types.WitnessArgs, key crypto.Key) error

group is an array, which content is the index of input after grouping

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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