Documentation
¶
Index ¶
- Constants
- Variables
- func AccountNonce(id int, address string) []byte
- func AuthorSubmitAndWatchExtrinsic(id int, signedExtrinsic string) []byte
- func AuthorSubmitExtrinsic(id int, signedExtrinsic string) []byte
- func ChainGetBlock(id int, hash string) []byte
- func ChainGetBlockHash(id int, blockNum int) []byte
- func ChainGetRuntimeVersion(id int, hash ...string) []byte
- func ChainSubscribeFinalizedHeads(id int) []byte
- func ChainSubscribeNewHead(id int) []byte
- func GetChainGetBlockHash(p websocket.WsConn, blockNum int) (string, error)
- func GetMetadataByHash(p websocket.WsConn, hash ...string) (string, error)
- func GetPaymentQueryInfo(p websocket.WsConn, encodedExtrinsic string) (paymentInfo *model.PaymentQueryInfo, err error)
- func GetStateGetRuntimeVersion(p websocket.WsConn, hash string) *model.RuntimeVersion
- func GetSystemAccountNextIndex(p websocket.WsConn, accountId string) uint64
- func GetSystemProperties(p websocket.WsConn) (*model.Properties, error)
- func ReadKeysPaged(p websocket.WsConn, module, prefix string) (r []string, scale string, err error)
- func ReadStorage(p websocket.WsConn, module, prefix string, hash string, arg ...string) (r storage.StateStorage, err error)
- func ReadStorageByKey(p websocket.WsConn, key storageKey.StorageKey, hash string) (r storage.StateStorage, err error)
- func StateGetKeysPaged(id int, storageKey string) []byte
- func StateGetMetadata(id int, hash ...string) []byte
- func StateGetRuntimeVersion(id int, hash string) []byte
- func StateGetStorage(id int, storageKey string, hash string) []byte
- func StateQueryStorage(id int, key, start, end string) []byte
- func StateQueryStorageAt(id int, key, start string) []byte
- func StateSubscribeStorage(id int, storageKey []string) []byte
- func SystemAccountNextIndex(id int, hash string) []byte
- func SystemChain(id int) []byte
- func SystemHealth(id int) []byte
- func SystemName(id int) []byte
- func SystemPaymentQueryInfo(id int, encodedExtrinsic string) []byte
- func SystemProperties(id int) []byte
- func SystemVersion(id int) []byte
- type Client
- func (cl *Client) SendAuthorSubmitAndWatchExtrinsic(signedExtrinsic string) (string, error)
- func (cl *Client) SendAuthorSubmitExtrinsic(signedExtrinsic string) (string, error)
- func (cl *Client) SetKeyRing(keyRing keyring.IKeyRing)
- func (cl *Client) SetMetadata(metadata *metadata.Instant)
- func (cl *Client) SignTransaction(moduleName, callName string, args ...interface{}) (string, error)
- type Param
Constants ¶
const TxVersionInfo = "84"
Variables ¶
var ( InvalidMetadataErr = errors.New("invalid Metadata") InvalidCallErr = errors.New("invalid call name or module name") InvalidCallArgsErr = errors.New("invalid call args length") NotSetKeyRingErr = errors.New("not set keyring") NetworkErr = errors.New("network error") SubscribeTransactionErr = errors.New("subscribe transaction failed") )
Functions ¶
func AccountNonce ¶
func AuthorSubmitAndWatchExtrinsic ¶ added in v0.5.0
AuthorSubmitAndWatchExtrinsic submits an extrinsic and watches it until block finalized
func AuthorSubmitExtrinsic ¶ added in v0.5.0
AuthorSubmitExtrinsic submits an extrinsic and returns the hash
func ChainGetBlock ¶
func ChainGetBlockHash ¶
func ChainGetRuntimeVersion ¶
func ChainSubscribeNewHead ¶
func GetChainGetBlockHash ¶ added in v0.5.0
func GetPaymentQueryInfo ¶
func GetStateGetRuntimeVersion ¶ added in v0.5.0
func GetStateGetRuntimeVersion(p websocket.WsConn, hash string) *model.RuntimeVersion
func GetSystemAccountNextIndex ¶ added in v0.5.0
func GetSystemProperties ¶
func GetSystemProperties(p websocket.WsConn) (*model.Properties, error)
func ReadKeysPaged ¶
func ReadStorage ¶
func ReadStorage(p websocket.WsConn, module, prefix string, hash string, arg ...string) (r storage.StateStorage, err error)
ReadStorage Read substrate storage
func ReadStorageByKey ¶
func ReadStorageByKey(p websocket.WsConn, key storageKey.StorageKey, hash string) (r storage.StateStorage, err error)
func StateGetKeysPaged ¶
func StateGetMetadata ¶
func StateGetRuntimeVersion ¶ added in v0.5.0
StateGetRuntimeVersion Query the runtime version
func StateQueryStorage ¶ added in v0.5.0
StateQueryStorage Query historical storage entries (by key) starting from a start block key Vec<StorageKey>
func StateQueryStorageAt ¶
StateQueryStorageAt Query storage entries (by key) starting at block hash given as the second parameter key Vec<StorageKey>
func StateSubscribeStorage ¶
func SystemAccountNextIndex ¶ added in v0.5.0
SystemAccountNextIndex Query the next account index of an account
func SystemChain ¶
func SystemHealth ¶
func SystemName ¶
func SystemPaymentQueryInfo ¶
func SystemProperties ¶
func SystemVersion ¶
Types ¶
type Client ¶ added in v0.5.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SendAuthorSubmitAndWatchExtrinsic ¶ added in v0.5.0
SendAuthorSubmitAndWatchExtrinsic send extrinsic and watch will call rpc author_submitAndWatchExtrinsic
func (*Client) SendAuthorSubmitExtrinsic ¶ added in v0.5.0
SendAuthorSubmitExtrinsic send extrinsic will call rpc author_submitExtrinsic
func (*Client) SetKeyRing ¶ added in v0.5.0
func (*Client) SetMetadata ¶ added in v0.5.0
func (*Client) SignTransaction ¶ added in v0.5.0
SignTransaction sign transaction p: websocket connection keyRing: keyring moduleName: module name callName: call name args: call args return: transaction hex