Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Verity — Frontend

React + Vite frontend for Verity, the AI trade-finance underwriting marketplace on X Layer. Reads positions directly from the deployed RWAPositions contract (no indexer needed at this scale), and calls the score-position Supabase edge function for AI risk analysis.

Setup

npm install
cp .env.example .env

Fill in .env:

  • VITE_RWA_CONTRACT_ADDRESS — already set to the current testnet deployment
  • VITE_SUPABASE_ANON_KEY — from Supabase Project Settings → API → anon public key

Run locally

npm run dev

Opens at http://localhost:5173. You'll need a browser wallet (MetaMask or OKX Wallet extension) installed to connect and invest — browsing positions and running AI analysis both work without a connected wallet, since those are read-only.

How it works

  • Marketplace (Hero + grid) — reads nextPositionId() and loops getPosition(id) directly against the X Layer RPC, no wallet required.
  • Analyze with AI — sends the position's on-chain data to the score-position edge function, which computes a deterministic risk score in code and asks an LLM only to explain it (see the contracts repo's supabase/functions/score-position/README.md for the full design rationale).
  • Invest — requires a connected wallet on X Layer testnet; calls invest(id, shares) on the contract with the exact required payment.

Build for deployment

npm run build

Outputs to dist/ — deploy that to Vercel, Netlify, or any static host. Remember to set the same environment variables in your hosting provider's dashboard (Vite only reads .env at build time).

Before mainnet submission

  1. Redeploy RWAPositions to X Layer mainnet (see contracts repo).
  2. Update VITE_RWA_CONTRACT_ADDRESS, VITE_XLAYER_CHAIN_ID (196), VITE_XLAYER_RPC_URL (https://rpc.xlayer.tech) in .env.
  3. Rebuild and redeploy the frontend.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages