api

package
v4.0.0-...-3659144 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 21

Documentation

Index

Constants

View Source
const (
	TransactionStateLength         = serializer.OneByte
	TransactionFailureReasonLength = serializer.OneByte
)
View Source
const (
	// APIRoot is the root path for all API endpoints.
	APIRoot = "/api"

	// CorePluginName is the name for the core API plugin.
	CorePluginName = "core/v3"

	// ManagementPluginName is the name for the management plugin.
	ManagementPluginName = "management/v1"

	// IndexerPluginName is the name for the indexer plugin.
	IndexerPluginName = "indexer/v2"

	// BlockIssuerPluginName is the name for the blockissuer plugin.
	BlockIssuerPluginName = "blockissuer/v1"

	// MQTTPluginName is the name for the MQTT plugin.
	MQTTPluginName = "mqtt/v2"
)
View Source
const (
	// ParameterPageSize is used to specify the page size.
	ParameterPageSize = "pageSize"

	// ParameterCursor is used to specify the point from which the response should continue for paginated results.
	ParameterCursor = "cursor"

	// ParameterSlot is used to identify a slot.
	ParameterSlot = "slot"

	// ParameterEpoch is used to identify an epoch.
	ParameterEpoch = "epoch"

	// ParameterBlockID is used to identify a block by its ID.
	ParameterBlockID = "blockId"

	// ParameterTransactionID is used to identify a transaction by its ID.
	ParameterTransactionID = "transactionId"

	// ParameterOutputID is used to identify an output by its ID.
	ParameterOutputID = "outputId"

	// ParameterCommitmentID is used to identify a slot commitment by its ID.
	ParameterCommitmentID = "commitmentId"

	// ParameterFoundryID is used to identify a foundry by its ID.
	ParameterFoundryID = "foundryId"

	// ParameterDelegationID is used to identify a delegation by its ID.
	ParameterDelegationID = "delegationId"

	// ParameterPeerID is used to identify a peer.
	ParameterPeerID = "peerId"

	// ParameterBech32Address is used to represent bech32 address.
	ParameterBech32Address = "bech32Address"

	// ParameterAddress is used to identify an address.
	ParameterAddress = "address"

	// ParameterAccountAddress is used to identify an account address.
	ParameterAccountAddress = "accountAddress"

	// ParameterAnchorAddress is used to identify an anchor address.
	ParameterAnchorAddress = "anchorAddress"

	// ParameterNFTAddress is used to identify an NFT address.
	ParameterNFTAddress = "nftAddress"

	// ParameterTag is used to identify a tag.
	ParameterTag = "tag"

	// ParameterCondition is used to identify an unlock condition.
	ParameterCondition = "condition"

	// ParameterWorkScore is used to identify work score.
	ParameterWorkScore = "workScore"
)
View Source
const (
	MIMEApplicationJSON                   = "application/json"
	MIMEApplicationVendorIOTASerializerV2 = "application/vnd.iota.serializer-v2"
)
View Source
const (
	// CoreEndpointInfo is the endpoint for getting the node info.
	// GET returns the node info.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointInfo = "/info"

	// CoreEndpointNetworkHealth is the endpoint for getting the network health.
	// GET returns http status code 200 if the network is healthy (finalization is not delayed).
	CoreEndpointNetworkHealth = "/network/health"

	// CoreEndpointNetworkMetrics is the endpoint for getting the network metrics.
	// GET returns the network metrics.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointNetworkMetrics = "/network/metrics"

	// CoreEndpointBlocks is the endpoint for sending new blocks.
	// POST sends a single new block and returns the new block ID.
	// "Content-Type" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointBlocks = "/blocks"

	// CoreEndpointBlock is the endpoint for getting a block by its blockID.
	// GET returns the block.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointBlock = "/blocks/{blockId}"

	// CoreEndpointBlockMetadata is the endpoint for getting block metadata by its blockID.
	// GET returns block metadata.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointBlockMetadata = "/blocks/{blockId}/metadata"

	// CoreEndpointBlockWithMetadata is the endpoint for getting a block, together with its metadata by its blockID.
	// GET returns the block and metadata.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointBlockWithMetadata = "/blocks/{blockId}/full"

	// CoreEndpointBlockIssuance is the endpoint for getting all needed information for block creation.
	// GET returns the data needed to attach a block.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointBlockIssuance = "/blocks/issuance"

	// CoreEndpointOutput is the endpoint for getting an output by its outputID (transactionHash + outputIndex). This includes the proof, that the output corresponds to the requested outputID.
	// GET returns the output.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointOutput = "/outputs/{outputId}"

	// CoreEndpointOutputMetadata is the endpoint for getting output metadata by its outputID (transactionHash + outputIndex) without getting the output itself again.
	// GET returns the output metadata.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointOutputMetadata = "/outputs/{outputId}/metadata"

	// CoreEndpointOutputWithMetadata is the endpoint for getting output, together with its metadata by its outputID (transactionHash + outputIndex).
	// GET returns the output and metadata.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointOutputWithMetadata = "/outputs/{outputId}/full"

	// CoreEndpointTransaction is the endpoint for getting a transaction by its transaction ID.
	// GET returns the transaction.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointTransaction = "/transactions/{transactionId}"

	// CoreEndpointTransactionsIncludedBlock is the endpoint for getting the block that was first confirmed for a given transaction ID.
	// GET returns the block.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointTransactionsIncludedBlock = "/transactions/{transactionId}/included-block"

	// CoreEndpointTransactionsIncludedBlockMetadata is the endpoint for getting the metadata for the block that was first confirmed in the ledger for a given transaction ID.
	// GET returns block metadata.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointTransactionsIncludedBlockMetadata = "/transactions/{transactionId}/included-block/metadata"

	// CoreEndpointTransactionsMetadata is the endpoint for getting the metadata for the given transaction ID.
	// GET returns transaction metadata.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointTransactionsMetadata = "/transactions/{transactionId}/metadata"

	// CoreEndpointCommitmentByID is the endpoint for getting a slot commitment by its ID.
	// GET returns the commitment.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommitmentByID = "/commitments/{commitmentId}"

	// CoreEndpointCommitmentByIDUTXOChanges is the endpoint for getting all UTXO changes of a commitment by its ID.
	// GET returns the output IDs of all UTXO changes.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommitmentByIDUTXOChanges = "/commitments/{commitmentId}/utxo-changes"

	// CoreEndpointCommitmentByIDUTXOChangesFull is the endpoint for getting all UTXO changes of a commitment by its ID.
	// GET returns the outputs of all UTXO changes including their corresponding output IDs.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommitmentByIDUTXOChangesFull = "/commitments/{commitmentId}/utxo-changes/full"

	// CoreEndpointCommitmentBySlot is the endpoint for getting a commitment by its Slot.
	// GET returns the commitment.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommitmentBySlot = "/commitments/by-slot/{slot}"

	// CoreEndpointCommitmentBySlotUTXOChanges is the endpoint for getting all UTXO changes of a commitment by its Slot.
	// GET returns the output IDs of all UTXO changes.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommitmentBySlotUTXOChanges = "/commitments/by-slot/{slot}/utxo-changes"

	// CoreEndpointCommitmentBySlotUTXOChangesFull is the endpoint for getting all UTXO changes of a commitment by its Slot.
	// GET returns the outputs of all UTXO changes including their corresponding output IDs.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommitmentBySlotUTXOChangesFull = "/commitments/by-slot/{slot}/utxo-changes/full"

	// CoreEndpointCongestion is the endpoint for getting the current congestion state and all account related useful details as block issuance credits.
	// GET returns the congestion state related to the specified account. (optional query parameters: "QueryParameterCommitmentID" to specify the used commitment)
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCongestion = "/accounts/{bech32Address}/congestion"

	// CoreEndpointValidators is the endpoint for getting informations about the current registered validators.
	// GET returns the paginated response with the list of validators.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointValidators = "/validators"

	// CoreEndpointValidatorsAccount is the endpoint for getting details about the validator by its bech32 account address.
	// GET returns the validator details.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointValidatorsAccount = "/validators/{bech32Address}"

	// CoreEndpointRewards is the endpoint for getting the rewards for staking or delegation based on staking account or delegation output.
	// Rewards are decayed up to returned epochEnd index.
	// GET returns the rewards.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointRewards = "/rewards/{outputId}"

	// CoreEndpointCommittee is the endpoint for getting information about the current committee.
	// GET returns the information about the current committee. (optional query parameters: "QueryParameterEpochIndex" to specify the epoch)
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	CoreEndpointCommittee = "/committee"
)

