@@ -11,6 +11,8 @@ import type {
1111 Slot ,
1212 SolanaRpcResponse ,
1313 TransactionError ,
14+ TransactionForFullMetaInnerInstructionsParsed ,
15+ TransactionForFullMetaInnerInstructionsUnparsed ,
1416 U64UnsafeBeyond2Pow53Minus1 ,
1517} from '@solana/rpc-types' ;
1618import type { Base64EncodedWireTransaction } from '@solana/transactions' ;
@@ -21,6 +23,12 @@ type SimulateTransactionConfigBase = Readonly<{
2123 * @defaultValue finalized
2224 * */
2325 commitment ?: Commitment ;
26+ /**
27+ * If `true` the response will include inner instructions. These inner instructions will be
28+ * `jsonParsed` where possible, otherwise `json`.
29+ * @defaultValue false
30+ */
31+ innerInstructions ?: boolean ;
2432 /** The minimum slot that the request can be evaluated at */
2533 minContextSlot ?: Slot ;
2634} > ;
@@ -74,6 +82,10 @@ type AccountsConfigWithBase64Encoding = Readonly<{
7482 } ;
7583} > ;
7684
85+ type WithInnerInstructionsConfig = Readonly < {
86+ innerInstructions : true ;
87+ } > ;
88+
7789type SimulateTransactionApiResponseBase = SolanaRpcResponse < {
7890 /** Error if transaction failed, null if transaction succeeded. */
7991 err : TransactionError | null ;
@@ -95,7 +107,22 @@ type SimulateTransactionApiResponseWithAccounts<T extends AccountInfoBase> = Sol
95107 accounts : ( T | null ) [ ] ;
96108} > ;
97109
110+ type SimulateTransactionApiResponseWithInnerInstructions = SolanaRpcResponse <
111+ TransactionForFullMetaInnerInstructionsParsed | TransactionForFullMetaInnerInstructionsUnparsed
112+ > ;
113+
98114export interface SimulateTransactionApi extends RpcApiMethods {
115+ /** @deprecated Set `encoding` to `'base64'` when calling this method */
116+ simulateTransaction (
117+ base58EncodedWireTransaction : Base58EncodedBytes ,
118+ config : AccountsConfigWithBase64Encoding &
119+ SigVerifyAndReplaceRecentBlockhashConfig &
120+ SimulateTransactionConfigBase &
121+ WithInnerInstructionsConfig ,
122+ ) : SimulateTransactionApiResponseBase &
123+ SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedData > &
124+ SimulateTransactionApiResponseWithInnerInstructions ;
125+
99126 /** @deprecated Set `encoding` to `'base64'` when calling this method */
100127 simulateTransaction (
101128 base58EncodedWireTransaction : Base58EncodedBytes ,
@@ -105,6 +132,17 @@ export interface SimulateTransactionApi extends RpcApiMethods {
105132 ) : SimulateTransactionApiResponseBase &
106133 SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedData > ;
107134
135+ /** @deprecated Set `encoding` to `'base64'` when calling this method */
136+ simulateTransaction (
137+ base58EncodedWireTransaction : Base58EncodedBytes ,
138+ config : AccountsConfigWithBase64EncodingZstdCompression &
139+ SigVerifyAndReplaceRecentBlockhashConfig &
140+ SimulateTransactionConfigBase &
141+ WithInnerInstructionsConfig ,
142+ ) : SimulateTransactionApiResponseBase &
143+ SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData > &
144+ SimulateTransactionApiResponseWithInnerInstructions ;
145+
108146 /** @deprecated Set `encoding` to `'base64'` when calling this method */
109147 simulateTransaction (
110148 base58EncodedWireTransaction : Base58EncodedBytes ,
@@ -114,6 +152,17 @@ export interface SimulateTransactionApi extends RpcApiMethods {
114152 ) : SimulateTransactionApiResponseBase &
115153 SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData > ;
116154
155+ /** @deprecated Set `encoding` to `'base64'` when calling this method */
156+ simulateTransaction (
157+ base58EncodedWireTransaction : Base58EncodedBytes ,
158+ config : AccountsConfigWithJsonParsedEncoding &
159+ SigVerifyAndReplaceRecentBlockhashConfig &
160+ SimulateTransactionConfigBase &
161+ WithInnerInstructionsConfig ,
162+ ) : SimulateTransactionApiResponseBase &
163+ SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithJsonData > &
164+ SimulateTransactionApiResponseWithInnerInstructions ;
165+
117166 /** @deprecated Set `encoding` to `'base64'` when calling this method */
118167 simulateTransaction (
119168 base58EncodedWireTransaction : Base58EncodedBytes ,
@@ -123,12 +172,31 @@ export interface SimulateTransactionApi extends RpcApiMethods {
123172 ) : SimulateTransactionApiResponseBase &
124173 SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithJsonData > ;
125174
175+ /** @deprecated Set `encoding` to `'base64'` when calling this method */
176+ simulateTransaction (
177+ base58EncodedWireTransaction : Base58EncodedBytes ,
178+ config ?: SigVerifyAndReplaceRecentBlockhashConfig & SimulateTransactionConfigBase & WithInnerInstructionsConfig ,
179+ ) : SimulateTransactionApiResponseBase &
180+ SimulateTransactionApiResponseWithInnerInstructions &
181+ SolanaRpcResponse < { readonly accounts : null } > ;
182+
126183 /** @deprecated Set `encoding` to `'base64'` when calling this method */
127184 simulateTransaction (
128185 base58EncodedWireTransaction : Base58EncodedBytes ,
129186 config ?: SigVerifyAndReplaceRecentBlockhashConfig & SimulateTransactionConfigBase ,
130187 ) : SimulateTransactionApiResponseBase & SolanaRpcResponse < { readonly accounts : null } > ;
131188
189+ /** Simulate sending a transaction */
190+ simulateTransaction (
191+ base64EncodedWireTransaction : Base64EncodedWireTransaction ,
192+ config : AccountsConfigWithBase64Encoding &
193+ SigVerifyAndReplaceRecentBlockhashConfig &
194+ SimulateTransactionConfigBase &
195+ WithInnerInstructionsConfig & { encoding : 'base64' } ,
196+ ) : SimulateTransactionApiResponseBase &
197+ SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedData > &
198+ SimulateTransactionApiResponseWithInnerInstructions ;
199+
132200 /** Simulate sending a transaction */
133201 simulateTransaction (
134202 base64EncodedWireTransaction : Base64EncodedWireTransaction ,
@@ -138,6 +206,17 @@ export interface SimulateTransactionApi extends RpcApiMethods {
138206 ) : SimulateTransactionApiResponseBase &
139207 SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedData > ;
140208
209+ /** Simulate sending a transaction */
210+ simulateTransaction (
211+ base64EncodedWireTransaction : Base64EncodedWireTransaction ,
212+ config : AccountsConfigWithBase64EncodingZstdCompression &
213+ SigVerifyAndReplaceRecentBlockhashConfig &
214+ SimulateTransactionConfigBase &
215+ WithInnerInstructionsConfig & { encoding : 'base64' } ,
216+ ) : SimulateTransactionApiResponseBase &
217+ SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData > &
218+ SimulateTransactionApiResponseWithInnerInstructions ;
219+
141220 /** Simulate sending a transaction */
142221 simulateTransaction (
143222 base64EncodedWireTransaction : Base64EncodedWireTransaction ,
@@ -147,6 +226,17 @@ export interface SimulateTransactionApi extends RpcApiMethods {
147226 ) : SimulateTransactionApiResponseBase &
148227 SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData > ;
149228
229+ /** Simulate sending a transaction */
230+ simulateTransaction (
231+ base64EncodedWireTransaction : Base64EncodedWireTransaction ,
232+ config : AccountsConfigWithJsonParsedEncoding &
233+ SigVerifyAndReplaceRecentBlockhashConfig &
234+ SimulateTransactionConfigBase &
235+ WithInnerInstructionsConfig & { encoding : 'base64' } ,
236+ ) : SimulateTransactionApiResponseBase &
237+ SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithJsonData > &
238+ SimulateTransactionApiResponseWithInnerInstructions ;
239+
150240 /** Simulate sending a transaction */
151241 simulateTransaction (
152242 base64EncodedWireTransaction : Base64EncodedWireTransaction ,
@@ -156,6 +246,16 @@ export interface SimulateTransactionApi extends RpcApiMethods {
156246 ) : SimulateTransactionApiResponseBase &
157247 SimulateTransactionApiResponseWithAccounts < AccountInfoBase & AccountInfoWithJsonData > ;
158248
249+ /** Simulate sending a transaction */
250+ simulateTransaction (
251+ base64EncodedWireTransaction : Base64EncodedWireTransaction ,
252+ config : SigVerifyAndReplaceRecentBlockhashConfig &
253+ SimulateTransactionConfigBase &
254+ WithInnerInstructionsConfig & { encoding : 'base64' } ,
255+ ) : SimulateTransactionApiResponseBase &
256+ SimulateTransactionApiResponseWithInnerInstructions &
257+ SolanaRpcResponse < { readonly accounts : null } > ;
258+
159259 /** Simulate sending a transaction */
160260 simulateTransaction (
161261 base64EncodedWireTransaction : Base64EncodedWireTransaction ,
0 commit comments