Skip to main content

Compress SOL

Compress native SOL to ZK compressed SOL.
POST /api/light/compress-sol
Request:
{
  "walletId": "wallet_uuid",
  "amount": 1.5
}
Response:
{
  "success": true,
  "txHash": "5abc...",
  "compressedAmount": "1500000000",
  "decimals": 9
}

Decompress SOL

Decompress ZK compressed SOL back to native SOL.
POST /api/light/decompress-sol
Request:
{
  "walletId": "wallet_uuid",
  "amount": 1.5
}
Response:
{
  "success": true,
  "txHash": "6def...",
  "decompressedAmount": "1500000000"
}

Compress Token

Compress regular SPL tokens to ZK compressed tokens.
POST /api/light/compress-token
Request:
{
  "walletId": "wallet_uuid",
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": 100
}
Response:
{
  "success": true,
  "txHash": "7ghi...",
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "compressedAmount": "100000000",
  "decimals": 6
}

Decompress Token

Decompress ZK compressed tokens back to regular SPL tokens.
POST /api/light/decompress-token
Request:
{
  "walletId": "wallet_uuid",
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": 50
}
Response:
{
  "success": true,
  "txHash": "8jkl...",
  "decompressedAmount": "50000000"
}

Get Compressed Balance

Get balance of compressed SOL.
GET /api/light/compressed-balance/:walletId
Response:
{
  "success": true,
  "balance": "1500000000",
  "formatted": "1.5",
  "decimals": 9
}

Get Compressed Token Balance

Get balance of a specific compressed token.
GET /api/light/compressed-token-balance/:walletId/:mint
Response:
{
  "success": true,
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "balance": "100000000",
  "formatted": "100.00",
  "decimals": 6
}

Transfer Compressed Tokens

Transfer compressed tokens to another wallet.
POST /api/light/transfer
Request:
{
  "walletId": "wallet_uuid",
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "to": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
  "amount": 50
}
Response:
{
  "success": true,
  "txHash": "9mno...",
  "from": "dujNoX4...",
  "to": "9WzDXwB...",
  "amount": "50000000"
}

Create Compressed Token

Create a new compressed SPL token mint.
POST /api/light/create-token
Request:
{
  "walletId": "wallet_uuid",
  "decimals": 6
}
Response:
{
  "success": true,
  "mintAddress": "NewMint123...",
  "txHash": "abc..."
}

Error Codes

CodeDescription
INSUFFICIENT_BALANCENot enough tokens to compress/decompress
INVALID_MINTInvalid token mint address
RPC_ERRORSolana RPC connection error
INDEXER_SYNCRPC indexer not synced (retry after delay)
WALLET_LOCKEDWallet mutex lock failed