cosmos

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Denom = "aastra"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BankClient

type BankClient struct {
	bankTypes.QueryClient
	bankTypes.MsgClient
}

func NewBankClient

func NewBankClient(conn grpc.ClientConn) BankClient

type BaseClient

type BaseClient struct {
	client.Context
	// contains filtered or unexported fields
}

type CosmosClient

type CosmosClient struct {
	*BaseClient
	BankClient
	StakingClient
	// contains filtered or unexported fields
}

func NewCosmosClient

func NewCosmosClient(cfg CosmosClientConfig, store *store.Store, log logger.Logger) (*CosmosClient, error)

NewCosmosClient creates a new cosmos client.

func (*CosmosClient) BlockTxsByHeight

func (c *CosmosClient) BlockTxsByHeight(ctx context.Context, blk *big.Int) ([]*sdk.TxResponse, error)

BlockTxsByHeight retrieves the receipts of all transaction in a block given its height.

func (*CosmosClient) GetValidatorDetail

func (c *CosmosClient) GetValidatorDetail(ctx context.Context, valAddress string) (*stakingTypes.Validator, error)

func (*CosmosClient) LatestBlockHeight

func (c *CosmosClient) LatestBlockHeight(ctx context.Context) (*big.Int, error)

LatestBlockHeight returns the latest block height from the current chain.

func (*CosmosClient) ListenToTxs

func (c *CosmosClient) ListenToTxs(ctx context.Context, txResult chan interface{}, startBlk *big.Int)

func (*CosmosClient) ParseCosmosMsgReceiver

func (c *CosmosClient) ParseCosmosMsgReceiver(msg sdk.Msg) string

ParseCosmosMsgReceiver returns the recipients of the given Cosmos message.

func (*CosmosClient) ParseCosmosMsgSender

func (c *CosmosClient) ParseCosmosMsgSender(msg sdk.Msg) string

ParseCosmosMsgSender returns the sender of the given Cosmos message.

func (*CosmosClient) ParseCosmosMsgValue

func (c *CosmosClient) ParseCosmosMsgValue(msg sdk.Msg) float64

ParseCosmosMsgValue returns the value of the given Cosmos message.

func (*CosmosClient) TxByHash

func (c *CosmosClient) TxByHash(hash string) (*sdk.TxResponse, error)

type CosmosClientConfig

type CosmosClientConfig struct {
	Endpoint       string `json:"Endpoint"`
	TendermintPort string `json:"TendermintPort"`
	Prefix         string `json:"Prefix"`
	ChainID        string `json:"ChainID"`
	Enabled        bool   `json:"Enabled"`
}

func DefaultConfig

func DefaultConfig() CosmosClientConfig

func (CosmosClientConfig) IsValid

func (cfg CosmosClientConfig) IsValid() (bool, error)

IsValid checks if the current CosmosClientConfig is valid.

type StakingClient

type StakingClient struct {
	stakingTypes.QueryClient
}

func NewStakingClient

func NewStakingClient(conn grpc.ClientConn) StakingClient

Jump to

Keyboard shortcuts

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