Skip to content

[Contract Storage] Replace SE with our own backend API#1893

Merged
jeesunikim merged 16 commits intomainfrom
issue-1882
Mar 4, 2026
Merged

[Contract Storage] Replace SE with our own backend API#1893
jeesunikim merged 16 commits intomainfrom
issue-1882

Conversation

@jeesunikim
Copy link
Copy Markdown
Contributor

@jeesunikim jeesunikim commented Feb 18, 2026

Summary:

  • Fallback to Stellar Expert's
  • Use our own backend to fetch
  • removed First and Last button when we use our own backend. Sorting by updated_at in asc mode returns the last items. They'll appear for the fallback SE.
  • Added tracking

Copilot AI review requested due to automatic review settings February 18, 2026 04:14
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Feb 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/query/external/useBackendHealthCheck.ts Outdated
Comment thread src/app/(sidebar)/smart-contracts/contract-explorer/components/ContractInfo.tsx Outdated
Comment thread src/query/external/useBackendEndpoint.ts Outdated
Comment thread src/app/(sidebar)/smart-contracts/contract-explorer/page.tsx Outdated
@stellar-jenkins
Copy link
Copy Markdown

3 similar comments
@stellar-jenkins
Copy link
Copy Markdown

@stellar-jenkins
Copy link
Copy Markdown

@stellar-jenkins
Copy link
Copy Markdown

@jeesunikim jeesunikim linked an issue Feb 18, 2026 that may be closed by this pull request
@stellar-jenkins
Copy link
Copy Markdown

1 similar comment
@stellar-jenkins
Copy link
Copy Markdown

@jeesunikim jeesunikim requested a review from quietbits February 25, 2026 23:39
@stellar-jenkins
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@quietbits quietbits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/query/external/useBackendContractStorage.ts Outdated
@stellar-jenkins
Copy link
Copy Markdown

@stellar-jenkins
Copy link
Copy Markdown

1 similar comment
@stellar-jenkins
Copy link
Copy Markdown

@stellar-jenkins
Copy link
Copy Markdown

1 similar comment
@stellar-jenkins
Copy link
Copy Markdown

@jeesunikim jeesunikim merged commit 90e7d2c into main Mar 4, 2026
7 checks passed
@jeesunikim jeesunikim deleted the issue-1882 branch March 4, 2026 20:13
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Contract Storage] Replace SE with our own backend API

4 participants