Core API endpoints.

View Source
const (
	// ManagementEndpointPeer is the endpoint for getting peers by their peerID.
	// GET returns the peer.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// DELETE deletes the peer.
	ManagementEndpointPeer = "/peers/{peerId}"

	// ManagementEndpointPeers is the endpoint for getting all peers of the node.
	// GET returns a list of all peers.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// POST adds a new peer.
	// "Content-Type" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	ManagementEndpointPeers = "/peers"

	// ManagementEndpointDatabasePrune is the endpoint to manually prune the database.
	// POST prunes the database.
	// "Content-Type" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	ManagementEndpointDatabasePrune = "/database/prune"

	// ManagementEndpointSnapshotsCreate is the endpoint to manually create a snapshot files.
	// POST creates a full snapshot.
	// "Content-Type" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	ManagementEndpointSnapshotsCreate = "/snapshots/create"
)

Management API endpoints.

View Source
const (
	// IndexerEndpointOutputs is the endpoint for getting basic, account, anchor, foundry, nft and delegation outputs filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "hasNativeToken", "nativeToken", "unlockableByAddress", "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputs = "/outputs"

	// IndexerEndpointOutputsBasic is the endpoint for getting basic outputs filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "hasNativeToken", "nativeToken", "address", "unlockableByAddress", "hasStorageDepositReturn", "storageDepositReturnAddress",
	// 					 "hasExpiration", "expiresBefore", "expiresAfter", "expirationReturnAddress",
	//					 "hasTimelock", "timelockedBefore", "timelockedAfter", "sender", "tag",
	//					 "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputsBasic = "/outputs/basic"

	// IndexerEndpointOutputsAccounts is the endpoint for getting accounts filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "address", "issuer", "sender",
	//					 "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputsAccounts = "/outputs/account"

	// IndexerEndpointOutputsAccountByAddress is the endpoint for getting accounts by their accountID.
	// GET returns the outputIDs or 404 if no record is found.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	IndexerEndpointOutputsAccountByAddress = "/outputs/account/{bech32Address}"

	// IndexerEndpointOutputsAnchors is the endpoint for getting anchors filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "unlockableByAddress", "stateController", "governor", "issuer", "sender",
	//					 "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputsAnchors = "/outputs/anchor"

	// IndexerEndpointOutputsAnchorByAddress is the endpoint for getting anchors by their anchorID.
	// GET returns the outputIDs or 404 if no record is found.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	IndexerEndpointOutputsAnchorByAddress = "/outputs/anchor/{bech32Address}"

	// IndexerEndpointOutputsFoundries is the endpoint for getting foundries filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "hasNativeToken", "nativeToken", "account", "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputsFoundries = "/outputs/foundry"

	// IndexerEndpointOutputsFoundryByID is the endpoint for getting foundries by their foundryID.
	// GET returns the outputIDs or 404 if no record is found.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	IndexerEndpointOutputsFoundryByID = "/outputs/foundry/{foundryId}"

	// IndexerEndpointOutputsNFTs is the endpoint for getting NFT filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "address", "unlockableByAddress", "hasStorageDepositReturn", "storageDepositReturnAddress",
	// 					 "hasExpiration", "expiresBefore", "expiresAfter", "expirationReturnAddress",
	//					 "hasTimelock", "timelockedBefore", "timelockedAfter", "issuer", "sender", "tag",
	//					 "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputsNFTs = "/outputs/nft"

	// IndexerEndpointOutputsNFTByAddress is the endpoint for getting NFT by their nftID.
	// GET returns the outputIDs or 404 if no record is found.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	IndexerEndpointOutputsNFTByAddress = "/outputs/nft/{bech32Address}"

	// IndexerEndpointOutputsDelegations is the endpoint for getting delegations filtered by the given parameters.
	// GET with query parameter returns all outputIDs that fit these filter criteria.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	// Query parameters: "address", "validator", "createdBefore", "createdAfter"
	// Returns an empty list if no results are found.
	IndexerEndpointOutputsDelegations = "/outputs/delegation"

	// IndexerEndpointOutputsDelegationByID is the endpoint for getting delegations by their delegationID.
	// GET returns the outputIDs or 404 if no record is found.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	IndexerEndpointOutputsDelegationByID = "/outputs/delegation/{delegationId}"

	// IndexerEndpointMultiAddressByAddress is the endpoint for getting the multi address unlock condition
	// of an MultiAddressReference (can be contained in a RestrictedAddress).
	// GET returns a MultiAddress.
	// "Accept" header:
	//		MIMEApplicationJSON => json.
	//		MIMEApplicationVendorIOTASerializerV2 => bytes.
	IndexerEndpointMultiAddressByAddress = "/multiaddress/{bech32Address}"
)

Indexer API endpoints.

View Source
const (
	HeaderBlockIssuerProofOfWorkNonce = "X-IOTA-BlockIssuer-PoW-Nonce"
	HeaderBlockIssuerCommitmentID     = "X-IOTA-BlockIssuer-Commitment-ID"
)
View Source
const (
	// BlockIssuerRouteInfo is the endpoint for getting the info of the block issuer.
	// GET returns the info.
	// "Accept" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	BlockIssuerEndpointInfo = "/info"

	// BlockIssuerRouteIssuePayload is the endpoint for issuing an ApplicationPayload.
	// POST issues the ApplicationPayload.
	// "Content-Type" header:
	// 		MIMEApplicationJSON => json.
	// 		MIMEApplicationVendorIOTASerializerV2 => bytes.
	BlockIssuerEndpointIssuePayload = "/issue"
)

BlockIssuer API endpoints.

