[Contract Storage] Replace SE with our own backend API#1893
[Contract Storage] Replace SE with our own backend API#1893jeesunikim merged 16 commits intomainfrom
Conversation
5997ce7 to
9856d93
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a new backend-driven contract storage data source (with a health-check gate) and falls back to StellarExpert when the backend is not healthy, aligning contract explorer storage retrieval with the project’s own backend API.
Changes:
- Added backend health-check and backend contract-storage query hooks.
- Updated contract explorer UI to choose backend vs StellarExpert for contract storage based on backend health.
- Updated network limit constants and introduced backend storage response typing + production env var.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/types.ts |
Adds a backend contract storage response type. |
src/query/external/useBackendHealthCheck.ts |
Introduces a periodic backend health-check query. |
src/query/external/useBackendEndpoint.ts |
Adds a backend contract storage fetch hook with cursor + sort support. |
src/constants/networkLimits.ts |
Updates live Soroban state size windows for networks. |
src/app/(sidebar)/smart-contracts/contract-explorer/page.tsx |
Wires backend health-check into contract explorer flow and passes status down. |
src/app/(sidebar)/smart-contracts/contract-explorer/components/ContractStorage.tsx |
Switches storage source to backend when healthy; adds cursor paging + server-side sorting wiring. |
src/app/(sidebar)/smart-contracts/contract-explorer/components/ContractInfo.tsx |
Uses backend health status to decide whether to fall back to StellarExpert for storage. |
.env.production |
Adds public backend base URL for production builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Preview is available here: |
3 similar comments
|
Preview is available here: |
|
Preview is available here: |
|
Preview is available here: |
|
Preview is available here: |
1 similar comment
|
Preview is available here: |
|
Preview is available here: |
quietbits
left a comment
There was a problem hiding this comment.
Works great! I think we can try to tweak TanStack Query to keep the previous data until the new data is loaded. Right now, we show loader when switching to a new page or using sort features, which makes the page content jump around.
Also, when going back to a page that I just fetched, we shouldn't need to fetch it again. This is also something we can control in TanStack Query.
|
Preview is available here: |
|
Preview is available here: |
1 similar comment
|
Preview is available here: |
|
Preview is available here: |
1 similar comment
|
Preview is available here: |
Summary:
FirstandLastbutton when we use our own backend. Sorting byupdated_atinascmode returns the last items. They'll appear for the fallback SE.