Skip to main content

Function Signature

Description

Builds an unsigned Solana transaction via the Portal backend. The returned transaction is a base64-encoded serialized Solana transaction ready to be signed and submitted using portal.request(method: 'sol_signAndSendTransaction', ...).

Parameters

Returns

PortalBuildSolanaTransactionResponse — the serialized transaction plus metadata. See buildEip155Transaction for the PortalBuildTransactionMetadata shape.

Examples

Native SOL transfer

SPL token transfer

Build, then sign and submit

Errors

Throws a PortalException on failure:
Always also check response.error for soft failures from the backend.

Implementation Notes

  • amount is the human-readable value. Pass "1" for 1 SOL, not "1000000000" lamports.
  • For native transfers, use "SOL". For SPL tokens, use the mint address.
  • The Portal backend automatically creates the recipient’s Associated Token Account (ATA) for SPL transfers when needed — the resulting transaction already includes the ATA-creation instruction.
  • chainId must start with solana:. Use buildEip155Transaction for EVM chains.