Feature/issue 5 persist stellar publickey - #26
Closed
Codex723 wants to merge 49 commits into
Closed
Conversation
Update various files with fixes and changes
Cleanup/remove default svgs
…on to let Next.js builder handle it automatically
fix vercel.json and update package-lock.json
- Prisma schema with User, Transaction, Rate models (CockroachDB) - Auth: register/login/logout/me with bcrypt + JWT + httpOnly cookies - Middleware protecting authenticated routes - Stellar: create account (Friendbot), fetch rates (Horizon + fallback), build path_payment_strict_send XDR, submit signed XDR - Wire Send page: live rate from /api/stellar/rate - Wire Review page: client-side XDR signing (testnet-only shortcut) + submit to /api/stellar/submit - Wire Activity page: real transactions from /api/transactions - Wire Dashboard page: real transaction count and recent activity - Login/Register page with reusable design system - Zod validation on all API routes - Build compiles with zero errors (20 routes)
…tinstall script for prisma generate
…crow scaffold + FOUNDATION.md
…eview, activity, anchors, rates, routes
…Skeleton component
- Add src/lib/rates.ts - core price engine (CoinGecko + Frankfurter APIs) - Wire fetchRate() in stellar.ts to the real price engine - Update rate API route to return full metadata - Add cron endpoint for Vercel Cron Jobs - Configure vercel.json with periodic cron schedule - Update rates page to fetch live data from the API with auto-refresh Cache chain: Fresh DB cache (< 5 min) -> API fetch -> Stale DB cache -> 1.00 Supports 21 crypto/fiat pairs routed through USD
Frankfurter API (European Central Bank) does NOT support African currencies (NGN, XAF, XOF, GHS, KES, ZAR), so USD/NGN and all African pairs always returned '1.00'. Changes: - Replace Frankfurter with ExchangeRate-API (free, no key, 150+ currencies including ALL African currencies) - Cache the entire ExchangeRate-API response in memory (one fetch gets every forex rate at once, avoiding per-currency rate limit issues) - Add hardcoded FALLBACK_RATES map so prices are realistic even when APIs are unreachable - Remove src/app/api/cron/update-rates route and Vercel Cron config (paid feature) — in-memory cache auto-refreshes on first request
- Reduced nav item padding (py-2 instead of py-3) and text size (text-sm) - Smaller icons (text-lg instead of default) - Compact logo (9x9 vs 10x10) with gradient background - Active state: full gradient background (primary->primary/70) with glow blur effect and left white accent bar - Hover state: subtle primary gradient overlay with scale effect - Added glass morphism to sidebar background (backdrop-blur-xl, 80% opacity) - Added web3 keyframe animations (glowPulse, shimmerSweep, borderGlow) - Smaller bottom section items with thinner borders
This workflow installs Deno and runs linting and tests on push and pull request events.
…ot funding - Generate a real Keypair via Keypair.random() - Fund the account via Friendbot on testnet (GET https://friendbot.stellar.org?addr=<publicKey>) - Handle Friendbot HTTP errors (e.g. already funded) and network failures gracefully - Return publicKey/secretKey pair on success or failure Closes #4
…account feat: replace createTestnetAccount() stub with real Keypair + Friendbot funding
- Add db import and user update call in POST /api/stellar/account - Return 409 Conflict if user already has a stellarPublicKey - Add comprehensive route tests for the endpoint - Add vitest config and test setup - Update CI workflow to run API tests - Fix pre-existing contract compilation errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Summary
Branch:
feature/persist-stellar-publickeyChanges Made
Main Implementation (
src/app/api/stellar/account/route.ts):dbimport from@/lib/dbstellarPublicKey- returns 409 Conflict if user already has onedb.user.update()call to persist thestellarPublicKeyto the user record aftercreateTestnetAccount()succeedsTest Suite (
src/app/api/stellar/account/route.test.ts):Infrastructure:
vitest.config.tsfor test configurationsrc/test/setup.tsfor test environment setuppackage.jsonwithtestandtest:apiscripts.github/workflows/backendci.ymlto run API tests in CI.github/workflows/contracts.ymlfor Rust/Soroban contract tests.github/workflows/frontend.ymlfor frontend CI (lint, test, build)Bug Fixes:
contracts/escrow/src/lib.rs(added.clone()toescrow_idinrelease()andrefund()functions)contracts/escrow/src/test.rs(removed unused imports).gitignoreto include Rust and vitest directoriesAcceptance Criteria
How to Test
Run
npm run testto execute the test suite.Closes #5