Skip to main content
Function Signature
Parameters
  • chainId: The chain identifier in CAIP-2 format (e.g., “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp” for Solana mainnet)
  • params: A BuildTransactionParam object containing:
    • to: Recipient’s Solana address
    • token: Token identifier (“SOL” for native transfers, mint address for SPL tokens)
    • amount: Amount to transfer as a string (in lamports for SOL, raw amount for SPL tokens)
Returns A BuildSolanaTransactionResponse containing:
  • transaction: The serialized transaction string ready for signing
  • metadata: A BuildTransactionMetaData object containing:
    • amount: Formatted transaction amount
    • fromAddress: Sender’s address
    • toAddress: Recipient’s address
    • tokenAddress: Optional token mint address for SPL tokens
    • tokenDecimals: Number of decimal places for the token
    • tokenSymbol: Optional token symbol
    • rawAmount: Raw transaction amount value
  • error: Optional error message if the build process encounters issues
Example Usage
  1. Native SOL Transfer:
  1. SPL Token Transfer:
Implementation Notes
  1. Amount Formatting
    • For native SOL:
    • For SPL tokens:
  2. Token Identifiers
  3. Address Validation
    • Solana addresses must be Base58 encoded
    • Must be between 32 and 44 characters in length
    • Example validation:
  4. Error Handling
Related Documentation For more information about Solana transaction building, see: