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 ¶
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.
Click to show internal directories.
Click to hide internal directories.