BlockchainService

class BlockchainService(blockchainRegistry: BlockchainAnchorRegistry)

Focused service for blockchain anchoring operations.

Provides a clean API for anchoring data to blockchains and reading anchored data.

Example:

val blockchainService = BlockchainService(blockchainRegistry)
val anchor = blockchainService.anchor(
data = myData,
serializer = MyData.serializer(),
chainId = "algorand:testnet"
)

Constructors

Link copied to clipboard
constructor(blockchainRegistry: BlockchainAnchorRegistry)

Functions

Link copied to clipboard
suspend fun <T : Any> anchor(data: T, serializer: KSerializer<T>, chainId: String): AnchorResult

Anchors data to a blockchain.

Link copied to clipboard

Gets available blockchain chains.

Link copied to clipboard
suspend fun <T : Any> read(ref: AnchorRef, serializer: KSerializer<T>): T

Reads anchored data from a blockchain.