Railnet SDK
TypeScript SDK for interacting with the Railnet protocol. Built on top of viem, with first-class support for React and TanStack Query.
Features
- Viem Actions - Standalone async functions that work with any viem
Client. - React Hooks - Wagmi-powered hooks with automatic re-fetching and caching.
- TanStack Query - Query options for full control over caching and data fetching.
- Type-safe - End-to-end type safety with TypeScript.
Quick Start
import { createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
import { getConduitPosition } from '@railnetorg/railnet-sdk'
const client = createPublicClient({
chain: base,
transport: http(),
})
const position = await getConduitPosition(client, {
conduit: '0x...',
account: '0x...',
})
console.log(position.shares) // shares held
console.log(position.assets) // equivalent asset valuePackages
| Export | Description |
|---|---|
@railnetorg/railnet-sdk | Core actions, ABIs, types and utilities |
@railnetorg/railnet-sdk/react | React hooks and TanStack Query integrations |