feat(solana): add Solana network support (Mainnet, Devnet, Testnet)#358
Open
AugustoL wants to merge 14 commits intoopenscan-explorer:devfrom
Open
feat(solana): add Solana network support (Mainnet, Devnet, Testnet)#358AugustoL wants to merge 14 commits intoopenscan-explorer:devfrom
AugustoL wants to merge 14 commits intoopenscan-explorer:devfrom
Conversation
Adds Solana as a third network type alongside EVM and Bitcoin, with dashboard, slots/blocks, transactions, accounts, SPL tokens, and validators views.
|
🚀 Preview: https://pr-358--openscan.netlify.app |
Bumps @openscan/network-connectors to 1.7 (which now ships SolanaClient), deletes the local SolanaClientTypes stub, replaces the inline JSON-RPC client in DataService with ClientFactory.createTypedClient, and updates SolanaAdapter and adaptersFactory to use the real types.
…kIndicator - Add public Solana RPC endpoints (mainnet-beta, devnet, testnet) to BUILTIN_RPC_DEFAULTS so the app can connect out of the box - Add Solana branch to NetworkBlockIndicator so the navbar shows the current slot for Solana networks instead of crashing with "At least one RPC URL must be provided"
Adds PublicNode, dRPC, Ankr, and Pocket Network as additional fallback RPCs for Solana mainnet, devnet, and testnet so the fallback strategy has more options when the official endpoints are rate-limited.
Refactors all Solana pages to use the same shared style classes and patterns established by the Bitcoin/EVM pages: - Wrap pages in container-wide / page-container-padded - Use Breadcrumb on every detail and list page - Use block-display-card, blocks-header, block-display-header, block-label, tx-details, tx-row, tx-value, tx-mono, tx-link - Use dash-table / table-wrapper / table-cell-* classes for tables - Use block-status-badge for status indicators - Use LoaderWithTimeout for loading states - Add CopyButton to addresses, signatures, mints, blockhashes - Skeleton placeholders match the Bitcoin loading pattern New display components extracted (mirroring BitcoinBlockDisplay pattern): - SolanaSlotDisplay - SolanaTransactionDisplay - SolanaAccountDisplay
- SolanaTransactionsPage and SolanaAccountDisplay now use the shared table-status-badge / table-status-success / table-status-failed classes (matching EVM TransactionHistory) so the success/failed pills render with rounded corners. - Add a block-status-failed CSS rule next to block-status-finalized and block-status-pending so the SolanaTransactionDisplay header badge has the correct red rounded style.
…ldings Wrap the account details and token holdings inside btc-tx-details-grid so they render side-by-side, mirroring the BTC/EVM address page layout. The address row stays full-width on top, then the left column holds the account metadata (balance, owner, executable, data size, rent) and the right column holds the SPL token holdings table.
…s as section header - Move the address row into its own tx-details block outside the two-column grid so it spans the full card width. - Replace the 'Token Holdings:' tx-row label with a proper block-display-section-title header inside the right column, so the token table has its own section heading like the rest of the app.
The custom tx-link class doesn't exist — replace all occurrences in SolanaTransactionDisplay, SolanaSlotDisplay, and SolanaAccountDisplay with link-accent tx-mono, matching how BTC/EVM detail pages render their block/slot/account/tx links.
Replace the Transactions stat card (which showed the cumulative transaction count) with a Version stat card. The cumulative count isn't useful at a glance and was taking up a prominent dashboard slot.
Remove the Version stat card so the Solana dashboard header only shows SOL Price, Current Slot, and Epoch.
Replace the table-based collapsible transactions section in SolanaSlotDisplay with the tx-list / tx-list-item / tx-list-index / tx-list-hash pattern used by EVM BlockAnalyser and BTC BitcoinBlockDisplay, toggled via a more-details-toggle button. The signatures now render as a numbered list of full hashes with link-accent styling, matching how EVM and BTC blocks display their transaction lists.
8 tasks
Replace the bare <pre> with nonexistent log-output class with the shared more-details-toggle / more-details-content / detail-row pattern. Logs now render as a numbered list inside the styled container, matching how EVM raw traces and block details display expandable content.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds Solana as a third network type alongside EVM and Bitcoin. Implements the full data layer (types, adapter, service integration), 8 page views, routing for 3 Solana networks, and the i18n namespace.
Following the Bitcoin pattern: a standalone
SolanaAdapter(does not extendNetworkAdapter), separate page components, and slug-based routes (/sol,/sol-devnet,/sol-testnet).Related Issue
Type of Change
Changes Made
Foundation (Types, Config, DataService)
"solana"toNetworkTypeand ~15 new domain types insrc/types/index.ts(SolanaBlock,SolanaTransaction,SolanaAccount,SolanaTokenHolding,SolanaValidator, etc.)networks.json: Solana Mainnet (sol), Devnet (sol-devnet), Testnet (sol-testnet) with CAIP-2 chain IDsSolanaAdapter(src/services/adapters/SolanaAdapter/) using realSolanaClientfrom@openscan/network-connectorsv1.7DataServicewithisSolana()/getSolanaAdapter()usingClientFactory.createTypedClientisSolanaNetwork()tonetworkResolver.tssolana_transaction/solana_block/solana_accountconfigs toAIPromptTemplates.tsSOLANA_NETWORK_SLUGStoMetadataService.tsso the explorer fetches Solana RPCs from the metadata CDN (bumpedMETADATA_VERSIONto1.2.0-alpha.0)NetworkBlockIndicatorso navbar shows current slotDefault RPC Endpoints
BUILTIN_RPC_DEFAULTS(Solana Foundation, PublicNode, dRPC, Ankr, Pocket Network — 11 endpoints total)Utilities & Hooks
src/utils/solanaUtils.ts—lamportsToSol,formatSol,shortenSolanaAddress,isSolanaAddress,isSolanaSignature,formatStake,calculateEpochProgresssrc/hooks/useSolanaDashboard.ts— auto-refreshing dashboard hook (10s interval)Pages (
src/components/pages/solana/)All pages follow the established BTC/EVM design system using shared CSS classes (
block-display-card,tx-details,tx-row,dash-table,more-details-toggle,Breadcrumb,LoaderWithTimeout,CopyButton,link-accent, etc.)index.tsx+SolanaDashboardStats.tsx(3 stats: SOL Price, Current Slot, Epoch) +SolanaBlocksTable.tsx+SolanaTransactionsTable.tsxSolanaSlotsPage.tsxwith skeleton loading states anddash-tableSolanaSlotPage.tsx+SolanaSlotDisplay.tsx(blockhash, parent slot, block height, rewards table, collapsible transaction list usingtx-listpattern)SolanaTransactionsPage.tsxwithtable-status-badgerounded status pillsSolanaTransactionPage.tsx+SolanaTransactionDisplay.tsx(signature, status badge, fee, compute units, account keys table, instructions, collapsible inner instructions, collapsible program logs usingmore-details-content/detail-row)SolanaAccountPage.tsx+SolanaAccountDisplay.tsx(two-column layout: left = balance/owner/executable/data size/rent, right = SPL token holdings with section header)SolanaTokenPage.tsx(mint, supply, decimals, top holders table with percentage)SolanaValidatorsPage.tsx(epoch info, total stake, current + delinquent validators sorted by stake)Routing & Lazy Loading
LazyComponents.tsxApp.tsx(8 per network × 3 Solana networks), placed before the EVM:networkIdcatch-alli18n
solananamespace registered ini18n.tsandi18next.d.tssrc/locales/en/solana.jsonandes/solana.jsonwith full translationsja/,pt-BR/,zh/seeded with English (falls back via i18next)Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:run(88/88 passing)To Do
solana.jsonforpt-BR,ja,zh(currently English fallback)SearchBoxpublic/assets/networks/solana.svg(currently served from metadata CDN)Additional Notes
Architectural decision: Bitcoin-style adapter
The
SolanaAdapterdoes not extendNetworkAdapter— it follows the Bitcoin pattern of a fully standalone class. Solana's data model (slots, signatures, programs, SPL tokens) is sufficiently different from EVM that forcing it into the EVM-centricNetworkAdapterinterface would require many no-op stubs. The DataService discriminates onnetworkTypeand exposesgetSolanaAdapter()analogous togetBitcoinAdapter().CAIP-2 chain IDs
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpsolana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z