View Source
const (
	EventAPITopicSuffixRaw       = "/raw"
	EventAPITopicSuffixAccepted  = "accepted"
	EventAPITopicSuffixConfirmed = "confirmed"

	// HINT: all existing topics always have a "/raw" suffix for the raw payload as well.
	EventAPITopicCommitmentsLatest    = "commitments/latest"    // iotago.Commitment
	EventAPITopicCommitmentsFinalized = "commitments/finalized" // iotago.Commitment

	EventAPITopicBlocks                              = "blocks"                                     // iotago.Block (track all incoming blocks)
	EventAPITopicBlocksValidation                    = "blocks/validation"                          // iotago.Block (track all incoming validation blocks)
	EventAPITopicBlocksBasic                         = "blocks/basic"                               // iotago.Block (track all incoming basic blocks)
	EventAPITopicBlocksBasicTaggedData               = "blocks/basic/tagged-data"                   // iotago.Block (track all incoming basic blocks with tagged data payload)
	EventAPITopicBlocksBasicTaggedDataTag            = "blocks/basic/tagged-data/{tag}"             // iotago.Block (track all incoming basic blocks with specific tagged data payload)
	EventAPITopicBlocksBasicTransaction              = "blocks/basic/transaction"                   // iotago.Block (track all incoming basic blocks with transactions)
	EventAPITopicBlocksBasicTransactionTaggedData    = "blocks/basic/transaction/tagged-data"       // iotago.Block (track all incoming basic blocks with transactions and tagged data)
	EventAPITopicBlocksBasicTransactionTaggedDataTag = "blocks/basic/transaction/tagged-data/{tag}" // iotago.Block (track all incoming basic blocks with transactions and specific tagged data)

	// single block on subscribe and changes in it's metadata (accepted, confirmed).
	EventAPITopicTransactionsIncludedBlockMetadata = "transactions/{transactionId}/included-block-metadata" // api.BlockMetadataResponse (track inclusion of a single transaction)
	EventAPITopicTransactionMetadata               = "transaction-metadata/{transactionId}"                 // api.TransactionMetadataResponse (track a specific transaction)

	// single block on subscribe and changes in it's metadata (accepted, confirmed).
	EventAPITopicBlockMetadata = "block-metadata/{blockId}" // api.BlockMetadataResponse (track changes to a single block)

	// all blocks that arrive after subscribing.
	EventAPITopicBlockMetadataAccepted  = "block-metadata/" + EventAPITopicSuffixAccepted  // api.BlockMetadataResponse (track acceptance of all blocks)
	EventAPITopicBlockMetadataConfirmed = "block-metadata/" + EventAPITopicSuffixConfirmed // api.BlockMetadataResponse (track confirmation of all blocks)

	// single output on subscribe and changes in it's metadata (accepted, committed, spent).
	EventAPITopicOutputs = "outputs/{outputId}" // api.OutputWithMetadataResponse (track changes to a single output)

	// all outputs that arrive after subscribing (on transaction accepted and transaction committed).
	EventAPITopicAccountOutputs                     = "outputs/account/{accountAddress}"     // api.OutputWithMetadataResponse (all changes of the chain output)
	EventAPITopicAnchorOutputs                      = "outputs/anchor/{anchorAddress}"       // api.OutputWithMetadataResponse (all changes of the chain output)
	EventAPITopicFoundryOutputs                     = "outputs/foundry/{foundryId}"          // api.OutputWithMetadataResponse (all changes of the chain output)
	EventAPITopicNFTOutputs                         = "outputs/nft/{nftAddress}"             // api.OutputWithMetadataResponse (all changes of the chain output)
	EventAPITopicDelegationOutputs                  = "outputs/delegation/{delegationId}"    // api.OutputWithMetadataResponse (all changes of the chain output)
	EventAPITopicOutputsByUnlockConditionAndAddress = "outputs/unlock/{condition}/{address}" // api.OutputWithMetadataResponse (all changes to outputs that match the unlock condition)
)

Event API endpoints.

Variables

View Source
var (
	// RouteHealth is the route for querying a node's health status.
	RouteHealth = "/health"

	// RouteRoutes is the route for getting the routes the node supports.
	// GET returns the nodes routes.
	RouteRoutes = route("", "/routes")
)
View Source
var (
	CoreRouteInfo                              = route(CorePluginName, CoreEndpointInfo)
	CoreRouteNetworkHealth                     = route(CorePluginName, CoreEndpointNetworkHealth)
	CoreRouteNetworkMetrics                    = route(CorePluginName, CoreEndpointNetworkMetrics)
	CoreRouteBlocks                            = route(CorePluginName, CoreEndpointBlocks)
	CoreRouteBlock                             = route(CorePluginName, CoreEndpointBlock)
	CoreRouteBlockMetadata                     = route(CorePluginName, CoreEndpointBlockMetadata)
	CoreRouteBlockWithMetadata                 = route(CorePluginName, CoreEndpointBlockWithMetadata)
	CoreRouteBlockIssuance                     = route(CorePluginName, CoreEndpointBlockIssuance)
	CoreRouteOutput                            = route(CorePluginName, CoreEndpointOutput)
	CoreRouteOutputMetadata                    = route(CorePluginName, CoreEndpointOutputMetadata)
	CoreRouteOutputWithMetadata                = route(CorePluginName, CoreEndpointOutputWithMetadata)
	CoreRouteTransaction                       = route(CorePluginName, CoreEndpointTransaction)
	CoreRouteTransactionsIncludedBlock         = route(CorePluginName, CoreEndpointTransactionsIncludedBlock)
	CoreRouteTransactionsIncludedBlockMetadata = route(CorePluginName, CoreEndpointTransactionsIncludedBlockMetadata)
	CoreRouteTransactionsMetadata              = route(CorePluginName, CoreEndpointTransactionsMetadata)
	CoreRouteCommitmentByID                    = route(CorePluginName, CoreEndpointCommitmentByID)
	CoreRouteCommitmentByIDUTXOChanges         = route(CorePluginName, CoreEndpointCommitmentByIDUTXOChanges)
	CoreRouteCommitmentByIDUTXOChangesFull     = route(CorePluginName, CoreEndpointCommitmentByIDUTXOChangesFull)
	CoreRouteCommitmentBySlot                  = route(CorePluginName, CoreEndpointCommitmentBySlot)
	CoreRouteCommitmentBySlotUTXOChanges       = route(CorePluginName, CoreEndpointCommitmentBySlotUTXOChanges)
	CoreRouteCommitmentBySlotUTXOChangesFull   = route(CorePluginName, CoreEndpointCommitmentBySlotUTXOChangesFull)
	CoreRouteCongestion                        = route(CorePluginName, CoreEndpointCongestion)
	CoreRouteValidators                        = route(CorePluginName, CoreEndpointValidators)
	CoreRouteValidatorsAccount                 = route(CorePluginName, CoreEndpointValidatorsAccount)
	CoreRouteRewards                           = route(CorePluginName, CoreEndpointRewards)
	CoreRouteCommittee                         = route(CorePluginName, CoreEndpointCommittee)
)
View Source
var (
	ManagementRoutePeer            = route(ManagementPluginName, ManagementEndpointPeer)
	ManagementRoutePeers           = route(ManagementPluginName, ManagementEndpointPeers)
	ManagementRouteDatabasePrune   = route(ManagementPluginName, ManagementEndpointDatabasePrune)
	ManagementRouteSnapshotsCreate = route(ManagementPluginName, ManagementEndpointSnapshotsCreate)
)
View Source
var (
	IndexerRouteOutputs                 = route(IndexerPluginName, IndexerEndpointOutputs)
	IndexerRouteOutputsBasic            = route(IndexerPluginName, IndexerEndpointOutputsBasic)
	IndexerRouteOutputsAccounts         = route(IndexerPluginName, IndexerEndpointOutputsAccounts)
	IndexerRouteOutputsAccountByAddress = route(IndexerPluginName, IndexerEndpointOutputsAccountByAddress)
	IndexerRouteOutputsAnchors          = route(IndexerPluginName, IndexerEndpointOutputsAnchors)
	IndexerRouteOutputsAnchorByAddress  = route(IndexerPluginName, IndexerEndpointOutputsAnchorByAddress)
	IndexerRouteOutputsFoundries        = route(IndexerPluginName, IndexerEndpointOutputsFoundries)
	IndexerRouteOutputsFoundryByID      = route(IndexerPluginName, IndexerEndpointOutputsFoundryByID)
	IndexerRouteOutputsNFTs             = route(IndexerPluginName, IndexerEndpointOutputsNFTs)
	IndexerRouteOutputsNFTByAddress     = route(IndexerPluginName, IndexerEndpointOutputsNFTByAddress)
	IndexerRouteOutputsDelegations      = route(IndexerPluginName, IndexerEndpointOutputsDelegations)
	IndexerRouteOutputsDelegationByID   = route(IndexerPluginName, IndexerEndpointOutputsDelegationByID)
	IndexerRouteMultiAddressByAddress   = route(IndexerPluginName, IndexerEndpointMultiAddressByAddress)
)
View Source
var (
	BlockIssuerRouteInfo         = route(BlockIssuerPluginName, BlockIssuerEndpointInfo)
	BlockIssuerRouteIssuePayload = route(BlockIssuerPluginName, BlockIssuerEndpointIssuePayload)
)

