Documentation ¶
Index ¶
- Constants
- Variables
- func ReadFixedBytes(t Type, word []byte) (interface{}, error)
- func ReadInteger(typ byte, kind reflect.Kind, b []byte) interface{}
- func ToCamelCase(input string) string
- func U256(n *big.Int) []byte
- type ABI
- func (abi *ABI) EventByID(topic common.Hash) (*Event, error)
- func (abi *ABI) MethodById(sigdata []byte) (*Method, error)
- func (abi ABI) Pack(name string, args ...interface{}) ([]byte, error)
- func (abi *ABI) UnmarshalJSON(data []byte) error
- func (abi ABI) Unpack(v interface{}, name string, data []byte) (err error)
- func (abi ABI) UnpackIntoMap(v map[string]interface{}, name string, data []byte) (err error)
- func (abi ABI) UnpackMethodInputs(v interface{}, name string, input []byte) (err error)
- type Argument
- type ArgumentMarshaling
- type Arguments
- func (arguments Arguments) LengthNonIndexed() int
- func (arguments Arguments) NonIndexed() Arguments
- func (arguments Arguments) Pack(args ...interface{}) ([]byte, error)
- func (arguments Arguments) PackValues(args []interface{}) ([]byte, error)
- func (arguments Arguments) Unpack(v interface{}, data []byte) error
- func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte) error
- func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error)
- type Event
- type Method
- type Type
Examples ¶
Constants ¶
View Source
const ( IntTy byte = iota UintTy BoolTy StringTy SliceTy ArrayTy TupleTy AddressTy FixedBytesTy BytesTy HashTy FixedPointTy FunctionTy )
Variables ¶
Functions ¶
func ReadFixedBytes ¶
func ToCamelCase ¶
Types ¶
type ABI ¶
func JSON ¶
Example ¶
const definition = `[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isBar","outputs":[{"name":"","type":"bool"}],"type":"function"}]` abi, err := JSON(strings.NewReader(definition)) if err != nil { panic(err) } out, err := abi.Pack("isBar", common.HexToAddress("01")) if err != nil { panic(err) } fmt.Printf("%x\n", out)
Output:
func (*ABI) UnmarshalJSON ¶
func (ABI) UnpackIntoMap ¶
type Argument ¶
func (*Argument) UnmarshalJSON ¶
type ArgumentMarshaling ¶
type ArgumentMarshaling struct { Name string Type string InternalType string Components []ArgumentMarshaling Indexed bool }
type Arguments ¶
type Arguments []Argument
func (Arguments) LengthNonIndexed ¶
func (Arguments) NonIndexed ¶
func (Arguments) PackValues ¶
func (Arguments) UnpackIntoMap ¶
func (Arguments) UnpackValues ¶
type Type ¶
type Type struct { Elem *Type Kind reflect.Kind Type reflect.Type Size int T byte TupleRawName string TupleElems []*Type TupleRawNames []string // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.