You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ProxyOptions.onPayment is declared and documented but never invoked #321
Documented as a working example at docs/configuration.md:353:
onPayment: (info)=>console.log(`Paid ${info.amount} for ${info.model}`),
But git grep -n onPayment -- src returns only that declaration. The one other hit in src/ is x402.onPaymentCreationFailure at src/spend-control.ts:966, a different
symbol. There is no call site anywhere in src/, so the callback cannot fire on any
path -- it is passed in test/test-e2e.ts:840 and never invoked there either.
Matches observation: it did not fire on real settlements (three paid completions plus an
MCP call) while other spend accounting updated normally.
Either wiring it where a payment is confirmed, or dropping it from the type and the docs,
would be an improvement over a documented option that cannot work. Happy to send whichever
you prefer.
Activity