Functions

func EndpointWithEchoParameters

func EndpointWithEchoParameters(endpoint string) string

func EndpointWithNamedParameterValue

func EndpointWithNamedParameterValue(endpoint string, parameter string, value string) string

Types

type AccountsQuery

type AccountsQuery struct {
	IndexerCursorParams
	IndexerCreationParams
	IndexerUnlockableByAddressParams

	// Bech32-encoded address that should be searched for.
	AddressBech32 string `qs:"address,omitempty"`
	// Filters outputs based on the presence of validated sender.
	SenderBech32 string `qs:"sender,omitempty"`
	// Filters outputs based on the presence of validated issuer.
	IssuerBech32 string `qs:"issuer,omitempty"`
}

AccountsQuery defines parameters for an account outputs query.

func (*AccountsQuery) SetOffset

func (query *AccountsQuery) SetOffset(cursor *string)

func (*AccountsQuery) URLParams

func (query *AccountsQuery) URLParams() (string, error)

type AddPeerRequest

type AddPeerRequest struct {
	// The libp2p multi address of the peer.
	MultiAddress string `serix:",lenPrefix=uint8"`
	// The alias to identify the peer.
	Alias string `serix:",lenPrefix=uint8,omitempty"`
}

AddPeerRequest defines the request for a POST peer REST API call.

type AnchorsQuery

type AnchorsQuery struct {
	IndexerCursorParams
	IndexerCreationParams
	IndexerUnlockableByAddressParams

	// Bech32-encoded state controller address that should be searched for.
	StateControllerBech32 string `qs:"stateController,omitempty"`
	// Bech32-encoded governor address that should be searched for.
	GovernorBech32 string `qs:"governor,omitempty"`
	// Filters outputs based on the presence of validated issuer.
	IssuerBech32 string `qs:"issuer,omitempty"`
}

AnchorsQuery defines parameters for an anchor outputs query.

func (*AnchorsQuery) SetOffset

func (query *AnchorsQuery) SetOffset(cursor *string)

func (*AnchorsQuery) URLParams

func (query *AnchorsQuery) URLParams() (string, error)

type BasicOutputsQuery

type BasicOutputsQuery struct {
	IndexerCursorParams
	IndexerTimelockParams
	IndexerExpirationParams
	IndexerCreationParams
	IndexerStorageDepositParams
	IndexerNativeTokenParams
	IndexerUnlockableByAddressParams

	// Bech32-encoded address that should be searched for.
	AddressBech32 string `qs:"address,omitempty"`
	// Filters outputs based on the presence of validated sender.
	SenderBech32 string `qs:"sender,omitempty"`
	// Filters outputs based on matching tag feature.
	Tag string `qs:"tag,omitempty"`
}

BasicOutputsQuery defines parameters for an basic outputs query.

func (*BasicOutputsQuery) SetOffset

func (query *BasicOutputsQuery) SetOffset(cursor *string)

func (*BasicOutputsQuery) URLParams

func (query *BasicOutputsQuery) URLParams() (string, error)

type BlockCreatedResponse

type BlockCreatedResponse struct {
	// The hex encoded block ID of the block.
	BlockID iotago.BlockID `serix:""`
}

BlockCreatedResponse defines the response of a POST blocks REST API call.

type BlockIssuerInfo

type BlockIssuerInfo struct {
	// The account address of the block issuer.
	BlockIssuerAddress string `serix:",lenPrefix=uint8"`
	// The number of trailing zeroes required for the proof of work to be valid.
	PowTargetTrailingZeros uint8 `serix:""`
}

BlockIssuerInfo is the response to the BlockIssuerRouteInfo endpoint.

type BlockMetadataResponse

type BlockMetadataResponse struct {
	// BlockID The hex encoded block ID of the block.
	BlockID iotago.BlockID `serix:""`
	// BlockState might be unknown, pending, accepted, confirmed, finalized, dropped, orphaned.
	BlockState BlockState `serix:""`
}

BlockMetadataResponse defines the response of a GET block metadata REST API call.

type BlockState

type BlockState byte
const (
	// BlockStateUnknown indicates that the state of the block can not be determined by the node for some reason.
	BlockStateUnknown BlockState = iota
	// BlockStatePending indicates that the block has been booked by the node but not yet accepted.
	BlockStatePending
	// BlockStateAccepted indicates that the block has been referenced by the super majority of the online committee.
	BlockStateAccepted
	// BlockStateConfirmed indicates that the block has been referenced by the super majority of the total committee.
	BlockStateConfirmed
	// BlockStateFinalized indicates that the commitment containing the block has been finalized.
	// This state is computed based on the accepted/confirmed block's slot being smaller or equal than the latest finalized slot.
	BlockStateFinalized
	// BlockStateDropped indicates that the block has been dropped due to congestion control.
	BlockStateDropped
	// BlockStateOrphaned indicates that the block's slot has been committed by the node without the block being included.
	// In this case, the block will never be finalized unless there is a chain switch.
	// This state is computed based on the pending block's slot being smaller or equal than the latest committed slot.
	BlockStateOrphaned
)

func (BlockState) Bytes

func (b BlockState) Bytes() ([]byte, error)

func (*BlockState) DecodeJSON

func (b *BlockState) DecodeJSON(state any) error

func (BlockState) EncodeJSON

func (b BlockState) EncodeJSON() (any, error)

func (BlockState) String

func (b BlockState) String() string

type BlockWithMetadataResponse

type BlockWithMetadataResponse struct {
	Block    *iotago.Block          `serix:""`
	Metadata *BlockMetadataResponse `serix:""`
}

BlockWithMetadataResponse defines the response of a GET full block REST API call.

type CommitteeMemberResponse

type CommitteeMemberResponse struct {
	// AddressBech32 is the account address of the validator.
	AddressBech32 string `serix:"address,lenPrefix=uint8"`
	// PoolStake is the sum of tokens delegated to the pool and the validator stake.
	PoolStake iotago.BaseToken `serix:""`
	// ValidatorStake is the stake of the validator.
	ValidatorStake iotago.BaseToken `serix:""`
	// FixedCost is the fixed cost that the validator received from the total pool reward.
	FixedCost iotago.Mana `serix:""`
}

CommitteeMemberResponse defines the response used in committee and staking response REST API calls.

