api

package
v0.0.0-...-c37bcb2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: LGPL-3.0-or-later Imports: 41 Imported by: 0

Documentation

Overview

Exporting types for querying states ug93tad

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHandler

func DefaultHandler(method, pattern string, params map[string]int, handlers ...apiHandle) hr.Handle

DefaultHandler is a common handle function for api requests

func InitSmartContract

func InitSmartContract(sc *smart.SmartContract, data []byte) error

InitSmartContract is initializes smart contract

func KeyLogin

func KeyLogin(keyFile string, pubKeyFile string, addr string) (err error)

func PostTx

func PostTx(txname string, form *url.Values) error

func PostTxWithResult

func PostTxWithResult(txname string, form *url.Values) (string, error)

func PrivateToPublicHex

func PrivateToPublicHex(hexkey string) (string, error)

PrivateToPublicHex returns the hex public key for the specified hex private key.

func RawToString

func RawToString(input json.RawMessage) string

func Route

func Route(route *hr.Router)

Route sets routing pathes

func SendGet

func SendGet(url string, form *url.Values, v interface{}) error

func SendPost

func SendPost(url string, form *url.Values, v interface{}) error

func SetApiAddress

func SetApiAddress(addr string)

func SetPriv

func SetPriv(key string)

func SetToken

func SetToken(token string)

func TestGetAvatar

func TestGetAvatar(t *testing.T)

func VDEContract

func VDEContract(contractData []byte, data *apiData) (result *contractResult, err error)

VDEContract is init VDE contract

Types

type ColumnInfo

type ColumnInfo struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Perm string `json:"perm"`
}

type CompletedTxsResults

type CompletedTxsResults struct {
	//Count int `json:"count"`
	Transactions []map[string][]byte `json:"transactions"`
}

type ContractField

type ContractField struct {
	Name string `json:"name"`
	HTML string `json:"htmltype"`
	Type string `json:"txtype"`
	Tags string `json:"tags"`
}

type ContractsResult

type ContractsResult struct {
	Count string              `json:"count"`
	List  []map[string]string `json:"list"`
}

type EcoSystemsResult

type EcoSystemsResult struct {
	Number uint32
}

type EncryptKey

type EncryptKey struct {
	Encrypted string `json:"encrypted"` //hex
	Public    string `json:"public"`    //hex
	WalletID  int64  `json:"wallet_id"`
	Address   string `json:"address"`
	Error     string `json:"error"`
}

EncryptKey is a structure for the answer of ajax_encrypt_key ajax request

type GUID

type GUID struct {
	UID         string
	Token       string
	Expire      string
	EcosystemID string
	KeyID       string
	Address     string
}

type GetContractResult

type GetContractResult struct {
	StateID  uint32          `json:"state"`
	Active   bool            `json:"active"`
	TableID  string          `json:"tableid"`
	WalletID string          `json:"walletid"`
	TokenID  string          `json:"tokenid"`
	Address  string          `json:"address"`
	Fields   []ContractField `json:"fields"`
	Name     string          `json:"name"`
}

type JWTClaims

type JWTClaims struct {
	UID         string `json:"uid,omitempty"`
	EcosystemID string `json:"ecosystem_id,omitempty"`
	KeyID       string `json:"key_id,omitempty"`
	RoleID      string `json:"role_id,omitempty"`
	IsMobile    string `json:"is_mobile,omitempty"`
	jwt.StandardClaims
}

JWTClaims is storing jwt claims

type ListResult

type ListResult struct {
	Count string              `json:"count"`
	List  []map[string]string `json:"list"`
}

type LoginResult

type LoginResult struct {
	Token       string        `json:"token,omitempty"`
	Refresh     string        `json:"refresh,omitempty"`
	EcosystemID string        `json:"ecosystem_id,omitempty"`
	KeyID       string        `json:"key_id,omitempty"`
	Address     string        `json:"address,omitempty"`
	NotifyKey   string        `json:"notify_key,omitempty"`
	IsNode      bool          `json:"isnode,omitempty"`
	IsOwner     bool          `json:"isowner,omitempty"`
	IsVDE       bool          `json:"vde,omitempty"`
	Timestamp   string        `json:"timestamp,omitempty"`
	Roles       []RolesResult `json:"roles,omitempty"`
}

type RolesResult

type RolesResult struct {
	RoleId   int64  `json:"role_id"`
	RoleName string `json:"role_name"`
}

type RowResult

type RowResult struct {
	Value map[string][]byte `json:"value"`
}

type SignRes

type SignRes struct {
	Param string `json:"name"`
	Text  string `json:"text"`
}

SignRes contains the data of the signature

type TableInfo

type TableInfo struct {
	Name  string `json:"name"`
	Count string `json:"count"`
}

type TableResult

type TableResult struct {
	Name       string       `json:"name"`
	Insert     string       `json:"insert"`
	NewColumn  string       `json:"new_column"`
	Update     string       `json:"update"`
	Read       string       `json:"read,omitempty"`
	Filter     string       `json:"filter,omitempty"`
	Conditions string       `json:"conditions"`
	AppID      string       `json:"app_id"`
	Columns    []ColumnInfo `json:"columns"`
}

type TablesResult

type TablesResult struct {
	Count int64       `json:"count"`
	List  []TableInfo `json:"list"`
}

type TxSignJSON

type TxSignJSON struct {
	ForSign string    `json:"forsign"`
	Field   string    `json:"field"`
	Title   string    `json:"title"`
	Params  []SignRes `json:"params"`
}

TxSignJSON is a structure for additional signs of transaction

Jump to

Keyboard shortcuts

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