{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "bitcoin-explorer", "title": "Bitcoin explorer", "description": "A data-source-agnostic block explorer composition.", "registryDependencies": [ "dennisonbertram/bitcoin-ui/bitcoin-ui" ], "files": [ { "path": "components/examples/bitcoin-explorer.tsx", "content": "import type { ComponentProps } from \"react\";\n\nimport {\n BitcoinSearch,\n BlockList,\n FeeEstimates,\n MempoolMeter,\n NetworkBadge,\n NetworkStats,\n TransactionRow,\n type BitcoinSearchSubmit,\n type NetworkStat,\n} from \"@/components/bitcoin\";\nimport type {\n BitcoinBlock,\n BitcoinNetwork,\n BitcoinTransaction,\n FeeEstimate,\n} from \"@/lib/bitcoin\";\nimport { cn } from \"@/lib/utils\";\n\nexport type BitcoinExplorerProps = Omit, \"children\"> & {\n network: BitcoinNetwork;\n blocks: BitcoinBlock[];\n transactions: BitcoinTransaction[];\n stats: NetworkStat[];\n feeEstimates: FeeEstimate[];\n mempool: {\n size: number;\n transactionCount: number;\n medianFeeRate: number;\n capacity?: number;\n };\n onSearch: (search: BitcoinSearchSubmit) => void | Promise;\n heading?: string;\n now?: number | Date;\n unstyled?: boolean;\n};\n\n/**\n * A data-source-agnostic block explorer composition.\n *\n * Pass data from Bitcoin Core, Esplora, Electrum, or your own indexer. The\n * block performs no fetching and makes no trust assumptions.\n */\nexport function BitcoinExplorer({\n network,\n blocks,\n transactions,\n stats,\n feeEstimates,\n mempool,\n onSearch,\n heading = \"Bitcoin explorer\",\n now,\n unstyled,\n className,\n ...props\n}: BitcoinExplorerProps) {\n return (\n \n \n
\n \n {heading}\n \n \n Read chain state from your configured source.\n

\n
\n \n \n\n \n \n\n \n \n

\n Recent blocks\n

\n \n \n
\n \n \n
\n \n\n
\n

\n Recent transactions\n

\n {transactions.map((transaction) => (\n \n ))}\n
\n \n );\n}\n", "type": "registry:component" } ], "type": "registry:block" }