type CommitteeResponse

type CommitteeResponse struct {
	Committee           []*CommitteeMemberResponse `serix:",lenPrefix=uint8"`
	TotalStake          iotago.BaseToken           `serix:""`
	TotalValidatorStake iotago.BaseToken           `serix:""`
	Epoch               iotago.EpochIndex          `serix:""`
}

CommitteeResponse defines the response for the staking REST API call.

type CongestionResponse

type CongestionResponse struct {
	// Slot is the slot for which the estimate is provided.
	Slot iotago.SlotIndex `serix:""`
	// Ready indicates if a node is ready to schedule a block issued by the specified account, or if the issuer should wait.
	Ready bool `serix:""`
	// ReferenceManaCost (RMC) is the mana cost a user needs to burn to issue a block in slot Slot.
	ReferenceManaCost iotago.Mana `serix:""`
	// BlockIssuanceCredits (BIC) provides the BIC of the account in slot Slot.
	// This balance needs to be non-negative, otherwise account is locked
	BlockIssuanceCredits iotago.BlockIssuanceCredits `serix:""`
}

CongestionResponse defines the response for the congestion REST API call.

type CreateSnapshotResponse

type CreateSnapshotResponse struct {
	// The slot of the snapshot.
	Slot iotago.SlotIndex `serix:""`
	// The file path of the snapshot file.
	FilePath string `serix:",lenPrefix=uint8"`
}

CreateSnapshotResponse defines the response of a create snapshot REST API call.

type DelegationOutputsQuery

type DelegationOutputsQuery struct {
	IndexerCursorParams
	IndexerCreationParams

	// Bech32-encoded address that should be searched for.
	AddressBech32 string `qs:"address,omitempty"`
	// Filters outputs based on the presence of validator.
	ValidatorBech32 string `qs:"validator,omitempty"`
}

func (*DelegationOutputsQuery) SetOffset

func (query *DelegationOutputsQuery) SetOffset(cursor *string)

func (*DelegationOutputsQuery) URLParams

func (query *DelegationOutputsQuery) URLParams() (string, error)

type EventAPIUnlockCondition

type EventAPIUnlockCondition string

EventAPIUnlockCondition denotes the different unlock conditions.

const (
	EventAPIUnlockConditionAny              EventAPIUnlockCondition = "+"
	EventAPIUnlockConditionAddress          EventAPIUnlockCondition = "address"
	EventAPIUnlockConditionStorageReturn    EventAPIUnlockCondition = "storage-return"
	EventAPIUnlockConditionExpiration       EventAPIUnlockCondition = "expiration"
	EventAPIUnlockConditionStateController  EventAPIUnlockCondition = "state-controller"
	EventAPIUnlockConditionGovernor         EventAPIUnlockCondition = "governor"
	EventAPIUnlockConditionImmutableAccount EventAPIUnlockCondition = "immutable-account"
)

type FoundriesQuery

type FoundriesQuery struct {
	IndexerCursorParams
	IndexerCreationParams
	IndexerNativeTokenParams

	// Bech32-encoded address that should be searched for.
	AccountAddressBech32 string `qs:"accountAddress,omitempty"`
}

FoundriesQuery defines parameters for a foundry outputs query.

func (*FoundriesQuery) SetOffset

func (query *FoundriesQuery) SetOffset(cursor *string)

func (*FoundriesQuery) URLParams

func (query *FoundriesQuery) URLParams() (string, error)

type HealthResponse

type HealthResponse struct {
	// Whether the node is healthy.
	IsHealthy bool `serix:""`
}

HealthResponse defines the health response.

type IndexerCreationParams

type IndexerCreationParams struct {
	// Return outputs that were created before a certain slot.
	CreatedBefore iotago.SlotIndex `qs:"createdBefore,omitempty"`
	// Return outputs that were created after a certain slot.
	CreatedAfter iotago.SlotIndex `qs:"createdAfter,omitempty"`
}

IndexerCreationParams define creation time query parameters.

type IndexerCursorParams

type IndexerCursorParams struct {
	// The maximum amount of items returned in one call.
	PageSize int `qs:"pageSize,omitempty"`
	// The offset from which to query from.
	Cursor *string `qs:"cursor,omitempty"`
}

IndexerCursorParams define page size and cursor query parameters.

type IndexerExpirationParams

type IndexerExpirationParams struct {
	// Filters outputs based on the presence of expiration unlock condition.
	HasExpiration *bool `qs:"hasExpiration,omitempty"`
	// Return outputs that expire before a certain slot.
	ExpiresBefore iotago.SlotIndex `qs:"expiresBefore,omitempty"`
	// Return outputs that expire after a certain slot.
	ExpiresAfter iotago.SlotIndex `qs:"expiresAfter,omitempty"`
	// Filter outputs based on the presence of a specific return address in the expiration unlock condition.
	ExpirationReturnAddressBech32 string `qs:"expirationReturnAddress,omitempty"`
}

IndexerExpirationParams define expiration query parameters.

type IndexerNativeTokenParams

type IndexerNativeTokenParams struct {
	// Filters outputs based on the presence of native tokens in the output.
	HasNativeToken *bool `qs:"hasNativeToken,omitempty"`
	// Filters outputs based on the presence of a specific native token in the output.
	NativeToken string `qs:"nativeToken,omitempty"`
}

IndexerNativeTokenParams define native token based query parameters.

type IndexerResponse

type IndexerResponse struct {
	// The committed slot at which these outputs where available at.
	CommittedSlot iotago.SlotIndex `serix:""`
	// The maximum count of results that are returned by the node.
	PageSize uint32 `serix:""`
	// The output IDs (transaction hash + output index) of the found outputs.
	Items iotago.HexOutputIDs `serix:",lenPrefix=uint16"`
	// The cursor to use for getting the next results.
	Cursor string `serix:",omitempty,lenPrefix=uint8"`
}

IndexerResponse is the standard successful response by the indexer.

type IndexerStorageDepositParams

type IndexerStorageDepositParams struct {
	// Filters outputs based on the presence of storage deposit return unlock condition.
	HasStorageDepositReturn *bool `qs:"hasStorageDepositReturn,omitempty"`
	// Filter outputs based on the presence of a specific return address in the storage deposit return unlock condition.
	StorageDepositReturnAddressBech32 string `qs:"storageDepositReturnAddress,omitempty"`
}

IndexerStorageDepositParams define storage deposit based query parameters.

type IndexerTimelockParams

type IndexerTimelockParams struct {
	// Filters outputs based on the presence of timelock unlock condition.
	HasTimelock *bool `qs:"hasTimelock,omitempty"`
	// Return outputs that are timelocked before a certain slot.
	TimelockedBefore iotago.SlotIndex `qs:"timelockedBefore,omitempty"`
	// Return outputs that are timelocked after a certain slot.
	TimelockedAfter iotago.SlotIndex `qs:"timelockedAfter,omitempty"`
}

IndexerTimelockParams define timelock query parameters.

type IndexerUnlockableByAddressParams

type IndexerUnlockableByAddressParams struct {
	// Bech32-encoded address that should be searched for.
	UnlockableByAddressBech32 string `qs:"unlockableByAddress,omitempty"`
}

IndexerUnlockableByAddressParams define address unlock related query parameters.

type InfoResBaseToken

