@solana/web3.js 1.93.4 → 1.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.browser.cjs.js +21 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +21 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +21 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.esm.js +21 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +21 -1
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +21 -1
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +46 -0
package/lib/index.d.ts
CHANGED
|
@@ -2245,6 +2245,8 @@ type SimulateTransactionConfig = {
|
|
|
2245
2245
|
};
|
|
2246
2246
|
/** Optional parameter used to specify the minimum block slot that can be used for simulation */
|
|
2247
2247
|
minContextSlot?: number;
|
|
2248
|
+
/** Optional parameter used to include inner instructions in the simulation */
|
|
2249
|
+
innerInstructions?: boolean;
|
|
2248
2250
|
};
|
|
2249
2251
|
type SimulatedTransactionResponse = {
|
|
2250
2252
|
err: TransactionError | string | null;
|
|
@@ -2252,6 +2254,7 @@ type SimulatedTransactionResponse = {
|
|
|
2252
2254
|
accounts?: (SimulatedTransactionAccountInfo | null)[] | null;
|
|
2253
2255
|
unitsConsumed?: number;
|
|
2254
2256
|
returnData?: TransactionReturnData | null;
|
|
2257
|
+
innerInstructions?: ParsedInnerInstruction[] | null;
|
|
2255
2258
|
};
|
|
2256
2259
|
type ParsedInnerInstruction = {
|
|
2257
2260
|
index: number;
|
package/lib/index.esm.js
CHANGED
|
@@ -4737,6 +4737,16 @@ const VersionResult = type({
|
|
|
4737
4737
|
'solana-core': string(),
|
|
4738
4738
|
'feature-set': optional(number())
|
|
4739
4739
|
});
|
|
4740
|
+
const ParsedInstructionStruct = type({
|
|
4741
|
+
program: string(),
|
|
4742
|
+
programId: PublicKeyFromString,
|
|
4743
|
+
parsed: unknown()
|
|
4744
|
+
});
|
|
4745
|
+
const PartiallyDecodedInstructionStruct = type({
|
|
4746
|
+
programId: PublicKeyFromString,
|
|
4747
|
+
accounts: array(PublicKeyFromString),
|
|
4748
|
+
data: string()
|
|
4749
|
+
});
|
|
4740
4750
|
const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
|
|
4741
4751
|
err: nullable(union([type({}), string()])),
|
|
4742
4752
|
logs: nullable(array(string())),
|
|
@@ -4751,7 +4761,11 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
|
|
|
4751
4761
|
returnData: optional(nullable(type({
|
|
4752
4762
|
programId: string(),
|
|
4753
4763
|
data: tuple([string(), literal('base64')])
|
|
4754
|
-
})))
|
|
4764
|
+
}))),
|
|
4765
|
+
innerInstructions: optional(nullable(array(type({
|
|
4766
|
+
index: number(),
|
|
4767
|
+
instructions: array(union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct]))
|
|
4768
|
+
}))))
|
|
4755
4769
|
}));
|
|
4756
4770
|
|
|
4757
4771
|
/**
|
|
@@ -7887,6 +7901,9 @@ class Connection {
|
|
|
7887
7901
|
if (!('commitment' in config)) {
|
|
7888
7902
|
config.commitment = this.commitment;
|
|
7889
7903
|
}
|
|
7904
|
+
if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
|
|
7905
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
7906
|
+
}
|
|
7890
7907
|
const args = [encodedTransaction, config];
|
|
7891
7908
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
7892
7909
|
const res = create(unsafeRes, SimulatedTransactionResponseStruct);
|
|
@@ -7958,6 +7975,9 @@ class Connection {
|
|
|
7958
7975
|
if (signers) {
|
|
7959
7976
|
config.sigVerify = true;
|
|
7960
7977
|
}
|
|
7978
|
+
if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
|
|
7979
|
+
config.innerInstructions = configOrSigners.innerInstructions;
|
|
7980
|
+
}
|
|
7961
7981
|
const args = [encodedTransaction, config];
|
|
7962
7982
|
const unsafeRes = await this._rpcRequest('simulateTransaction', args);
|
|
7963
7983
|
const res = create(unsafeRes, SimulatedTransactionResponseStruct);
|