Documentation ¶
Index ¶
- func Decode(t *Type, input []byte) (interface{}, error)
- func DecodeStruct(t *Type, input []byte, out interface{}) error
- func Encode(v interface{}, t *Type) ([]byte, error)
- func EncodeTopic(t *Type, val interface{}) (web3.Hash, error)
- func ParseLog(args *Type, log *web3.Log) (map[string]interface{}, error)
- func ParseTopic(t *Type, topic web3.Hash) (interface{}, error)
- func ParseTopics(args *Type, topics []web3.Hash) ([]interface{}, error)
- type ABI
- type ArgumentStr
- type Event
- type Kind
- type Method
- type TupleElem
- type Type
- func (t *Type) Decode(input []byte) (interface{}, error)
- func (t *Type) DecodeStruct(input []byte, out interface{}) error
- func (t *Type) Elem() *Type
- func (t *Type) Encode(v interface{}) ([]byte, error)
- func (t *Type) GoType() reflect.Type
- func (t *Type) Kind() Kind
- func (t *Type) ParseLog(log *web3.Log) (map[string]interface{}, error)
- func (t *Type) Size() int
- func (t *Type) String() string
- func (t *Type) TupleElems() []*TupleElem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeStruct ¶
DecodeStruct decodes the input with a type to a struct
func EncodeTopic ¶
EncodeTopic encodes a topic
func ParseTopic ¶
ParseTopic parses an individual topic
func ParseTopics ¶
ParseTopics parses topics from a log event
Types ¶
type ABI ¶
ABI represents the ethereum abi format
func MustNewABI ¶
MustNewABI returns a parsed ABI contract or panics if fails
func NewABIFromList ¶
func NewABIFromReader ¶
NewABIFromReader returns an ABI object from a reader
func (*ABI) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type ArgumentStr ¶
type ArgumentStr struct { Name string Type string Indexed bool Components []*ArgumentStr }
ArgumentStr encodes a type object
type Event ¶
Event is a triggered log mechanism
func MustNewEvent ¶
MustNewEvent creates a new solidity event object or fails
func NewEventFromType ¶
NewEventFromType creates a new solidity event object using the name and type
func (*Event) ID ¶
func (e *Event) ID() (res web3.Hash)
ID returns the id of the event used during logs
type Kind ¶
type Kind int
Kind represents the kind of abi type
const ( // KindBool is a boolean KindBool Kind = iota // KindUInt is an uint KindUInt // KindInt is an int KindInt // KindString is a string KindString // KindArray is an array KindArray // KindSlice is a slice KindSlice // KindAddress is an address KindAddress // KindBytes is a bytes array KindBytes // KindFixedBytes is a fixed bytes KindFixedBytes // KindFixedPoint is a fixed point KindFixedPoint // KindTuple is a tuple KindTuple // KindFunction is a function KindFunction )
type Method ¶
Method is a callable function in the contract
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is an ABI type
func MustNewType ¶
MustNewType parses a type in string format or panics if its invalid
func NewTupleType ¶
func NewTypeFromArgument ¶
func NewTypeFromArgument(arg *ArgumentStr) (*Type, error)
NewTypeFromArgument parses an abi type from an argument
func (*Type) DecodeStruct ¶
DecodeStruct decodes an object using this type to the out param
func (*Type) TupleElems ¶
TupleElems returns the elems of the tuple