type InfoResBaseToken struct {
	// The base token name.
	Name string `serix:",lenPrefix=uint8"`
	// The base token ticker symbol.
	TickerSymbol string `serix:",lenPrefix=uint8"`
	// The base token unit.
	Unit string `serix:",lenPrefix=uint8"`
	// The base token subunit.
	Subunit string `serix:",lenPrefix=uint8,omitempty"`
	// The base token amount of decimals.
	Decimals uint32 `serix:""`
}

InfoResBaseToken defines the base token of the node in the InfoResponse.

type InfoResNodeStatus

type InfoResNodeStatus struct {
	// Whether the node is healthy.
	IsHealthy bool `serix:""`
	// Whether the network is healthy (finalization is not delayed).
	IsNetworkHealthy bool `serix:""`
	// The accepted tangle time.
	AcceptedTangleTime time.Time `serix:""`
	// The relative accepted tangle time.
	RelativeAcceptedTangleTime time.Time `serix:""`
	// The confirmed tangle time.
	ConfirmedTangleTime time.Time `serix:""`
	// The relative confirmed tangle time.
	RelativeConfirmedTangleTime time.Time `serix:""`
	// The id of the latest known commitment.
	LatestCommitmentID iotago.CommitmentID `serix:""`
	// The latest finalized slot.
	LatestFinalizedSlot iotago.SlotIndex `serix:""`
	// The slot of the latest accepted block.
	LatestAcceptedBlockSlot iotago.SlotIndex `serix:""`
	// The slot of the latest confirmed block.
	LatestConfirmedBlockSlot iotago.SlotIndex `serix:""`
	// The epoch at which the tangle data was pruned.
	PruningEpoch iotago.EpochIndex `serix:""`
}

InfoResNodeStatus defines the status of the node in the InfoResponse.

type InfoResProtocolParameters

type InfoResProtocolParameters struct {
	StartEpoch iotago.EpochIndex         `serix:""`
	Parameters iotago.ProtocolParameters `serix:""`
}

InfoResProtocolParameters defines the protocol parameters of a node in the InfoResponse.

type InfoResponse

type InfoResponse struct {
	// The name of the node software.
	Name string `serix:",lenPrefix=uint8"`
	// The semver version of the node software.
	Version string `serix:",lenPrefix=uint8"`
	// The current status of this node.
	Status *InfoResNodeStatus `serix:""`
	// The protocol parameters used by this node.
	ProtocolParameters []*InfoResProtocolParameters `serix:",lenPrefix=uint8"`
	// The base token of the network.
	BaseToken *InfoResBaseToken `serix:""`
}

InfoResponse defines the response of a GET info REST API call.

type IssuanceBlockHeaderResponse

type IssuanceBlockHeaderResponse struct {
	// StrongParents are the strong parents of the block.
	StrongParents iotago.BlockIDs `serix:",lenPrefix=uint8"`
	// WeakParents are the weak parents of the block.
	WeakParents iotago.BlockIDs `serix:",lenPrefix=uint8,omitempty"`
	// ShallowLikeParents are the shallow like parents of the block.
	ShallowLikeParents iotago.BlockIDs `serix:",lenPrefix=uint8,omitempty"`
	// LatestParentBlockIssuingTime is the latest issuing time of the returned parents.
	LatestParentBlockIssuingTime time.Time `serix:""`
	// LatestFinalizedSlot is the latest finalized slot.
	LatestFinalizedSlot iotago.SlotIndex `serix:""`
	// LatestCommitment is the latest commitment of the node.
	LatestCommitment *iotago.Commitment `serix:""`
}

IssuanceBlockHeaderResponse defines the response of a GET block issuance REST API call.

type ManaRewardsResponse

type ManaRewardsResponse struct {
	// StartEpoch is the first epoch for which rewards can be claimed.
	// This value is useful for checking if rewards have expired (by comparing against the staking or delegation start)
	// or would expire soon (by checking its relation to the rewards retention period).
	StartEpoch iotago.EpochIndex `serix:""`
	// EndEpoch is the last epoch for which rewards can be claimed.
	EndEpoch iotago.EpochIndex `serix:""`
	// The amount of totally available decayed rewards the requested output may claim.
	Rewards iotago.Mana `serix:""`
	// The rewards of the latest committed epoch of the staking pool to which this validator or delegator belongs.
	// The ratio of this value and the maximally possible rewards for the latest committed epoch can be used to determine
	// how well the validator of this staking pool performed in that epoch.
	// Note that if the pool was not part of the committee in the latest committed epoch, this value is 0.
	LatestCommittedEpochPoolRewards iotago.Mana `serix:""`
}

ManaRewardsResponse defines the response for the mana rewards REST API call.

type NFTsQuery

type NFTsQuery struct {
	IndexerCursorParams
	IndexerTimelockParams
	IndexerExpirationParams
	IndexerStorageDepositParams
	IndexerCreationParams
	IndexerUnlockableByAddressParams

	// Bech32-encoded address that should be searched for.
	AddressBech32 string `qs:"address,omitempty"`
	// Filters outputs based on the presence of validated sender.
	SenderBech32 string `qs:"sender,omitempty"`
	// Filters outputs based on the presence of validated issuer.
	IssuerBech32 string `qs:"issuer,omitempty"`
	// Filters outputs based on matching tag feature.
	Tag string `qs:"tag,omitempty"`
}

NFTsQuery defines parameters for an NFT outputs query.

func (*NFTsQuery) SetOffset

func (query *NFTsQuery) SetOffset(cursor *string)

func (*NFTsQuery) URLParams

func (query *NFTsQuery) URLParams() (string, error)

type NetworkHealthResponse

type NetworkHealthResponse struct {
	// Whether the network is healthy (finalization is not delayed).
	IsNetworkHealthy bool `serix:""`
}

NetworkHealthResponse defines the network health response.

type NetworkMetricsResponse

type NetworkMetricsResponse struct {
	// The current rate of new blocks per second, it's updated when a commitment is committed.
	BlocksPerSecond float64 `serix:""`
	// The current rate of confirmed blocks per second, it's updated when a commitment is committed.
	ConfirmedBlocksPerSecond float64 `serix:""`
	// The ratio of confirmed blocks in relation to new blocks up until the latest commitment is committed.
	ConfirmationRate float64 `serix:""`
}

NetworkMetricsResponse defines the network metrics response.

type OutputConsumptionMetadata

type OutputConsumptionMetadata struct {
	// Slot is the slot in which the output was spent.
	Slot iotago.SlotIndex `serix:""`
	// TransactionID is the transaction ID that spent the output.
	TransactionID iotago.TransactionID `serix:""`
	// CommitmentID is the commitment ID that includes the spending of the output.
	CommitmentID iotago.CommitmentID `serix:",omitempty"`
}

type OutputInclusionMetadata

type OutputInclusionMetadata struct {
	// Slot is the slot in which the output was included.
	Slot iotago.SlotIndex `serix:""`
	// TransactionID is the transaction ID that created the output.
	TransactionID iotago.TransactionID `serix:""`
	// CommitmentID is the commitment ID that includes the creation of the output.
	CommitmentID iotago.CommitmentID `serix:",omitempty"`
}

type OutputMetadata

type OutputMetadata struct {
	// OutputID is the hex encoded output ID.
	OutputID iotago.OutputID `serix:""`
	// BlockID is the block ID that contains the output.
	BlockID iotago.BlockID `serix:""`
	// Included is the metadata of the output if it is included in the ledger.
	Included *OutputInclusionMetadata `serix:""`
	// Spent is the metadata of the output if it is marked as spent in the ledger.
	Spent *OutputConsumptionMetadata `serix:",optional,omitempty"`
	// LatestCommitmentID is the latest commitment ID of a node.
	LatestCommitmentID iotago.CommitmentID `serix:""`
}

