@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.cjs.js CHANGED
@@ -4767,6 +4767,16 @@ const VersionResult = superstruct.type({
4767
4767
  'solana-core': superstruct.string(),
4768
4768
  'feature-set': superstruct.optional(superstruct.number())
4769
4769
  });
4770
+ const ParsedInstructionStruct = superstruct.type({
4771
+ program: superstruct.string(),
4772
+ programId: PublicKeyFromString,
4773
+ parsed: superstruct.unknown()
4774
+ });
4775
+ const PartiallyDecodedInstructionStruct = superstruct.type({
4776
+ programId: PublicKeyFromString,
4777
+ accounts: superstruct.array(PublicKeyFromString),
4778
+ data: superstruct.string()
4779
+ });
4770
4780
  const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.type({
4771
4781
  err: superstruct.nullable(superstruct.union([superstruct.type({}), superstruct.string()])),
4772
4782
  logs: superstruct.nullable(superstruct.array(superstruct.string())),
@@ -4781,7 +4791,11 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
4781
4791
  returnData: superstruct.optional(superstruct.nullable(superstruct.type({
4782
4792
  programId: superstruct.string(),
4783
4793
  data: superstruct.tuple([superstruct.string(), superstruct.literal('base64')])
4784
- })))
4794
+ }))),
4795
+ innerInstructions: superstruct.optional(superstruct.nullable(superstruct.array(superstruct.type({
4796
+ index: superstruct.number(),
4797
+ instructions: superstruct.array(superstruct.union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct]))
4798
+ }))))
4785
4799
  }));
4786
4800
 
4787
4801
  /**
@@ -7917,6 +7931,9 @@ class Connection {
7917
7931
  if (!('commitment' in config)) {
7918
7932
  config.commitment = this.commitment;
7919
7933
  }
7934
+ if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
7935
+ config.innerInstructions = configOrSigners.innerInstructions;
7936
+ }
7920
7937
  const args = [encodedTransaction, config];
7921
7938
  const unsafeRes = await this._rpcRequest('simulateTransaction', args);
7922
7939
  const res = superstruct.create(unsafeRes, SimulatedTransactionResponseStruct);
@@ -7988,6 +8005,9 @@ class Connection {
7988
8005
  if (signers) {
7989
8006
  config.sigVerify = true;
7990
8007
  }
8008
+ if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
8009
+ config.innerInstructions = configOrSigners.innerInstructions;
8010
+ }
7991
8011
  const args = [encodedTransaction, config];
7992
8012
  const unsafeRes = await this._rpcRequest('simulateTransaction', args);
7993
8013
  const res = superstruct.create(unsafeRes, SimulatedTransactionResponseStruct);