ORRANGE / Developer

Local Development

Where everything lives, and how the pieces fit. Start with Quickstart to run the app; come back here to navigate the code.

src/
├── app/         App Router pages + API routes (/api/ai/analyze, /api/launch/metadata)
├── components/  wallet UI, app shell, landing, docs shell
├── config/      networks (one authoritative config), launchpad
├── context/     WalletRuntimeContext, NetworkContext
├── docs/        documentation navigation (this site)
├── wallet/      Wallet Core: runtime, custody, keystore, account adapters, privacy session
├── privacy/     STRK20 privacy: Strk20Adapter (official SDK), allowance, private-curve
├── services/    chain/data + feature services (balances, prices, swap, treasury, launch)
├── ai/          Hamster: provider, schema, portfolio, policy, health, prices
└── utils/       formatters, helpers

src/ai — Hamster

The entire copilot, fully deterministic where it matters:

  • provider.ts — the single LLM seam (OpenAI-compatible). See AI Provider.
  • schema.ts + agent.ts — structured proposal schema, validation, and the system prompt.
  • portfolio.ts / prices.ts — privacy-minimized portfolio and the price feed (AVNU live + static fallback).
  • policy.ts — the deterministic engine, guardrail presets, andsimulateAction. See AI + Policy Architecture.
  • health.ts — advisory health/risk metrics and diagnosis copy.

src/wallet — Wallet Core (the wallet)

  • runtime.ts — the ONE wallet runtime the UI talks to (WalletRuntime); safe UI state, generation/stale guards, deploy/send/privacy orchestration.
  • walletCore.ts / keystore.ts / crypto.ts /storage.ts — custody: keygen, AES-GCM + PBKDF2 keystore, create/unlock/ deploy/sign/send, public vs private storage.
  • account/ — Ready + Braavos account adapters (self-custodial) with on-chain ownership verification.
  • privacy.tsWalletPrivacySession: the wallet-native STRK20 viewing key (ORRANGE_WALLET_CORE_STRK20_VIEWING_KEY_V1, in-memory only) and the privacy-operation serialization mutex.

src/privacy — STRK20 privacy protocol

  • strk20/Strk20Adapter.ts — the single generic adapter over the official vendored STRK20 SDK (register / shield / transfer / unshield / balances). No Privy, no Wallet API.
  • strk20/allowance.ts — wallet-generic STRK allowance (STRK headroom; non-STRK tokens approved exactly).
  • strk20/privateCurve.ts — launchpad private-curve trade composed on the generic adapter.
  • identity/PrivateIdentity (app-level namespace + SDK shadow commitments; never stores keys).

src/services — chain/data + feature services

  • chains/publicBalances.ts — neutral on-chain public-balance reads (RPC/ERC-20).
  • treasuryService.ts — the AI treasury execution gate (executeIntent / executeProposal).
  • swapService.ts / priceService.ts — AVNU public swaps and pricing.
  • launchService.ts / launchMetadata.ts — launchpad browse data (create/trade gated pending Wallet Core migration).

src/app — routes and API

Product routes live under src/app/: /wallet, /send, /receive, /treasury, /activity, /settings,/swap. API routes handle the AI analyze endpoint and launchpad metadata. Launchpad trade and extended/perps trading are explicitly unavailable (gated) until they are migrated to Wallet Core.

src/config + src/context

config/networks.ts is the ONE authoritative network config (networks, tokens, pool, anonymizer per network). context/WalletRuntimeContext.tsx exposes the single wallet runtime to the UI via useSyncExternalStore.

Deeper documents