OutputMetadata defines the response of a GET outputs metadata REST API call.

type OutputResponse

type OutputResponse struct {
	Output        iotago.TxEssenceOutput `serix:""`
	OutputIDProof *iotago.OutputIDProof  `serix:""`
}

OutputResponse defines the response of a GET outputs REST API call.

type OutputWithID

type OutputWithID struct {
	OutputID iotago.OutputID        `serix:""`
	Output   iotago.TxEssenceOutput `serix:""`
}

OutputWithID returns an output with its corresponding ID.

type OutputWithMetadataResponse

type OutputWithMetadataResponse struct {
	Output        iotago.TxEssenceOutput `serix:""`
	OutputIDProof *iotago.OutputIDProof  `serix:""`
	Metadata      *OutputMetadata        `serix:""`
}

OutputWithMetadataResponse defines the response of a GET full outputs REST API call.

type OutputsQuery

func (*OutputsQuery) SetOffset

func (query *OutputsQuery) SetOffset(cursor *string)

func (*OutputsQuery) URLParams

func (query *OutputsQuery) URLParams() (string, error)

type PeerGossipMetrics

type PeerGossipMetrics struct {
	// The total amount of received packets.
	PacketsReceived uint32 `serix:""`
	// The total amount of sent packets.
	PacketsSent uint32 `serix:""`
}

PeerGossipMetrics defines the peer gossip metrics.

type PeerInfo

type PeerInfo struct {
	// The libp2p identifier of the peer.
	ID string `serix:",lenPrefix=uint8"`
	// The libp2p multi addresses of the peer.
	MultiAddresses []iotago.PrefixedStringUint8 `serix:",lenPrefix=uint8"`
	// The alias to identify the peer.
	Alias string `serix:",lenPrefix=uint8,omitempty"`
	// The relation (manual, autopeered) of the peer.
	Relation string `serix:",lenPrefix=uint8"`
	// Whether the peer is connected.
	Connected bool `serix:""`
	// The gossip metrics for this peer.
	GossipMetrics *PeerGossipMetrics `serix:""`
}

PeerInfo defines the response of a GET peer REST API call.

type PeersResponse

type PeersResponse struct {
	Peers []*PeerInfo `serix:",lenPrefix=uint8"`
}

type PruneDatabaseRequest

type PruneDatabaseRequest struct {
	// The pruning target epoch.
	Epoch iotago.EpochIndex `serix:",omitempty"`
	// The pruning depth.
	Depth iotago.EpochIndex `serix:",omitempty"`
	// The target size of the database.
	TargetDatabaseSize string `serix:",lenPrefix=uint8,omitempty"`
}

PruneDatabaseRequest defines the request of a prune database REST API call.

type PruneDatabaseResponse

type PruneDatabaseResponse struct {
	// The current oldest epoch in the database.
	Epoch iotago.EpochIndex `serix:""`
}

PruneDatabaseResponse defines the response of a prune database REST API call.

type RoutesResponse

type RoutesResponse struct {
	Routes []iotago.PrefixedStringUint8 `serix:",lenPrefix=uint8"`
}

RoutesResponse defines the response of a GET routes REST API call.

type TransactionFailureReason

type TransactionFailureReason byte
const (
	TxFailureNone TransactionFailureReason = 0

	TxFailureConflictRejected TransactionFailureReason = 1
	TxFailureOrphaned         TransactionFailureReason = 2

	TxFailureInputAlreadySpent            TransactionFailureReason = 3
	TxFailureInputCreationAfterTxCreation TransactionFailureReason = 4
	TxFailureUnlockSignatureInvalid       TransactionFailureReason = 5

	TxFailureChainAddressUnlockInvalid            TransactionFailureReason = 6
	TxFailureDirectUnlockableAddressUnlockInvalid TransactionFailureReason = 7
	TxFailureMultiAddressUnlockInvalid            TransactionFailureReason = 8

	TxFailureCommitmentInputReferenceInvalid TransactionFailureReason = 9
	TxFailureBICInputReferenceInvalid        TransactionFailureReason = 10
	TxFailureRewardInputReferenceInvalid     TransactionFailureReason = 11

	TxFailureStakingRewardCalculationFailure    TransactionFailureReason = 12
	TxFailureDelegationRewardCalculationFailure TransactionFailureReason = 13

	TxFailureInputOutputBaseTokenMismatch TransactionFailureReason = 14

	TxFailureManaOverflow                             TransactionFailureReason = 15
	TxFailureInputOutputManaMismatch                  TransactionFailureReason = 16
	TxFailureManaDecayCreationIndexExceedsTargetIndex TransactionFailureReason = 17

	TxFailureNativeTokenSumUnbalanced TransactionFailureReason = 18

	TxFailureSimpleTokenSchemeMintedMeltedTokenDecrease TransactionFailureReason = 19
	TxFailureSimpleTokenSchemeMintingInvalid            TransactionFailureReason = 20
	TxFailureSimpleTokenSchemeMeltingInvalid            TransactionFailureReason = 21
	TxFailureSimpleTokenSchemeMaximumSupplyChanged      TransactionFailureReason = 22
	TxFailureSimpleTokenSchemeGenesisInvalid            TransactionFailureReason = 23

	TxFailureMultiAddressLengthUnlockLengthMismatch TransactionFailureReason = 24
	TxFailureMultiAddressUnlockThresholdNotReached  TransactionFailureReason = 25

	TxFailureSenderFeatureNotUnlocked TransactionFailureReason = 26

	TxFailureIssuerFeatureNotUnlocked TransactionFailureReason = 27

	TxFailureStakingRewardInputMissing             TransactionFailureReason = 28
	TxFailureStakingCommitmentInputMissing         TransactionFailureReason = 29
	TxFailureStakingRewardClaimingInvalid          TransactionFailureReason = 30
	TxFailureStakingFeatureRemovedBeforeUnbonding  TransactionFailureReason = 31
	TxFailureStakingFeatureModifiedBeforeUnbonding TransactionFailureReason = 32
	TxFailureStakingStartEpochInvalid              TransactionFailureReason = 33
	TxFailureStakingEndEpochTooEarly               TransactionFailureReason = 34

	TxFailureBlockIssuerCommitmentInputMissing TransactionFailureReason = 35
	TxFailureBlockIssuanceCreditInputMissing   TransactionFailureReason = 36
	TxFailureBlockIssuerNotExpired             TransactionFailureReason = 37
	TxFailureBlockIssuerExpiryTooEarly         TransactionFailureReason = 38
	TxFailureManaMovedOffBlockIssuerAccount    TransactionFailureReason = 39
	TxFailureAccountLocked                     TransactionFailureReason = 40

	TxFailureTimelockCommitmentInputMissing TransactionFailureReason = 41
	TxFailureTimelockNotExpired             TransactionFailureReason = 42

	TxFailureExpirationCommitmentInputMissing TransactionFailureReason = 43
	TxFailureExpirationNotUnlockable          TransactionFailureReason = 44

	TxFailureReturnAmountNotFulFilled TransactionFailureReason = 45

	TxFailureNewChainOutputHasNonZeroedID        TransactionFailureReason = 46
	TxFailureChainOutputImmutableFeaturesChanged TransactionFailureReason = 47

	TxFailureImplicitAccountDestructionDisallowed     TransactionFailureReason = 48
	TxFailureMultipleImplicitAccountCreationAddresses TransactionFailureReason = 49

	TxFailureAccountInvalidFoundryCounter TransactionFailureReason = 50

	TxFailureAnchorInvalidStateTransition      TransactionFailureReason = 51
	TxFailureAnchorInvalidGovernanceTransition TransactionFailureReason = 52

	TxFailureFoundryTransitionWithoutAccount TransactionFailureReason = 53
	TxFailureFoundrySerialInvalid            TransactionFailureReason = 54

	TxFailureDelegationCommitmentInputMissing  TransactionFailureReason = 55
	TxFailureDelegationRewardInputMissing      TransactionFailureReason = 56
	TxFailureDelegationRewardsClaimingInvalid  TransactionFailureReason = 57
	TxFailureDelegationOutputTransitionedTwice TransactionFailureReason = 58
	TxFailureDelegationModified                TransactionFailureReason = 59
	TxFailureDelegationStartEpochInvalid       TransactionFailureReason = 60
	TxFailureDelegationAmountMismatch          TransactionFailureReason = 61
	TxFailureDelegationEndEpochNotZero         TransactionFailureReason = 62
	TxFailureDelegationEndEpochInvalid         TransactionFailureReason = 63

	TxFailureCapabilitiesNativeTokenBurningNotAllowed TransactionFailureReason = 64
	TxFailureCapabilitiesManaBurningNotAllowed        TransactionFailureReason = 65
	TxFailureCapabilitiesAccountDestructionNotAllowed TransactionFailureReason = 66
	TxFailureCapabilitiesAnchorDestructionNotAllowed  TransactionFailureReason = 67
	TxFailureCapabilitiesFoundryDestructionNotAllowed TransactionFailureReason = 68
	TxFailureCapabilitiesNFTDestructionNotAllowed     TransactionFailureReason = 69

	TxFailureSemanticValidationFailed TransactionFailureReason = 255
)

