lcd

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UriQueryAccount      = "/auth/accounts/%s"
	UriQueryCIPAL        = "/cipal/query/%s"
	UriQueryCIPALs       = "/cipal/batch_query"
	UriQueryIPAL         = "/ipal/node/%s"
	UriQueryIPALs        = "/ipal/nodes"
	UriQueryIPALList     = "/ipal/list"
	UriQueryContractLogs = "/vm/logs/%s"
)
View Source
const (
	EndpointTypeServerChat      = "1"
	EndpointTypeClientChat      = "1"
	EndpointTypeClientGroupChat = "2"
)

Variables

Functions

func Bech32AddrsFromUNCompressedPubKeys added in v1.1.1

func Bech32AddrsFromUNCompressedPubKeys(uncompressedPubKeys []string) (bech32Addrs []string)

func QueryCIPALsParamsFromUNCompressedPubKeys added in v1.1.1

func QueryCIPALsParamsFromUNCompressedPubKeys(uncompressedPubKeys []string) (params types.QueryCIPALsParams)

func QueryServiceNodesParamsFromBech32Addresses added in v1.1.1

func QueryServiceNodesParamsFromBech32Addresses(addresses []string) (params ipaltypes.QueryServiceNodesParams)

Types

type AccountBody

type AccountBody struct {
	Height string        `json:"height"`
	Result AccountResult `json:"result"`
}

type AccountResult

type AccountResult struct {
	Type  string       `json:"type"`
	Value AccountValue `json:"value"`
}

type AccountValue

type AccountValue struct {
	Address       string       `json:"address"`
	Coins         []types.Coin `json:"coins"`
	AccountNumber string       `json:"account_number"`
	Sequence      string       `json:"sequence"`
}

type CIPALBody

type CIPALBody struct {
	Height string      `json:"height"`
	Result CIPALResult `json:"result"`
}

type CIPALResult

type CIPALResult struct {
	UserAddress  string             `json:"user_address"`
	ServiceInfos []CIPALServiceInfo `json:"service_infos"`
}

type CIPALServiceInfo

type CIPALServiceInfo struct {
	Type    string `json:"type"`
	Address string `json:"address"`
}

type CIPALsBody added in v1.1.1

type CIPALsBody struct {
	Height string        `json:"height"`
	Result []CIPALResult `json:"result"`
}

type ContractLog added in v1.1.4

type ContractLog struct {
	Height string `json:"height"`
	Result VMLogs `json:"result"`
}

type Endpoint

type Endpoint struct {
	Type     string `json:"type"`
	Endpoint string `json:"endpoint"`
}

type IPALBody added in v1.0.9

type IPALBody struct {
	Height string     `json:"height"`
	Result IPALResult `json:"result"`
}

type IPALListBody added in v1.0.9

type IPALListBody struct {
	Height string       `json:"height"`
	Result []IPALResult `json:"result"`
}

type IPALResult added in v1.0.9

type IPALResult struct {
	OperatorAddress string     `json:"operator_address"`
	Moniker         string     `json:"moniker"`
	Website         string     `json:"website"`
	Details         string     `json:"details"`
	Endpoints       []Endpoint `json:"endpoints"`
	Bond            types.Coin `json:"bond"`
}

type IPALsBody added in v1.1.1

type IPALsBody struct {
	Height string       `json:"height"`
	Result []IPALResult `json:"result"`
}

type LiteClient

type LiteClient interface {
	QueryAccount(address string) (AccountBody, error)

	QueryIPALList() (IPALListBody, error)
	QueryIPALChatServerEndpoints() ([]string, error)
	QueryIPALEndpointsByType(endpointType string) ([]string, error)

	QueryIPALByAddress(address string) (IPALBody, error)
	QueryIPALByUNCompressedPubKey(uncompressedPubKey string) (IPALBody, error)
	QueryIPALChatServerEndpointByUNCompressedPubKey(uncompressedPubKey string) (string, error)
	QueryIPALChatServersEndpointByAddresses(addresses []string) (map[string]string, error)
	QueryIPALsEndpointByAddressesByType(addresses []string, endpointType string) (map[string]string, error)

	QueryCIPALByAddress(address string) (CIPALBody, error)
	QueryCIPALByUNCompressedPubKey(uncompressedPubKey string) (CIPALBody, error)
	QueryCIPALChatServerAddrByUNCompressedPubKey(uncompressedPubKey string) (string, error)
	QueryCIPALChatServersAddrByUNCompressedPubKeys(uncompressedPubKey []string) (map[string]string, error)
	QueryCIPALsAddrByUNCompressedPubKeysByType(uncompressedPubKey []string, endpointType string) (map[string]string, error)

	QueryContractLog(txId []byte) (ContractLog, error)
}

func NewClient

func NewClient(c basic.HttpClient) LiteClient

type VMLog added in v1.1.4

type VMLog struct {
	Address          string   `json:"address"`
	Topics           []string `json:"topics"`
	Data             string   `json:"data"`
	BlockNumber      string   `json:"blockNumber"`
	TransactionHash  string   `json:"transactionHash"`
	TransactionIndex string   `json:"transactionIndex"`
	BlockHash        string   `json:"blockHash"`
	LogIndex         string   `json:"logIndex"`
	Removed          bool     `json:"removed"`
}

type VMLogs added in v1.1.4

type VMLogs struct {
	Logs []VMLog `json:"logs"`
}

Jump to

Keyboard shortcuts

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