@lithosphere/sdk
pnpm add @lithosphere/sdk
# or
npm install @lithosphere/sdkQuickstart
import { LithoClient, NETWORKS, LithoError, ErrorCode } from '@lithosphere/sdk';
const client = new LithoClient('mainnet');
const height = await client.getBlockNumber();
const { formatted } = await client.getBalance('0x22d279d24f0b7ca5d49c5a7a7f032da416f72387');
console.log(`Head block: ${height}, balance: ${formatted} LITHO`);Error handling
try {
await client.getBalance('0xnot-a-real-address');
} catch (err) {
if (err instanceof LithoError && err.code === ErrorCode.INVALID_ADDRESS) {
// user input is bad — surface a friendly message
}
}Retry / backoff
Contract calls
Network registry
Last updated