@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.
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;
@@ -2266,7 +2269,7 @@ type TokenBalance = {
2266
2269
  /**
2267
2270
  * Metadata for a parsed confirmed transaction on the ledger
2268
2271
  *
2269
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
2272
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
2270
2273
  */
2271
2274
  type ParsedConfirmedTransactionMeta = ParsedTransactionMeta;
2272
2275
  /**
@@ -2371,7 +2374,7 @@ type VersionedTransactionResponse = {
2371
2374
  /**
2372
2375
  * A confirmed transaction on the ledger
2373
2376
  *
2374
- * @deprecated Deprecated since Solana v1.8.0.
2377
+ * @deprecated Deprecated since RPC v1.8.0.
2375
2378
  */
2376
2379
  type ConfirmedTransaction = {
2377
2380
  /** The slot during which the transaction was processed */
@@ -2454,7 +2457,7 @@ type ParsedTransaction = {
2454
2457
  /**
2455
2458
  * A parsed and confirmed transaction on the ledger
2456
2459
  *
2457
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
2460
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
2458
2461
  */
2459
2462
  type ParsedConfirmedTransaction = ParsedTransactionWithMeta;
2460
2463
  /**
@@ -2628,7 +2631,7 @@ type VersionedNoneModeBlockResponse = Omit<VersionedBlockResponse, 'transactions
2628
2631
  /**
2629
2632
  * A confirmed block on the ledger
2630
2633
  *
2631
- * @deprecated Deprecated since Solana v1.8.0.
2634
+ * @deprecated Deprecated since RPC v1.8.0.
2632
2635
  */
2633
2636
  type ConfirmedBlock = {
2634
2637
  /** Blockhash of this block */
@@ -3274,6 +3277,8 @@ declare class Connection {
3274
3277
  getMultipleAccountsInfo(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(AccountInfo<Buffer> | null)[]>;
3275
3278
  /**
3276
3279
  * Returns epoch activation information for a stake account that has been delegated
3280
+ *
3281
+ * @deprecated Deprecated since RPC v1.18; will be removed in a future version.
3277
3282
  */
3278
3283
  getStakeActivation(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetStakeActivationConfig, epoch?: number): Promise<StakeActivationData>;
3279
3284
  /**
@@ -3340,7 +3345,7 @@ declare class Connection {
3340
3345
  /**
3341
3346
  * Fetch the current total currency supply of the cluster in lamports
3342
3347
  *
3343
- * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
3348
+ * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
3344
3349
  */
3345
3350
  getTotalSupply(commitment?: Commitment): Promise<number>;
3346
3351
  /**
@@ -3377,7 +3382,7 @@ declare class Connection {
3377
3382
  * Fetch a recent blockhash from the cluster, return with context
3378
3383
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
3379
3384
  *
3380
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
3385
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
3381
3386
  */
3382
3387
  getRecentBlockhashAndContext(commitment?: Commitment): Promise<RpcResponseAndContext<{
3383
3388
  blockhash: Blockhash;
@@ -3391,7 +3396,7 @@ declare class Connection {
3391
3396
  /**
3392
3397
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
3393
3398
  *
3394
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
3399
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
3395
3400
  */
3396
3401
  getFeeCalculatorForBlockhash(blockhash: Blockhash, commitment?: Commitment): Promise<RpcResponseAndContext<FeeCalculator | null>>;
3397
3402
  /**
@@ -3406,7 +3411,7 @@ declare class Connection {
3406
3411
  * Fetch a recent blockhash from the cluster
3407
3412
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
3408
3413
  *
3409
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
3414
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
3410
3415
  */
3411
3416
  getRecentBlockhash(commitment?: Commitment): Promise<{
3412
3417
  blockhash: Blockhash;
@@ -3516,7 +3521,7 @@ declare class Connection {
3516
3521
  * Fetch a list of Transactions and transaction statuses from the cluster
3517
3522
  * for a confirmed block.
3518
3523
  *
3519
- * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.
3524
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
3520
3525
  */
3521
3526
  getConfirmedBlock(slot: number, commitment?: Finality): Promise<ConfirmedBlock>;
3522
3527
  /**
@@ -3530,32 +3535,32 @@ declare class Connection {
3530
3535
  /**
3531
3536
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
3532
3537
  *
3533
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
3538
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
3534
3539
  */
3535
3540
  getConfirmedBlockSignatures(slot: number, commitment?: Finality): Promise<BlockSignatures>;
3536
3541
  /**
3537
3542
  * Fetch a transaction details for a confirmed transaction
3538
3543
  *
3539
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
3544
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
3540
3545
  */
3541
3546
  getConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ConfirmedTransaction | null>;
3542
3547
  /**
3543
3548
  * Fetch parsed transaction details for a confirmed transaction
3544
3549
  *
3545
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
3550
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
3546
3551
  */
3547
3552
  getParsedConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ParsedConfirmedTransaction | null>;
3548
3553
  /**
3549
3554
  * Fetch parsed transaction details for a batch of confirmed transactions
3550
3555
  *
3551
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
3556
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
3552
3557
  */
3553
3558
  getParsedConfirmedTransactions(signatures: TransactionSignature[], commitment?: Finality): Promise<(ParsedConfirmedTransaction | null)[]>;
3554
3559
  /**
3555
3560
  * Fetch a list of all the confirmed signatures for transactions involving an address
3556
3561
  * within a specified slot range. Max range allowed is 10,000 slots.
3557
3562
  *
3558
- * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
3563
+ * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
3559
3564
  *
3560
3565
  * @param address queried address
3561
3566
  * @param startSlot start slot, inclusive
@@ -3566,9 +3571,7 @@ declare class Connection {
3566
3571
  * Returns confirmed signatures for transactions involving an
3567
3572
  * address backwards in time from the provided signature or most recent confirmed block
3568
3573
  *
3569
- *
3570
- * @param address queried address
3571
- * @param options
3574
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
3572
3575
  */
3573
3576
  getConfirmedSignaturesForAddress2(address: PublicKey, options?: ConfirmedSignaturesForAddress2Options, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
3574
3577
  /**
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,13 +4761,17 @@ 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
  /**
4758
4772
  * Metadata for a parsed confirmed transaction on the ledger
4759
4773
  *
4760
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4774
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionMeta} instead.
4761
4775
  */
4762
4776
 
4763
4777
  /**
@@ -4787,7 +4801,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4787
4801
  /**
4788
4802
  * A confirmed transaction on the ledger
4789
4803
  *
4790
- * @deprecated Deprecated since Solana v1.8.0.
4804
+ * @deprecated Deprecated since RPC v1.8.0.
4791
4805
  */
4792
4806
 
4793
4807
  /**
@@ -4817,7 +4831,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4817
4831
  /**
4818
4832
  * A parsed and confirmed transaction on the ledger
4819
4833
  *
4820
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4834
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.
4821
4835
  */
4822
4836
 
4823
4837
  /**
@@ -4863,7 +4877,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
4863
4877
  /**
4864
4878
  * A confirmed block on the ledger
4865
4879
  *
4866
- * @deprecated Deprecated since Solana v1.8.0.
4880
+ * @deprecated Deprecated since RPC v1.8.0.
4867
4881
  */
4868
4882
 
4869
4883
  /**
@@ -5588,7 +5602,7 @@ const GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({
5588
5602
  /**
5589
5603
  * Expected JSON RPC response for the "getConfirmedBlock" message
5590
5604
  *
5591
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.
5605
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetBlockRpcResult} instead.
5592
5606
  */
5593
5607
  const GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({
5594
5608
  blockhash: string(),
@@ -5638,7 +5652,7 @@ const GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({
5638
5652
  /**
5639
5653
  * Expected JSON RPC response for the "getRecentBlockhash" message
5640
5654
  *
5641
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
5655
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.
5642
5656
  */
5643
5657
  const GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({
5644
5658
  blockhash: string(),
@@ -6326,6 +6340,8 @@ class Connection {
6326
6340
 
6327
6341
  /**
6328
6342
  * Returns epoch activation information for a stake account that has been delegated
6343
+ *
6344
+ * @deprecated Deprecated since RPC v1.18; will be removed in a future version.
6329
6345
  */
6330
6346
  async getStakeActivation(publicKey, commitmentOrConfig, epoch) {
6331
6347
  const {
@@ -6897,7 +6913,7 @@ class Connection {
6897
6913
  /**
6898
6914
  * Fetch the current total currency supply of the cluster in lamports
6899
6915
  *
6900
- * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.
6916
+ * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead.
6901
6917
  */
6902
6918
  async getTotalSupply(commitment) {
6903
6919
  const result = await this.getSupply({
@@ -7014,7 +7030,7 @@ class Connection {
7014
7030
  * Fetch a recent blockhash from the cluster, return with context
7015
7031
  * @return {Promise<RpcResponseAndContext<{blockhash: Blockhash, feeCalculator: FeeCalculator}>>}
7016
7032
  *
7017
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
7033
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead.
7018
7034
  */
7019
7035
  async getRecentBlockhashAndContext(commitment) {
7020
7036
  const args = this._buildArgs([], commitment);
@@ -7042,7 +7058,7 @@ class Connection {
7042
7058
  /**
7043
7059
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
7044
7060
  *
7045
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.
7061
+ * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead.
7046
7062
  */
7047
7063
  async getFeeCalculatorForBlockhash(blockhash, commitment) {
7048
7064
  const args = this._buildArgs([blockhash], commitment);
@@ -7095,7 +7111,7 @@ class Connection {
7095
7111
  * Fetch a recent blockhash from the cluster
7096
7112
  * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}
7097
7113
  *
7098
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.
7114
+ * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead.
7099
7115
  */
7100
7116
  async getRecentBlockhash(commitment) {
7101
7117
  try {
@@ -7477,7 +7493,7 @@ class Connection {
7477
7493
  * Fetch a list of Transactions and transaction statuses from the cluster
7478
7494
  * for a confirmed block.
7479
7495
  *
7480
- * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.
7496
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead.
7481
7497
  */
7482
7498
  async getConfirmedBlock(slot, commitment) {
7483
7499
  const args = this._buildArgsAtLeastConfirmed([slot], commitment);
@@ -7556,7 +7572,7 @@ class Connection {
7556
7572
  /**
7557
7573
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
7558
7574
  *
7559
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.
7575
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead.
7560
7576
  */
7561
7577
  async getConfirmedBlockSignatures(slot, commitment) {
7562
7578
  const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {
@@ -7578,7 +7594,7 @@ class Connection {
7578
7594
  /**
7579
7595
  * Fetch a transaction details for a confirmed transaction
7580
7596
  *
7581
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.
7597
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead.
7582
7598
  */
7583
7599
  async getConfirmedTransaction(signature, commitment) {
7584
7600
  const args = this._buildArgsAtLeastConfirmed([signature], commitment);
@@ -7600,7 +7616,7 @@ class Connection {
7600
7616
  /**
7601
7617
  * Fetch parsed transaction details for a confirmed transaction
7602
7618
  *
7603
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.
7619
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead.
7604
7620
  */
7605
7621
  async getParsedConfirmedTransaction(signature, commitment) {
7606
7622
  const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');
@@ -7615,7 +7631,7 @@ class Connection {
7615
7631
  /**
7616
7632
  * Fetch parsed transaction details for a batch of confirmed transactions
7617
7633
  *
7618
- * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.
7634
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead.
7619
7635
  */
7620
7636
  async getParsedConfirmedTransactions(signatures, commitment) {
7621
7637
  const batch = signatures.map(signature => {
@@ -7640,7 +7656,7 @@ class Connection {
7640
7656
  * Fetch a list of all the confirmed signatures for transactions involving an address
7641
7657
  * within a specified slot range. Max range allowed is 10,000 slots.
7642
7658
  *
7643
- * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
7659
+ * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.
7644
7660
  *
7645
7661
  * @param address queried address
7646
7662
  * @param startSlot start slot, inclusive
@@ -7694,9 +7710,7 @@ class Connection {
7694
7710
  * Returns confirmed signatures for transactions involving an
7695
7711
  * address backwards in time from the provided signature or most recent confirmed block
7696
7712
  *
7697
- *
7698
- * @param address queried address
7699
- * @param options
7713
+ * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead.
7700
7714
  */
7701
7715
  async getConfirmedSignaturesForAddress2(address, options, commitment) {
7702
7716
  const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);
@@ -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);