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
  • Loading branch information
steveluscher committed Jun 27, 2024
1 parent 6572045 commit 5bb7d21
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 5bb7d21

Please sign in to comment.