Getting Started
- Fork the repository: https://github.com/JointSave-org/Joint_Save
- Clone your fork:
git clone https://github.com/<your-username>/Joint_Save.git
cd Joint_Save
- Create a new branch:
git checkout -b fix/main-typecheck-errors
Overview
main currently fails tsc --noEmit with three TypeScript errors, unrelated to each other and unrelated to any specific in-progress feature. This means contributors running a typecheck locally see pre-existing noise that isn't caused by their own changes, and it blocks frontend CI (#54) from passing cleanly.
A fourth, related error in group-members.tsx was already fixed in PR #74 (a JSX nesting bug from a merge conflict) — this issue covers the three that remain.
Current Errors
components/group/group-details.tsx(39,31): error TS2304: Cannot find name 'useOptimisticTransactions'.
components/group/yield-dashboard.tsx(15,18): error TS2459: Module '"@/hooks/useJointSaveContracts"' declares 'STELLAR_RPC_URL' locally, but it is not exported.
components/group/yield-dashboard.tsx(48,18): error TS2503: Cannot find namespace 'rpc'.
hooks/useJointSaveContracts.ts(662,28): error TS2339: Property 'xdr' does not exist on type 'LedgerEntryResult'.
Error 1 — Missing import in group-details.tsx
File: frontend/components/group/group-details.tsx, line 39
Issue: useOptimisticTransactions is called but never imported.
Fix: Add the missing import, e.g.:
import { useOptimisticTransactions } from "@/hooks/useOptimisticTransactions"
Confirm the correct export name and path against the actual hook file before fixing.
Error 2 — STELLAR_RPC_URL not exported
File: frontend/components/group/yield-dashboard.tsx, line 15
Issue: This file imports STELLAR_RPC_URL from @/hooks/useJointSaveContracts, but that file only declares it as a local (non-exported) constant.
Fix: Either export STELLAR_RPC_URL from useJointSaveContracts.ts, or have yield-dashboard.tsx read it directly from process.env.NEXT_PUBLIC_STELLAR_RPC_URL instead of importing it.
Error 3 — Missing rpc namespace import
File: frontend/components/group/yield-dashboard.tsx, line 48
Issue: rpc namespace is referenced but not imported.
Fix: Add the Stellar SDK import, e.g.:
import { rpc } from "@stellar/stellar-sdk"
Error 4 — LedgerEntryResult type mismatch
File: frontend/hooks/useJointSaveContracts.ts, line 662
Issue: Code accesses entry.xdr, but the installed @stellar/stellar-sdk version's LedgerEntryResult type doesn't expose that property under that name.
Fix: Check the actual SDK version in package.json against its type definitions, and use the correct field/method (e.g. entry.toXDR() or equivalent) for that version.
Acceptance Criteria
Getting Started
Overview
maincurrently failstsc --noEmitwith three TypeScript errors, unrelated to each other and unrelated to any specific in-progress feature. This means contributors running a typecheck locally see pre-existing noise that isn't caused by their own changes, and it blocks frontend CI (#54) from passing cleanly.A fourth, related error in
group-members.tsxwas already fixed in PR #74 (a JSX nesting bug from a merge conflict) — this issue covers the three that remain.Current Errors
components/group/group-details.tsx(39,31): error TS2304: Cannot find name 'useOptimisticTransactions'.
components/group/yield-dashboard.tsx(15,18): error TS2459: Module '"@/hooks/useJointSaveContracts"' declares 'STELLAR_RPC_URL' locally, but it is not exported.
components/group/yield-dashboard.tsx(48,18): error TS2503: Cannot find namespace 'rpc'.
hooks/useJointSaveContracts.ts(662,28): error TS2339: Property 'xdr' does not exist on type 'LedgerEntryResult'.
Error 1 — Missing import in
group-details.tsxFile:
frontend/components/group/group-details.tsx, line 39Issue:
useOptimisticTransactionsis called but never imported.Fix: Add the missing import, e.g.:
Confirm the correct export name and path against the actual hook file before fixing.
Error 2 —
STELLAR_RPC_URLnot exportedFile:
frontend/components/group/yield-dashboard.tsx, line 15Issue: This file imports
STELLAR_RPC_URLfrom@/hooks/useJointSaveContracts, but that file only declares it as a local (non-exported) constant.Fix: Either export
STELLAR_RPC_URLfromuseJointSaveContracts.ts, or haveyield-dashboard.tsxread it directly fromprocess.env.NEXT_PUBLIC_STELLAR_RPC_URLinstead of importing it.Error 3 — Missing
rpcnamespace importFile:
frontend/components/group/yield-dashboard.tsx, line 48Issue:
rpcnamespace is referenced but not imported.Fix: Add the Stellar SDK import, e.g.:
Error 4 —
LedgerEntryResulttype mismatchFile:
frontend/hooks/useJointSaveContracts.ts, line 662Issue: Code accesses
entry.xdr, but the installed@stellar/stellar-sdkversion'sLedgerEntryResulttype doesn't expose that property under that name.Fix: Check the actual SDK version in
package.jsonagainst its type definitions, and use the correct field/method (e.g.entry.toXDR()or equivalent) for that version.Acceptance Criteria
tsc --noEmitexits with zero errors onmain@ts-ignoreor@ts-expect-errorsuppressions used — each fix resolves the actual missing import/export/type mismatchgroup-details.tsx's optimistic transaction flow manually verified to still work correctly after the fix (this error suggests the feature may currently be broken at runtime, not just failing the type check)yield-dashboard.tsxmanually verified to load and display data correctly after the fix