BlockchainAnchorClient

Interface for blockchain anchoring operations. This interface is chain-agnostic; specific blockchain implementations will be provided in separate adapter modules.

Inheritors

Functions

Link copied to clipboard

Estimate the native-token fee that an operation would cost on this chain. Plugins compute this from the chain's native API (eth_feeHistory, Algorand suggested params, Cardano protocol params, Bitcoin estimatesmartfee, …). The default returns TokenAmount.unknown for plugins that have not yet implemented the payment plane.

Link copied to clipboard
abstract suspend fun readPayload(ref: AnchorRef): AnchorResult

Reads a payload from the blockchain using an anchor reference.

Link copied to clipboard
open suspend fun verifyAnchor(payload: JsonElement, ref: AnchorRef): Boolean

Verifies that payload is the payload anchored at ref, enabling third-party verification of an anchor without trusting the presenter.

Link copied to clipboard
open suspend fun verifyAnchorDetailed(payload: JsonElement, ref: AnchorRef, requireCanonicalEnvelope: Boolean): AnchorVerification

verifyAnchor with an explanation of the outcome: whether the anchor came from a client's in-memory test fallback (AnchorVerification.testMode) and why verification failed.

Link copied to clipboard
abstract suspend fun writePayload(payload: JsonElement, mediaType: String = "application/json"): AnchorResult

Writes a payload to the blockchain and returns an anchor reference.

open suspend fun writePayload(payload: JsonElement, ctx: PaymentContext, mediaType: String = "application/json"): AnchorResult

Payment-aware write. Plugins that opt into the payment plane override this; the default delegates to the legacy writePayload so existing implementations keep compiling.