chronik library

Classes

Block
Block data for in-node chronik
BlockchainInfo
BlockHeader
Header on the blockchain
BlockHeaders
Range of headers
BlockInfo
Block information for a chronik block
BlockMetadata
Block metadata
Blocks
Range of blocks
BroadcastResponse
Response for broadcast transaction
BroadcastTxRequest
Broadcast a single tx
BroadcastTxResponse
Response of broadcasting the tx
BroadcastTxsRequest
Broadcast multiple txs. If one of the txs fails token validation, the entire batch will not be broadcast.
BroadcastTxsResponse
Response for broadcast transaction
ChronikClient
Main client for accessing the Chronik indexer
ChronikInfo
CoinbaseData
The relevant coinbase data
ConfirmedTxsResponse
Response for confirmed transactions query
Empty
Empty msg without any data
Endpoint
A pair of Chronik HTTP and WebSocket endpoint urls
Error
Error message returned from our APIs.
FailoverProxy
Handles the networking to Chronik Endpoints, including cycling through both types of endpoints.
GenesisInfo
LokadIdEndpoint
Endpoint for querying lokad ID data
MsgBlock
Block got connected, disconnected, finalized, invalidated, etc.
MsgTx
Tx got added to/removed from mempool, or confirmed in a block, etc.
OutPoint
Outpoint referencing an output on the blockchain
PluginEndpoint
Endpoint for querying plugin data
PluginEntry
Plugin data entry
PluginGroup
PluginGroups
Response for plugin groups query
QueryEndpoint
Base class for all query endpoints
RawTx
ScriptEndpoint
Endpoint for querying script/address data
ScriptUtxo
Unspent transaction output
ScriptUtxos
List of UTXOs of a script
SpentBy
Points to an input spending a coin.
Token
Token value attached to an input or output
TokenEntry
Token involved in a transaction
TokenFailedColoring
Failed coloring report for a token
TokenFailedParsing
Failed parsing report for a token
TokenIdEndpoint
Endpoint for querying token ID data
TokenInfo
TokenType
Tx
A complete transaction with all details
TxFinalizationReason
The reason that caused a tx to finalize
TxHistoryPage
TxInput
Transaction input
TxOutput
Transaction output
Utxo
Utxos
List of UTXOs
UtxosResponse
Response for UTXO query
WsConfig
WebSocket configuration
WsEndpoint
WebSocket endpoint for real-time blockchain updates
WsMsg
Message coming from the WebSocket
WsMsgClient
WebSocket message from server
WsPlugin
Subscription to a group assigned by a plugin to outputs.
WsSub
Subscription to WebSocket updates.
WsSubBlocks
Subscription to blocks. They will be sent any time a block got connected, disconnected or finalized.
WsSubLokadId
Subscription to a LOKAD ID. They will be sent every time a tx matches the given LOKAD ID in one of the following ways:
WsSubPluginClient
WebSocket subscription for a plugin
WsSubScript
Subscription to a script. They will be sent every time a tx spending the given script or sending to the given script has been added to/removed from the mempool, or confirmed in a block.
WsSubScriptClient
WebSocket subscription for a script/address
WsSubscriptions
WebSocket subscriptions state
WsSubTokenId
Subscription to a token ID. They will be sent every time a tx spending or sending tokens with the token ID.
WsSubTxId
Subscription to a txid. They will be sent every time a tx status confirmation changes.
WsSubTxs
Subscription to all txs.

Enums

AlpTokenTypeValue
Possible ALP token types
BlockMsgType
Block message type from WebSocket
ConnectionStrategy
Connection strategy for the Chronik client
ScriptType
Type of script/address
SlpTokenTypeValue
Possible SLP token types
TokenStatus
Token status enumeration
TokenTxType
Token transaction type
TokenType_TokenType
TxFinalizationReasonType
Token transaction finalization reason type
TxMsgType
Transaction message type from WebSocket
WsMsg_MsgType
WsSub_SubType

Extensions

