Server API
Complete reference for server-side APIs provided by Levr SDK.
Categories
Query Functions
Core data fetching functions:
- getProject() - Get project data (static + dynamic)
- getStaticProject() - Get static project data only
- getProjects() - Get multiple projects data
- getUser() - Get user data (balances, staking, voting power)
- proposals() - Get governance proposals with vote receipts
- proposal() - Get single proposal by ID
- getAirdropStatus() - Get multi-recipient airdrop status with IPFS integration
- getFactoryConfig() - Get factory configuration (governance parameters)
- fetchVaultData() - Get vault allocation data
- getVaultStatus() - Compute vault status with messages
- balance() - Get token balances (used internally by getUser)
- feeReceivers() - Get fee receiver information
- configureSplits() - Configure fee splitter splits
- updateRecipientToSplitter() - Update fee recipient to splitter
Class APIs
Class-based APIs for operations:
- Stake - Staking operations
- Governance - Governance operations
Swap Functions
Uniswap V3/V4 swap functionality:
Utilities
Helper functions and constants:
- getUsdPrice() - Get USD prices
- updateFeeReceiver() - Update fee receiver address
- Constants - Exported constants (includes
GET_VAULT_ADDRESS,GET_FEE_SPLITTER_ADDRESS)
Quick Example
typescript
import { getProject, Stake } from 'levr-sdk'
import { createPublicClient, createWalletClient, http } from 'viem'
import { base } from 'viem/chains'
const publicClient = createPublicClient({
chain: base,
transport: http(),
})
// Get project data
const projectData = await getProject({
publicClient,
clankerToken: '0x...',
})
if (!projectData) {
throw new Error('Project not found')
}
// Use staking
const stake = new Stake({
wallet: walletClient,
publicClient,
project: projectData,
})
await stake.approve(1000)
await stake.stake(1000)