Skip to content

mergeSpendState

mergeSpendState(state, spend): SpendState

Defined in: src/policy/spending-policy.ts:257

Fold a successful spend back into a SpendState (pure; returns a new state). The caller of the local adapter uses this to keep cumulativeCap meaningful across calls — local does not own an authoritative ledger.

Parameters

state

SpendState

spend

token

`0x${string}`

value

bigint

Returns

SpendState