Solana Kit intentionally splits the transaction stack into a few focused layers.
solana_kit_instructionsmodels program invocations.solana_kit_transaction_messagesbuilds immutable message state.solana_kit_signersmodels who can authorize, mutate, or submit a transaction.solana_kit_transactionshandles wire-format transactions and signatures.solana_kit_transaction_confirmationhandles confirmation strategies.
Recommended mental model#
Think in four phases:
- Describe intent: create instructions.
- Build message state: set fee payer, lifetime, and instruction order.
- Authorize: attach signers and produce signatures.
- Submit and confirm: send the signed transaction and wait for a final outcome.
Message construction#
Use immutable message transforms:
final message = createTransactionMessage()
.pipe(setTransactionMessageFeePayer(feePayerAddress))
.pipe(setTransactionMessageLifetimeUsingBlockhash(blockhashConstraint))
.pipe(appendTransactionMessageInstruction(instruction));
This style makes transaction assembly predictable and easy to test.
Signing strategies#
Use signTransactionMessageWithSigners(...) when all required signers are attached to the message and you want a fully signed transaction.
Use partiallySignTransactionMessageWithSigners(...) when a transaction will move through multiple signing stages.
Use signAndSendTransactionMessageWithSigners(...) when the message contains a TransactionSendingSigner, such as a wallet adapter.
Confirmation strategies#
Send and confirm a signed transaction#
Once you have a signed Transaction, use the additive confirmation helper for an end-to-end “send then wait for confirmation” flow.
import 'package:solana_kit/solana_kit.dart';
import 'package:solana_kit_rpc_spec/solana_kit_rpc_spec.dart';
Future<void> sendAndWait(
Rpc rpc,
Transaction signedTransaction,
) async {
final signature = await sendAndConfirmTransaction(
rpc: rpc,
transaction: signedTransaction,
);
print('Confirmed signature: ${signature.value}');
}
For lower-level control, solana_kit_transaction_confirmation also exposes strategy factories for block-height expiry, durable nonce invalidation, signature notifications, and timeout racing.
When to use instruction plans#
If your operation spans multiple transactions or has parallel/sequential structure, move up to solana_kit_instruction_plans.
That package helps you model transaction orchestration explicitly instead of hiding it in ad hoc control flow.