rpc

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountNonce

func AccountNonce(id int, address string) []byte

func ChainGetBlock

func ChainGetBlock(id int, hash string) []byte

func ChainGetBlockHash

func ChainGetBlockHash(id int, blockNum int) []byte

func ChainGetRuntimeVersion

func ChainGetRuntimeVersion(id int, hash ...string) []byte

func ChainSubscribeFinalizedHeads

func ChainSubscribeFinalizedHeads(id int) []byte

func ChainSubscribeNewHead

func ChainSubscribeNewHead(id int) []byte

func GetMetadataByHash

func GetMetadataByHash(p websocket.WsConn, hash ...string) (string, error)

func PowerOf

func PowerOf(id int, address string) []byte

func ReadKeysPaged

func ReadKeysPaged(p websocket.WsConn, module, prefix string) (r []string, scale string, err error)

func ReadStorage

func ReadStorage(p websocket.WsConn, module, prefix string, hash string, arg ...string) (r storage.StateStorage, err error)

Read substrate storage

func ReadStorageByKey

func ReadStorageByKey(p websocket.WsConn, key storageKey.StorageKey, hash string) (r storage.StateStorage, err error)

func StateGetKeysPaged

func StateGetKeysPaged(id int, storageKey string) []byte

func StateGetMetadata

func StateGetMetadata(id int, hash ...string) []byte

func StateGetStorage

func StateGetStorage(id int, storageKey string, hash string) []byte

func StateQueryStorageAt

func StateQueryStorageAt(id int, key, start string) []byte
Query storage entries (by key) starting at block hash given as the second parameter

key Vec<StorageKey>

func StateQuerystorage

func StateQuerystorage(id int, key, start, end string) []byte

Query historical storage entries (by key) starting from a start block key Vec<StorageKey>

func StateSubscribeStorage

func StateSubscribeStorage(id int, storageKey []string) []byte

func SystemChain

func SystemChain(id int) []byte

func SystemHealth

func SystemHealth(id int) []byte

func SystemName

func SystemName(id int) []byte

func SystemPaymentQueryInfo

func SystemPaymentQueryInfo(id int, encodedExtrinsic string) []byte

func SystemProperties

func SystemProperties(id int) []byte

func SystemVersion

func SystemVersion(id int) []byte

Types

type Block

type Block struct {
	Extrinsics []string           `json:"extrinsics"`
	Header     ChainNewHeadResult `json:"header"`
}

type BlockResult

type BlockResult struct {
	Block         Block  `json:"block"`
	Justification string `json:"justification"`
}

type ChainNewHeadLog

type ChainNewHeadLog struct {
	Logs []string `json:"logs"`
}

type ChainNewHeadResult

type ChainNewHeadResult struct {
	ExtrinsicsRoot string          `json:"extrinsicsRoot"`
	Number         string          `json:"number"`
	ParentHash     string          `json:"parentHash"`
	StateRoot      string          `json:"stateRoot"`
	Digest         ChainNewHeadLog `json:"digest"`
}

type Error

type Error struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type HealthResult

type HealthResult struct {
	IsSyncing       bool `json:"isSyncing"`
	Peers           int  `json:"peers"`
	ShouldHavePeers bool `json:"shouldHavePeers"`
}

type JsonRpcParams

type JsonRpcParams struct {
	Id      int         `json:"id,omitempty"`
	JsonRpc string      `json:"jsonrpc"`
	Params  interface{} `json:"params"`
	Method  string      `json:"method"`
	Error   *Error      `json:"error,omitempty"`
}

type JsonRpcResult

type JsonRpcResult struct {
	Id      int         `json:"id,omitempty"`
	JsonRpc string      `json:"jsonrpc"`
	Result  interface{} `json:"result,omitempty"`
	Params  *SubParams  `json:"params,omitempty"`
	Method  string      `json:"method,omitempty"`
	Error   *Error      `json:"error,omitempty"`
}

func (*JsonRpcResult) ToAnyThing

func (p *JsonRpcResult) ToAnyThing(r interface{}) error

func (*JsonRpcResult) ToBlock

func (p *JsonRpcResult) ToBlock() *BlockResult

func (*JsonRpcResult) ToFloat64

func (p *JsonRpcResult) ToFloat64() float64

func (*JsonRpcResult) ToInt

func (p *JsonRpcResult) ToInt() uint64

func (*JsonRpcResult) ToInterfaces

func (p *JsonRpcResult) ToInterfaces() ([]interface{}, error)

func (*JsonRpcResult) ToNewHead

func (p *JsonRpcResult) ToNewHead() *ChainNewHeadResult

func (*JsonRpcResult) ToPaymentQueryInfo

func (p *JsonRpcResult) ToPaymentQueryInfo() *PaymentQueryInfo

func (*JsonRpcResult) ToRuntimeVersion

func (p *JsonRpcResult) ToRuntimeVersion() *RuntimeVersion

func (*JsonRpcResult) ToStorage

func (p *JsonRpcResult) ToStorage() (*StateStorageResult, int64)

func (*JsonRpcResult) ToString

func (p *JsonRpcResult) ToString() (string, error)

func (*JsonRpcResult) ToSysHealth

func (p *JsonRpcResult) ToSysHealth() *HealthResult

type Param

type Param struct {
	Id      int         `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	JsonRpc string      `json:"jsonrpc"`
}

type PaymentQueryInfo

type PaymentQueryInfo struct {
	Class      string          `json:"class"`
	PartialFee decimal.Decimal `json:"partialFee"`
	Weight     int64           `json:"weight"`
}

func GetPaymentQueryInfo

func GetPaymentQueryInfo(p websocket.WsConn, encodedExtrinsic string) (paymentInfo *PaymentQueryInfo, err error)

type Properties

type Properties struct {
	Ss58Format    int    `json:"ss58Format"`
	TokenDecimals int    `json:"tokenDecimals"`
	TokenSymbol   string `json:"tokenSymbol"`
}

func GetSystemProperties

func GetSystemProperties(p websocket.WsConn) (*Properties, error)

type RuntimeVersion

type RuntimeVersion struct {
	Apis             [][]interface{} `json:"apis"`
	AuthoringVersion int             `json:"authoringVersion"`
	ImplName         string          `json:"implName"`
	ImplVersion      int             `json:"implVersion"`
	SpecName         string          `json:"specName"`
	SpecVersion      int             `json:"specVersion"`
}

type StateStorageResult

type StateStorageResult struct {
	Block   string     `json:"block"`
	Changes [][]string `json:"changes"`
}

type SubParams

type SubParams struct {
	Result interface{} `json:"result"`
}

type SystemTokenResult

type SystemTokenResult struct {
	TokenDecimals int    `json:"tokenDecimals"`
	TokenSymbol   string `json:"tokenSymbol"`
}

Jump to

Keyboard shortcuts

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