📋 Description
The frontend reads on-chain data through a cached contract layer: lib/cache/contract-cache.ts, lib/cache/registry.ts, and cached wrappers like lib/contracts/remittance-split-cached.ts and lib/contracts/insurance-cached.ts. The caching semantics (TTL, invalidation via app/api/cache/invalidate/route.ts, lru-cache usage) are non-obvious and undocumented, making it risky for contributors to add a new cached read correctly.
Why this matters: a contributor who caches a write result or sets the wrong TTL can serve stale balances. Clear docs on when and how to cache are essential before more readers are added.
🎯 Requirements & Context
Functional requirements
Context & constraints
🛠️ Suggested Execution
git checkout -b docs/contract-cache-guide
- Add TSDoc +
docs/contract-cache.md + README cross-link.
npm run lint
npm run test:unit
- Edge cases to document: cache miss, manual invalidation, TTL expiry, what must never be cached (writes, balances post-transfer).
Example commit message
docs(cache): document contract-cache layer and add-a-reader recipe
Adds TSDoc to cache/registry plus docs/contract-cache.md covering TTL,
invalidation, and a step-by-step new cached read recipe.
✅ Acceptance Criteria & Guidelines
| Requirement |
Target |
| TSDoc on cache/registry public API |
Required |
| docs/contract-cache.md complete + accurate |
Required |
| Invalidation endpoint documented |
Required |
| README cross-link |
Required |
| Lint + unit tests still pass |
Required |
| Timeframe |
96 hours from assignment |
💬 Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim before starting. 🚀
📋 Description
The frontend reads on-chain data through a cached contract layer:
lib/cache/contract-cache.ts,lib/cache/registry.ts, and cached wrappers likelib/contracts/remittance-split-cached.tsandlib/contracts/insurance-cached.ts. The caching semantics (TTL, invalidation viaapp/api/cache/invalidate/route.ts,lru-cacheusage) are non-obvious and undocumented, making it risky for contributors to add a new cached read correctly.🎯 Requirements & Context
Functional requirements
lib/cache/contract-cache.tsandlib/cache/registry.ts(params, TTL semantics, invalidation, what is safe to cache).docs/contract-cache.mdexplaining the read/cache/invalidate flow, the registry, and a step-by-step "add a new cached read" recipe (mirroringremittance-split-cached.ts).app/api/cache/invalidate/route.ts.README.md.Context & constraints
tests/unit/contract-cache.test.ts/tests/unit/cached-wrappers.test.ts.🛠️ Suggested Execution
docs/contract-cache.md+ README cross-link.Example commit message
✅ Acceptance Criteria & Guidelines
💬 Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim before starting. 🚀