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.
npm install
cp .env.example .envFill in .env:
VITE_RWA_CONTRACT_ADDRESS— already set to the current testnet deploymentVITE_SUPABASE_ANON_KEY— from Supabase Project Settings → API → anon public key
npm run devOpens 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.
- Marketplace (Hero + grid) — reads
nextPositionId()and loopsgetPosition(id)directly against the X Layer RPC, no wallet required. - Analyze with AI — sends the position's on-chain data to the
score-positionedge function, which computes a deterministic risk score in code and asks an LLM only to explain it (see the contracts repo'ssupabase/functions/score-position/README.mdfor 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.
npm run buildOutputs 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).
- Redeploy
RWAPositionsto X Layer mainnet (see contracts repo). - Update
VITE_RWA_CONTRACT_ADDRESS,VITE_XLAYER_CHAIN_ID(196),VITE_XLAYER_RPC_URL(https://rpc.xlayer.tech) in.env. - Rebuild and redeploy the frontend.