Documentation
¶
Index ¶
- type APIClient
- func (c APIClient) AdminAPI() *admin.Client
- func (c APIClient) CChainAPI() interface{}
- func (c APIClient) CChainEthAPI() EthClient
- func (c APIClient) CChainIndexAPI() *indexer.Client
- func (c APIClient) HealthAPI() HealthClient
- func (c APIClient) InfoAPI() *info.Client
- func (c APIClient) PChainAPI() *platformvm.Client
- func (c APIClient) PChainIndexAPI() *indexer.Client
- func (c APIClient) XChainAPI() *exchangevm.Client
- func (c APIClient) XChainWalletAPI() *exchangevm.WalletClient
- type Client
- type EthClient
- type HealthClient
- type NewAPIClientF
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient gives access to most node apis (or suitable wrappers)
func (APIClient) CChainEthAPI ¶
func (APIClient) CChainIndexAPI ¶
func (APIClient) HealthAPI ¶
func (c APIClient) HealthAPI() HealthClient
func (APIClient) PChainAPI ¶
func (c APIClient) PChainAPI() *platformvm.Client
func (APIClient) PChainIndexAPI ¶
func (APIClient) XChainAPI ¶
func (c APIClient) XChainAPI() *exchangevm.Client
func (APIClient) XChainWalletAPI ¶
func (c APIClient) XChainWalletAPI() *exchangevm.WalletClient
type Client ¶
type Client interface {
PChainAPI() *platformvm.Client
XChainAPI() *exchangevm.Client
XChainWalletAPI() *exchangevm.WalletClient
CChainAPI() interface{} // evmclient.Client
CChainEthAPI() EthClient // ethclient websocket wrapper that adds mutexed calls, and lazy conn init (on first call)
InfoAPI() *info.Client
HealthAPI() HealthClient
AdminAPI() *admin.Client
PChainIndexAPI() *indexer.Client
CChainIndexAPI() *indexer.Client
}
Issues API calls to a node TODO: byzantine api. check if appropriate. improve implementation.
func NewAPIClient ¶
NewAPIClient initialize most of node apis
type EthClient ¶
type EthClient interface {
// Balance operations
BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
// Block operations
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
BlockNumber(ctx context.Context) (uint64, error)
HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
// Transaction operations
SendTransaction(ctx context.Context, tx *types.Transaction) error
TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
// Contract operations
CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
AcceptedCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
AcceptedCodeAt(ctx context.Context, account common.Address) ([]byte, error)
// Nonce operations
NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
AcceptedNonceAt(ctx context.Context, account common.Address) (uint64, error)
// Gas operations
EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
SuggestGasPrice(ctx context.Context) (*big.Int, error)
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
// Log operations
FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
// Connection management
Close()
}
EthClient is the interface for ethereum client operations
func NewEthClient ¶
NewEthClient creates a new EthClient stub for testing This is a minimal implementation that returns reasonable test values
type HealthClient ¶ added in v1.6.1
type HealthClient interface {
Readiness(ctx context.Context, tags []string, options ...rpc.Option) (*health.APIReply, error)
Health(ctx context.Context, tags []string, options ...rpc.Option) (*health.APIReply, error)
Liveness(ctx context.Context, tags []string, options ...rpc.Option) (*health.APIReply, error)
}
HealthClient is the interface for health API client operations
type NewAPIClientF ¶
Returns a new API client for a node at [ipAddr]:[port].
Click to show internal directories.
Click to hide internal directories.