Skip to content

feat(examples): add DA payment anchoring client example#1954

Open
zse4321 wants to merge 1 commit intox402-foundation:mainfrom
zse4321:feat/da-anchoring-example
Open

feat(examples): add DA payment anchoring client example#1954
zse4321 wants to merge 1 commit intox402-foundation:mainfrom
zse4321:feat/da-anchoring-example

Conversation

@zse4321
Copy link
Copy Markdown

@zse4321 zse4321 commented Apr 7, 2026

Adds a TypeScript client example demonstrating how to anchor x402 payment decisions externally using Decision Anchor.

What it does

Wraps @x402/fetch payment flow with DA Decision Declarations:

  1. Before payment — creates a DD recording the authorization scope
  2. x402 payment — executes USDC payment via wrapFetchWithPayment
  3. After payment — confirms the DD, anchoring completion timestamp

This provides external, append-only proof of what was authorized, at what scope, at the moment of decision — independent of on-chain records and internal logs.

Files

  • examples/typescript/clients/da-anchoring/index.ts — main example
  • examples/typescript/clients/da-anchoring/package.json — deps (@x402/fetch, @x402/evm, decision-anchor-sdk)
  • examples/typescript/clients/da-anchoring/README.md — setup guide
  • Config files (.prettierrc, eslint.config.js, tsconfig.json) copied from clients/fetch

No SDK changes — examples only (private package). No changeset needed.

Checklist

  • Formatted and linted (prettier, eslint — 0 errors)
  • Commit is GPG-signed
  • No changelog fragment needed (examples-only, private package)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the examples Changes to examples label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Changes to examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant