Documentation ¶
Overview ¶
Package chain defines the interface for interacting with a blockchain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EthAddress = common.HexToAddress("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE")
EthAddress is the address of a chain's native gas token.
Functions ¶
func IsGasToken ¶ added in v0.0.35
IsGasToken returns true if the given token is the gas token.
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, chainClient client.EVM, addr common.Address, 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.