From c796a27d69cbd98d0cc10127be928bf68b1f4bfc Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Fri, 4 Sep 2026 11:16:23 +0100 Subject: [PATCH] Surface underlying transaction errors in the CLI This fixes the CLI swallowing useful transaction errors when executing an instruction plan (e.g. uploading an IDL). The runOrExport helper called the deprecated low-level transactionPlanExecutor, which threw a generic "The provided transaction plan failed to execute" error that hid the real cause. It now uses the client's sendTransactions method, which unwraps failures into readable messages reporting which transaction failed and its underlying program error. --- clients/js/pnpm-workspace.yaml | 2 ++ clients/js/src/cli/utils.ts | 11 ++++------- 2 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 clients/js/pnpm-workspace.yaml diff --git a/clients/js/pnpm-workspace.yaml b/clients/js/pnpm-workspace.yaml new file mode 100644 index 0000000..49c0ad7 --- /dev/null +++ b/clients/js/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +allowBuilds: + esbuild: false diff --git a/clients/js/src/cli/utils.ts b/clients/js/src/cli/utils.ts index 04fe533..f540501 100644 --- a/clients/js/src/cli/utils.ts +++ b/clients/js/src/cli/utils.ts @@ -9,6 +9,7 @@ import { address, ClientWithRpc, ClientWithTransactionPlanning, + ClientWithTransactionSending, Commitment, compileTransaction, createClient, @@ -32,7 +33,6 @@ import { SolanaRpcSubscriptionsApi, TransactionMessage, TransactionPlan, - TransactionPlanExecutor, TransactionSigner, } from '@solana/kit'; import { solanaRpc, TransactionPlannerConfig } from '@solana/kit-plugin-rpc'; @@ -131,10 +131,7 @@ function cliConfigs(configs: SolanaConfigs) { */ function cliRunOrExport(options: ExportOption & ExportEncodingOption) { return < - T extends ClientWithRpc & - ClientWithTransactionPlanning & { - transactionPlanExecutor: TransactionPlanExecutor; - }, + T extends ClientWithRpc & ClientWithTransactionPlanning & ClientWithTransactionSending, >( client: T, ) => @@ -144,8 +141,8 @@ function cliRunOrExport(options: ExportOption & ExportEncodingOption) { if (options.export) { await exportTransactionPlan(transactionPlan, client, options); } else { - // TODO: progress + error handling. - await client.transactionPlanExecutor(transactionPlan); + // TODO: progress reporting. + await client.sendTransactions(transactionPlan); logSuccess('Operation executed successfully'); } },