Repository navigation
feat(demo): decision receipts in the explorer, and a market sale as an example - #28
Merged
Merged
Conversation
…n example The explorer recognizes a nirium-decision-v1 receipt (what the payer's pre-sign policy decided, DENY and WAIT included) and checks it in the browser with verifyDecision: hash and payer signature, since a refusal has nothing on the chain. It shows the decision, the reason, what it would have paid, to whom and for what. New self-test: sdk/examples/decision-selftest.mjs refuses a $0.01 payment on Avalanche Fuji as DENY and as WAIT, signs nothing on-chain, and writes the two receipts now in evidence/2026-11-27. New example: a C-Chain mainnet sale (Qmf2KvRL…) of the x402 market, anchored on Audit Trail on 27 Nov. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M0nsxx
approved these changes
Nov 27, 2026
M0nsxx
left a comment
Member
There was a problem hiding this comment.
AI-assisted review (Claude)
Read the diff: the explorer recognizes a nirium-decision-v1 receipt and checks it in the browser with verifyDecision (hash and payer signature), showing the decision, the reason, the would-be amount and the payee. It adds decision-selftest.mjs and its two Fuji receipts (DENY, WAIT, nothing signed on-chain), plus a C-Chain mainnet market-sale story. tsc and 13/13 tests pass; checked in Edge, and an edited amount shows NO VÁLIDO. Approve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small receipt types the explorer did not show yet.
Decision receipts. The library already writes
nirium-decision-v1: what the payer's pre-sign policy decided about an x402 payment, including DENY and WAIT, which sign nothing and leave nothing on the chain. The explorer now recognizes one (pasted, dropped or by CID) and checks it in the browser withverifyDecision: format, hash and payer signature. It shows the decision, the reason, the policy, what it would have paid, to whom, for what and the reference, and says there is no transfer to compare against the chain.avalanche/sdk/examples/decision-selftest.mjs: a local seller charging $0.01 on Avalanche Fuji and a buyer whose policy refuses it twice (DENY: limit $0.005; WAIT: above $0.005 needs a person). Nothing settles; the payer signs a decision receipt for each. Both are inevidence/2026-11-27/, 10/10 checks.A market sale as an example: a C-Chain mainnet sale (Qmf2KvRL…) of the x402 market, anchored on Audit Trail today (pinned document = the evidence file, verifier VALID against the chain before anchoring).
The decision receipts get their own example cards once the node can anchor them (Eras256/nirium-core-private#281, then a node deploy); that is a small follow-up with the CIDs.
Checked locally in Edge: the four receipts VALID, an edited amount NO VÁLIDO, the market story VALID, no page errors. tsc and the tests pass.
🤖 Generated with Claude Code