abi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IntTy byte = iota
	UintTy
	BoolTy
	StringTy
	SliceTy
	AddressTy
	FixedBytesTy
	BytesTy
	HashTy
	FixedpointTy
	FunctionTy
)

Variables

This section is empty.

Functions

func U256

func U256(n *big.Int) []byte

Types

type ABI

type ABI struct {
	Constructor Method
	Methods     map[string]Method
	Events      map[string]Event
}

func JSON

func JSON(reader io.Reader) (ABI, error)

func (*ABI) Pack

func (abi *ABI) Pack(name string, args ...interface{}) ([]byte, error)

func (*ABI) UnmarshalJSON

func (abi *ABI) UnmarshalJSON(data []byte) error

func (ABI) Unpack

func (abi ABI) Unpack(v interface{}, name string, output []byte) error

type Argument

type Argument struct {
	Name    string
	Type    Type
	Indexed bool // indexed is only used by events
}

func (*Argument) UnmarshalJSON

func (a *Argument) UnmarshalJSON(data []byte) error

type Event

type Event struct {
	Name      string
	Anonymous bool
	Inputs    []Argument
}

type Method

type Method struct {
	Name    string
	Const   bool
	Inputs  []Argument
	Outputs []Argument
}

func (Method) Id

func (m Method) Id() []byte

func (Method) Sig

func (m Method) Sig() string

type Type

type Type struct {
	IsSlice, IsArray bool
	SliceSize        int

	Elem *Type

	Kind reflect.Kind
	Type reflect.Type
	Size int
	T    byte // Our own type checking
	// contains filtered or unexported fields
}

func NewType

func NewType(t string) (typ Type, err error)

func (Type) String

func (t Type) String() (out string)

Jump to

Keyboard shortcuts

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