BlockchainInfoPatterns on BlockchainInfo
Adds pattern-matching-related methods to BlockchainInfo.
BlockInfoPatterns on BlockInfo
Adds pattern-matching-related methods to BlockInfo.
BlockMetadataPatterns on BlockMetadata
Adds pattern-matching-related methods to BlockMetadata.
BlockPatterns on Block
Adds pattern-matching-related methods to Block.
BroadcastResponsePatterns on BroadcastResponse
Adds pattern-matching-related methods to BroadcastResponse.
BroadcastTxsResponsePatterns on BroadcastTxsResponse
Adds pattern-matching-related methods to BroadcastTxsResponse.
BytesExtension on Iterable<int>
ChronikInfoPatterns on ChronikInfo
Adds pattern-matching-related methods to ChronikInfo.
ConfirmedTxsResponsePatterns on ConfirmedTxsResponse
Adds pattern-matching-related methods to ConfirmedTxsResponse.
EndpointPatterns on Endpoint
Adds pattern-matching-related methods to Endpoint.
GeneratedMessageGenericExtensions on T
Extensions on GeneratedMessages.
GenesisInfoPatterns on GenesisInfo
Adds pattern-matching-related methods to GenesisInfo.
OutPointPatterns on OutPoint
Adds pattern-matching-related methods to OutPoint.
PluginEntryPatterns on PluginEntry
Adds pattern-matching-related methods to PluginEntry.
PluginGroupPatterns on PluginGroup
Adds pattern-matching-related methods to PluginGroup.
PluginGroupsPatterns on PluginGroups
Adds pattern-matching-related methods to PluginGroups.
RawTxPatterns on RawTx
Adds pattern-matching-related methods to RawTx.
ScriptUtxoPatterns on ScriptUtxo
Adds pattern-matching-related methods to ScriptUtxo.
TokenEntryPatterns on TokenEntry
Adds pattern-matching-related methods to TokenEntry.
TokenFailedColoringPatterns on TokenFailedColoring
Adds pattern-matching-related methods to TokenFailedColoring.
TokenFailedParsingPatterns on TokenFailedParsing
Adds pattern-matching-related methods to TokenFailedParsing.
TokenInfoPatterns on TokenInfo
Adds pattern-matching-related methods to TokenInfo.
TokenPatterns on Token
Adds pattern-matching-related methods to Token.
TokenTypePatterns on TokenType
Adds pattern-matching-related methods to TokenType.
TxHistoryPagePatterns on TxHistoryPage
Adds pattern-matching-related methods to TxHistoryPage.
TxInputPatterns on TxInput
Adds pattern-matching-related methods to TxInput.
TxOutputPatterns on TxOutput
Adds pattern-matching-related methods to TxOutput.
TxPatterns on Tx
Adds pattern-matching-related methods to Tx.
UtxoPatterns on Utxo
Adds pattern-matching-related methods to Utxo.
UtxosResponsePatterns on UtxosResponse
Adds pattern-matching-related methods to UtxosResponse.
WsMsgClientPatterns on WsMsgClient
Adds pattern-matching-related methods to WsMsgClient.
WsSubPluginClientPatterns on WsSubPluginClient
Adds pattern-matching-related methods to WsSubPluginClient.
WsSubScriptClientPatterns on WsSubScriptClient
Adds pattern-matching-related methods to WsSubScriptClient.

Constants

kWebsocketTimeout → const Duration

Functions

appendWsUrls(List<String> urls) List<Endpoint>
Converts an array of chronik http/https urls into websocket equivalents and combines them into an object array
bytesToHex(Iterable<int> bytes) String
Convert bytes to hex string
convertToBlock(Block pbBlock) Block
convertToBlockchainInfo(BlockchainInfo pbInfo) BlockchainInfo
convertToBlockInfo(BlockInfo pbBlockInfo) BlockInfo
convertToChronikInfo(ChronikInfo chronikInfo) ChronikInfo
convertToGenesisInfo(GenesisInfo genesisInfo, TokenType tokenType) GenesisInfo
convertToTokenInfo(TokenInfo tokenInfo) TokenInfo
convertToTx(Tx pbTx) Tx
Convert a protocol buffer Tx to a user-friendly Tx object
convertToUtxo(Utxo utxo) Utxo
hexToBytes(String hex) List<int>
Convert a hex string to bytes
isValidLokadId(String lokadId) bool
Validate a lokad ID (should be 4 bytes in hex format)
isValidTokenId(String tokenId) bool
Validate a token ID (should be 32 bytes in hex format)
isValidTxId(String txId) bool
Validate a transaction ID (should be 32 bytes in hex format)
isValidWsSubscription(WsSubScriptClient subscription) → dynamic
Validate a WebSocket subscription to a script/address
measureWebsocketLatency(String wsUrl) Future<double>
Measure WebSocket connection latency to a given URL
normalizeScriptType(String scriptType) String
Convert a script type string to normalized ScriptType enum value
sortNodesByLatency(List<String> urls) Future<List<String>>
Sort a list of server URLs by their WebSocket latency (fastest first)
verifyLokadId(String lokadId) → void
Verify a lokad ID is valid
verifyPluginSubscription(WsSubPluginClient pluginSubscription) → void
Verify a plugin subscription is valid
verifyTokenId(String tokenId) → void
Verify a token ID is valid
verifyTxid(String txid) → void
Verify a transaction ID is valid

Typedefs

PluginEntries = Map<String, PluginEntry>
Plugin entries map

Exceptions / Errors

AllServersFailedException
Exception thrown when all failover servers have been exhausted
ChronikException
Exception thrown by Chronik client
ServerException
Exception thrown when a server is not responsive
ValidationException
Exception thrown when validation fails