From be36babd752b1c987a2f53b4ff83ac8c045a3418 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Thu, 27 Jun 2024 17:37:29 -0700 Subject: [PATCH] Correct the type of `innerInstructions` in JSON RPC errors (#2867) These names are camel-cased. This can't be imported from `@solana/rpc-types` because `@solana/errors` must be zero dependency. --- .changeset/sour-mugs-press.md | 5 +++++ packages/errors/src/json-rpc-error.ts | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/sour-mugs-press.md diff --git a/.changeset/sour-mugs-press.md b/.changeset/sour-mugs-press.md new file mode 100644 index 000000000000..89a2e654ae1b --- /dev/null +++ b/.changeset/sour-mugs-press.md @@ -0,0 +1,5 @@ +--- +'@solana/errors': patch +--- + +The `innerInstructions` property of JSON-RPC errors used snake case rather than camelCase for `stackHeight` and `programId`. This has been corrected. diff --git a/packages/errors/src/json-rpc-error.ts b/packages/errors/src/json-rpc-error.ts index 2f98c694b7f4..b942aa0db253 100644 --- a/packages/errors/src/json-rpc-error.ts +++ b/packages/errors/src/json-rpc-error.ts @@ -61,21 +61,21 @@ export interface RpcSimulateTransactionResult { accounts: number[]; data: string; programIdIndex: number; - stack_height?: number; + stackHeight?: number; } | { // Parsed parsed: unknown; program: string; - program_id: string; - stack_height?: number; + programId: string; + stackHeight?: number; } | { // PartiallyDecoded accounts: string[]; data: string; - program_id: string; - stack_height?: number; + programId: string; + stackHeight?: number; } )[]; }[]