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 CustomTransaction
- type ICustomTranscation
- 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 ¶
AuthorSubmitAndWatchExtrinsic submits an extrinsic and watches it until block finalized
func AuthorSubmitExtrinsic ¶
AuthorSubmitExtrinsic submits an extrinsic and returns the hash
func ChainGetBlock ¶
func ChainGetBlockHash ¶
func ChainGetRuntimeVersion ¶
func ChainSubscribeNewHead ¶
func GetChainGetBlockHash ¶
func GetPaymentQueryInfo ¶
func GetStateGetRuntimeVersion ¶
func GetStateGetRuntimeVersion(p websocket.WsConn, hash string) *model.RuntimeVersion
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 ¶
StateGetRuntimeVersion Query the runtime version
func StateQueryStorage ¶
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 ¶
SystemAccountNextIndex Query the next account index of an account
func SystemChain ¶
func SystemHealth ¶
func SystemName ¶
func SystemPaymentQueryInfo ¶
func SystemProperties ¶
func SystemVersion ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SendAuthorSubmitAndWatchExtrinsic ¶
SendAuthorSubmitAndWatchExtrinsic send extrinsic and watch will call rpc author_submitAndWatchExtrinsic
func (*Client) SendAuthorSubmitExtrinsic ¶
SendAuthorSubmitExtrinsic send extrinsic will call rpc author_submitExtrinsic
func (*Client) SetKeyRing ¶
func (*Client) SetMetadata ¶
type CustomTransaction ¶
type CustomTransaction struct {
CallIndex,
GenesisHash,
Era string
Nonce int
RuntimeVersion *model.RuntimeVersion
Meta *types.MetadataStruct
Keyring keyring.IKeyRing
ScaleDecoderOpts *types.ScaleDecoderOption
Params []scalecodec.ExtrinsicParam
}
func (*CustomTransaction) GetEncodedCall ¶
func (customTx *CustomTransaction) GetEncodedCall() string
func (*CustomTransaction) SignTransactionCustom ¶
func (customTx *CustomTransaction) SignTransactionCustom() (string, error)
type ICustomTranscation ¶
func NewCustomTransaction ¶
func NewCustomTransaction( callIndex, genesisHash, era string, nonce int, version *model.RuntimeVersion, meta *types.MetadataStruct, kr keyring.IKeyRing, scaleDecOpts *types.ScaleDecoderOption, params []scalecodec.ExtrinsicParam) ICustomTranscation