avalanche

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
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

type AvalancheClient struct {
	ethclient.Client
}

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

func (*AvalancheClient) NonceAt

func (c *AvalancheClient) NonceAt(ctx context.Context, addrDesc bchain.AddressDescriptor, blockNumber *big.Int) (uint64, error)

NonceAt returns the nonce for the given account at a specific block, or latest known block if no block number is provided

type AvalancheClientSubscription

type AvalancheClientSubscription struct {
	*rpc.ClientSubscription
}

AvalancheClientSubscription wraps a client subcription to implement the EVMClientSubscription interface

type AvalancheHash

type AvalancheHash struct {
	common.Hash
}

AvalancheHash wraps a transaction hash to implement the EVMHash interface

type AvalancheHeader

type AvalancheHeader struct {
	*types.Header
}

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

func (*AvalancheNewBlock) Close

func (s *AvalancheNewBlock) Close()

Close the underlying channel

func (*AvalancheNewBlock) Read

func (s *AvalancheNewBlock) Read() (bchain.EVMHeader, bool)

Read from the underlying channel and return a block header that implements the EVMHeader 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

func (*AvalancheNewTx) Close

func (s *AvalancheNewTx) Close()

Close the underlying channel

func (*AvalancheNewTx) Read

func (s *AvalancheNewTx) Read() (bchain.EVMHash, bool)

Read from the underlying channel and return a transaction hash that implements the EVMHash 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

type AvalancheRPCClient struct {
	*rpc.Client
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL