@solana/kit
v6.0.0 (2026-02-04)
Major Changes
-
[
@solana/instruction-plans] #13025f12df2Thanks @lorisleiva! - TheexecuteTransactionMessagecallback increateTransactionPlanExecutornow receives a mutable context object as its first argument. This context can be incrementally populated during execution (e.g. with the latest transaction message, the compiled transaction, or custom properties) and is preserved in the resultingSingleTransactionPlanResultregardless of the outcome. If an error is thrown at any point in the callback, any attributes already saved to the context will still be available in theFailedSingleTransactionPlanResult, which is useful for debugging failures or building recovery plans.The callback must now return either a
Signatureor a fullTransactionobject directly, instead of wrapping the result in an object.BREAKING CHANGES
executeTransactionMessagecallback signature changed. The callback now receives(context, message, config)instead of(message, config)and returnsSignature | Transactioninstead of{ transaction: Transaction } | { signature: Signature }.const executor = createTransactionPlanExecutor({ - executeTransactionMessage: async (message, { abortSignal }) => { + executeTransactionMessage: async (context, message, { abortSignal }) => { const transaction = await signTransactionMessageWithSigners(message); + context.transaction = transaction; await sendAndConfirmTransaction(transaction, { commitment: 'confirmed' }); - return { transaction }; + return transaction; } });Custom context is now set via mutation instead of being returned. Previously, custom context was returned as part of the result object. Now, it must be set directly on the mutable context argument.
const executor = createTransactionPlanExecutor({ - executeTransactionMessage: async (message) => { - const transaction = await signAndSend(message); - return { transaction, context: { custom: 'value' } }; + executeTransactionMessage: async (context, message) => { + context.custom = 'value'; + const transaction = await signAndSend(message); + return transaction; } }); -
[
@solana/instruction-plans] #12935c810acThanks @lorisleiva! - Reshape the successfulSingleTransactionPlanResultfactory functions. ThesuccessfulSingleTransactionPlanResulthelper now accepts a context object (which must include asignatureproperty) instead of a separatesignatureargument. A newsuccessfulSingleTransactionPlanResultFromTransactionhelper is introduced for the common case of creating a successful result from a fullTransactionobject.BREAKING CHANGES
successfulSingleTransactionPlanResultrenamed tosuccessfulSingleTransactionPlanResultFromTransaction. If you were creating a successful result from aTransaction, update the function name.- successfulSingleTransactionPlanResult(message, transaction) + successfulSingleTransactionPlanResultFromTransaction(message, transaction)
successfulSingleTransactionPlanResultFromSignaturerenamed tosuccessfulSingleTransactionPlanResultwith a new signature. Thesignatureis no longer a separate argument — it must be included in thecontextobject.- successfulSingleTransactionPlanResultFromSignature(message, signature) + successfulSingleTransactionPlanResult(message, { signature })
- successfulSingleTransactionPlanResultFromSignature(message, signature, context) + successfulSingleTransactionPlanResult(message, { ...context, signature })
-
[
@solana/instruction-plans] #1309bd3d5f1Thanks @lorisleiva! - Add a newplanTypeproperty to allInstructionPlan,TransactionPlan, andTransactionPlanResulttypes to distinguish them from each other at runtime. This property is a string literal with the value'instructionPlan','transactionPlan', or'transactionPlanResult'respectively. It also adds new type guard functions that make use of that new property:isInstructionPlan,isTransactionPlan, andisTransactionPlanResult.BREAKING CHANGES
InstructionPlan,TransactionPlan, andTransactionPlanResulttype guards updated. All factories have been updated to add the newplanTypeproperty but any custom instantiation of these types must be updated to include it as well.const myInstructionPlan: InstructionPlan = { kind: 'parallel', plans: [/* ... */], + planType: 'instructionPlan', }; const myTransactionPlan: TransactionPlan = { kind: 'parallel', plans: [/* ... */], + planType: 'transactionPlan', }; const myTransactionPlanResult: TransactionPlanResult = { kind: 'parallel', plans: [/* ... */], + planType: 'transactionPlanResult', }; -
[
@solana/instruction-plans] #131191cdb71Thanks @lorisleiva! - Remove deprecated functiongetAllSingleTransactionPlansBREAKING CHANGES
getAllSingleTransactionPlansremoved. UseflattenTransactionPlaninstead.- const singlePlans = getAllSingleTransactionPlans(transactionPlan); + const singlePlans = flattenTransactionPlan(transactionPlan);
-
[
@solana/instruction-plans] #12762fbad6aThanks @lorisleiva! - ReshapeSingleTransactionPlanResultfrom a single object type with astatusdiscriminated union into three distinct types:SuccessfulSingleTransactionPlanResult,FailedSingleTransactionPlanResult, andCanceledSingleTransactionPlanResult. This flattens the result structure so thatstatusis now a string literal ('successful','failed', or'canceled') and properties likecontext,error, andplannedMessagelive at the top level of each variant.Other changes include:
- Rename the
messageproperty toplannedMessageon all single transaction plan result types. This makes it clearer that this original planned message from theTransactionPlan, not the final message that was sent to the network. - Move the
contextobject from inside thestatusfield to the top level of each result variant. All variants now carry acontext— not just successful ones. - Expand
contextattribute to optionally includemessage,signature, andtransactionproperties. These properties are meant to hold the actualTransactionMessage,Signature, andTransactionused when the transaction was sent to the network — which may differ from the originallyplannedMessage. - Remove the now-unused
TransactionPlanResultStatustype. failedSingleTransactionPlanResultandcanceledSingleTransactionPlanResultnow accept an optionalcontextparameter too.
BREAKING CHANGES
Accessing the status kind. Replace
result.status.kindwithresult.status.- if (result.status.kind === 'successful') { /* ... */ } + if (result.status === 'successful') { /* ... */ }
Accessing the signature. The signature has moved from
result.status.signaturetoresult.context.signature.- const sig = result.status.signature; + const sig = result.context.signature;
Accessing the transaction. The transaction has moved from
result.status.transactiontoresult.context.transaction.- const tx = result.status.transaction; + const tx = result.context.transaction;
Accessing the error. The error has moved from
result.status.errortoresult.error.- const err = result.status.error; + const err = result.error;
Accessing the context. The context has moved from
result.status.contexttoresult.context.- const ctx = result.status.context; + const ctx = result.context;
Accessing the message. The
messageproperty has been renamed toplannedMessage.- const msg = result.message; + const msg = result.plannedMessage;
TransactionPlanResultStatusremoved. Code that references this type must be updated to use the individual result variant types (SuccessfulSingleTransactionPlanResult,FailedSingleTransactionPlanResult,CanceledSingleTransactionPlanResult) or theSingleTransactionPlanResultunion directly. - Rename the
-
[
@solana/transaction-messages] #1289b82df4cThanks @mcintyre94! - Remove the export of BaseTransactionMessage, which was previously deprecated. Use TransactionMessage instead.
Minor Changes
- [
@solana/instruction-plans] #1275f8ef83eThanks @lorisleiva! - Add missingTContext,TTransactionMessageand/orTSingletype parameters toTransactionPlanResulttypes and helper functions to better preserve type information through narrowing operations.
Patch Changes
-
[
@solana/transaction-messages] #1287f80b6deThanks @mcintyre94! - Refactor compressTransactionMessageUsingAddressLookupTables to not use BaseTransactionMessage -
[
@solana/transaction-messages] #1288986a09cThanks @mcintyre94! - Refactor transaction-messages package to stop using BaseTransactionMessage