chain

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 12 Imported by: 0

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

func IsGasToken(token common.Address) bool

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

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