Documentation
¶
Index ¶
- type Block
- type Client
- func (c *Client) BlockByNumberCustom(ctx context.Context, blockNumber *big.Int) (*Block, error)
- func (c *Client) HealthCheck(ctx context.Context) (time.Time, error)
- func (c *Client) IsTxConfirmed(ctx context.Context, txHash string, confirmations uint64) (bool, error)
- func (c *Client) TransactionByHashCustom(ctx context.Context, hash string) (*Transaction, error)
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Number int Hash string ParentHash string Nonce string Sha3Uncles string LogsBloom string TransactionsRoot string StateRoot string Miner string Difficulty *big.Int TotalDifficulty *big.Int ExtraData string Size int GasLimit int GasUsed int Timestamp int Uncles []string Transactions []Transaction }
Block EVM block.
type Client ¶
func NewFromEndpoint ¶
NewFromEndpoint new Client constructor based on endpoint URL.
func (*Client) BlockByNumberCustom ¶
BlockByNumberCustom is alternative to geth BlockByNumber that supports NON-ETH chains. For example, OP stack has different tx types that result in err="transaction type not supported"
See https://github.com/zeta-chain/node/issues/3386 See https://github.com/ethereum/go-ethereum/issues/29407
func (*Client) HealthCheck ¶
HealthCheck asserts RPC health. Returns the latest block time in UTC.
func (*Client) IsTxConfirmed ¶
func (c *Client) IsTxConfirmed(ctx context.Context, txHash string, confirmations uint64) (bool, error)
IsTxConfirmed checks whether txHash settled on-chain && has at least X blocks of confirmations.
func (*Client) TransactionByHashCustom ¶
TransactionByHashCustom is alternative to geth TransactionByHash that supports NON-ETH chains. See BlockByNumberCustom.