avalanchegoclient

package
v0.0.0-...-91837a0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XChain = "X"
	CChain = "C"
)

Chain names

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a general client for avalanche

func NewClient

func NewClient(ipAddr string, port int, requestTimeout time.Duration) *Client

NewClient returns a Client for interacting with the Chain endpoints

func (*Client) AdminAPI

func (c *Client) AdminAPI() *admin.Client

AdminAPI ...

func (*Client) CChaiConcurrentEth

func (c *Client) CChaiConcurrentEth() *ConcurrentEthClient

CChaiConcurrentEth wraps the ethclient.Client in a concurrency-safe implementation

func (*Client) CChainAPI

func (c *Client) CChainAPI() *evm.Client

CChainAPI ...

func (*Client) CChainEthAPI

func (c *Client) CChainEthAPI() *ethclient.Client

CChainEthAPI

func (*Client) HealthAPI

func (c *Client) HealthAPI() *health.Client

HealthAPI ...

func (*Client) InfoAPI

func (c *Client) InfoAPI() *info.Client

InfoAPI ...

func (*Client) IpcsAPI

func (c *Client) IpcsAPI() *ipcs.Client

IpcsAPI ...

func (*Client) KeystoreAPI

func (c *Client) KeystoreAPI() *keystore.Client

KeystoreAPI ...

func (*Client) PChainAPI

func (c *Client) PChainAPI() *platformvm.Client

PChainAPI ...

func (*Client) Reconnect

func (c *Client) Reconnect() *Client

func (*Client) XChainAPI

func (c *Client) XChainAPI() *avm.Client

XChainAPI ...

type ConcurrentEthClient

type ConcurrentEthClient struct {
	// contains filtered or unexported fields
}

ConcurrentEthClient is a concurrency-safe implementation of ethclient.Client that allows for multiple concurrent requests to be made to a single *services.Client.

func NewConcurrentEthClient

func NewConcurrentEthClient(client *ethclient.Client) *ConcurrentEthClient

NewConcurrentEthClient ...

func (*ConcurrentEthClient) BalanceAt

func (c *ConcurrentEthClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

BalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.

func (*ConcurrentEthClient) BlockByNumber

func (c *ConcurrentEthClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.

Note that loading full blocks requires two requests. Use HeaderByNumber if you don't need all transactions or uncle headers.

func (*ConcurrentEthClient) BlockNumber

func (c *ConcurrentEthClient) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the most recent block number

func (*ConcurrentEthClient) Close

func (c *ConcurrentEthClient) Close()

Close terminates the client's connection.

func (*ConcurrentEthClient) SendTransaction

func (c *ConcurrentEthClient) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction injects a signed transaction into the pending pool for execution.

If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.

func (*ConcurrentEthClient) TransactionReceipt

func (c *ConcurrentEthClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

TransactionReceipt returns the receipt of a transaction by transaction hash. Note that the receipt is not available for pending transactions.

Jump to

Keyboard shortcuts

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