Documentation ¶
Index ¶
- Variables
- type BlockIssuerClient
- type Client
- func (client *Client) APIForEpoch(epoch iotago.EpochIndex) iotago.API
- func (client *Client) APIForSlot(slot iotago.SlotIndex) iotago.API
- func (client *Client) APIForTime(t time.Time) iotago.API
- func (client *Client) APIForVersion(version iotago.Version) (iotago.API, error)
- func (client *Client) BlockByBlockID(ctx context.Context, blockID iotago.BlockID) (*iotago.Block, error)
- func (client *Client) BlockIssuance(ctx context.Context) (*api.IssuanceBlockHeaderResponse, error)
- func (client *Client) BlockIssuer(ctx context.Context) (BlockIssuerClient, error)
- func (client *Client) BlockMetadataByBlockID(ctx context.Context, blockID iotago.BlockID) (*api.BlockMetadataResponse, error)
- func (client *Client) BlockWithMetadataByBlockID(ctx context.Context, blockID iotago.BlockID) (*api.BlockWithMetadataResponse, error)
- func (client *Client) CommitmentByID(ctx context.Context, commitmentID iotago.CommitmentID) (*iotago.Commitment, error)
- func (client *Client) CommitmentBySlot(ctx context.Context, slot iotago.SlotIndex) (*iotago.Commitment, error)
- func (client *Client) CommitmentUTXOChangesByID(ctx context.Context, commitmentID iotago.CommitmentID) (*api.UTXOChangesResponse, error)
- func (client *Client) CommitmentUTXOChangesBySlot(ctx context.Context, slot iotago.SlotIndex) (*api.UTXOChangesResponse, error)
- func (client *Client) CommitmentUTXOChangesFullByID(ctx context.Context, commitmentID iotago.CommitmentID) (*api.UTXOChangesFullResponse, error)
- func (client *Client) CommitmentUTXOChangesFullBySlot(ctx context.Context, slot iotago.SlotIndex) (*api.UTXOChangesFullResponse, error)
- func (client *Client) CommittedAPI() iotago.API
- func (client *Client) Committee(ctx context.Context, optEpochIndex ...iotago.EpochIndex) (*api.CommitteeResponse, error)
- func (client *Client) Congestion(ctx context.Context, accountAddress *iotago.AccountAddress, ...) (*api.CongestionResponse, error)
- func (client *Client) Do(ctx context.Context, method string, route string, reqObj interface{}, ...) (*http.Response, error)
- func (client *Client) DoWithRequestHeaderHook(ctx context.Context, method string, route string, ...) (*http.Response, error)
- func (client *Client) EventAPI(ctx context.Context) (*EventAPIClient, error)
- func (client *Client) HTTPClient() *http.Client
- func (client *Client) Health(ctx context.Context) (bool, error)
- func (client *Client) Indexer(ctx context.Context) (IndexerClient, error)
- func (client *Client) Info(ctx context.Context) (*api.InfoResponse, error)
- func (client *Client) LatestAPI() iotago.API
- func (client *Client) Management(ctx context.Context) (ManagementClient, error)
- func (client *Client) NetworkHealth(ctx context.Context) (bool, error)
- func (client *Client) NetworkMetrics(ctx context.Context) (*api.NetworkMetricsResponse, error)
- func (client *Client) NodeSupportsRoute(ctx context.Context, route string) (bool, error)
- func (client *Client) OutputByID(ctx context.Context, outputID iotago.OutputID) (iotago.Output, error)
- func (client *Client) OutputMetadataByID(ctx context.Context, outputID iotago.OutputID) (*api.OutputMetadata, error)
- func (client *Client) OutputWithMetadataByID(ctx context.Context, outputID iotago.OutputID) (iotago.Output, *api.OutputMetadata, error)
- func (client *Client) Rewards(ctx context.Context, outputID iotago.OutputID) (*api.ManaRewardsResponse, error)
- func (client *Client) Routes(ctx context.Context) (*api.RoutesResponse, error)
- func (client *Client) SubmitBlock(ctx context.Context, m *iotago.Block) (iotago.BlockID, error)
- func (client *Client) TransactionByID(ctx context.Context, txID iotago.TransactionID) (*iotago.Transaction, error)
- func (client *Client) TransactionIncludedBlock(ctx context.Context, txID iotago.TransactionID) (*iotago.Block, error)
- func (client *Client) TransactionIncludedBlockMetadata(ctx context.Context, txID iotago.TransactionID) (*api.BlockMetadataResponse, error)
- func (client *Client) TransactionMetadata(ctx context.Context, txID iotago.TransactionID) (*api.TransactionMetadataResponse, error)
- func (client *Client) Validator(ctx context.Context, accountAddress *iotago.AccountAddress) (*api.ValidatorResponse, error)
- func (client *Client) Validators(ctx context.Context, pageSize uint64, cursor ...string) (*api.ValidatorsResponse, error)
- func (client *Client) ValidatorsAll(ctx context.Context, maxPages ...int) (validators *api.ValidatorsResponse, allRetrieved bool, err error)
- type ClientOption
- type ClientOptions
- type EventAPIClient
- func (eac *EventAPIClient) BlockMetadataAcceptedBlocks() (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlockMetadataByBlockID(blockID iotago.BlockID) (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlockMetadataConfirmedBlocks() (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlockMetadataTransactionIncludedBlocksByTransactionID(txID iotago.TransactionID) (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) Blocks() (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksBasic() (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksBasicWithTaggedData() (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksBasicWithTaggedDataByTag(tag []byte) (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksBasicWithTransactions() (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksBasicWithTransactionsWithTaggedData() (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksBasicWithTransactionsWithTaggedDataByTag(tag []byte) (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) BlocksValidation() (<-chan *iotago.Block, *EventAPIClientSubscription)
- func (eac *EventAPIClient) Close()
- func (eac *EventAPIClient) CommitmentsFinalized() (<-chan *iotago.Commitment, *EventAPIClientSubscription)
- func (eac *EventAPIClient) CommitmentsLatest() (<-chan *iotago.Commitment, *EventAPIClientSubscription)
- func (eac *EventAPIClient) Connect(ctx context.Context) error
- func (eac *EventAPIClient) OutputWithMetadataByOutputID(outputID iotago.OutputID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) OutputsWithMetadataByAccountID(accountID iotago.AccountID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) OutputsWithMetadataByAnchorID(anchorID iotago.AnchorID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) OutputsWithMetadataByDelegationID(delegationID iotago.DelegationID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) OutputsWithMetadataByFoundryID(foundryID iotago.FoundryID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) OutputsWithMetadataByNFTID(nftID iotago.NFTID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) OutputsWithMetadataByUnlockConditionAndAddress(condition api.EventAPIUnlockCondition, addr iotago.Address) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
- func (eac *EventAPIClient) TransactionMetadataByTransactionID(txID iotago.TransactionID) (<-chan *api.TransactionMetadataResponse, *EventAPIClientSubscription)
- type EventAPIClientSubscription
- type HTTPErrorResponseEnvelope
- type IndexerClient
- type IndexerQuery
- type IndexerResultSet
- type ManagementClient
- type RawDataEnvelope
- type RequestHeaderHook
- type RequestURLHook
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHTTPBadRequest gets returned for 400 bad request HTTP responses. ErrHTTPBadRequest = ierrors.New("bad request") // ErrHTTPInternalServerError gets returned for 500 internal server error HTTP responses. ErrHTTPInternalServerError = ierrors.New("internal server error") // ErrHTTPNotFound gets returned for 404 not found error HTTP responses. ErrHTTPNotFound = ierrors.New("not found") ErrHTTPUnauthorized = ierrors.New("unauthorized") // ErrHTTPUnknownError gets returned for unknown error HTTP responses. ErrHTTPUnknownError = ierrors.New("unknown error") // ErrHTTPNotImplemented gets returned for 501 not implemented error HTTP responses. ErrHTTPNotImplemented = ierrors.New("operation not implemented/supported/available") ErrHTTPServiceUnavailable = ierrors.New("service unavailable") )
var ( // ErrManagementPluginNotAvailable is returned when the Management plugin is not available on the node. ErrManagementPluginNotAvailable = ierrors.New("management plugin not available on the current node") // ErrIndexerPluginNotAvailable is returned when the indexer plugin is not available on the node. ErrIndexerPluginNotAvailable = ierrors.New("indexer plugin not available on the current node") // ErrMQTTPluginNotAvailable is returned when the MQTT plugin is not available on the node. ErrMQTTPluginNotAvailable = ierrors.New("mqtt plugin not available on the current node") // ErrBlockIssuerPluginNotAvailable is returned when the BlockIssuer plugin is not available on the node. ErrBlockIssuerPluginNotAvailable = ierrors.New("blockissuer plugin not available on the current node") )
var ( // RequestHeaderHookAcceptJSON is used to set the request "Accept" header to MIMEApplicationJSON. RequestHeaderHookAcceptJSON = func(header http.Header) { header.Set("Accept", api.MIMEApplicationJSON) } // RequestHeaderHookAcceptIOTASerializerV2 is used to set the request "Accept" header to MIMEApplicationVendorIOTASerializerV2. RequestHeaderHookAcceptIOTASerializerV2 = func(header http.Header) { header.Set("Accept", api.MIMEApplicationVendorIOTASerializerV2) } // RequestHeaderHookContentTypeIOTASerializerV2 is used to set the request "Content-Type" header to MIMEApplicationVendorIOTASerializerV2. RequestHeaderHookContentTypeIOTASerializerV2 = func(header http.Header) { header.Set("Content-Type", api.MIMEApplicationVendorIOTASerializerV2) } )
var ( // ErrEventAPIClientInactive gets returned when an EventAPIClient is inactive. ErrEventAPIClientInactive = ierrors.New("event api client is inactive") )
var ( // ErrIndexerNotFound gets returned when the indexer doesn't find any result. // Only applicable to single element queries. ErrIndexerNotFound = ierrors.New("no result found") )
Functions ¶
This section is empty.
Types ¶
type BlockIssuerClient ¶
type BlockIssuerClient interface { // Info returns the info of the block issuer. Info(ctx context.Context) (*api.BlockIssuerInfo, error) // SendPayload sends an ApplicationPayload to the block issuer. SendPayload(ctx context.Context, payload iotago.ApplicationPayload, commitmentID iotago.CommitmentID, numPoWWorkers ...int) (*api.BlockCreatedResponse, error) // SendPayloadWithTransactionBuilder automatically allots the needed mana and sends an ApplicationPayload to the block issuer. SendPayloadWithTransactionBuilder(ctx context.Context, builder *builder.TransactionBuilder, storedManaOutputIndex int, numPoWWorkers ...int) (iotago.ApplicationPayload, *api.BlockCreatedResponse, error) }
BlockIssuerClient is a client which queries the optional blockissuer functionality of a node.
type Client ¶
type Client struct { // The base URL for all API calls. BaseURL string // contains filtered or unexported fields }
Client is a client for node HTTP REST API endpoints.
func New ¶
func New(baseURL string, opts ...ClientOption) (*Client, error)
New returns a new Client using the given base URL. This constructor will automatically call Client.Info() in order to initialize the Client with the appropriate protocol parameters and latest iotago.API version (use WithIOTAGoAPI() to override this behavior).
func (*Client) APIForEpoch ¶
func (client *Client) APIForEpoch(epoch iotago.EpochIndex) iotago.API
func (*Client) APIForVersion ¶
func (*Client) BlockByBlockID ¶
func (client *Client) BlockByBlockID(ctx context.Context, blockID iotago.BlockID) (*iotago.Block, error)
BlockByBlockID get a block by its block ID from the node.
func (*Client) BlockIssuance ¶
BlockIssuance gets the info to issue a block.
func (*Client) BlockIssuer ¶
func (client *Client) BlockIssuer(ctx context.Context) (BlockIssuerClient, error)
BlockIssuer returns the BlockIssuerClient. Returns ErrBlockIssuerPluginNotAvailable if the current node does not support the plugin.
func (*Client) BlockMetadataByBlockID ¶
func (client *Client) BlockMetadataByBlockID(ctx context.Context, blockID iotago.BlockID) (*api.BlockMetadataResponse, error)
BlockMetadataByBlockID gets the metadata of a block by its ID from the node.
func (*Client) BlockWithMetadataByBlockID ¶
func (client *Client) BlockWithMetadataByBlockID(ctx context.Context, blockID iotago.BlockID) (*api.BlockWithMetadataResponse, error)
BlockWithMetadataByBlockID gets a block by its ID, together with the metadata from the node.
func (*Client) CommitmentByID ¶
func (client *Client) CommitmentByID(ctx context.Context, commitmentID iotago.CommitmentID) (*iotago.Commitment, error)
CommitmentByID gets a commitment details by its ID.
func (*Client) CommitmentBySlot ¶
func (client *Client) CommitmentBySlot(ctx context.Context, slot iotago.SlotIndex) (*iotago.Commitment, error)
CommitmentBySlot gets a commitment details by its slot.
func (*Client) CommitmentUTXOChangesByID ¶
func (client *Client) CommitmentUTXOChangesByID(ctx context.Context, commitmentID iotago.CommitmentID) (*api.UTXOChangesResponse, error)
CommitmentUTXOChangesByID returns all UTXO changes of a commitment by its ID.
func (*Client) CommitmentUTXOChangesBySlot ¶
func (client *Client) CommitmentUTXOChangesBySlot(ctx context.Context, slot iotago.SlotIndex) (*api.UTXOChangesResponse, error)
CommitmentUTXOChangesBySlot returns all UTXO changes of a commitment by its slot.
func (*Client) CommitmentUTXOChangesFullByID ¶
func (client *Client) CommitmentUTXOChangesFullByID(ctx context.Context, commitmentID iotago.CommitmentID) (*api.UTXOChangesFullResponse, error)
CommitmentUTXOChangesFullByID returns all UTXO changes (including outputs) of a commitment by its ID.
func (*Client) CommitmentUTXOChangesFullBySlot ¶
func (client *Client) CommitmentUTXOChangesFullBySlot(ctx context.Context, slot iotago.SlotIndex) (*api.UTXOChangesFullResponse, error)
CommitmentUTXOChangesFullBySlot returns all UTXO changes (including outputs) of a commitment by its slot.
func (*Client) CommittedAPI ¶
func (*Client) Committee ¶
func (client *Client) Committee(ctx context.Context, optEpochIndex ...iotago.EpochIndex) (*api.CommitteeResponse, error)
Committee gets the committee of the given epoch index.
func (*Client) Congestion ¶
func (client *Client) Congestion(ctx context.Context, accountAddress *iotago.AccountAddress, workScore iotago.WorkScore, optCommitmentID ...iotago.CommitmentID) (*api.CongestionResponse, error)
Congestion gets the congestion of the node.
func (*Client) Do ¶
func (client *Client) Do(ctx context.Context, method string, route string, reqObj interface{}, resObj interface{}) (*http.Response, error)
Do executes a request against the endpoint. This function is only meant to be used for special routes not covered through the standard API.
func (*Client) DoWithRequestHeaderHook ¶
func (client *Client) DoWithRequestHeaderHook(ctx context.Context, method string, route string, requestHeaderHook RequestHeaderHook, reqObj interface{}, resObj interface{}) (*http.Response, error)
DoWithRequestHeaderHook executes a request against the endpoint. This function is only meant to be used for special routes not covered through the standard API.
func (*Client) EventAPI ¶
func (client *Client) EventAPI(ctx context.Context) (*EventAPIClient, error)
EventAPI returns the EventAPIClient if supported by the node. Returns ErrMQTTPluginNotAvailable if the current node does not support the plugin.
func (*Client) HTTPClient ¶
HTTPClient returns the underlying HTTP client.
func (*Client) Indexer ¶
func (client *Client) Indexer(ctx context.Context) (IndexerClient, error)
Indexer returns the IndexerClient. Returns ErrIndexerPluginNotAvailable if the current node does not support the plugin.
func (*Client) Management ¶
func (client *Client) Management(ctx context.Context) (ManagementClient, error)
Management returns the ManagementClient. Returns ErrManagementPluginNotAvailable if the current node does not support the plugin.
func (*Client) NetworkHealth ¶
NetworkHealth returns whether the network is healthy (finalization is not delayed).
func (*Client) NetworkMetrics ¶
NetworkMetrics gets the current network metrics.
func (*Client) NodeSupportsRoute ¶
NodeSupportsRoute gets the routes of the node and checks if the given route is enabled.
func (*Client) OutputByID ¶
func (client *Client) OutputByID(ctx context.Context, outputID iotago.OutputID) (iotago.Output, error)
OutputByID gets an output by its ID from the node.
func (*Client) OutputMetadataByID ¶
func (client *Client) OutputMetadataByID(ctx context.Context, outputID iotago.OutputID) (*api.OutputMetadata, error)
OutputMetadataByID gets an output's metadata by its ID from the node without getting the output data again.
func (*Client) OutputWithMetadataByID ¶
func (client *Client) OutputWithMetadataByID(ctx context.Context, outputID iotago.OutputID) (iotago.Output, *api.OutputMetadata, error)
OutputWithMetadataByID gets an output by its ID, together with the metadata from the node.
func (*Client) Rewards ¶
func (client *Client) Rewards(ctx context.Context, outputID iotago.OutputID) (*api.ManaRewardsResponse, error)
Rewards gets the mana rewards of the given output.
func (*Client) SubmitBlock ¶
SubmitBlock submits the given Block to the node. The node will take care of filling missing information. This function returns the blockID of the finalized block. To get the finalized block you need to call "BlockByBlockID".
func (*Client) TransactionByID ¶
func (client *Client) TransactionByID(ctx context.Context, txID iotago.TransactionID) (*iotago.Transaction, error)
TransactionByID gets a transaction by its ID from the node.
func (*Client) TransactionIncludedBlock ¶
func (client *Client) TransactionIncludedBlock(ctx context.Context, txID iotago.TransactionID) (*iotago.Block, error)
TransactionIncludedBlock get a block that included the given transaction ID in the ledger.
func (*Client) TransactionIncludedBlockMetadata ¶
func (client *Client) TransactionIncludedBlockMetadata(ctx context.Context, txID iotago.TransactionID) (*api.BlockMetadataResponse, error)
TransactionIncludedBlockMetadata gets the metadata of a block by its ID from the node.
func (*Client) TransactionMetadata ¶
func (client *Client) TransactionMetadata(ctx context.Context, txID iotago.TransactionID) (*api.TransactionMetadataResponse, error)
TransactionMetadata gets the metadata of a transaction by its ID from the node.
func (*Client) Validator ¶
func (client *Client) Validator(ctx context.Context, accountAddress *iotago.AccountAddress) (*api.ValidatorResponse, error)
Validator gets the validator response of the given account address.
func (*Client) Validators ¶
func (client *Client) Validators(ctx context.Context, pageSize uint64, cursor ...string) (*api.ValidatorsResponse, error)
Validators gets the validators from the node with the given page size and cursor.
func (*Client) ValidatorsAll ¶
func (client *Client) ValidatorsAll(ctx context.Context, maxPages ...int) (validators *api.ValidatorsResponse, allRetrieved bool, err error)
ValidatorsAll gets all validators from the node.
type ClientOption ¶
type ClientOption func(opts *ClientOptions)
ClientOption is a function setting a Client option.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets the used HTTP Client.
func WithRequestURLHook ¶
func WithRequestURLHook(requestURLHook RequestURLHook) ClientOption
WithRequestURLHook is used to modify the URL before sending a request.
func WithUserInfo ¶
func WithUserInfo(userInfo *url.Userinfo) ClientOption
WithUserInfo sets the Userinfo used to add basic auth "Authorization" headers to the requests.
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
ClientOptions define options for the Client.
type EventAPIClient ¶
type EventAPIClient struct { Client *Client MQTTClient mqtt.Client // A channel up on which errors are returned from within subscriptions or when the connection is lost. // Errors are dropped silently if no receiver is listening for them or can consume them fast enough. Errors chan error // contains filtered or unexported fields }
EventAPIClient represents a handle to retrieve channels for node events. Any registration will panic if the EventAPIClient.Ctx is done or the client isn't connected. Multiple calls to the same channel registration will override the previously created channel.
func (*EventAPIClient) BlockMetadataAcceptedBlocks ¶
func (eac *EventAPIClient) BlockMetadataAcceptedBlocks() (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
BlockMetadataAcceptedBlocks returns a channel of BlockMetadataResponse of newly accepted blocks.
func (*EventAPIClient) BlockMetadataByBlockID ¶
func (eac *EventAPIClient) BlockMetadataByBlockID(blockID iotago.BlockID) (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
BlockMetadataByBlockID returns a channel of BlockMetadataResponse each time the given block's state changes.
func (*EventAPIClient) BlockMetadataConfirmedBlocks ¶
func (eac *EventAPIClient) BlockMetadataConfirmedBlocks() (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
BlockMetadataConfirmedBlocks returns a channel of BlockMetadataResponse of newly confirmed blocks.
func (*EventAPIClient) BlockMetadataTransactionIncludedBlocksByTransactionID ¶
func (eac *EventAPIClient) BlockMetadataTransactionIncludedBlocksByTransactionID(txID iotago.TransactionID) (<-chan *api.BlockMetadataResponse, *EventAPIClientSubscription)
BlockMetadataTransactionIncludedBlocksByTransactionID returns a channel of BlockMetadataResponse of blocks which carry the transaction with the given ID.
func (*EventAPIClient) Blocks ¶
func (eac *EventAPIClient) Blocks() (<-chan *iotago.Block, *EventAPIClientSubscription)
Blocks returns a channel of newly received blocks.
func (*EventAPIClient) BlocksBasic ¶
func (eac *EventAPIClient) BlocksBasic() (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksBasic returns a channel of newly received basic blocks.
func (*EventAPIClient) BlocksBasicWithTaggedData ¶
func (eac *EventAPIClient) BlocksBasicWithTaggedData() (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksBasicWithTaggedData returns a channel of blocks containing tagged data containing the given tag.
func (*EventAPIClient) BlocksBasicWithTaggedDataByTag ¶
func (eac *EventAPIClient) BlocksBasicWithTaggedDataByTag(tag []byte) (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksBasicWithTaggedDataByTag returns a channel of blocks containing tagged data.
func (*EventAPIClient) BlocksBasicWithTransactions ¶
func (eac *EventAPIClient) BlocksBasicWithTransactions() (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksBasicWithTransactions returns a channel of blocks containing transactions.
func (*EventAPIClient) BlocksBasicWithTransactionsWithTaggedData ¶
func (eac *EventAPIClient) BlocksBasicWithTransactionsWithTaggedData() (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksBasicWithTransactionsWithTaggedData returns a channel of blocks containing transactions with tagged data.
func (*EventAPIClient) BlocksBasicWithTransactionsWithTaggedDataByTag ¶
func (eac *EventAPIClient) BlocksBasicWithTransactionsWithTaggedDataByTag(tag []byte) (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksBasicWithTransactionsWithTaggedDataByTag returns a channel of blocks containing transactions with tagged data containing the given tag.
func (*EventAPIClient) BlocksValidation ¶
func (eac *EventAPIClient) BlocksValidation() (<-chan *iotago.Block, *EventAPIClientSubscription)
BlocksValidation returns a channel of newly received validation blocks.
func (*EventAPIClient) Close ¶
func (eac *EventAPIClient) Close()
Close disconnects the underlying MQTT client. Call this function to clean up any registered channels.
func (*EventAPIClient) CommitmentsFinalized ¶
func (eac *EventAPIClient) CommitmentsFinalized() (<-chan *iotago.Commitment, *EventAPIClientSubscription)
func (*EventAPIClient) CommitmentsLatest ¶
func (eac *EventAPIClient) CommitmentsLatest() (<-chan *iotago.Commitment, *EventAPIClientSubscription)
func (*EventAPIClient) Connect ¶
func (eac *EventAPIClient) Connect(ctx context.Context) error
Connect connects the EventAPIClient to the specified brokers. The EventAPIClient remains active as long as the given context isn't done/canceled.
func (*EventAPIClient) OutputWithMetadataByOutputID ¶
func (eac *EventAPIClient) OutputWithMetadataByOutputID(outputID iotago.OutputID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputWithMetadataByOutputID returns a channel which immediately returns the output with the given ID and afterward when its state changes.
func (*EventAPIClient) OutputsWithMetadataByAccountID ¶
func (eac *EventAPIClient) OutputsWithMetadataByAccountID(accountID iotago.AccountID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputsWithMetadataByAccountID returns a channel of newly created outputs to track the chain mutations of a given Account.
func (*EventAPIClient) OutputsWithMetadataByAnchorID ¶
func (eac *EventAPIClient) OutputsWithMetadataByAnchorID(anchorID iotago.AnchorID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputsWithMetadataByAnchorID returns a channel of newly created outputs to track the chain mutations of a given anchor ID.
func (*EventAPIClient) OutputsWithMetadataByDelegationID ¶
func (eac *EventAPIClient) OutputsWithMetadataByDelegationID(delegationID iotago.DelegationID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputsWithMetadataByDelegationID returns a channel of newly created outputs to track the chain mutations of a given delegation ID.
func (*EventAPIClient) OutputsWithMetadataByFoundryID ¶
func (eac *EventAPIClient) OutputsWithMetadataByFoundryID(foundryID iotago.FoundryID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputsWithMetadataByFoundryID returns a channel of newly created outputs to track the chain mutations of a given Foundry.
func (*EventAPIClient) OutputsWithMetadataByNFTID ¶
func (eac *EventAPIClient) OutputsWithMetadataByNFTID(nftID iotago.NFTID) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputsWithMetadataByNFTID returns a channel of newly created outputs to track the chain mutations of a given NFT.
func (*EventAPIClient) OutputsWithMetadataByUnlockConditionAndAddress ¶
func (eac *EventAPIClient) OutputsWithMetadataByUnlockConditionAndAddress(condition api.EventAPIUnlockCondition, addr iotago.Address) (<-chan *api.OutputWithMetadataResponse, *EventAPIClientSubscription)
OutputsWithMetadataByUnlockConditionAndAddress returns a channel of newly created outputs on the given unlock condition and address.
func (*EventAPIClient) TransactionMetadataByTransactionID ¶
func (eac *EventAPIClient) TransactionMetadataByTransactionID(txID iotago.TransactionID) (<-chan *api.TransactionMetadataResponse, *EventAPIClientSubscription)
TransactionMetadataByTransactionID returns a channel of TransactionMetadataResponse each time the given transaction's state changes.
type EventAPIClientSubscription ¶
type EventAPIClientSubscription struct {
// contains filtered or unexported fields
}
EventAPIClientSubscription holds any error that happened when trying to subscribe to an event. It also allows to close the subscription to cleanly unsubscribe from the node.
func (*EventAPIClientSubscription) Close ¶
func (s *EventAPIClientSubscription) Close() error
Close allows to close the subscription to cleanly unsubscribe from the node.
func (*EventAPIClientSubscription) Error ¶
func (s *EventAPIClientSubscription) Error() error
Error holds any error that happened when trying to subscribe.
type HTTPErrorResponseEnvelope ¶
type HTTPErrorResponseEnvelope struct { Error struct { Code string `json:"code"` Message string `json:"message"` } `json:"error"` }
HTTPErrorResponseEnvelope defines the error response schema for node API responses.
type IndexerClient ¶
type IndexerClient interface { // Outputs returns a handle to query for outputs. Outputs(ctx context.Context, query IndexerQuery) (*IndexerResultSet, error) // Account queries for a specific iotago.AccountOutput by its address and returns the ledger index at which this output where available at. Account(ctx context.Context, accountAddress *iotago.AccountAddress) (*iotago.OutputID, *iotago.AccountOutput, iotago.SlotIndex, error) // Anchor queries for a specific iotago.AnchorOutput by its address and returns the ledger index at which this output where available at. Anchor(ctx context.Context, anchorAddress *iotago.AnchorAddress) (*iotago.OutputID, *iotago.AnchorOutput, iotago.SlotIndex, error) // Foundry queries for a specific iotago.FoundryOutput by its identifier and returns the ledger index at which this output where available at. Foundry(ctx context.Context, foundryID iotago.FoundryID) (*iotago.OutputID, *iotago.FoundryOutput, iotago.SlotIndex, error) // NFT queries for a specific iotago.NFTOutput by its address and returns the ledger index at which this output where available at. NFT(ctx context.Context, nftAddress *iotago.NFTAddress) (*iotago.OutputID, *iotago.NFTOutput, iotago.SlotIndex, error) // Delegation queries for a specific iotago.DelegationOutout by its identifier and returns the ledger index at which this output where available at. Delegation(ctx context.Context, delegationID iotago.DelegationID) (*iotago.OutputID, *iotago.DelegationOutput, iotago.SlotIndex, error) }
IndexerClient is a client which queries the optional indexer functionality of a node.
type IndexerQuery ¶
type IndexerQuery interface { // SetOffset sets the offset for the query. SetOffset(offset *string) // URLParams returns the query parameters as URL encoded query parameters. URLParams() (string, error) }
IndexerQuery is a query executed against the indexer.
type IndexerResultSet ¶
type IndexerResultSet struct { // The error which has occurred during querying. Error error // The response from the indexer after calling Next(). Response *api.IndexerResponse // contains filtered or unexported fields }
IndexerResultSet is a handle for indexer queries.
func (*IndexerResultSet) Next ¶
func (resultSet *IndexerResultSet) Next() bool
Next runs the next query against the indexer. Returns false if there are no more results to collect.
type ManagementClient ¶
type ManagementClient interface { // PeerByID gets a peer by its identifier. PeerByID(ctx context.Context, id string) (*api.PeerInfo, error) // RemovePeerByID removes a peer by its identifier. RemovePeerByID(ctx context.Context, id string) error // Peers returns a list of all peers. Peers(ctx context.Context) (*api.PeersResponse, error) // AddPeer adds a new peer by libp2p multi address with optional alias. AddPeer(ctx context.Context, multiAddress string, alias ...string) (*api.PeerInfo, error) // PruneDatabaseBySize prunes the database by target size. PruneDatabaseBySize(ctx context.Context, targetDatabaseSize string) (*api.PruneDatabaseResponse, error) // PruneDatabaseByEpoch prunes the database by epoch. PruneDatabaseByEpoch(ctx context.Context, epoch iotago.EpochIndex) (*api.PruneDatabaseResponse, error) // PruneDatabaseByDepth prunes the database by depth. PruneDatabaseByDepth(ctx context.Context, depth iotago.EpochIndex) (*api.PruneDatabaseResponse, error) // CreateSnapshot creates a snapshot. CreateSnapshot(ctx context.Context) (*api.CreateSnapshotResponse, error) }
ManagementClient is a client which queries the optional management functionality of a node.
type RawDataEnvelope ¶
type RawDataEnvelope struct { // The encapsulated binary data. Data []byte }
RawDataEnvelope is used internally to encapsulate binary data.
type RequestHeaderHook ¶
RequestHeaderHook is a function to modify the request header before sending a request.
type RequestURLHook ¶
RequestURLHook is a function to modify the URL before sending a request.