ethevent

package
v0.0.0-...-1df5c7e Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventNameTransfer       = "Transfer"
	EventNameApproval       = "Approval"
	EventNameApprovalForAll = "ApprovalForAll"
)

Variables

This section is empty.

Functions

func BuildMethodData

func BuildMethodData(name string, args ...interface{}) ([]byte, error)

func GetMethodByData

func GetMethodByData(data []byte) (method *abi.Method, err error)

func UnpackMethodDataToMap

func UnpackMethodDataToMap(v map[string]interface{}, name string, data []byte) error

Types

type Approval

type Approval struct {
	Origin
	Owner   common.Address `json:"owner"`
	Spender common.Address `json:"spender"`
	Value   *big.Int       `json:"value"`
}

type ApprovalForAll

type ApprovalForAll struct {
	Origin
	Owner    common.Address `json:"owner"`
	Operator common.Address `json:"operator"`
	Approved bool           `json:"approved"`
}

type EventLog

type EventLog struct {
	// Consensus fields:
	// address of the contract that generated the event
	Address common.Address `json:"address" gencodec:"required"`
	// list of topics provided by the contract.
	Topics []common.Hash `json:"topics" gencodec:"required"`
	// supplied by the contract, usually ABI-encoded
	Data hexutil.Bytes `json:"data" gencodec:"required"`
}

type IEventType

type IEventType interface {
	SetContractAddr(contractAddr string)
	SetEventName(eventName string)
	SetEventID(eventID string)

	GetContractAddr() string
	GetEventName() string
	GetEventID() string
}

func ParseEventToStruct

func ParseEventToStruct(output IEventType, eventLog *EventLog) (out IEventType, err error)

type Origin

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

func (*Origin) GetContractAddr

func (e *Origin) GetContractAddr() string

func (*Origin) GetEventID

func (e *Origin) GetEventID() string

func (*Origin) GetEventName

func (e *Origin) GetEventName() string

func (*Origin) SetContractAddr

func (e *Origin) SetContractAddr(contractAddr string)

func (*Origin) SetEventID

func (e *Origin) SetEventID(eventID string)

func (*Origin) SetEventName

func (e *Origin) SetEventName(eventName string)

type Transfer

type Transfer struct {
	Origin
	From  common.Address `json:"from"`
	To    common.Address `json:"to"`
	Value *big.Int       `json:"value"`
}

Jump to

Keyboard shortcuts

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