Skip to main content

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

ExampleWhat it does
payer/request-refund.tsRequest a refund for a payment in escrow
payer/submit-evidence.tsSubmit an IPFS evidence CID for a dispute
payer/freeze-payment.tsFreeze a payment to block release during investigation

Merchant

ExampleWhat it does
merchant/charge-payment.tsCharge an authorized payment (no escrow)
merchant/release-escrow.tsRelease remaining funds after escrow expires

Arbiter

ExampleWhat it does
arbiter/approve-refund.tsApprove a payer’s refund request
arbiter/review-evidence.tsReview all submitted evidence for a dispute
arbiter/distribute-fees.tsDistribute accumulated protocol fees

Scenarios

Full multi-role integration tests running against a local Anvil fork.
ScenarioWhat it does
scenarios/happy-path-release.tsAuthorize, wait for escrow, release (2 roles: payer + merchant)
scenarios/dispute-resolution.tsFull dispute lifecycle with evidence and arbitration (3 roles)