Pi-Defi-world
Zyradex-frontend
TypeScript

ZyraDex is a DeFi protocol on the Pi Network that complies with the PiRC requirements and documentation for building decentralized financial platforms.

Last updated Jun 28, 2026
10
Stars
2
Forks
0
Issues
0
Stars/day
Attention Score
42
Language breakdown
TypeScript 99.0%
CSS 1.0%
JavaScript 0.0%
โ–ธ Files click to expand
README

Demo App Frontend

A Next.js 15 application that consumes the Pi DEX backend to offer portfolio tracking, liquidity management, and swap tooling.

Prerequisites

  • Node.js 18+
  • npm 10+
  • Running instance of the Pi DEX backend (see backend.md)

Installation

pnpm install

This project relies on the following environment variables:

# .env.local
NEXTPUBLICAPI_URL=http://localhost:8000

Development

pnpm run dev

Admin Authentication

Administrative actions (minting tokens, managing fees, etc.) require a backend JWT. Authenticate via the Admin Access card in Settings:

  • Launch the app within Pi Browser (or with the Pi SDK available).
  • Click Sign in as admin. The Pi SDK prompts for authentication.
  • The frontend exchanges the Pi access token with /v1/users/signin and stores the returned JWT.
  • Admin-only hooks automatically attach the bearer token using setAuthToken.
To revoke access, use Sign out of admin in the same card.

Account Import

Profile โ†’ Account Service allows a user to call /v1/account/import by providing either a secret key or mnemonic. The backend responds with the derived public key, which the frontend stores locally (no secrets are persisted). This is the recommended way to register the wallet used across dashboard, swap, and liquidity tools.

QA Checklist

Manual checks to verify the integration:

  • Dashboard loads live balances and operations for the authenticated wallet (/v1/account/*).
  • Swap quotes and executes against /v1/swap endpoints.
  • Liquidity lists pools, allows deposit/withdraw via /v1/liquidity-pools/*.
  • Mint Token requires admin login, then POSTs to /v1/tokens/mint.
  • Trustline submits to /v1/tokens/trustline.
  • Settings โ†’ Admin Access signs in/out and persists session tokens.
After significant changes run the lint suite:
npm run lint

Notable Dependencies

  • axios โ€“ HTTP client for API modules.
  • jwt-decode โ€“ Validates admin JWT expiry for session management.
  • lucide-react โ€“ Icon set used across the UI.

ยฉ 2026 GitRepoTrend ยท Pi-Defi-world/Zyradex-frontend ยท Updated daily from GitHub