Documentation
¶
Index ¶
- Constants
- func NewAvalancheRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
- type AvalancheClient
- func (c *AvalancheClient) BalanceAt(ctx context.Context, addrDesc bchain.AddressDescriptor, blockNumber *big.Int) (*big.Int, error)
- func (c *AvalancheClient) EstimateGas(ctx context.Context, msg interface{}) (uint64, error)
- func (c *AvalancheClient) HeaderByNumber(ctx context.Context, number *big.Int) (bchain.EVMHeader, error)
- func (c *AvalancheClient) NonceAt(ctx context.Context, addrDesc bchain.AddressDescriptor, blockNumber *big.Int) (uint64, error)
- type AvalancheClientSubscription
- type AvalancheHash
- type AvalancheHeader
- type AvalancheNewBlock
- type AvalancheNewTx
- type AvalancheRPC
- type AvalancheRPCClient
Constants ¶
const ( // MainNet is production network MainNet eth.Network = 43114 )
Variables ¶
This section is empty.
Functions ¶
func NewAvalancheRPC ¶
func NewAvalancheRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
NewAvalancheRPC returns new AvalancheRPC instance.
Types ¶
type AvalancheClient ¶
AvalancheClient wraps a client to implement the EVMClient interface
func (*AvalancheClient) BalanceAt ¶
func (c *AvalancheClient) BalanceAt(ctx context.Context, addrDesc bchain.AddressDescriptor, blockNumber *big.Int) (*big.Int, error)
BalanceAt returns the balance for the given account at a specific block, or latest known block if no block number is provided
func (*AvalancheClient) EstimateGas ¶
func (c *AvalancheClient) EstimateGas(ctx context.Context, msg interface{}) (uint64, error)
EstimateGas returns the current estimated gas cost for executing a transaction
func (*AvalancheClient) HeaderByNumber ¶
func (c *AvalancheClient) HeaderByNumber(ctx context.Context, number *big.Int) (bchain.EVMHeader, error)
HeaderByNumber returns a block header that implements the EVMHeader interface
type AvalancheClientSubscription ¶
type AvalancheClientSubscription struct {
*rpc.ClientSubscription
}
AvalancheClientSubscription wraps a client subcription to implement the EVMClientSubscription interface
type AvalancheHash ¶
AvalancheHash wraps a transaction hash to implement the EVMHash interface
type AvalancheHeader ¶
AvalancheHeader wraps a block header to implement the EVMHeader interface
func (*AvalancheHeader) Difficulty ¶
func (h *AvalancheHeader) Difficulty() *big.Int
Difficulty returns the block difficulty
func (*AvalancheHeader) Hash ¶
func (h *AvalancheHeader) Hash() string
Hash returns the block hash as a hex string
func (*AvalancheHeader) Number ¶
func (h *AvalancheHeader) Number() *big.Int
Number returns the block number
type AvalancheNewBlock ¶
type AvalancheNewBlock struct {
// contains filtered or unexported fields
}
AvalancheNewBlock wraps a block header channel to implement the EVMNewBlockSubscriber interface
func (*AvalancheNewBlock) Channel ¶
func (s *AvalancheNewBlock) Channel() interface{}
Channel returns the underlying channel as an empty interface
type AvalancheNewTx ¶
type AvalancheNewTx struct {
// contains filtered or unexported fields
}
AvalancheNewTx wraps a transaction hash channel to conform with the EVMNewTxSubscriber interface
func (*AvalancheNewTx) Channel ¶
func (s *AvalancheNewTx) Channel() interface{}
Channel returns the underlying channel as an empty interface
type AvalancheRPC ¶
type AvalancheRPC struct { *eth.EthereumRPC // contains filtered or unexported fields }
AvalancheRPC is an interface to JSON-RPC avalanche service.
func (*AvalancheRPC) EthereumTypeEstimateGas ¶
func (b *AvalancheRPC) EthereumTypeEstimateGas(params map[string]interface{}) (uint64, error)
EthereumTypeEstimateGas returns estimation of gas consumption for given transaction parameters
func (*AvalancheRPC) GetChainInfo ¶
func (b *AvalancheRPC) GetChainInfo() (*bchain.ChainInfo, error)
GetChainInfo returns information about the connected backend
func (*AvalancheRPC) Initialize ¶
func (b *AvalancheRPC) Initialize() error
Initialize avalanche rpc interface
type AvalancheRPCClient ¶
AvalancheRPCClient wraps an rpc client to implement the EVMRPCClient interface
func (*AvalancheRPCClient) CallContext ¶
func (c *AvalancheRPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
CallContext performs a JSON-RPC call with the given arguments
func (*AvalancheRPCClient) EthSubscribe ¶
func (c *AvalancheRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (bchain.EVMClientSubscription, error)
EthSubscribe subscribes to events and returns a client subscription that implements the EVMClientSubscription interface