abi

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbiToJson

func AbiToJson(abi *ABI) (string, error)

AbiToJson parse abi to json for contracts

func DecodeAbiEx

func DecodeAbiEx(contractName string, method string, r io.Reader, abi ABI, subStructName string, subStructValueName string, mapResultIn *map[string]interface{}) map[string]interface{}

DecodeAbiEx is to encode message

func DecodeTableAbiEx

func DecodeTableAbiEx(table_name string, r io.Reader, abi ABI, subStructName string, subStructValueName string, mapResultIn *map[string]interface{}) map[string]interface{}

DecodeTableAbiEx is to encode message

func EncodeAbiEx

func EncodeAbiEx(contractName string, method string, w io.Writer, value map[string]interface{}, abi ABI, subStructName string) error

EncodeAbiEx is to encode message

func MarshalAbiEx

func MarshalAbiEx(v map[string]interface{}, Abi *ABI, contractName string, method string) ([]byte, error)

MarshalAbiEx is to serialize the message

func Setmapval

func Setmapval(structmap map[string]interface{}, key string, val interface{})

func UnmarshalAbiEx

func UnmarshalAbiEx(contractName string, Abi *ABI, method string, data []byte) map[string]interface{}

UnmarshalAbiEx is to unserialize the message

Types

type ABI

type ABI struct {
	Types   []interface{} `json:"types"`
	Structs []ABIStruct   `json:"structs"`
	Actions []ABIAction   `json:"actions"`
	Tables  []TableStruct `json:"tables"`
}

ABI struct for abi

func CreateNativeContractABI

func CreateNativeContractABI() *ABI

func GetAbi

func GetAbi() *ABI

func ParseAbi

func ParseAbi(abiRaw []byte) (*ABI, error)

ParseAbi parse abiraw to struct for contracts

type ABIAction

type ABIAction struct {
	ActionName string `json:"action_name"`
	Type       string `json:"type"`
}

ABIAction abi Action(Method)

type ABIStruct

type ABIStruct struct {
	Name   string    `json:"name"`
	Base   string    `json:"base"`
	Fields *FeildMap `json:"fields"`
}

ABIStruct parameter struct for abi Action(Method)

type ABIStructs

type ABIStructs struct {
	Structs []struct {
		Name   string            `json:"name"`
		Base   string            `json:"base"`
		Fields map[string]string `json:"fields"`
	} `json:"structs"`
}

ABIStructs structs for ABI

type ByIndex

type ByIndex []KeyIndex

ByIndex struct

func (ByIndex) Len

func (a ByIndex) Len() int

func (ByIndex) Less

func (a ByIndex) Less(i, j int) bool

func (ByIndex) Swap

func (a ByIndex) Swap(i, j int)

type ByPair

type ByPair struct {
	Pairs    []*Pair
	LessFunc func(a *Pair, j *Pair) bool
}

ByPair function

func (ByPair) Len

func (a ByPair) Len() int

func (ByPair) Less

func (a ByPair) Less(i, j int) bool

func (ByPair) Swap

func (a ByPair) Swap(i, j int)

type FeildMap

type FeildMap struct {
	// contains filtered or unexported fields
}

FeildMap struct

func New

func New() *FeildMap

New new a FeildMap struct

func (*FeildMap) Delete

func (o *FeildMap) Delete(key string)

Delete delete key

func (*FeildMap) Get

func (o *FeildMap) Get(key string) (interface{}, bool)

Get get interface value by key

func (*FeildMap) GetStringPair

func (o *FeildMap) GetStringPair() []StringPair

GetStringPair get key value pairs

func (*FeildMap) GetStringVal

func (o *FeildMap) GetStringVal(key string) (string, bool)

GetStringVal get string value by key

func (*FeildMap) Keys

func (o *FeildMap) Keys() []string

Keys list all keys

func (FeildMap) MarshalJSON

func (o FeildMap) MarshalJSON() ([]byte, error)

MarshalJSON function

func (*FeildMap) Set

func (o *FeildMap) Set(key string, value interface{})

Set set interface value by key

func (*FeildMap) Sort

func (o *FeildMap) Sort(lessFunc func(a *Pair, b *Pair) bool)

Sort Sort the map using your sort func

func (*FeildMap) SortKeys

func (o *FeildMap) SortKeys(sortFunc func(keys []string))

SortKeys Sort the map keys using your sort func

func (*FeildMap) UnmarshalJSON

func (o *FeildMap) UnmarshalJSON(b []byte) error

UnmarshalJSON function

type KeyIndex

type KeyIndex struct {
	Key   string
	Index int
}

KeyIndex struct

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

Pair struct

func (*Pair) Key

func (kv *Pair) Key() string

Key function

func (*Pair) Value

func (kv *Pair) Value() interface{}

Value function

type StringPair

type StringPair struct {
	Key   string
	Value string
}

StringPair struct

type TableStruct

type TableStruct struct {
	Table_name string   `json:"table_name"`
	Index_type string   `json:"index_type"`
	Key_names  []string `json:"key_names"`
	Key_types  []string `json:"key_types"`
	Type       string   `json:"type"`
}

TableStruct struct for abi

Jump to

Keyboard shortcuts

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