Solana Token Balance API and Dashboard Integration

Solana Token Balance API and Dashboard Integration

Solana Token Balance API and Dashboard Integration

API Integration

You can use our new Get Solana Wallet Balance API to easily fetch native SOL or SPL token balances as you would with EVM wallets in terms of I/O.


Examples

Retrieve SOL Balance

fetch('https://api.thirdweb.com/v1/solana/wallets/${YOUR_ADDRESS}/balance?chainId=solana:mainnet', {
  headers: {
    'x-secret-key': 'YOUR_SECRET_KEY'
  }
})

Response Format

{
  "result": {
    "chainId": "solana:mainnet",
    "decimals": 9,
    "displayValue": "0.086260671",
    "value": "86260671"
  }
}

Retrieve SPL Token Balance (USDC Example)

fetch('https://api.thirdweb.com/v1/solana/wallets/${YOUR_ADDRESS}/balance?chainId=solana:mainnet&tokenAddress=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', {
  headers: {
    'x-secret-key': 'YOUR_SECRET_KEY'
  }
})

Response Format

{
  "result": {
    "chainId": "solana:mainnet",
    "decimals": 6,
    "displayValue": "0.004105",
    "value": "4105"
  }
}

Dashboard Integration

The dashboard now shows you server wallet balances on both Solana mainnet and devnet.

What's Next

  • x402 support
  • Equivalent to Contract Write high level Program Write API
  • User/External Wallets