chronik/utils library

Utility functions for Chronik client

Functions

bytesToHex(List<int> bytes) String
Convert bytes to hex string
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)
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)