substrate

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainTypeStafi    = "stafi"
	ChainTypePolkadot = "polkadot"

	AddressTypeAccountId    = "AccountId"
	AddressTypeMultiAddress = "MultiAddress"
)

Variables

View Source
var (
	TerminatedError           = errors.New("terminated")
	BondEqualToUnbondError    = errors.New("BondEqualToUnbondError")
	BondSmallerThanLeastError = errors.New("BondSmallerThanLeastError")
)

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) GetHeader

func (gc *GsrpcClient) GetHeader(blockHash types.Hash) (*types.Header, 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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