github anza-xyz/kit v6.0.0

15 hours ago

@solana/kit

v6.0.0 (2026-02-04)

Major Changes

  • [@solana/instruction-plans] #1302 5f12df2 Thanks @lorisleiva! - The executeTransactionMessage callback in createTransactionPlanExecutor now 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 resulting SingleTransactionPlanResult regardless 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 the FailedSingleTransactionPlanResult, which is useful for debugging failures or building recovery plans.

    The callback must now return either a Signature or a full Transaction object directly, instead of wrapping the result in an object.

    BREAKING CHANGES

    executeTransactionMessage callback signature changed. The callback now receives (context, message, config) instead of (message, config) and returns Signature | Transaction instead 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] #1293 5c810ac Thanks @lorisleiva! - Reshape the successful SingleTransactionPlanResult factory functions. The successfulSingleTransactionPlanResult helper now accepts a context object (which must include a signature property) instead of a separate signature argument. A new successfulSingleTransactionPlanResultFromTransaction helper is introduced for the common case of creating a successful result from a full Transaction object.

    BREAKING CHANGES

    successfulSingleTransactionPlanResult renamed to successfulSingleTransactionPlanResultFromTransaction. If you were creating a successful result from a Transaction, update the function name.

    - successfulSingleTransactionPlanResult(message, transaction)
    + successfulSingleTransactionPlanResultFromTransaction(message, transaction)

    successfulSingleTransactionPlanResultFromSignature renamed to successfulSingleTransactionPlanResult with a new signature. The signature is no longer a separate argument — it must be included in the context object.

    - successfulSingleTransactionPlanResultFromSignature(message, signature)
    + successfulSingleTransactionPlanResult(message, { signature })
    - successfulSingleTransactionPlanResultFromSignature(message, signature, context)
    + successfulSingleTransactionPlanResult(message, { ...context, signature })
  • [@solana/instruction-plans] #1309 bd3d5f1 Thanks @lorisleiva! - Add a new planType property to all InstructionPlan, TransactionPlan, and TransactionPlanResult types 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, and isTransactionPlanResult.

    BREAKING CHANGES

    InstructionPlan, TransactionPlan, and TransactionPlanResult type guards updated. All factories have been updated to add the new planType property 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] #1311 91cdb71 Thanks @lorisleiva! - Remove deprecated function getAllSingleTransactionPlans

    BREAKING CHANGES

    getAllSingleTransactionPlans removed. Use flattenTransactionPlan instead.

    - const singlePlans = getAllSingleTransactionPlans(transactionPlan);
    + const singlePlans = flattenTransactionPlan(transactionPlan);
  • [@solana/instruction-plans] #1276 2fbad6a Thanks @lorisleiva! - Reshape SingleTransactionPlanResult from a single object type with a status discriminated union into three distinct types: SuccessfulSingleTransactionPlanResult, FailedSingleTransactionPlanResult, and CanceledSingleTransactionPlanResult. This flattens the result structure so that status is now a string literal ('successful', 'failed', or 'canceled') and properties like context, error, and plannedMessage live at the top level of each variant.

    Other changes include:

    • Rename the message property to plannedMessage on all single transaction plan result types. This makes it clearer that this original planned message from the TransactionPlan, not the final message that was sent to the network.
    • Move the context object from inside the status field to the top level of each result variant. All variants now carry a context — not just successful ones.
    • Expand context attribute to optionally include message, signature, and transaction properties. These properties are meant to hold the actual TransactionMessage, Signature, and Transaction used when the transaction was sent to the network — which may differ from the originally plannedMessage.
    • Remove the now-unused TransactionPlanResultStatus type.
    • failedSingleTransactionPlanResult and canceledSingleTransactionPlanResult now accept an optional context parameter too.

    BREAKING CHANGES

    Accessing the status kind. Replace result.status.kind with result.status.

    - if (result.status.kind === 'successful') { /* ... */ }
    + if (result.status === 'successful') { /* ... */ }

    Accessing the signature. The signature has moved from result.status.signature to result.context.signature.

    - const sig = result.status.signature;
    + const sig = result.context.signature;

    Accessing the transaction. The transaction has moved from result.status.transaction to result.context.transaction.

    - const tx = result.status.transaction;
    + const tx = result.context.transaction;

    Accessing the error. The error has moved from result.status.error to result.error.

    - const err = result.status.error;
    + const err = result.error;

    Accessing the context. The context has moved from result.status.context to result.context.

    - const ctx = result.status.context;
    + const ctx = result.context;

    Accessing the message. The message property has been renamed to plannedMessage.

    - const msg = result.message;
    + const msg = result.plannedMessage;

    TransactionPlanResultStatus removed. Code that references this type must be updated to use the individual result variant types (SuccessfulSingleTransactionPlanResult, FailedSingleTransactionPlanResult, CanceledSingleTransactionPlanResult) or the SingleTransactionPlanResult union directly.

  • [@solana/transaction-messages] #1289 b82df4c Thanks @mcintyre94! - Remove the export of BaseTransactionMessage, which was previously deprecated. Use TransactionMessage instead.

Minor Changes

  • [@solana/instruction-plans] #1275 f8ef83e Thanks @lorisleiva! - Add missing TContext, TTransactionMessage and/or TSingle type parameters to TransactionPlanResult types and helper functions to better preserve type information through narrowing operations.

Patch Changes

  • [@solana/transaction-messages] #1287 f80b6de Thanks @mcintyre94! - Refactor compressTransactionMessageUsingAddressLookupTables to not use BaseTransactionMessage

  • [@solana/transaction-messages] #1288 986a09c Thanks @mcintyre94! - Refactor transaction-messages package to stop using BaseTransactionMessage

Don't miss a new kit release

NewReleases is sending notifications on new releases.