Documentation
¶
Index ¶
- Constants
- Variables
- type BaseEthereumClienter
- type BlockNumber
- type BlockNumberFinality
- func (b BlockNumberFinality) IsEmpty() bool
- func (b BlockNumberFinality) IsFinalized() bool
- func (b BlockNumberFinality) IsSafe() bool
- func (BlockNumberFinality) JSONSchema() *jsonschema.Schema
- func (b BlockNumberFinality) String() string
- func (b *BlockNumberFinality) ToBlockNum() (*big.Int, error)
- func (d *BlockNumberFinality) UnmarshalText(data []byte) error
- type DefaultEthClient
- type EthClienter
- type NoopRPCClient
- type RPCClienter
Constants ¶
View Source
const ( Safe = BlockNumber(-4) Finalized = BlockNumber(-3) Latest = BlockNumber(-2) Pending = BlockNumber(-1) Earliest = BlockNumber(0) )
Variables ¶
View Source
var ( SafeBlock = BlockNumberFinality{"SafeBlock"} FinalizedBlock = BlockNumberFinality{"FinalizedBlock"} LatestBlock = BlockNumberFinality{"LatestBlock"} PendingBlock = BlockNumberFinality{"PendingBlock"} EarliestBlock = BlockNumberFinality{"EarliestBlock"} )
Functions ¶
This section is empty.
Types ¶
type BaseEthereumClienter ¶
type BaseEthereumClienter interface {
ethereum.BlockNumberReader
ethereum.ChainIDReader
ethereum.ChainReader
ethereum.ChainStateReader
ethereum.LogFilterer
ethereum.TransactionReader
bind.ContractBackend
}
BaseEthereumClienter defines the methods required to interact with an Ethereum client.
type BlockNumber ¶
type BlockNumber int64
type BlockNumberFinality ¶
type BlockNumberFinality struct {
// contains filtered or unexported fields
}
func NewBlockNumberFinality ¶
func NewBlockNumberFinality(s string) BlockNumberFinality
func (BlockNumberFinality) IsEmpty ¶
func (b BlockNumberFinality) IsEmpty() bool
func (BlockNumberFinality) IsFinalized ¶
func (b BlockNumberFinality) IsFinalized() bool
func (BlockNumberFinality) IsSafe ¶
func (b BlockNumberFinality) IsSafe() bool
func (BlockNumberFinality) JSONSchema ¶
func (BlockNumberFinality) JSONSchema() *jsonschema.Schema
func (BlockNumberFinality) String ¶
func (b BlockNumberFinality) String() string
func (*BlockNumberFinality) ToBlockNum ¶
func (b *BlockNumberFinality) ToBlockNum() (*big.Int, error)
func (*BlockNumberFinality) UnmarshalText ¶
func (d *BlockNumberFinality) UnmarshalText(data []byte) error
UnmarshalText unmarshalls BlockNumberFinality from text.
type DefaultEthClient ¶
type DefaultEthClient struct {
BaseEthereumClienter
RPCClienter
}
DefaultEthClient is the default implementation of EthClienter.
func NewDefaultEthClient ¶
func NewDefaultEthClient(baseClient BaseEthereumClienter, rpcClient RPCClienter) *DefaultEthClient
NewDefaultEthClient creates a new DefaultEthClient.
type EthClienter ¶
type EthClienter interface {
BaseEthereumClienter
RPCClienter
}
EthClienter defines the methods for an Ethereum RPC client.
func DialWithRetry ¶ added in v0.7.0
func DialWithRetry(ctx context.Context, url string, retryHandler commontypes.RetryHandler) (EthClienter, error)
DialWithRetry attempts to connect to an Ethereum client with retries and exponential backoff. It returns an EthClienter on success or an error if all attempts fail.
type NoopRPCClient ¶
type NoopRPCClient struct{}
NoopRPCClient is no operation implementation for the RPCClienter interface
Click to show internal directories.
Click to hide internal directories.