@solana/web3.js 1.93.3 → 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.
@@ -4067,6 +4067,16 @@ const VersionResult = type({
4067
4067
  'solana-core': string(),
4068
4068
  'feature-set': optional(number())
4069
4069
  });
4070
+ const ParsedInstructionStruct = type({
4071
+ program: string(),
4072
+ programId: PublicKeyFromString,
4073
+ parsed: unknown()
4074
+ });
4075
+ const PartiallyDecodedInstructionStruct = type({
4076
+ programId: PublicKeyFromString,
4077
+ accounts: array(PublicKeyFromString),
4078
+ data: string()
4079
+ });
4070
4080
  const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4071
4081
  err: nullable(union([type({}), string()])),
4072
4082
  logs: nullable(array(string())),
@@ -4081,13 +4091,17 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4081
4091
  returnData: optional(nullable(type({
4082
4092
  programId: string(),
4083
4093
  data: tuple([string(), literal('base64')])
4084
- })))
4094
+ }))),
4095
+ innerInstructions: optional(nullable(array(type({
4096
+ index: number(),
4097
+ instructions: array(union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct]))
4098
+ }))))
4085
4099
  }));
4086
4100
 
4087
4101
  /**
4088
4102
  * Metadata for a parsed confirmed transaction on the ledger
4089
4103
  *
4090
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4104
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4091
4105
  */
4092
4106
 
4093
4107
  /**
@@ -4117,7 +4131,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4117
4131
  /**
4118
4132
  * A confirmed transaction on the ledger
4119
4133
  *
4120
- * @deprecated Deprecated since Solana v1.8.0.
4134
+ * @deprecated Deprecated since RPC v1.8.0.
4121
4135
  */
4122
4136
 
4123
4137
  /**
@@ -4147,7 +4161,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4147
4161
  /**
4148
4162
  * A parsed and confirmed transaction on the ledger
4149
4163
  *
4150
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4164
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4151
4165
  */
4152
4166
 
4153
4167
  /**
@@ -4193,7 +4207,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4193
4207
  /**
4194
4208
  * A confirmed block on the ledger
4195
4209
  *
4196
- * @deprecated Deprecated since Solana v1.8.0.
4210
+ * @deprecated Deprecated since RPC v1.8.0.
4197
4211
  */
4198
4212
 
4199
4213
  /**
@@ -4895,7 +4909,7 @@ const GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({
4895
4909
  /**
4896
4910
  * Expected JSON RPC response for the "getConfirmedBlock" message
4897
4911
  *
4898
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.
4912
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetBlockRpcResult} instead.
4899
4913
  */
