From d60cf2187edd5be820fba1bc4979abceae665604 Mon Sep 17 00:00:00 2001 From: beeman Date: Tue, 24 Mar 2026 23:05:08 +0700 Subject: [PATCH] fix: replace Kit IInstruction with Instruction Kit client generation now imports and returns Instruction instead of the removed IInstruction type. This keeps generated TypeScript clients aligned with @solana/kit 3.0.0 and later, where IInstruction was removed after being deprecated in 2.3.0. --- idl/src/codegen/typescript.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idl/src/codegen/typescript.rs b/idl/src/codegen/typescript.rs index 584a6b5..0a2590f 100644 --- a/idl/src/codegen/typescript.rs +++ b/idl/src/codegen/typescript.rs @@ -58,7 +58,7 @@ fn generate_ts(idl: &Idl, target: TsTarget) -> String { let mut kit_imports: Vec<&str> = vec!["type Address", "address"]; if has_instructions { kit_imports.push("AccountRole"); - kit_imports.push("type IInstruction"); + kit_imports.push("type Instruction"); } if has_pdas { kit_imports.push("getProgramDerivedAddress"); @@ -684,9 +684,9 @@ fn generate_instruction_builders_kit(out: &mut String, idl: &Idl) { format!("input: {pascal}InstructionInput") }; let return_type = if ix_has_pdas { - "Promise" + "Promise" } else { - "IInstruction" + "Instruction" }; let async_kw = if ix_has_pdas { "async " } else { "" }; writeln!( @@ -771,7 +771,7 @@ fn generate_instruction_builders_kit(out: &mut String, idl: &Idl) { .expect("write to String"); } - // Return IInstruction + // Return Instruction out.push_str(" return {\n"); out.push_str(" programAddress: PROGRAM_ADDRESS,\n"); if !ix.accounts.is_empty() || ix.has_remaining {