Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this points out a broader issue.

In lots of places, we're including the RpcResponse wrapper in the "base response", but in others, we do something like:

RpcResponse<Base & { ... }>

I think it should always be the latter. I'll make a note to comb for this in my pass over RPC stuff.


/** 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 }>;
}