evm

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvmClient

type EvmClient struct {
	*ethclient.Client
	GEthClient *gethclient.Client
	RPCClient  *rpc.Client
	// contains filtered or unexported fields
}

func NewEvmClient

func NewEvmClient(cfg EvmClientConfig, store *store.Store, log logger.Logger) (*EvmClient, error)

NewEvmClient creates a new EvmClient.

func (*EvmClient) BlockTxsByHeight

func (c *EvmClient) BlockTxsByHeight(ctx context.Context, blk *big.Int) ([]*types.Receipt, error)

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

func (*EvmClient) ChainID

func (c *EvmClient) ChainID() *big.Int

func (*EvmClient) LatestBlockHeight

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

LatestBlockHeight returns the latest block height from the current chain.

func (*EvmClient) ListenToTxs

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

func (*EvmClient) MustGetEvmTxSender

func (c *EvmClient) MustGetEvmTxSender(tx *types.Transaction) string

type EvmClientConfig

type EvmClientConfig struct {
	Endpoint string `json:"Endpoint"`
	Enabled  bool   `json:"Enabled"`
}

func DefaultConfig

func DefaultConfig() EvmClientConfig

func (EvmClientConfig) IsValid

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

IsValid checks if the current EvmClientConfig is valid.

Jump to

Keyboard shortcuts

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