API Reference
zkCompression API
API reference for Light Protocol compression operations
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API reference for Light Protocol compression operations
POST /api/light/compress-sol
{
"walletId": "wallet_uuid",
"amount": 1.5
}
{
"success": true,
"txHash": "5abc...",
"compressedAmount": "1500000000",
"decimals": 9
}
POST /api/light/decompress-sol
{
"walletId": "wallet_uuid",
"amount": 1.5
}
{
"success": true,
"txHash": "6def...",
"decompressedAmount": "1500000000"
}
POST /api/light/compress-token
{
"walletId": "wallet_uuid",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 100
}
{
"success": true,
"txHash": "7ghi...",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"compressedAmount": "100000000",
"decimals": 6
}
POST /api/light/decompress-token
{
"walletId": "wallet_uuid",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": 50
}
{
"success": true,
"txHash": "8jkl...",
"decompressedAmount": "50000000"
}
GET /api/light/compressed-balance/:walletId
{
"success": true,
"balance": "1500000000",
"formatted": "1.5",
"decimals": 9
}
GET /api/light/compressed-token-balance/:walletId/:mint
{
"success": true,
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"balance": "100000000",
"formatted": "100.00",
"decimals": 6
}
POST /api/light/transfer
{
"walletId": "wallet_uuid",
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"to": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"amount": 50
}
{
"success": true,
"txHash": "9mno...",
"from": "dujNoX4...",
"to": "9WzDXwB...",
"amount": "50000000"
}
POST /api/light/create-token
{
"walletId": "wallet_uuid",
"decimals": 6
}
{
"success": true,
"mintAddress": "NewMint123...",
"txHash": "abc..."
}
| Code | Description |
|---|---|
INSUFFICIENT_BALANCE | Not enough tokens to compress/decompress |
INVALID_MINT | Invalid token mint address |
RPC_ERROR | Solana RPC connection error |
INDEXER_SYNC | RPC indexer not synced (retry after delay) |
WALLET_LOCKED | Wallet mutex lock failed |