Description
When the dApp's backend API rate-limits any request (not just invoice creation), the frontend surfaces a generic network error rather than explaining the situation and automatically retrying. A unified rate-limit handler with countdown and auto-retry should apply to all API calls across the application.
Technical Context
src/lib/api.ts (new or refactored) is a central fetch wrapper that intercepts 429 responses, reads the Retry-After header, and schedules an automatic retry using setTimeout. src/context/RateLimitContext.tsx (new) tracks the global rate-limit state and exposes it to src/components/layout/RateLimitBar.tsx (new), which renders a slim banner at the top of the page showing the countdown. Individual hooks in src/hooks/ use the central api wrapper instead of raw fetch.
Acceptance Criteria
Description
When the dApp's backend API rate-limits any request (not just invoice creation), the frontend surfaces a generic network error rather than explaining the situation and automatically retrying. A unified rate-limit handler with countdown and auto-retry should apply to all API calls across the application.
Technical Context
src/lib/api.ts(new or refactored) is a centralfetchwrapper that intercepts 429 responses, reads theRetry-Afterheader, and schedules an automatic retry usingsetTimeout.src/context/RateLimitContext.tsx(new) tracks the global rate-limit state and exposes it tosrc/components/layout/RateLimitBar.tsx(new), which renders a slim banner at the top of the page showing the countdown. Individual hooks insrc/hooks/use the centralapiwrapper instead of rawfetch.Acceptance Criteria