Skip to content

Commit daf9691

Browse files
authored
Correct the return type of simulateTransaction when accounts are not loaded (#2865)
This was returning `accounts: null` at the top level instead of inside `value` See 7192f3d
1 parent f9b0d6d commit daf9691

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/fast-cars-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solana/rpc-api': patch
3+
---
4+
5+
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`

packages/rpc-api/src/simulateTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export interface SimulateTransactionApi extends RpcApiMethods {
127127
simulateTransaction(
128128
base58EncodedWireTransaction: Base58EncodedBytes,
129129
config?: SigVerifyAndReplaceRecentBlockhashConfig & SimulateTransactionConfigBase,
130-
): SimulateTransactionApiResponseBase & { accounts: null };
130+
): SimulateTransactionApiResponseBase & SolanaRpcResponse<{ readonly accounts: null }>;
131131

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

0 commit comments

Comments
 (0)