Documentation
¶
Index ¶
- Constants
- Variables
- type ChainEvent
- type GsrpcClient
- func (gc *GsrpcClient) Address() string
- func (gc *GsrpcClient) ChainId() (uint8, error)
- func (gc *GsrpcClient) FlashApi() (*gsrpc.SubstrateAPI, error)
- func (gc *GsrpcClient) GetAccountInfo() (*types.AccountInfo, error)
- func (gc *GsrpcClient) GetBlockNumber(blockHash types.Hash) (uint64, error)
- func (gc *GsrpcClient) GetFinalizedBlockNumber() (uint64, error)
- func (gc *GsrpcClient) GetFinalizedHead() (types.Hash, error)
- func (gc *GsrpcClient) GetHeader(blockHash types.Hash) (*types.Header, error)
- func (gc *GsrpcClient) GetHeaderLatest() (*types.Header, error)
- func (gc *GsrpcClient) GetLatestBlockNumber() (uint64, error)
- func (gc *GsrpcClient) GetLatestMetadata() (*types.Metadata, error)
- func (gc *GsrpcClient) GetLatestNonce() (types.U32, error)
- func (gc *GsrpcClient) GetLatestRuntimeVersion() (*types.RuntimeVersion, error)
- func (gc *GsrpcClient) NewUnsignedExtrinsic(callMethod string, args ...interface{}) (interface{}, error)
- func (gc *GsrpcClient) PublicKey() []byte
- func (gc *GsrpcClient) QueryStorage(prefix, method string, arg1, arg2 []byte, result interface{}) (bool, error)
- func (gc *GsrpcClient) SignAndSubmitTx(ext interface{}) error
- type SarpcClient
- func (sc *SarpcClient) GetBlock(blockHash string) (*rpc.Block, error)
- func (sc *SarpcClient) GetBlockHash(blockNum uint64) (string, error)
- func (sc *SarpcClient) GetChainEvents(blockHash string) ([]*ChainEvent, error)
- func (sc *SarpcClient) GetEvents(blockNum uint64) ([]*ChainEvent, error)
- func (sc *SarpcClient) UpdateMeta(blockHash string) error
Constants ¶
View Source
const ( ChainTypeStafi = "stafi" ChainTypePolkadot = "polkadot" AddressTypeAccountId = "AccountId" AddressTypeMultiAddress = "MultiAddress" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ChainEvent ¶
type ChainEvent struct {
ModuleId string `json:"module_id" `
EventId string `json:"event_id" `
Params []scalecodec.EventParam `json:"params"`
}
type GsrpcClient ¶
type GsrpcClient struct {
// contains filtered or unexported fields
}
func NewGsrpcClient ¶
func NewGsrpcClient(endpoint, addressType string, key *signature.KeyringPair, log log15.Logger, stop <-chan int) (*GsrpcClient, error)
func (*GsrpcClient) Address ¶
func (gc *GsrpcClient) Address() string
func (*GsrpcClient) ChainId ¶
func (gc *GsrpcClient) ChainId() (uint8, error)
func (*GsrpcClient) FlashApi ¶
func (gc *GsrpcClient) FlashApi() (*gsrpc.SubstrateAPI, error)
func (*GsrpcClient) GetAccountInfo ¶
func (gc *GsrpcClient) GetAccountInfo() (*types.AccountInfo, error)
func (*GsrpcClient) GetBlockNumber ¶
func (gc *GsrpcClient) GetBlockNumber(blockHash types.Hash) (uint64, error)
func (*GsrpcClient) GetFinalizedBlockNumber ¶
func (gc *GsrpcClient) GetFinalizedBlockNumber() (uint64, error)
func (*GsrpcClient) GetFinalizedHead ¶
func (gc *GsrpcClient) GetFinalizedHead() (types.Hash, error)
func (*GsrpcClient) GetHeaderLatest ¶
func (gc *GsrpcClient) GetHeaderLatest() (*types.Header, error)
func (*GsrpcClient) GetLatestBlockNumber ¶
func (gc *GsrpcClient) GetLatestBlockNumber() (uint64, error)
func (*GsrpcClient) GetLatestMetadata ¶
func (gc *GsrpcClient) GetLatestMetadata() (*types.Metadata, error)
func (*GsrpcClient) GetLatestNonce ¶
func (gc *GsrpcClient) GetLatestNonce() (types.U32, error)
func (*GsrpcClient) GetLatestRuntimeVersion ¶
func (gc *GsrpcClient) GetLatestRuntimeVersion() (*types.RuntimeVersion, error)
func (*GsrpcClient) NewUnsignedExtrinsic ¶
func (gc *GsrpcClient) NewUnsignedExtrinsic(callMethod string, args ...interface{}) (interface{}, error)
func (*GsrpcClient) PublicKey ¶
func (gc *GsrpcClient) PublicKey() []byte
func (*GsrpcClient) QueryStorage ¶
func (gc *GsrpcClient) QueryStorage(prefix, method string, arg1, arg2 []byte, result interface{}) (bool, error)
queryStorage performs a storage lookup. Arguments may be nil, result must be a pointer.
func (*GsrpcClient) SignAndSubmitTx ¶
func (gc *GsrpcClient) SignAndSubmitTx(ext interface{}) error
type SarpcClient ¶
type SarpcClient struct {
// contains filtered or unexported fields
}
func NewSarpcClient ¶
func NewSarpcClient(endpoint, typesPath string, log log15.Logger) (*SarpcClient, error)
func (*SarpcClient) GetBlock ¶
func (sc *SarpcClient) GetBlock(blockHash string) (*rpc.Block, error)
func (*SarpcClient) GetBlockHash ¶
func (sc *SarpcClient) GetBlockHash(blockNum uint64) (string, error)
func (*SarpcClient) GetChainEvents ¶
func (sc *SarpcClient) GetChainEvents(blockHash string) ([]*ChainEvent, error)
func (*SarpcClient) GetEvents ¶
func (sc *SarpcClient) GetEvents(blockNum uint64) ([]*ChainEvent, error)
func (*SarpcClient) UpdateMeta ¶
func (sc *SarpcClient) UpdateMeta(blockHash string) error
Click to show internal directories.
Click to hide internal directories.