predictarena
v0.1.3
Published
PredictArena CLI for DFlow prediction markets
Maintainers
Readme
PredictArena CLI
Production-ready CLI for discovering and trading DFlow prediction markets.
For agents
Requirements
- Node.js 18+
Install (deployed CLI)
npm install -g predictarenaOr run without installing:
npx predictarena <command> [options]Run
predictarena <command> [options]Examples:
predictarena categories --json
predictarena series --category Economics --json
predictarena events list --limit 5 --json
predictarena markets list --limit 3 --json
predictarena trades list --limit 5 --json
predictarena search bitcoin --limit 5 --json
predictarena wallet create ./agent-wallet.jsonDevelopment (from source)
git clone <repo> && cd predictarena
npm install && npm run build
node dist/bin.mjs --help # or: predictarena if linked via npm linkOutput formats
- Default: human-readable full JSON (no truncation)
--json: structured JSON withdata,pagination,_hints
Wallet
Create a Solana keypair for agent signing and save it to a file:
predictarena wallet create <path>The CLI writes a standard Solana keypair file (JSON array of 64 bytes) to <path> and prints the public key so you can fund it. The file is compatible with Keypair.fromSecretKey(new Uint8Array(JSON.parse(...))).
Agent / automation: Agents can run wallet create <path> autonomously. Use --json to get machine-readable output { data: { publicKey, path } }. Fund the returned publicKey before using the wallet.
Config (codebase only)
The CLI does not accept API URL or API key flags. The library reads them from env:
METADATA_API_BASEorDFLOW_METADATA_API_URL(default:https://dev-prediction-markets-api.dflow.net)TRADE_API_BASEorDFLOW_TRADE_API_URL(default:https://dev-quote-api.dflow.net)DFLOW_API_KEYorPREDICTARENA_API_KEY(optional for dev, rate-limited without)
Tests
Integration tests hit the live dev API.
npm testPublishing (maintainers)
Option A – Publish from CI (recommended)
Push a version tag to trigger publish to npm:
- In GitHub: Settings → Secrets and variables → Actions → add secret
NPM_TOKEN. Use an Automation token (not Read-only) from npmjs.com/settings/~/tokens. If you get 403, do the first publish locally once:npm loginthennpm run build && npm publish --access publicso the package is created under your account; after that CI can publish new versions. repository.urlinpackage.jsonshould point to your repo.- Bump version and push a tag:
Thenpm version patch # or minor / major git push && git push --tags.github/workflows/publish.ymlworkflow runs on tagsv*and runsnpm publish --provenance --access public.
Option B – Publish locally
npm run build
npm publish --access publicLog in first with npm login if needed. prepack runs the build before publish; files includes only dist.
