Documentation ¶
Index ¶
- type Client
- type Ethereum2Client
- type EthereumClient
- func (c *EthereumClient) HeaderByNumber(ctx context.Context, number *big.Int) (*Header, error)
- func (c *EthereumClient) LatestFinalizedBlockNumber(ctx context.Context, confirmations uint64) (*big.Int, error)
- func (c *EthereumClient) TransactionReceipts(ctx context.Context, txHashes []common.Hash) ([]Result, error)
- type EthereumJSONRPCClient
- type FinalityOverride
- type Header
- type JSONRPCClient
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // TransactionReceipt returns the transaction receipt for the given transaction hash TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) // TransactionReceipts returns transaction receipts for the given transaction hashes TransactionReceipts(ctx context.Context, txHashes []common.Hash) ([]Result, error) // HeaderByNumber returns the block header for the given block number HeaderByNumber(ctx context.Context, number *big.Int) (*Header, error) // LatestFinalizedBlockNumber returns the latest finalized block number LatestFinalizedBlockNumber(ctx context.Context, confirmations uint64) (*big.Int, error) // Close closes the client connection Close() }
Client provides calls to EVM JSON-RPC endpoints
type Ethereum2Client ¶ added in v0.31.0
type Ethereum2Client struct {
*EthereumClient
}
Ethereum2Client is a JSON-RPC client of Ethereum 2.0
func NewEthereum2Client ¶ added in v0.31.0
func NewEthereum2Client(ethereumClient *EthereumClient) (*Ethereum2Client, error)
NewEthereum2Client is the constructor
func (*Ethereum2Client) LatestFinalizedBlockNumber ¶ added in v0.33.1
func (c *Ethereum2Client) LatestFinalizedBlockNumber(ctx context.Context, _ uint64) (*big.Int, error)
LatestFinalizedBlockNumber returns the latest finalized block number
type EthereumClient ¶ added in v0.31.0
type EthereumClient struct { EthereumJSONRPCClient // contains filtered or unexported fields }
EthereumClient is a JSON-RPC client of any Ethereum-compact chains
func NewEthereumClient ¶ added in v0.31.0
func NewEthereumClient(ethClient EthereumJSONRPCClient, rpc JSONRPCClient) (*EthereumClient, error)
NewEthereumClient is the constructor
func (*EthereumClient) HeaderByNumber ¶ added in v0.31.0
HeaderByNumber returns the block header for the given block number
func (*EthereumClient) LatestFinalizedBlockNumber ¶ added in v0.33.1
func (c *EthereumClient) LatestFinalizedBlockNumber(ctx context.Context, confirmations uint64) (*big.Int, error)
LatestFinalizedBlockNumber returns the latest finalized block number
func (*EthereumClient) TransactionReceipts ¶ added in v0.34.0
type EthereumJSONRPCClient ¶ added in v0.31.0
type EthereumJSONRPCClient interface { BlockNumber(ctx context.Context) (uint64, error) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) Close() }
EthereumJSONRPCClient represents the functionality of github.com/ethereum/go-ethereum/ethclient.Client
type FinalityOverride ¶ added in v0.33.1
type FinalityOverride int
const ( NoOverride FinalityOverride = iota Confirmation )
func ParseFinalityOverride ¶ added in v0.33.1
func ParseFinalityOverride(s string) (FinalityOverride, error)
func (FinalityOverride) String ¶ added in v0.33.1
func (i FinalityOverride) String() string
type Header ¶ added in v0.26.4
type Header struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` Number *hexutil.Big `json:"number" gencodec:"required"` Time hexutil.Uint64 `json:"timestamp" gencodec:"required"` Hash common.Hash `json:"hash"` Transactions []common.Hash `json:"transactions" gencodec:"required"` L1BlockNumber *hexutil.Big `json:"l1BlockNumber"` }
Header represents a block header in any EVM blockchain
type JSONRPCClient ¶ added in v0.31.0
type JSONRPCClient interface { CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error BatchCallContext(ctx context.Context, b []rpc.BatchElem) error }
JSONRPCClient represents the functionality of github.com/ethereum/go-ethereum/rpc.Client