OneBalance now supports Solana blockchain, enabling seamless cross-chain operations between Solana and EVM chains. This guide covers everything you need to integrate Solana into your application.

What You Can Do

Cross-Chain Swaps

Swap tokens between Solana and EVM chains (e.g. SOL → USDC on Arbitrum)

Unified Balances

View Solana and EVM balances aggregated in one place

Same-Chain Operations

Swap tokens within Solana ecosystem (SOL → USDC)

Cross-Chain Operations

Use both EVM and Solana accounts together for unified operations

Key Differences from EVM

v3 API Endpoints Required

Solana operations require the v3 API endpoints which support multiple accounts:
// v1 (EVM only) - Single account object
{
  "from": {
    "account": { "sessionAddress": "0x...", ... }
  }
}

// v3 (Cross-chain) - Accounts array
{
  "from": {
    "accounts": [
      { "type": "role-based", "sessionAddress": "0x...", ... },
      { "type": "solana", "accountAddress": "J5CC..." }
    ]
  }
}

Solana Account Structure

Solana accounts are simpler than EVM smart accounts:
{
  "type": "solana",
  "accountAddress": "J5CCzBULFax899tcirb6wMbenQUd8whbaetG7EfSick5"
}
Solana uses base58-encoded addresses and doesn’t require session/admin addresses like EVM smart accounts.

Different Signing Process

Solana transactions use a different signing mechanism:
import { MessageV0, VersionedTransaction } from '@solana/web3.js';
import bs58 from 'bs58';

async function signSolanaOperation(dataToSign: string, wallet: any) {
  // 1. Convert base64 data to Message
  const message = MessageV0.deserialize(Buffer.from(dataToSign, 'base64'));
  
  // 2. Create versioned transaction
  const transaction = new VersionedTransaction(message);
  
  // 3. Sign with wallet
  const signedTx = await wallet.signTransaction(transaction);
  
  // 4. Extract signature in base58 format
  return bs58.encode(Buffer.from(signedTx.signatures[signedTx.signatures.length - 1]));
}

Supported Operations

Current Support

OperationSolana → SolanaSolana → EVMEVM → SolanaCross-Chain
Swaps✅ SOL ↔ USDC✅ SOL → USDC (Arb)✅ USDC → SOL✅ Aggregated USDC → SOL
Transfers✅ Same chain✅ Cross-chain✅ Cross-chain✅ Combined balances
Balance Queries✅ Solana assets✅ Aggregated view✅ Aggregated view✅ Unified view

Coming Soon

Call data operations are not yet supported on Solana. Currently limited to swaps and transfers only.

Integration Steps

1

Update to v3 endpoints

Switch from v1 to v3 endpoints to support Solana accounts:
2

Add Solana wallet support

Integrate Solana wallet providers like Phantom, Solflare, or others in your frontend.
3

Handle cross-chain account structure

Update your code to use the accounts array format to support both EVM and Solana accounts.
4

Implement Solana signing

Add Solana-specific transaction signing using @solana/web3.js and bs58 libraries.
5

Test operations

Try your integration on staging: https://be.staging.onebalance.io

Account Setup Patterns

You can configure accounts in different ways based on your needs:

Single Account Operations

// Solana-only operation
const quote = await fetch('/api/v3/quote', {
  method: 'POST',
  body: JSON.stringify({
    from: {
      accounts: [{
        type: "solana",
        accountAddress: "J5CCzBULFax899tcirb6wMbenQUd8whbaetG7EfSick5"
      }],
      asset: { assetId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501" },
      amount: "10000000" // 0.01 SOL
    },
    to: {
      asset: { assetId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
    }
  })
});

Cross-Chain Operations

// Cross-chain: Solana → EVM
const quote = await fetch('/api/v3/quote', {
  method: 'POST', 
  body: JSON.stringify({
    from: {
      accounts: [{
        type: "solana",
        accountAddress: "J5CCzBULFax899tcirb6wMbenQUd8whbaetG7EfSick5"
      }],
      asset: { assetId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501" },
      amount: "10000000"
    },
    to: {
      asset: { assetId: "eip155:42161/erc20:0xaf88d065e77c8C2239327C5EDb3A432268e5831" },
      account: "eip155:42161:0x895Cf62399bF1F8b88195E741b64278b41EB7F09"
    }
  })
});

Unified Balance Operations

// Use aggregated balances from both EVM and Solana accounts
const quote = await fetch('/api/v3/quote', {
  method: 'POST',
  body: JSON.stringify({
    from: {
      accounts: [
        // Your EVM smart account
        {
          type: "kernel-v3.1-ecdsa",
          accountAddress: "0xd4f5A60c9b500f875ADf757BC3027A4424079E05",
          deploymentType: "ERC4337",
          signerAddress: "0x9b747cC14A5672a7166b4eccdc92d7F4003f8081"
        },
        // Your Solana account
        {
          type: "solana",
          accountAddress: "J5CCzBULFax899tcirb6wMbenQUd8whbaetG7EfSick5"
        }
      ],
      asset: { assetId: "ds:usdc" }, // Aggregated USDC across all chains
      amount: "10000000"
    },
    to: {
      asset: { assetId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501" }
    }
  })
});

Error Handling

Common issues and solutions: Insufficient Balance
// Always check balances before creating quotes
const balances = await fetch('/api/v3/balances/aggregated-balance?account=solana:J5CC...');
Invalid Account Address
// Ensure Solana addresses are valid base58
import { PublicKey } from '@solana/web3.js';

try {
  new PublicKey(accountAddress);
} catch (error) {
  console.error('Invalid Solana address');
}
Signing Failures
// Handle wallet connection and signing errors
try {
  const signature = await signSolanaOperation(dataToSign, wallet);
} catch (error) {
  if (error.code === 4001) {
    console.error('User rejected signing');
  }
}

Next Steps

For questions or support with Solana integration, use the Intercom chat widget in the bottom right corner for instant help, join our Discord, or reach out via support.