opreturn

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OPRNameMap = map[OPReturnType]string{
	OPReturnType(txscript.OP_MEER_LOCK): "LockAmount",
	OPReturnType(txscript.OP_MEER_EVM):  "MeerEVM",
}

Functions

func GetOPReturnTxOutput

func GetOPReturnTxOutput(opr IOPReturn) *types.TxOutput

func IsMeerEVM

func IsMeerEVM(pks []byte) bool

func IsMeerEVMTx

func IsMeerEVMTx(tx *types.Transaction) bool

func IsOPReturn

func IsOPReturn(pks []byte) bool

func UseLogger

func UseLogger(logger l.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type IOPReturn

type IOPReturn interface {
	GetType() OPReturnType
	Verify(tx *types.Transaction) error
	Init(ops []txscript.ParsedOpcode) error
	PKScript() []byte
}

Exclusive to Coinbase OP Return function

func NewOPReturnFrom

func NewOPReturnFrom(pks []byte) (IOPReturn, error)

type LockAmount

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

func NewLockAmount

func NewLockAmount(amount int64) *LockAmount

func (*LockAmount) GetAmount

func (a *LockAmount) GetAmount() int64

func (*LockAmount) GetType

func (a *LockAmount) GetType() OPReturnType

func (*LockAmount) Init

func (a *LockAmount) Init(ops []txscript.ParsedOpcode) error

func (*LockAmount) PKScript

func (a *LockAmount) PKScript() []byte

func (*LockAmount) Verify

func (a *LockAmount) Verify(tx *types.Transaction) error

type MeerEVM

type MeerEVM struct {
}

func NewEVMTx

func NewEVMTx() *MeerEVM

func (*MeerEVM) GetType

func (m *MeerEVM) GetType() OPReturnType

func (*MeerEVM) Init

func (m *MeerEVM) Init(ops []txscript.ParsedOpcode) error

func (*MeerEVM) PKScript

func (m *MeerEVM) PKScript() []byte

func (*MeerEVM) Verify

func (m *MeerEVM) Verify(tx *types.Transaction) error

type OPReturnType

type OPReturnType byte

func GetOPReturnType

func GetOPReturnType(pks []byte) OPReturnType

func (OPReturnType) Name

func (t OPReturnType) Name() string

Jump to

Keyboard shortcuts

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