Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 782 Bytes

File metadata and controls

32 lines (23 loc) · 782 Bytes

x402 Examples

Mode 1: CLI

See cli.sh - query directly from the terminal.

export X402_PRIVATE_KEY=0x...
export X402_CHAIN=base-sepolia
./cli.sh http://localhost:7700/api/x402/deployments/id/Qm... '{ indexers { id } }'

Mode 2: Programmatic

See programmatic.ts - use in scripts without a build step.

export X402_PRIVATE_KEY=0x...
export X402_CHAIN=base-sepolia
npx tsx programmatic.ts http://localhost:7700/api/x402/deployments/id/Qm... '{ indexers { id } }'

Mode 3: Typed SDK

See index.ts + .graphclientrc.yml - full type safety with generated SDK.

export X402_PRIVATE_KEY=0x...
export X402_CHAIN=base-sepolia
npx graphclient build
npx tsx index.ts