abiutil

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvlidEventParam is an error for invalid event param
	ErrInvlidEventParam = errors.New("invalid event param")
)

Functions

func EventField

func EventField[T any](e EventParam, name string) (T, error)

EventField is a helper function to get a field from event param

func EventFieldByID

func EventFieldByID[T any](e EventParam, id int) (T, error)

EventFieldByID is a helper function to get a field from event param

Types

type EventParam

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

EventParam is a struct to hold smart contract event parameters, which can easily convert a param to go type

func UnpackEventParam

func UnpackEventParam(abiEvent *abi.Event, log *action.Log) (*EventParam, error)

UnpackEventParam is a helper function to unpack event parameters

func (EventParam) FieldAddress

func (e EventParam) FieldAddress(name string) (address.Address, error)

FieldAddress is a helper function to get an address field from event param

func (EventParam) FieldByIDAddress

func (e EventParam) FieldByIDAddress(id int) (address.Address, error)

FieldByIDAddress is a helper function to get an address field from event param

func (EventParam) FieldByIDBytes12

func (e EventParam) FieldByIDBytes12(id int) (string, error)

FieldByIDBytes12 is a helper function to get a bytes12 field from event param

func (EventParam) FieldByIDUint256

func (e EventParam) FieldByIDUint256(id int) (*big.Int, error)

FieldByIDUint256 is a helper function to get a uint256 field from event param

func (EventParam) FieldByIDUint256Slice

func (e EventParam) FieldByIDUint256Slice(id int) ([]*big.Int, error)

FieldByIDUint256Slice is a helper function to get a uint256 slice field from event param

func (EventParam) FieldBytes12

func (e EventParam) FieldBytes12(name string) (string, error)

FieldBytes12 is a helper function to get a bytes12 field from event param

func (EventParam) FieldUint256

func (e EventParam) FieldUint256(name string) (*big.Int, error)

FieldUint256 is a helper function to get a uint256 field from event param

func (EventParam) FieldUint256Slice

func (e EventParam) FieldUint256Slice(name string) ([]*big.Int, error)

FieldUint256Slice is a helper function to get a uint256 slice field from event param

func (EventParam) String

func (e EventParam) String() string

Jump to

Keyboard shortcuts

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