Skip to content

[Intermediate/Advanced] Fix Pollar's own Nirium x402 demo tab (real PR to pollar-xyz/demo) #85

Description

@Eras256

Difficulty: Intermediate/Advanced (6/10). ~10–16h. TypeScript/Next.js, familiarity with nirium-pollar-adapter and x402.

Context

Pollar (Stellar-native onboarding/wallet SDK) already ships a "Nirium x402" tab in their own public demo — pollar-xyz/demo, live at demo.pollar.xyz/adapters/nirium — but it's a stub written before nirium-pollar-adapter existed:

  • app/adapters/nirium/x402/adapter.ts builds a classic Stellar Operation.payment() and calls it x402. That's not x402 — no 402 challenge, no auth-entry signing, no facilitator settlement.
  • app/adapters/nirium/adapter/page.tsx documents an aspirational agent.x402.buildPayment(p) method that does not exist in the published nirium package. The real client-side primitive is x402Fetch().

This issue is an external contribution to Pollar's own repo, not another example in this repo — it only counts if a real PR lands against pollar-xyz/demo. Reference implementation to follow already exists and is merged: pollar-xyz/pollar-apps#30 (apps/adapters/nirium) uses the exact real pattern — usePollar().getClient()createPollarSigner()createNiriumAdapter({ signer, network }).x402Fetch(url) — verified end-to-end with a real settled testnet payment.

Goal

Replace the stub in pollar-xyz/demo's Nirium tab with the real nirium-pollar-adapter integration, so demo.pollar.xyz/adapters/nirium actually performs a live x402 payment instead of a mislabeled classic payment.

Scope / Deliverables

  1. Add nirium-pollar-adapter as a dependency (@pollar/core/@pollar/react are already ^0.11.1 there — compatible).
  2. Rewrite app/adapters/nirium/x402/adapter.ts's pay function to use createPollarSigner(pollarClient) + createNiriumAdapter({ signer, network }).x402Fetch(url) against a real Nirium endpoint (GET /api/v1/premium/market, $0.05 USDC, testnet — see pollar-apps#30's apps/adapters/nirium/lib/nirium.ts for the exact working call).
  3. Update app/adapters/nirium/adapter/page.tsx's documented source snippet to match the real API (x402Fetch, not the invented buildPayment).
  4. Show the actual response and settlement tx hash (linked to Stellar Expert) in the UI — same pattern as pollar-apps#30's result panel.
  5. PR against pollar-xyz/demo explaining the before/after — this fixes a real, published-and-live inaccuracy about how Nirium's protocol works, not just an enhancement.

Acceptance criteria

  • A real PR opened against pollar-xyz/demo — link it here. Merge isn't required, but it must be a genuine working replacement, not a doc-only edit.
  • Demonstrated end-to-end on testnet: a real settled tx, hash included and independently verified on Horizon before claiming it works (same standard as this repo's other external-integration issues).
  • Testnet only. Never touches Pollar's own SDK internals — only this one demo page.

Out of scope

  • Modifying @pollar/core/@pollar/react themselves.
  • Any Pollar route besides app/adapters/nirium/.
  • Mainnet.

Pointers

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions