signer

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAnyCanPayMatched

func IsAnyCanPayMatched(key *secp256k1.Secp256k1Key, scriptArgs []byte) (bool, error)

func IsMultiSigMatched

func IsMultiSigMatched(key *secp256k1.Secp256k1Key, multisigScript *MultisigScript, scriptArgs []byte) (bool, error)

func IsPWLockMatched

func IsPWLockMatched(key *secp256k1.Secp256k1Key, scriptArgs []byte) bool

func IsSingleSigMatched

func IsSingleSigMatched(key *secp256k1.Secp256k1Key, scriptArgs []byte) (bool, error)

func PWLockSignTransaction

func PWLockSignTransaction(tx *types.Transaction, group *transaction.ScriptGroup, key *secp256k1.Secp256k1Key) (bool, error)

func SingleSignTransaction

func SingleSignTransaction(tx *types.Transaction, group *transaction.ScriptGroup, key *secp256k1.Secp256k1Key) (bool, error)

Types

type AnyCanPaySigner

type AnyCanPaySigner struct {
}

func (*AnyCanPaySigner) SignTransaction

func (s *AnyCanPaySigner) SignTransaction(transaction *types.Transaction, group *transaction.ScriptGroup, ctx *transaction.Context) (bool, error)

type MultisigScript

type MultisigScript struct {
	Version    byte
	FirstN     byte
	Threshold  byte
	KeysHashes [][20]byte
}

func DecodeToMultisigScript

func DecodeToMultisigScript(in []byte) (*MultisigScript, error)

func NewMultisigScript

func NewMultisigScript(firstN byte, threshold byte) *MultisigScript

func (*MultisigScript) AddKeyHash

func (r *MultisigScript) AddKeyHash(keyHash [20]byte)

func (*MultisigScript) AddKeyHashBySlice

func (r *MultisigScript) AddKeyHashBySlice(keyHash []byte) error

func (*MultisigScript) ComputeHash

func (r *MultisigScript) ComputeHash() ([]byte, error)

func (*MultisigScript) Encode

func (r *MultisigScript) Encode() []byte

func (*MultisigScript) WitnessPlaceholder

func (r *MultisigScript) WitnessPlaceholder(originalWitness []byte) ([]byte, error)

func (*MultisigScript) WitnessPlaceholderInLock

func (r *MultisigScript) WitnessPlaceholderInLock() []byte

type PWLockSigner

type PWLockSigner struct {
}

func (*PWLockSigner) SignTransaction

func (s *PWLockSigner) SignTransaction(transaction *types.Transaction, group *transaction.ScriptGroup, ctx *transaction.Context) (bool, error)

type ScriptSigner

type ScriptSigner interface {
	SignTransaction(transaction *types.Transaction, group *transaction.ScriptGroup, ctx *transaction.Context) (bool, error)
}

type Secp256k1Blake160MultisigAllSigner

type Secp256k1Blake160MultisigAllSigner struct {
}

func (*Secp256k1Blake160MultisigAllSigner) SignTransaction

func (s *Secp256k1Blake160MultisigAllSigner) SignTransaction(transaction *types.Transaction, group *transaction.ScriptGroup, ctx *transaction.Context) (bool, error)

type Secp256k1Blake160SighashAllSigner

type Secp256k1Blake160SighashAllSigner struct {
}

func (*Secp256k1Blake160SighashAllSigner) SignTransaction

func (s *Secp256k1Blake160SighashAllSigner) SignTransaction(transaction *types.Transaction, group *transaction.ScriptGroup, ctx *transaction.Context) (bool, error)

type TransactionSigner

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

func GetTransactionSignerInstance

func GetTransactionSignerInstance(network types.Network) *TransactionSigner

func NewTransactionSigner

func NewTransactionSigner() *TransactionSigner

func (*TransactionSigner) RegisterLockSigner

func (r *TransactionSigner) RegisterLockSigner(codeHash types.Hash, signer ScriptSigner) error

func (*TransactionSigner) RegisterSigner

func (r *TransactionSigner) RegisterSigner(codeHash types.Hash, scriptType transaction.ScriptType, signer ScriptSigner) error

func (*TransactionSigner) RegisterTypeSigner

func (r *TransactionSigner) RegisterTypeSigner(codeHash types.Hash, signer ScriptSigner) error

func (*TransactionSigner) SignTransaction

func (*TransactionSigner) SignTransactionByPrivateKeys

func (r *TransactionSigner) SignTransactionByPrivateKeys(tx *transaction.TransactionWithScriptGroups, privKeys ...string) ([]int, error)

Jump to

Keyboard shortcuts

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