client

package
v0.0.0-...-a08de0b Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: CC0-1.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGrpcConnection

func CreateGrpcConnection(cfg types.Config) (*grpc.ClientConn, error)

CreateGrpcConnection creates a new gRPC client connection from the given configuration

func GetHeightRequestHeader

func GetHeightRequestHeader(height int64) grpc.CallOption

GetHeightRequestHeader returns the grpc.CallOption to query the state at a given height

func MustCreateGrpcConnection

func MustCreateGrpcConnection(cfg types.Config) *grpc.ClientConn

MustCreateGrpcConnection creates a new gRPC connection using the provided configuration and panics on error

Types

type Contracts

type Contracts struct {
	FungibleToken    string
	FlowToken        string
	FlowFee          string
	StakingTable     string
	LockedTokens     string
	NonFungibleToken string
	StakingProxy     string
	ChainID          string
}

func MainnetContracts

func MainnetContracts() Contracts

func TestnetContracts

func TestnetContracts() Contracts

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy implements a wrapper around both a Tendermint RPC client and a Cosmos Sdk REST client that allows for essential data queries.

func NewClientProxy

func NewClientProxy(cfg types.Config, encodingConfig *params.EncodingConfig) (*Proxy, error)

NewClientProxy allows to build a new Proxy instance

func (*Proxy) Block

func (cp *Proxy) Block(height int64) (*flow.Block, error)

Block queries for a block by height. An error is returned if the query fails.

func (*Proxy) Client

func (cp *Proxy) Client() *client.Client

func (*Proxy) Collections

func (cp *Proxy) Collections(block *flow.Block) []types.Collection

Collections get all the collection from block

func (*Proxy) Contract

func (cp *Proxy) Contract() Contracts

func (*Proxy) Ctx

func (cp *Proxy) Ctx() context.Context

func (*Proxy) Events

func (cp *Proxy) Events(transactionID string, height int) ([]types.Event, error)

Events get events from a transaction ID

func (*Proxy) EventsInBlock

func (cp *Proxy) EventsInBlock(block *flow.Block) ([]types.Event, error)

func (*Proxy) EventsInTransaction

func (cp *Proxy) EventsInTransaction(tx types.Tx) ([]types.Event, error)

func (*Proxy) GetChainID

func (cp *Proxy) GetChainID() string

func (*Proxy) GetGenesisHeight

func (cp *Proxy) GetGenesisHeight() uint64

GetGeneisisBlock parse the specific block as genesis block

func (*Proxy) GetTransaction

func (cp *Proxy) GetTransaction(hash string) (*flow.Transaction, error)

GetTransaction queries for a transaction by hash. An error is returned if the query fails.

func (*Proxy) LatestHeight

func (cp *Proxy) LatestHeight() (int64, error)

LatestHeight returns the latest block height on the active chain. An error is returned if the query fails.

func (*Proxy) Stop

func (cp *Proxy) Stop()

Stop defers the node stop execution to the RPC client.

func (*Proxy) TransactionResult

func (cp *Proxy) TransactionResult(transactionIds []flow.Identifier) ([]types.TransactionResult, error)

func (*Proxy) Txs

func (cp *Proxy) Txs(block *flow.Block) (types.Txs, error)

Txs queries for all the transactions in a block. Transactions are returned in the TransactionResult format which internally contains an array of Transactions. An error is returned if any query fails.

Jump to

Keyboard shortcuts

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