Skip to content

Commit

Permalink
Correct the return type of simulateTransaction when accounts are no…
Browse files Browse the repository at this point in the history
…t loaded (#2865)

This was returning `accounts: null` at the top level instead of inside `value`

See 7192f3d
  • Loading branch information
steveluscher authored Jun 28, 2024
1 parent f9b0d6d commit daf9691
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-cars-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@solana/rpc-api': patch
---

Fixed a TypeScript error where the return value of `simulateTransaction` claimed there was an `accounts` property at the top level when it is in fact `value.accounts`
4 changes: 2 additions & 2 deletions packages/rpc-api/src/simulateTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export interface SimulateTransactionApi extends RpcApiMethods {
simulateTransaction(
base58EncodedWireTransaction: Base58EncodedBytes,
config?: SigVerifyAndReplaceRecentBlockhashConfig & SimulateTransactionConfigBase,
): SimulateTransactionApiResponseBase & { accounts: null };
): SimulateTransactionApiResponseBase & SolanaRpcResponse<{ readonly accounts: null }>;

/** Simulate sending a transaction */
simulateTransaction(
Expand Down Expand Up @@ -160,5 +160,5 @@ export interface SimulateTransactionApi extends RpcApiMethods {
simulateTransaction(
base64EncodedWireTransaction: Base64EncodedWireTransaction,
config: SigVerifyAndReplaceRecentBlockhashConfig & SimulateTransactionConfigBase & { encoding: 'base64' },
): SimulateTransactionApiResponseBase & { accounts: null };
): SimulateTransactionApiResponseBase & SolanaRpcResponse<{ readonly accounts: null }>;
}

0 comments on commit daf9691

Please sign in to comment.