Documentation Index
Fetch the complete documentation index at: https://docs.x402r.org/llms.txt
Use this file to discover all available pages before exploring further.
The x402r-sdk repo includes runnable examples for every role. Each example starts a local Anvil fork, deploys contracts, and runs. No wallet or testnet funds needed.
Running
git clone https://github.com/BackTrackCo/x402r-sdk.git
cd x402r-sdk
pnpm install && pnpm build
Then run any example:
# Per-action examples
pnpm example:payer:request-refund
pnpm example:merchant:charge
pnpm example:arbiter:approve-refund
# Multi-role scenarios
pnpm scenario:release
pnpm scenario:dispute
Payer
| Example | What it does |
|---|
payer/request-refund.ts | Request a refund for a payment in escrow |
payer/submit-evidence.ts | Submit an IPFS evidence CID for a dispute |
payer/freeze-payment.ts | Freeze a payment to block release during investigation |
Merchant
| Example | What it does |
|---|
merchant/charge-payment.ts | Charge an authorized payment (no escrow) |
merchant/release-escrow.ts | Release remaining funds after escrow expires |
Arbiter
| Example | What it does |
|---|
arbiter/approve-refund.ts | Approve a payer’s refund request |
arbiter/review-evidence.ts | Review all submitted evidence for a dispute |
arbiter/distribute-fees.ts | Distribute accumulated protocol fees |
Scenarios
Full multi-role integration tests running against a local Anvil fork.
| Scenario | What it does |
|---|
scenarios/happy-path-release.ts | Authorize, wait for escrow, release (2 roles: payer + merchant) |
scenarios/dispute-resolution.ts | Full dispute lifecycle with evidence and arbitration (3 roles) |