Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) AdminAPI() *admin.Client
- func (c *Client) CChaiConcurrentEth() *ConcurrentEthClient
- func (c *Client) CChainAPI() *evm.Client
- func (c *Client) CChainEthAPI() *ethclient.Client
- func (c *Client) HealthAPI() *health.Client
- func (c *Client) InfoAPI() *info.Client
- func (c *Client) IpcsAPI() *ipcs.Client
- func (c *Client) KeystoreAPI() *keystore.Client
- func (c *Client) PChainAPI() *platformvm.Client
- func (c *Client) Reconnect() *Client
- func (c *Client) XChainAPI() *avm.Client
- type ConcurrentEthClient
- func (c *ConcurrentEthClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (c *ConcurrentEthClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (c *ConcurrentEthClient) BlockNumber(ctx context.Context) (uint64, error)
- func (c *ConcurrentEthClient) Close()
- func (c *ConcurrentEthClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (c *ConcurrentEthClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
Constants ¶
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 (*Client) CChaiConcurrentEth ¶
func (c *Client) CChaiConcurrentEth() *ConcurrentEthClient
CChaiConcurrentEth wraps the ethclient.Client in a concurrency-safe implementation
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.