abi

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte, fn Function, v interface{}) error

Types

type ABI

type ABI struct {
	Constructor Function
	Functions   map[string]Function
	Events      map[string]Event
}

func ReadFile

func ReadFile(path string) (ABI, error)

func (*ABI) UnmarshalJSON

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

type Event

type Event struct {
	Name   string
	Inputs []Value
}

type Function

type Function struct {
	Name       string
	Mutability string
	Inputs     []Value
	Outputs    []Value
}

func (Function) Decode

func (f Function) Decode(b []byte) ([]interface{}, error)

func (Function) Encode

func (f Function) Encode(args ...interface{}) []byte

func (Function) GetOutputIndex

func (f Function) GetOutputIndex(name string) int

func (Function) Immutable

func (f Function) Immutable() bool

Immutable returns if the function updates the blockchain on execution.

func (Function) Payable

func (f Function) Payable() bool

Payable returns if the function accepts Tron.

func (Function) Signature

func (f Function) Signature() string

type Value

type Value struct {
	Name    string    `json:"name"`
	Type    ValueType `json:"type"`
	Indexed bool      `json:"indexed"`
}

type ValueType

type ValueType string
const (
	TypeBool    ValueType = "bool"
	TypeBytes32 ValueType = "bytes32"
	TypeUint256 ValueType = "uint256"
)

Jump to

Keyboard shortcuts

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