Function: reserveSpend()¶
Defined in: rine-core/dist/src/x402/spend-journal.d.ts:35
Reserve a spend under the cross-process lock and return the reserved canonical
value: the LAST local act before transmit. Inside the lock it reads today's bucket
fresh (a day computed before a contended acquire could roll over), refuses a
same-message re-pay (ALREADY_PAID unless force), re-runs the full policy
against that total (deny-by-default on a null policy), then commits spent + value
and the message id. Throws a typed X402Error on any refusal.
Parameters¶
| Parameter | Type |
|---|---|
configDir |
string |
agentId |
string |
policy |
PaymentPolicy | null |
req |
PaymentRequirements |
opts? |
ReserveSpendOptions |
Returns¶
Promise\<bigint>