Difficulty: Advanced (senior · 7/10). ~12–18h. Node/TypeScript CLI, Stellar keypair handling, x402.
Context
packages/cli is currently minimal (only a create scaffold command). Developers want to (a) pay an x402-protected endpoint straight from the terminal and (b) spin up a protected endpoint to test against — without writing code. Both belong in the existing nirium CLI.
Goal
Two new commands in the existing nirium CLI, fully typed and tested.
Scope / Deliverables
nirium pay <url> [--amount] [--network] — reads the 402 payment requirements, signs the Stellar auth entry from a configured secret, performs the pay→retry, and prints the response plus a tx reference.
nirium serve --price --pay-to [--port] — starts a local x402-protected demo endpoint by wrapping the SDK's own x402Serve() (don't reimplement verification/settlement) so a developer can test pay against it.
- Config & safety: secret via env or a
nirium config store; the secret is never printed; actionable errors on misconfig.
--help for both commands with examples; clean, scriptable output.
- Tests: argument parsing + the full 402 flow with the network mocked.
- Update the CLI
README.
Acceptance criteria
nirium pay works end-to-end on testnet against a real facilitator (include a tx hash that resolves on stellar.expert in the PR).
- No secret leakage in logs or output; typed public surface; lint/CI pass.
Pointers
- Extend
packages/cli; reuse the SDK's x402 client (initX402/x402Fetch) and x402Serve() — keep @x402/* versions aligned with the SDK.
- The credential header the client must send after a 402 is
PAYMENT-SIGNATURE — not X-PAYMENT (x402 v1). Several past submissions on this repo got this wrong; the SDK's own client already handles it correctly, so lean on it rather than hand-rolling the flow.
Test target (live, verified)
Pay against Nirium's own live testnet x402 endpoint — confirmed responding today:
GET https://nirium-agent.fly.dev/api/v1/premium/signals
Returns a real 402 with a payment-required header (x402 v2, stellar:testnet, 0.02 USDC, fees sponsored). No API key needed. This is the same endpoint referenced in the SDK's own README examples.
Out of scope
- MPP support in the CLI (x402 only for this issue).
- A GUI — terminal only.
References
Reward
Eligibility is subject to GrantFox review under this campaign. Rewards are decided by GrantFox based on quality and available budget and are not guaranteed.
Difficulty: Advanced (senior · 7/10). ~12–18h. Node/TypeScript CLI, Stellar keypair handling, x402.
Context
packages/cliis currently minimal (only acreatescaffold command). Developers want to (a) pay an x402-protected endpoint straight from the terminal and (b) spin up a protected endpoint to test against — without writing code. Both belong in the existingniriumCLI.Goal
Two new commands in the existing
niriumCLI, fully typed and tested.Scope / Deliverables
nirium pay <url> [--amount] [--network]— reads the402payment requirements, signs the Stellar auth entry from a configured secret, performs the pay→retry, and prints the response plus a tx reference.nirium serve --price --pay-to [--port]— starts a local x402-protected demo endpoint by wrapping the SDK's ownx402Serve()(don't reimplement verification/settlement) so a developer can testpayagainst it.nirium configstore; the secret is never printed; actionable errors on misconfig.--helpfor both commands with examples; clean, scriptable output.README.Acceptance criteria
nirium payworks end-to-end on testnet against a real facilitator (include a tx hash that resolves on stellar.expert in the PR).Pointers
packages/cli; reuse the SDK's x402 client (initX402/x402Fetch) andx402Serve()— keep@x402/*versions aligned with the SDK.PAYMENT-SIGNATURE— notX-PAYMENT(x402 v1). Several past submissions on this repo got this wrong; the SDK's own client already handles it correctly, so lean on it rather than hand-rolling the flow.Test target (live, verified)
Pay against Nirium's own live testnet x402 endpoint — confirmed responding today:
Returns a real
402with apayment-requiredheader (x402 v2,stellar:testnet, 0.02 USDC, fees sponsored). No API key needed. This is the same endpoint referenced in the SDK's own README examples.Out of scope
References
Reward
Eligibility is subject to GrantFox review under this campaign. Rewards are decided by GrantFox based on quality and available budget and are not guaranteed.