Sparkscan API

Sparkscan SDK - React

Lightweight React hooks for querying the Sparkscan API.

• npm: @sparkscan/api-react-sdk-hooks

Install

TerminalCode
npm install @sparkscan/api-react-sdk-hooks

Quick example

ReactCode
import { useNetworkStats } from '@sparkscan/api-react-sdk-hooks'; function Dashboard() { const { data, loading, error } = useNetworkStats({ network: 'MAINNET' }); if (loading) return <p>Loading…</p>; if (error) return <p>Error: {error.message}</p>; return <p>TVL: {data.totalValueLockedSats} sats</p>; }

See the README for full API surface and TypeScript types.

Last modified on