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{}) (ethgo.Hash, error)
- func ParseLog(args *Type, log *ethgo.Log) (map[string]interface{}, error)
- func ParseTopic(t *Type, topic ethgo.Hash) (interface{}, error)
- func ParseTopics(args *Type, topics []ethgo.Hash) ([]interface{}, error)
- func UnpackRevertError(b []byte) (string, error)
- type ABI
- type ABIEncoder
- type Error
- 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) Format(includeArgs bool) string
- func (t *Type) GoType() reflect.Type
- func (t *Type) InternalType() string
- func (t *Type) Kind() Kind
- func (t *Type) ParseLog(log *ethgo.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
func UnpackRevertError ¶
Types ¶
type ABI ¶
type ABI struct { Constructor *Method Methods map[string]*Method MethodsBySignature map[string]*Method Events map[string]*Event Errors map[string]*Error }
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 NewABIFromSlice ¶
NewABIFromSlice returns a parsed ABI struct from a slice of ABI fields that represent the contract
func (*ABI) GetMethodBySignature ¶
func (*ABI) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type ABIEncoder ¶
type ABIEncoder interface { // EncodeAbi contains logic for encoding arbitrary data into ABI format EncodeAbi() ([]byte, error) // DecodeAbi contains logic for decoding given ABI data DecodeAbi(b []byte) error }
ABIEncoder declares functions that are encoding and decoding data to/from ABI format
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
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
func MustNewMethod ¶
MustNewMethod creates a new solidity method object or fails
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 NewTupleTypeFromFields ¶
func NewTypeFromField ¶
NewTypeFromField parses an abi type from an argument
func (*Type) DecodeStruct ¶
DecodeStruct decodes an object using this type to the out param
func (*Type) InternalType ¶
InternalType returns the internal type
func (*Type) TupleElems ¶
TupleElems returns the elems of the tuple