LadderMine / LadderMine/yieldladder
[NF-20] [BACKEND] SDK: Governance Client
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 26
- Avg merge
- 4h 36m
- Merged PRs (30d)
- 8
Description
Overview
The TypeScript SDK only ever wrapped VaultRouter (its original GF-08 scope). This issue adds a first-class client for the Governance contract, which currently has zero SDK surface at all.
Problem
sdks/typescript/src/index.ts's YieldLadder class exposes exactly four methods: deposit, withdraw, earlyExit, position — all against VaultRouter. There is no way for a frontend or third-party integrator to call propose, veto, or execute on Governance, or to read a proposal's status, without hand-rolling raw Soroban RPC calls (which is exactly what the current app/src/app/governance/page.tsx ends up needing to do ad hoc, since no SDK method exists for it).
Proposed Solution
- Add a
YieldLadder.governancesub-client (or a separate exportedGovernanceClientclass, consistent with whichever pattern the maintainers prefer) with:propose(poolId: string, targetBps: number): Promise<number>(returns proposal id)veto(proposalId: number): Promise<void>execute(proposalId: number): Promise<void>proposal(proposalId: number): Promise<Proposal>— new exportedProposaltype matching the on-chain struct (id,action,proposedAtLedger,status)pendingProposals(): Promise<Proposal[]>
- Resolves the
Governancecontract address fromdeployments/{network}.json, following the same address-resolution pattern already used forVaultRouter. - Simulates before submitting for all state-changing calls, consistent with the existing
deposit/withdraw/earlyExitpattern.
Acceptance Criteria
- All five methods above are implemented and exported
-
proposal()/pendingProposals()correctly deserialize the on-chainProposalstruct into the new TypeScriptProposaltype -
veto/executecorrectly surface on-chain rejection reasons (timelock not elapsed, already vetoed, etc.) as typed errors, not raw RPC error strings - Governance contract address is resolved per-network, matching the existing
VaultRouteraddress-resolution pattern - Unit tests cover: propose returns an id, veto/execute call the right contract method with the right args, proposal deserialization
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in sdks/typescript/src/index.ts, reading the existing VaultRouter address resolution and deposit, withdraw, and earlyExit simulation patterns; compare the ad hoc calls in app/src/app/governance/page.tsx. Add the five Governance operations, Proposal deserialization, per-network address lookup, and typed rejection errors, then add unit tests covering the listed calls and deserialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100