chain

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package chain defines the interface for interacting with a blockchain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	ChainID       uint32
	Bridge        *fastbridge.FastBridgeRef
	Client        client.EVM
	Confirmations uint64
	// contains filtered or unexported fields
}

Chain is a chain helper for relayer. lowercase fields are private, uppercase are public. the plan is to move this out of relayer which is when this distinction will matter.

func NewChain

func NewChain(ctx context.Context, cfg relconfig.Config, chainClient client.EVM, chainListener listener.ContractListener, ts submitter.TransactionSubmitter) (*Chain, error)

NewChain creates a new chain.

func (Chain) LatestBlock

func (c Chain) LatestBlock() uint64

LatestBlock returns the latest block.

func (Chain) SubmitRelay

func (c Chain) SubmitRelay(ctx context.Context, request reldb.QuoteRequest) (uint64, *big.Int, error)

SubmitRelay submits a relay transaction to the destination chain after evaluating gas amount.

func (Chain) SubmitTransaction

func (c Chain) SubmitTransaction(ctx context.Context, call submitter.ContractCallType) (nonce uint64, _ error)

SubmitTransaction submits a transaction to the chain.

Jump to

Keyboard shortcuts

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