api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

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 odysseygo apis (or suitable wrappers)

func (APIClient) AChainAPI

func (c APIClient) AChainAPI() alpha.Client

func (APIClient) AChainWalletAPI

func (c APIClient) AChainWalletAPI() alpha.WalletClient

func (APIClient) AdminAPI

func (c APIClient) AdminAPI() admin.Client

func (APIClient) DChainAPI

func (c APIClient) DChainAPI() delta.Client

func (APIClient) DChainEthAPI

func (c APIClient) DChainEthAPI() EthClient

func (APIClient) DChainIndexAPI

func (c APIClient) DChainIndexAPI() indexer.Client

func (APIClient) HealthAPI

func (c APIClient) HealthAPI() health.Client

func (APIClient) InfoAPI

func (c APIClient) InfoAPI() info.Client

func (APIClient) IpcsAPI

func (c APIClient) IpcsAPI() ipcs.Client

func (APIClient) KeystoreAPI

func (c APIClient) KeystoreAPI() keystore.Client

func (APIClient) OChainAPI

func (c APIClient) OChainAPI() omegavm.Client

func (APIClient) OChainIndexAPI

func (c APIClient) OChainIndexAPI() indexer.Client

type Client

type Client interface {
	OChainAPI() omegavm.Client
	AChainAPI() alpha.Client
	AChainWalletAPI() alpha.WalletClient
	DChainAPI() delta.Client
	DChainEthAPI() EthClient // ethclient websocket wrapper that adds mutexed calls, and lazy conn init (on first call)
	InfoAPI() info.Client
	HealthAPI() health.Client
	IpcsAPI() ipcs.Client
	KeystoreAPI() keystore.Client
	AdminAPI() admin.Client
	OChainIndexAPI() indexer.Client
	DChainIndexAPI() indexer.Client
}

Issues API calls to a node TODO: byzantine api. check if appropriate. improve implementation.

func NewAPIClient

func NewAPIClient(ipAddr string, port uint16) Client

NewAPIClient initialize most of odysseygo apis

type EthClient

type EthClient interface {
	Close()
	SendTransaction(context.Context, *types.Transaction) error
	TransactionReceipt(context.Context, common.Hash) (*types.Receipt, error)
	BalanceAt(context.Context, common.Address, *big.Int) (*big.Int, error)
	BlockByNumber(context.Context, *big.Int) (*types.Block, error)
	BlockByHash(context.Context, common.Hash) (*types.Block, error)
	BlockNumber(context.Context) (uint64, error)
	CallContract(context.Context, interfaces.CallMsg, *big.Int) ([]byte, error)
	NonceAt(context.Context, common.Address, *big.Int) (uint64, error)
	AssetBalanceAt(context.Context, common.Address, ids.ID, *big.Int) (*big.Int, error)
	SuggestGasPrice(context.Context) (*big.Int, error)
	AcceptedCodeAt(context.Context, common.Address) ([]byte, error)
	AcceptedNonceAt(context.Context, common.Address) (uint64, error)
	CodeAt(context.Context, common.Address, *big.Int) ([]byte, error)
	EstimateGas(context.Context, interfaces.CallMsg) (uint64, error)
	AcceptedCallContract(context.Context, interfaces.CallMsg) ([]byte, error)
	HeaderByNumber(context.Context, *big.Int) (*types.Header, error)
	SuggestGasTipCap(context.Context) (*big.Int, error)
	FilterLogs(context.Context, interfaces.FilterQuery) ([]types.Log, error)
	SubscribeFilterLogs(context.Context, interfaces.FilterQuery, chan<- types.Log) (interfaces.Subscription, error)
}

func NewEthClient

func NewEthClient(ipAddr string, port uint) EthClient

NewEthClient mainly takes ip/port info for usage in future calls Connection can't be initialized in constructor because node is not ready when the constructor is called It follows convention of most odysseygo api constructors that can be called without having a ready node

func NewEthClientWithChainID

func NewEthClientWithChainID(ipAddr string, port uint, chainID string) EthClient

NewEthClientWithChainID creates an EthClient initialized to connect to ipAddr/port and communicate with the given chainID.

type NewAPIClientF

type NewAPIClientF func(ipAddr string, port uint16) Client

Returns a new API client for a node at [ipAddr]:[port].

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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