SpendPolicy

data class SpendPolicy(val caps: List<Cap> = emptyList(), val allowedStrategies: Set<KClass<out FeeStrategy>> = setOf( FeeStrategy.DomainPays::class, ), val requireSponsorAllowList: Boolean = false, val sponsorAllowList: Set<String> = emptySet())

The set of rules a domain treasury evaluates at reserve time. Exhausting any cap raises org.trustweave.anchor.exceptions.TreasuryException.CapExceeded before the operation reaches the SPI — never silently degraded.

Constructors

Link copied to clipboard
constructor(caps: List<Cap> = emptyList(), allowedStrategies: Set<KClass<out FeeStrategy>> = setOf( FeeStrategy.DomainPays::class, ), requireSponsorAllowList: Boolean = false, sponsorAllowList: Set<String> = emptySet())

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class WindowState(val chainId: String, val window: Duration, val spent: TokenAmount)

Snapshot of recent spend used by PerWindow evaluation. Plumbed in from the treasury ledger at evaluation time, not embedded in the policy.

Properties

Link copied to clipboard

the subset of FeeStrategy subclasses the domain accepts; absence rejects the strategy

Link copied to clipboard
val caps: List<Cap>

per-chain spend ceilings

Link copied to clipboard

when true, a sponsored strategy is only accepted if the sponsor DID appears in sponsorAllowList

Link copied to clipboard

DIDs permitted to sponsor this domain