Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusSuccess = "success" StatusFail = "fail" // NonceKey is the name of the key in the Metadata map inside a // ConstructionMetadataResponse that specifies the next valid nonce. NonceKey = "nonce" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IoTexClient ¶
type IoTexClient interface {
// GetChainID returns the network chain context, derived from the
// genesis document.
GetChainID(ctx context.Context) (string, error)
// GetBlock returns the IoTex block at given height.
GetBlock(ctx context.Context, height int64) (*types.Block, error)
// GetLatestBlock returns latest IoTex block.
GetLatestBlock(ctx context.Context) (*types.Block, error)
// GetGenesisBlock returns the IoTex genesis block.
GetGenesisBlock(ctx context.Context) (*types.Block, error)
// GetAccount returns the IoTex staking account for given owner address
// at given height.
GetAccount(ctx context.Context, height int64, owner string) (*types.AccountBalanceResponse, error)
// SubmitTx submits the given encoded transaction to the node.
SubmitTx(ctx context.Context, tx *iotextypes.Action) (txid string, err error)
// GetStatus returns the status overview of the node.
GetStatus(ctx context.Context) (*iotexapi.GetChainMetaResponse, error)
// GetVersion returns the server's version.
GetVersion(ctx context.Context) (*iotexapi.GetServerMetaResponse, error)
// GetTransactions returns transactions of the block.
GetTransactions(ctx context.Context, height int64) ([]*types.Transaction, error)
// GetConfig returns the config.
GetConfig() *config.Config
SuggestGasPrice(ctx context.Context) (uint64, error)
EstimateGasForAction(ctx context.Context, action *iotextypes.Action) (uint64, error)
GetBlockTransaction(ctx context.Context, actionHash string) (*types.Transaction, error)
GetMemPool(ctx context.Context, actionHashes []string) ([]*types.TransactionIdentifier, error)
GetMemPoolTransaction(ctx context.Context, h string) (*types.Transaction, error)
}
IoTexClient is the IoTex blockchain client interface.
func NewIoTexClient ¶
func NewIoTexClient(cfg *config.Config) (cli IoTexClient, err error)
NewIoTexClient returns an implementation of IoTexClient
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_client is a generated GoMock package.
|
Package mock_client is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.