Solana Transactions
Build, sign, and broadcast Solana transactions, and construct transfer and nonce account instructions with Zafeguard Solana components.
Solana Transactions
Components for building, signing, and broadcasting Solana transactions, including SOL/SPL transfers and durable nonce account setup.
Public RPC URLs enforce rate limits per IP address and can fail under concurrent load. Use a private endpoint (Helius, Alchemy, or self-hosted). See Connecting to Solana.
BROADCAST_SOLANA_TRANSACTION
BROADCAST_SOLANA_TRANSACTION Workflow Component
Broadcasts a fully-signed Solana transaction to the network and returns the transaction signature.
Config
None.
Inputs
| Field | Type | Description |
|---|---|---|
jsonRpcUrl | string (URL) | Solana JSON-RPC endpoint URL |
signedTransaction | string (base64) | Base64-encoded signed transaction |
Outputs
| Field | Type | Description |
|---|---|---|
transactionSignature | string (base58) | Transaction signature (txid) — directly usable in Solana explorers |
SDK example
import { WorkspaceClient, ComponentModule } from '@zafeguard/caller-sdk';
const workspace = new WorkspaceClient({ apiKey: process.env.ZAFEGUARD_API_KEY! });
const result = await workspace.call(ComponentModule.BROADCAST_SOLANA_TRANSACTION, {
jsonRpcUrl: 'https://api.mainnet-beta.solana.com',
signedTransaction: 'AQAAAAAAAABh...',
}).promise();
console.log(result.transactionSignature);BUILD_SOLANA_TRANSACTION
BUILD_SOLANA_TRANSACTION Workflow Component
Builds an unsigned Solana transaction with SOL transfer and/or custom program instructions. Supports durable nonce auto-detection, gas sponsorship via a separate fee payer, and fee deduction.
Config
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
deductFee | boolean | No | false | When true, subtracts the transaction fee from the lamports amount. Only applies when from equals feePayer. Ignored for gas sponsorship |
Inputs
| Field | Type | Description |
|---|---|---|
jsonRpcUrl | string (URL) | Solana JSON-RPC endpoint |
feePayer | string (base58) | Public key of the account paying transaction fees |
from | string | null (base58) | Public key of the account sending SOL. Defaults to feePayer. Set differently for gas sponsorship |
to | string | null (base58) | Recipient public key for SOL transfer. Leave null if only using instructions |
lamports | string | Amount to transfer in lamports (1 SOL = 1,000,000,000). Decimal or 0x hex. Default "0" |
instructions | Instruction[] | Custom program instructions (default []) |
nonceAccount | string | null (base58) | Durable nonce account public key. If provided, nonce is auto-fetched and a nonceAdvance instruction is prepended. Leave null for recent blockhash |
priorityFeeMicroLamports | number | null | Optional priority fee per compute unit, in micro-lamports. When provided, a ComputeBudgetProgram.setComputeUnitPrice instruction is prepended to the transaction. Solana's base fee (~5,000 lamports per signature) is set by the protocol — this controls how the validator orders your tx under load. Pass null to use the network default. See Customizing Transaction Fees for typical priority-fee ranges |
Outputs
| Field | Type | Description |
|---|---|---|
unsignedTransaction | string (base64) | Base64-encoded unsigned transaction |
serializedHash | string (hex) | Transaction message hash each signer must sign with Ed25519 |
signers | string[] | Base58 public keys that must sign (fee payer + instruction signers) |
estimatedFee | string (decimal) | Estimated transaction fee in lamports, fetched via connection.getFeeForMessage |
Instruction type
{
programId: string; // base58 program ID
keys: Array<{
pubkey: string; // base58
isSigner: boolean;
isWritable: boolean;
}>;
data: string | null; // hex-encoded instruction data
}SDK example
import { WorkspaceClient, ComponentModule } from '@zafeguard/caller-sdk';
const workspace = new WorkspaceClient({ apiKey: process.env.ZAFEGUARD_API_KEY! });
const result = await workspace.call(ComponentModule.BUILD_SOLANA_TRANSACTION, {
jsonRpcUrl: 'https://api.mainnet-beta.solana.com',
feePayer: 'FEEPAYERpubkey...',
from: null,
to: 'RECIPIENTpubkey...',
lamports: '1000000000',
instructions: [],
nonceAccount: null,
priorityFeeMicroLamports: null, // or e.g. 50_000 micro-lamports per CU for faster inclusion
}).promise();
console.log(result.unsignedTransaction);
console.log(result.serializedHash); // sign this
console.log(result.signers);SIGN_SOLANA_TRANSACTION
SIGN_SOLANA_TRANSACTION Workflow Component
Applies one or more Ed25519 signatures to an unsigned Solana transaction. Supports multi-party signing for gas sponsorship and multi-sig workflows.
Config
None.
Inputs
| Field | Type | Description |
|---|---|---|
unsignedTransaction | string (base64) | Base64-encoded unsigned transaction |
signatures | SignaturePair[] | Array of { publicKey, signature } pairs |
Outputs
| Field | Type | Description |
|---|---|---|
signedTransaction | string (base64) | Base64-encoded fully-signed transaction, ready to broadcast |
SignaturePair type
{
publicKey: string; // base58 (32–44 chars)
signature: string; // hex (128 chars or 130 with 0x prefix)
}BUILD_SOLANA_TRANSFER_INSTRUCTION
BUILD_SOLANA_TRANSFER_INSTRUCTION Component
Builds transfer instructions for native SOL or SPL tokens. When tokenMint is provided, auto-resolves Associated Token Accounts (ATAs) and creates the destination ATA if needed. When tokenMint is null, builds a native SOL transfer.
Config
None.
Inputs
| Field | Type | Description |
|---|---|---|
jsonRpcUrl | string (URL) | Solana JSON-RPC endpoint |
from | string (base58) | Sender public key |
to | string (base58) | Recipient public key |
amount | string | Amount in smallest unit (lamports for SOL, raw amount for SPL tokens). Decimal or 0x hex |
tokenMint | string | null (base58) | SPL token mint address. null for native SOL |
Outputs
| Field | Type | Description |
|---|---|---|
instructions | Instruction[] | Instructions to pass into BUILD_SOLANA_TRANSACTION |
SDK example
import { WorkspaceClient, ComponentModule } from '@zafeguard/caller-sdk';
const workspace = new WorkspaceClient({ apiKey: process.env.ZAFEGUARD_API_KEY! });
// SOL transfer instructions
const result = await workspace.call(ComponentModule.BUILD_SOLANA_TRANSFER_INSTRUCTION, {
jsonRpcUrl: 'https://api.mainnet-beta.solana.com',
from: 'FROMpubkey...',
to: 'TOPubkey...',
amount: '500000000',
tokenMint: null,
}).promise();
console.log(result.instructions);BUILD_SOLANA_NONCE_ACCOUNT_INSTRUCTION
BUILD_SOLANA_NONCE_ACCOUNT_INSTRUCTION Component
Builds instructions to create and initialize a durable nonce account. Pass the output instructions into BUILD_SOLANA_TRANSACTION.
Config
None.
Inputs
| Field | Type | Description |
|---|---|---|
jsonRpcUrl | string (URL) | Solana JSON-RPC endpoint (used to fetch minimum rent-exempt balance) |
feePayer | string (base58) | Account funding the nonce account creation |
nonceAccount | string (base58) | Public key of the new nonce account (must be a fresh keypair) |
nonceAuthority | string | null (base58) | Account authorized to use the nonce. Defaults to feePayer when null |
Outputs
| Field | Type | Description |
|---|---|---|
instructions | Instruction[] | createAccount + nonceInitialize instructions |
Transaction flow (SOL transfer)
GET_SOLANA_DERIVATION_PATH
│
▼
(external signing)
→ public key
│
▼
COMPUTE_SOLANA_ADDRESS BUILD_SOLANA_TRANSFER_INSTRUCTION
│ │ instructions
│ ▼
└────────────▶ BUILD_SOLANA_TRANSACTION
│ serializedHash
▼
(external signing)
│ signature
▼
BUILD_SOLANA_SIGNATURE_PAIR_ITEM
│ item
▼
SIGN_SOLANA_TRANSACTION
│ signedTransaction
▼
BROADCAST_SOLANA_TRANSACTIONOverview
Zafeguard Solana components for the full transaction lifecycle — address derivation, SPL tokens, program instructions, signing, and broadcasting.
Solana Instructions & Signatures
Build program instructions, account meta items, and signature pairs for Solana transactions with Zafeguard components.