Client Example
The official example client is available here:
https://github.com/mntgmry-tech/atomic-stream-examples
It demonstrates:
- x402 HTTP payment flow for schema and renew
- WebSocket connection and control messages
- Renewal handling (
httpandinbandmodes) - Structured logging for events and status
Key scripts
bash
npm run dev
npm run build
npm startEnvironment variables
The example uses these variables (full list in .env.example):
SVM_PRIVATE_KEY(required)PUBLIC_HTTP_BASE_URL(defaulthttps://x402.atomicstream.net)X402_SCHEMA_PATH(default/v1/schema/stream/mempool-sniff; set to/v2/schema/stream/<id>for v2)RENEW_METHOD(httporinband)WATCH_ACCOUNTS,WATCH_PROGRAMSEVENT_FORMAT,INCLUDE_ACCOUNTS,INCLUDE_TOKEN_BALANCE_CHANGESINCLUDE_LOGS,INCLUDE_INSTRUCTIONS,FILTER_TOKEN_BALANCES
Keypair conversion helper
If you have a Solana CLI keypair file:
bash
npm run keypair-to-base58 -- ~/.config/solana/id.json