4900
4914
  const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({
4901
4915
  blockhash: string(),
@@ -4945,7 +4959,7 @@ const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({
4945
4959
  /**
4946
4960
  * Expected JSON RPC response for the "getRecentBlockhash" message
4947
4961
  *
4948
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4962
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
4949
4963
  */
4950
4964
  const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
4951
4965
  blockhash: string(),
@@ -5633,6 +5647,8 @@ class Connection {
5633
5647
 
5634
5648
  /**
5635
5649
  * Returns epoch activation information for a stake account that has been delegated
5650
+ *
5651
+ * @deprecated Deprecated since RPC v1.18; will be removed in a future version.
5636
5652
  */
5637
5653
  async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
5638
5654
  const {
@@ -6204,7 +6220,7 @@ class Connection {
6204
6220
  /**
6205
6221
  * Fetch the current total currency supply of the cluster in lamports
6206
6222
  *
6207
- * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
6223
+ * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
6208
6224
  */
6209
6225
  async getTotalSupply(commitment) {
6210
6226
  const result = await this.getSupply({
@@ -6321,7 +6337,7 @@ class Connection {
6321
6337
  * Fetch a recent blockhash from the cluster, return with context
6322
6338
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
6323
6339
  *
6324
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
6340
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
6325
6341
  */
6326
6342
  async getRecentBlockhashAndContext(commitment) {
6327
6343
  const args = this._buildArgs([], commitment);
@@ -6349,7 +6365,7 @@ class Connection {
6349
6365
  /**
6350
6366
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
6351
6367
  *
6352
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
6368
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
6353
6369
  */
6354
6370
  async getFeeCalculatorForBlockhash(blockhash, commitment) {
6355
6371
  const args = this._buildArgs([blockhash], commitment);
@@ -6402,7 +6418,7 @@ class Connection {
6402
6418
  * Fetch a recent blockhash from the cluster
6403
6419
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
6404
6420
  *
6405
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
6421
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
6406
6422
  */
6407
6423
  async getRecentBlockhash(commitment) {
6408
6424
  try {
@@ -6784,7 +6800,7 @@ class Connection {
6784
6800
  * Fetch a list of Transactions and transaction statuses from the cluster
6785
6801
  * for a confirmed block.
6786
6802
  *
6787
- * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.
6803
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
6788
6804
  */
6789
6805
  async getConfirmedBlock(slot, commitment) {
6790
6806
  const args = this._buildArgsAtLeastConfirmed([slot], commitment);
@@ -6863,7 +6879,7 @@ class Connection {
6863
6879
  /**
6864
6880
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
6865
6881
  *
6866
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
6882
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
6867
6883
  */
6868
6884
  async getConfirmedBlockSignatures(slot, commitment) {
6869
6885
  const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
@@ -6885,7 +6901,7 @@ class Connection {
6885
6901
  /**
6886
6902
  * Fetch a transaction details for a confirmed transaction
6887
6903
  *
6888
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
6904
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
6889
6905
  */
6890
6906
  async getConfirmedTransaction(signature, commitment) {
6891
6907
  const args = this._buildArgsAtLeastConfirmed([signature], commitment);
@@ -6907,7 +6923,7 @@ class Connection {
6907
6923
  /**
6908
6924
  * Fetch parsed transaction details for a confirmed transaction
6909
6925
  *
6910
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
6926
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
6911
6927
  */
6912
6928
  async getParsedConfirmedTransaction(signature, commitment) {
6913
6929
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
@@ -6922,7 +6938,7 @@ class Connection {
6922
6938
  /**
6923
6939
  * Fetch parsed transaction details for a batch of confirmed transactions
6924
6940
  *
6925
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
6941
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
6926
6942
  */
6927
6943
  async getParsedConfirmedTransactions(signatures, commitment) {
6928
6944
  const batch = signatures.map(signature => {
@@ -6947,7 +6963,7 @@ class Connection {
6947
6963
  * Fetch a list of all the confirmed signatures for transactions involving an address
6948
6964
  * within a specified slot range. Max range allowed is 10,000 slots.
6949
6965
  *
6950
- * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
6966
+ * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
6951
6967
  *
6952
6968
  * @param address queried address
6953
6969
  * @param startSlot start slot, inclusive
@@ -7001,9 +7017,7 @@ class Connection {
7001
7017
  * Returns confirmed signatures for transactions involving an
7002
7018
  * address backwards in time from the provided signature or most recent confirmed block
7003
7019
  *
7004
- *
7005
- * @param address queried address
7006
- * @param options
7020
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
7007
7021
  */
7008
7022
  async getConfirmedSignaturesForAddress2(address, options, commitment) {
7009
7023
  const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
@@ -7194,6 +7208,9 @@ class Connection {
7194
7208
  if (!('commitment' in config)) {
7195
7209
  config.commitment = this.commitment;
7196
7210
  }
7211
+ if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
7212
+ config.innerInstructions = configOrSigners.innerInstructions;
7213
+ }
7197
7214
  const args = [encodedTransaction, config];
7198
7215
  const unsafeRes = await this._rpcRequest('simulateTransaction', args);
7199
7216
  const res = create(unsafeRes, SimulatedTransactionResponseStruct);
@@ -7265,6 +7282,9 @@ class Connection {
7265
7282
  if (signers) {
7266
7283
  config.sigVerify = true;
7267
7284
  }
7285
+ if (configOrSigners && typeof configOrSigners === 'object' && 'innerInstructions' in configOrSigners) {
7286
+ config.innerInstructions = configOrSigners.innerInstructions;
7287
+ }
7268
7288
  const args = [encodedTransaction, config];
7269
7289
  const unsafeRes = await this._rpcRequest('simulateTransaction', args);
7270
7290
  const res = create(unsafeRes, SimulatedTransactionResponseStruct);