Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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