Skip to content

feat: optional --guard pre-payment seller trust check - #11

Open
jywy78kgrf-create wants to merge 1 commit into
cascade-protocol:mainfrom
jywy78kgrf-create:feat/optional-merona-guard
Open

feat: optional --guard pre-payment seller trust check#11
jywy78kgrf-create wants to merge 1 commit into
cascade-protocol:mainfrom
jywy78kgrf-create:feat/optional-merona-guard

Conversation

@jywy78kgrf-create

Copy link
Copy Markdown

Opt-in, off by default. Before a payment is signed, optionally check the seller wallet via the client's onBeforePaymentCreation hook and abort on a recorded FAIL (or UNCERTAIN with --guard-strict). Fail-soft: an unreachable or unsupported check never blocks a payment. No dependency added (single fetch to merona's free, keyless trust API). Covers Base/Polygon/Solana.

  • lib/trust-guard.ts: fail-soft gate + CAIP-2 chain mapping (+ tests)
  • handler.ts: GuardConfig, registers onBeforePaymentCreation when enabled
  • commands/fetch.ts: --guard / --guard-strict flags, passed to both x402 sites
  • README: 'Optional: pre-payment guard' section

Opt-in, off by default. Before a payment is signed, optionally check the seller
wallet via the client's onBeforePaymentCreation hook and abort on a recorded
FAIL (or UNCERTAIN with --guard-strict). Fail-soft: an unreachable or
unsupported check never blocks a payment. No dependency added (single fetch to
merona's free, keyless trust API). Covers Base/Polygon/Solana.

- lib/trust-guard.ts: fail-soft gate + CAIP-2 chain mapping (+ tests)
- handler.ts: GuardConfig, registers onBeforePaymentCreation when enabled
- commands/fetch.ts: --guard / --guard-strict flags, passed to both x402 sites
- README: 'Optional: pre-payment guard' section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant