Add web frontend for vault-strategy Solana program - #116
Merged
Conversation
- Run biome check --write across the new app (quote style, semicolons, import order) - Add type="button" to non-submit buttons (a11y/useButtonType) - Suppress useExhaustiveDependencies for the intentional refresh tick dependency - Suppress noUnknownAtRules for Tailwind v3 directives in index.css Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCy1icrZWHGqyWRCYqYJmf
- verify-client.mjs: @coral-xyz/anchor is CJS; BN only exists on the default export under Node ESM interop, so the script failed with 'BN is not a constructor' on a clean install. Resolve exports from both namespaces. - Remove committed build artifacts (vite.config.js, vite.config.d.ts, *.tsbuildinfo) and gitignore them. The compiled vite.config.js is a real footgun: Vite resolves .js config before .ts, so a stale compiled copy silently shadows vite.config.ts. - Point composite-project emit and tsbuildinfo at node_modules/.tmp so tsc -b never writes artifacts into the source tree again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCy1icrZWHGqyWRCYqYJmf
Generate app/src/idl/vault_strategy.json from the program source with anchor idl build (anchor-cli 1.1.2, the version CI installs) instead of hand-transcribing it. The generated IDL carries the same discriminators, account orders, flags, and args as the hand-written one (verified by diff), and adds PDA seed derivations, has_one relations, known program addresses, and doc strings from the Rust source. Also update the README and comments that explained why the IDL was hand-authored, and document the regeneration command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCy1icrZWHGqyWRCYqYJmf
Collaborator
Author
|
Supersedes #115 — same frontend, with the CI failures fixed and the IDL regenerated.
Generated by Claude Code |
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.
Summary
This PR adds a complete web frontend for the vault-strategy Solana program—an educational demo of a manager-run investment vault. The app is built with Vite + React + TypeScript + Tailwind and provides both investor and manager interfaces for interacting with the on-chain vault.
Key Changes
vault_strategy.json) and generated TypeScript types for program accounts and instructionsuseVaulthook that manages strategy state, position tracking, and exposes both depositor actions (deposit/redeem) and manager actions (rebalance, set weights, add assets, collect fees)instructions.tswith builders for all program interactions (deposit, withdraw, rebalance, add asset, approve asset, initialize strategy, etc.)strategy.tsfor loading and computing strategy views, including NAV calculations, asset pricing via Pyth oracles, and position trackingInvestorViewwith deposit/redeem ticket, allocation visualization, and portfolio metricsManagerViewwith panels for rebalancing, weight adjustments, asset management, and fee collectionverify-client.mjs) that validates discriminators, PDAs, and instruction encoding against the IDLNotable Implementation Details
https://claude.ai/code/session_01GCy1icrZWHGqyWRCYqYJmf