func DetermineTransactionFailureReason

func DetermineTransactionFailureReason(err error) TransactionFailureReason

func TransactionFailureReasonFromBytes

func TransactionFailureReasonFromBytes(b []byte) (TransactionFailureReason, int, error)

func (TransactionFailureReason) Bytes

func (t TransactionFailureReason) Bytes() ([]byte, error)

type TransactionMetadataResponse

type TransactionMetadataResponse struct {
	// TransactionID is the hex encoded transaction ID of the transaction.
	TransactionID iotago.TransactionID `serix:""`
	// TransactionState might be pending, accepted, committed, finalized, failed.
	TransactionState TransactionState `serix:""`
	// EarliestAttachmentSlot is the slot of the earliest included valid block that contains an attachment of the transaction.
	EarliestAttachmentSlot iotago.SlotIndex `serix:""`
	// TransactionFailureReason if applicable indicates the error that occurred during the transaction processing.
	TransactionFailureReason TransactionFailureReason `serix:",omitempty"`
	// TransactionFailureDetails contains the detailed error message that occurred during the transaction processing
	// if the debug mode was activated in the retainer.
	TransactionFailureDetails string `serix:",omitempty,lenPrefix=uint16"`
}

TransactionMetadataResponse defines the response of a GET transaction metadata REST API call.

type TransactionState

type TransactionState byte
const (
	// TransactionStateUnknown indicates that the state of the transaction can not be determined by the node for some reason.
	TransactionStateUnknown TransactionState = iota
	// TransactionStatePending indicates that the transaction has been booked by the node but not yet accepted.
	TransactionStatePending
	// TransactionStateAccepted indicates that the transaction meets the following 4 conditions:
	//	- Signatures of the transaction are valid.
	//  - The transaction has been approved by the super majority of the online committee (potential conflicts are resolved by this time).
	//	- The transactions that created the inputs were accepted (monotonicity).
	//  - At least one valid attachment was accepted.
	TransactionStateAccepted
	// TransactionStateCommitted indicates that the slot of the earliest accepted attachment of the transaction was committed.
	TransactionStateCommitted
	// TransactionStateFinalized indicates that the transaction is accepted and the slot containing the transaction has been finalized by the node.
	// This state is computed based on the accepted transaction's earliest included attachment slot being smaller or equal than the latest finalized slot.
	TransactionStateFinalized
	// TransactionStateFailed indicates that the transaction has not been executed by the node due to a failure during processing.
	TransactionStateFailed
)

func TransactionStateFromBytes

func TransactionStateFromBytes(b []byte) (TransactionState, int, error)

func (TransactionState) Bytes

func (t TransactionState) Bytes() ([]byte, error)

func (*TransactionState) DecodeJSON

func (t *TransactionState) DecodeJSON(state any) error

func (TransactionState) EncodeJSON

func (t TransactionState) EncodeJSON() (any, error)

func (TransactionState) String

func (t TransactionState) String() string

type UTXOChangesFullResponse

type UTXOChangesFullResponse struct {
	// CommitmentID is the commitment ID of the requested slot that contains the changes.
	CommitmentID iotago.CommitmentID `serix:""`
	// The outputs that are created in this slot.
	CreatedOutputs []*OutputWithID `serix:",lenPrefix=uint32"`
	// The outputs that are consumed in this slot.
	ConsumedOutputs []*OutputWithID `serix:",lenPrefix=uint32"`
}

UTXOChangesFullResponse defines the response for the UTXO changes per slot REST API call. It returns the full information about the outputs with their corresponding ID.

type UTXOChangesResponse

type UTXOChangesResponse struct {
	// CommitmentID is the commitment ID of the requested slot that contains the changes.
	CommitmentID iotago.CommitmentID `serix:""`
	// The outputs that are created in this slot.
	CreatedOutputs iotago.OutputIDs `serix:",lenPrefix=uint32"`
	// The outputs that are consumed in this slot.
	ConsumedOutputs iotago.OutputIDs `serix:",lenPrefix=uint32"`
}

UTXOChangesResponse defines the response for the UTXO changes per slot REST API call.

type ValidatorResponse

type ValidatorResponse struct {
	// AddressBech32 is the account address of the validator.
	AddressBech32 string `serix:"address,lenPrefix=uint8"`
	// StakingEndEpoch is the epoch until which the validator registered to stake.
	StakingEndEpoch iotago.EpochIndex `serix:""`
	// PoolStake is the sum of tokens delegated to the pool and the validator stake.
	PoolStake iotago.BaseToken `serix:""`
	// ValidatorStake is the stake of the validator.
	ValidatorStake iotago.BaseToken `serix:""`
	// FixedCost is the fixed cost that the validator receives from the total pool reward.
	FixedCost iotago.Mana `serix:""`
	// Active indicates whether the validator was active recently, and would be considered during committee selection.
	Active bool `serix:""`
	// LatestSupportedProtocolVersion is the latest supported protocol version of the validator.
	LatestSupportedProtocolVersion iotago.Version `serix:""`
	// LatestSupportedProtocolHash is the protocol hash of the latest supported protocol of the validator.
	LatestSupportedProtocolHash iotago.Identifier `serix:""`
}

ValidatorResponse defines the response used in stakers response REST API calls.

type ValidatorsResponse

type ValidatorsResponse struct {
	Validators []*ValidatorResponse `serix:",lenPrefix=uint16"`
	PageSize   uint32               `serix:""`
	Cursor     string               `serix:",lenPrefix=uint8,omitempty"`
}

ValidatorsResponse defines the response for the staking REST API call.

Jump to

Keyboard shortcuts

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