reader

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	CallContract(contractAddress address.Address, method string, params []any) (map[string]interface{}, error)
	CallContractFullNode(contractAddress address.Address, method string, params []any) (map[string]interface{}, error)
	LatestBlockHeight() (uint64, error)
	GetEventsFromBlock(contractAddress address.Address, eventName string, blockNum uint64) ([]map[string]interface{}, error)

	BaseClient() sdk.CombinedClient
}

type ReaderClient

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

func NewReader

func NewReader(rpc sdk.CombinedClient, lggr logger.Logger) *ReaderClient

func (*ReaderClient) BaseClient

func (c *ReaderClient) BaseClient() sdk.CombinedClient

func (*ReaderClient) CallContract

func (c *ReaderClient) CallContract(contractAddress address.Address, method string, params []any) (map[string]interface{}, error)

func (*ReaderClient) CallContractFullNode

func (c *ReaderClient) CallContractFullNode(contractAddress address.Address, method string, params []any) (map[string]interface{}, error)

Same as CallContract, but uses the fullnode client instead of the solidity client, which means it uses the non-finalized state of the chain.

func (*ReaderClient) GetEventsFromBlock

func (c *ReaderClient) GetEventsFromBlock(contractAddress address.Address, eventName string, blockNum uint64) ([]map[string]interface{}, error)

func (*ReaderClient) LatestBlockHeight

func (c *ReaderClient) LatestBlockHeight() (uint64, error)

Jump to

Keyboard shortcuts

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