PaymentContext

data class PaymentContext(val domainId: String, val payerDid: String, val chainId: String, val feeStrategy: FeeStrategy, val maxFee: TokenAmount? = null, val sponsor: SponsorRef? = null, val correlationId: String = UUID.randomUUID().toString())

The single piece of state every payment-aware blockchain operation carries.

Threaded through the SPI (BlockchainAnchorClient.writePayload(payload, ctx)) and consumed by the Trusted Domain Manager to enforce policy, reserve funds, and settle against the treasury ledger.

Constructors

Link copied to clipboard
constructor(domainId: String, payerDid: String, chainId: String, feeStrategy: FeeStrategy, maxFee: TokenAmount? = null, sponsor: SponsorRef? = null, correlationId: String = UUID.randomUUID().toString())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

CAIP-2 chain ID (e.g. eip155:137, algorand:mainnet)

Link copied to clipboard

stable ID used to reconcile reservations, receipts and ledger entries across the reserve→submit→settle lifecycle

Link copied to clipboard

the Trusted Domain ID this operation is billed to

Link copied to clipboard

how the fee is routed

Link copied to clipboard

True for any PaymentContext returned by PaymentContext.unmanaged; plugins use this to decide whether to consult the treasury or fall back to legacy embedded-credentials behaviour.

Link copied to clipboard

caller's optional hard cap; the client must abort if the estimate exceeds this even when policy would allow it

Link copied to clipboard

the DID being debited — domain DID for FeeStrategy.DomainPays, subject DID for FeeStrategy.SelfPay, sponsor DID for FeeStrategy.Sponsored

Link copied to clipboard

sponsor routing detail (only meaningful when feeStrategy is FeeStrategy.Sponsored)

Link copied to clipboard