@solana/web3.js 1.32.0 → 1.34.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/module.flow.js CHANGED
@@ -664,6 +664,11 @@ declare module "@solana/web3.js" {
664
664
  * preflight commitment level
665
665
  */
666
666
  preflightCommitment?: Commitment,
667
+
668
+ /**
669
+ * Maximum number of times for the RPC node to retry sending the transaction to the leader.
670
+ */
671
+ maxRetries?: number,
667
672
  ...
668
673
  };
669
674
 
@@ -685,6 +690,11 @@ declare module "@solana/web3.js" {
685
690
  * preflight commitment level
686
691
  */
687
692
  preflightCommitment?: Commitment,
693
+
694
+ /**
695
+ * Maximum number of times for the RPC node to retry sending the transaction to the leader.
696
+ */
697
+ maxRetries?: number,
688
698
  ...
689
699
  };
690
700
 
@@ -1036,8 +1046,14 @@ declare module "@solana/web3.js" {
1036
1046
 
1037
1047
  /**
1038
1048
  * Metadata for a parsed confirmed transaction on the ledger
1049
+ * @deprecated [object Object],[object Object],[object Object]
1039
1050
  */
1040
- declare export type ParsedConfirmedTransactionMeta = {
1051
+ declare export type ParsedConfirmedTransactionMeta = ParsedTransactionMeta;
1052
+
1053
+ /**
1054
+ * Metadata for a parsed transaction on the ledger
1055
+ */
1056
+ declare export type ParsedTransactionMeta = {
1041
1057
  /**
1042
1058
  * The fee charged for processing the transaction
1043
1059
  */
@@ -1296,8 +1312,14 @@ declare module "@solana/web3.js" {
1296
1312
 
1297
1313
  /**
1298
1314
  * A parsed and confirmed transaction on the ledger
1315
+ * @deprecated [object Object],[object Object],[object Object]
1299
1316
  */
1300
- declare export type ParsedConfirmedTransaction = {
1317
+ declare export type ParsedConfirmedTransaction = ParsedTransactionWithMeta;
1318
+
1319
+ /**
1320
+ * A parsed transaction on the ledger with meta
1321
+ */
1322
+ declare export type ParsedTransactionWithMeta = {
1301
1323
  /**
1302
1324
  * The slot during which the transaction was processed
1303
1325
  */
@@ -1311,7 +1333,7 @@ declare module "@solana/web3.js" {
1311
1333
  /**
1312
1334
  * Metadata produced from the transaction
1313
1335
  */
1314
- meta: ParsedConfirmedTransactionMeta | null,
1336
+ meta: ParsedTransactionMeta | null,
1315
1337
 
1316
1338
  /**
1317
1339
  * The unix timestamp of when the transaction was processed
@@ -1446,9 +1468,9 @@ declare module "@solana/web3.js" {
1446
1468
  };
1447
1469
 
1448
1470
  /**
1449
- * A ConfirmedBlock on the ledger with signatures only
1471
+ * A Block on the ledger with signatures only
1450
1472
  */
1451
- declare export type ConfirmedBlockSignatures = {
1473
+ declare export type BlockSignatures = {
1452
1474
  /**
1453
1475
  * Blockhash of this block
1454
1476
  */
@@ -2419,6 +2441,7 @@ account: AccountInfo<Buffer | ParsedAccountData>,...
2419
2441
  blockhash: Blockhash,
2420
2442
  feeCalculator: FeeCalculator,...
2421
2443
  }>>}
2444
+ * @deprecated [object Object],[object Object],[object Object]
2422
2445
  */
2423
2446
  getRecentBlockhashAndContext(commitment?: Commitment): Promise<
2424
2447
  RpcResponseAndContext<{
@@ -2436,6 +2459,7 @@ feeCalculator: FeeCalculator,...
2436
2459
 
2437
2460
  /**
2438
2461
  * Fetch the fee calculator for a recent blockhash from the cluster, return with context
2462
+ * @deprecated [object Object],[object Object],[object Object]
2439
2463
  */
2440
2464
  getFeeCalculatorForBlockhash(
2441
2465
  blockhash: Blockhash,
@@ -2456,6 +2480,7 @@ feeCalculator: FeeCalculator,...
2456
2480
  blockhash: Blockhash,
2457
2481
  feeCalculator: FeeCalculator,...
2458
2482
  }>}
2483
+ * @deprecated [object Object],[object Object],[object Object]
2459
2484
  */
2460
2485
  getRecentBlockhash(commitment?: Commitment): Promise<{
2461
2486
  blockhash: Blockhash,
@@ -2463,6 +2488,34 @@ feeCalculator: FeeCalculator,...
2463
2488
  ...
2464
2489
  }>;
2465
2490
 
2491
+ /**
2492
+ * Fetch the latest blockhash from the cluster
2493
+ * @return {Promise<{
2494
+ blockhash: Blockhash,
2495
+ lastValidBlockHeight: number,...
2496
+ }>}
2497
+ */
2498
+ getLatestBlockhash(commitment?: Commitment): Promise<{
2499
+ blockhash: Blockhash,
2500
+ lastValidBlockHeight: number,
2501
+ ...
2502
+ }>;
2503
+
2504
+ /**
2505
+ * Fetch the latest blockhash from the cluster
2506
+ * @return {Promise<{
2507
+ blockhash: Blockhash,
2508
+ lastValidBlockHeight: number,...
2509
+ }>}
2510
+ */
2511
+ getLatestBlockhashAndContext(commitment?: Commitment): Promise<
2512
+ RpcResponseAndContext<{
2513
+ blockhash: Blockhash,
2514
+ lastValidBlockHeight: number,
2515
+ ...
2516
+ }>
2517
+ >;
2518
+
2466
2519
  /**
2467
2520
  * Fetch the node version
2468
2521
  */
@@ -2485,7 +2538,7 @@ feeCalculator: FeeCalculator,...
2485
2538
  ): Promise<BlockResponse | null>;
2486
2539
 
2487
2540
  /**
2488
- * Fetch a processed transaction from the cluster.
2541
+ * Fetch a confirmed or finalized transaction from the cluster.
2489
2542
  */
2490
2543
  getTransaction(
2491
2544
  signature: string,
@@ -2495,6 +2548,22 @@ feeCalculator: FeeCalculator,...
2495
2548
  }
2496
2549
  ): Promise<TransactionResponse | null>;
2497
2550
 
2551
+ /**
2552
+ * Fetch parsed transaction details for a confirmed or finalized transaction
2553
+ */
2554
+ getParsedTransaction(
2555
+ signature: TransactionSignature,
2556
+ commitment?: Finality
2557
+ ): Promise<ParsedConfirmedTransaction | null>;
2558
+
2559
+ /**
2560
+ * Fetch parsed transaction details for a batch of confirmed transactions
2561
+ */
2562
+ getParsedTransactions(
2563
+ signatures: TransactionSignature[],
2564
+ commitment?: Finality
2565
+ ): Promise<(ParsedConfirmedTransaction | null)[]>;
2566
+
2498
2567
  /**
2499
2568
  * Fetch a list of Transactions and transaction statuses from the cluster
2500
2569
  * for a confirmed block.
@@ -2514,16 +2583,26 @@ feeCalculator: FeeCalculator,...
2514
2583
  commitment?: Finality
2515
2584
  ): Promise<Array<number>>;
2516
2585
 
2586
+ /**
2587
+ * Fetch a list of Signatures from the cluster for a block, excluding rewards
2588
+ */
2589
+ getBlockSignatures(
2590
+ slot: number,
2591
+ commitment?: Finality
2592
+ ): Promise<BlockSignatures>;
2593
+
2517
2594
  /**
2518
2595
  * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
2596
+ * @deprecated [object Object],[object Object],[object Object]
2519
2597
  */
2520
2598
  getConfirmedBlockSignatures(
2521
2599
  slot: number,
2522
2600
  commitment?: Finality
2523
- ): Promise<ConfirmedBlockSignatures>;
2601
+ ): Promise<BlockSignatures>;
2524
2602
 
2525
2603
  /**
2526
2604
  * Fetch a transaction details for a confirmed transaction
2605
+ * @deprecated [object Object],[object Object],[object Object]
2527
2606
  */
2528
2607
  getConfirmedTransaction(
2529
2608
  signature: TransactionSignature,
@@ -2532,6 +2611,7 @@ feeCalculator: FeeCalculator,...
2532
2611
 
2533
2612
  /**
2534
2613
  * Fetch parsed transaction details for a confirmed transaction
2614
+ * @deprecated [object Object],[object Object],[object Object]
2535
2615
  */
2536
2616
  getParsedConfirmedTransaction(
2537
2617
  signature: TransactionSignature,
@@ -2540,6 +2620,7 @@ feeCalculator: FeeCalculator,...
2540
2620
 
2541
2621
  /**
2542
2622
  * Fetch parsed transaction details for a batch of confirmed transactions
2623
+ * @deprecated [object Object],[object Object],[object Object]
2543
2624
  */
2544
2625
  getParsedConfirmedTransactions(
2545
2626
  signatures: TransactionSignature[],
@@ -4001,6 +4082,177 @@ feeCalculator: FeeCalculator,...
4001
4082
  buffer: Buffer | Uint8Array | Array<number>
4002
4083
  ): VoteAccount;
4003
4084
  }
4085
+
4086
+ /**
4087
+ * Vote account info
4088
+ */
4089
+ declare export class VoteInit {
4090
+ nodePubkey: PublicKey;
4091
+ authorizedVoter: PublicKey;
4092
+ authorizedWithdrawer: PublicKey;
4093
+ commission: number;
4094
+ constructor(
4095
+ nodePubkey: PublicKey,
4096
+ authorizedVoter: PublicKey,
4097
+ authorizedWithdrawer: PublicKey,
4098
+ commission: number
4099
+ ): this;
4100
+ }
4101
+
4102
+ /**
4103
+ * Create vote account transaction params
4104
+ */
4105
+ declare export type CreateVoteAccountParams = {
4106
+ fromPubkey: PublicKey,
4107
+ votePubkey: PublicKey,
4108
+ voteInit: VoteInit,
4109
+ lamports: number,
4110
+ ...
4111
+ };
4112
+
4113
+ /**
4114
+ * InitializeAccount instruction params
4115
+ */
4116
+ declare export type InitializeAccountParams = {
4117
+ votePubkey: PublicKey,
4118
+ nodePubkey: PublicKey,
4119
+ voteInit: VoteInit,
4120
+ ...
4121
+ };
4122
+
4123
+ /**
4124
+ * Authorize instruction params
4125
+ */
4126
+ declare export type AuthorizeVoteParams = {
4127
+ votePubkey: PublicKey,
4128
+
4129
+ /**
4130
+ * Current vote or withdraw authority, depending on `voteAuthorizationType`
4131
+ */
4132
+ authorizedPubkey: PublicKey,
4133
+ newAuthorizedPubkey: PublicKey,
4134
+ voteAuthorizationType: VoteAuthorizationType,
4135
+ ...
4136
+ };
4137
+
4138
+ /**
4139
+ * Withdraw from vote account transaction params
4140
+ */
4141
+ declare export type WithdrawFromVoteAccountParams = {
4142
+ votePubkey: PublicKey,
4143
+ authorizedWithdrawerPubkey: PublicKey,
4144
+ lamports: number,
4145
+ toPubkey: PublicKey,
4146
+ ...
4147
+ };
4148
+
4149
+ /**
4150
+ * Vote Instruction class
4151
+ */
4152
+ declare export class VoteInstruction {
4153
+ /**
4154
+ * Decode a vote instruction and retrieve the instruction type.
4155
+ */
4156
+ static decodeInstructionType(
4157
+ instruction: TransactionInstruction
4158
+ ): VoteInstructionType;
4159
+
4160
+ /**
4161
+ * Decode an initialize vote instruction and retrieve the instruction params.
4162
+ */
4163
+ static decodeInitializeAccount(
4164
+ instruction: TransactionInstruction
4165
+ ): InitializeAccountParams;
4166
+
4167
+ /**
4168
+ * Decode an authorize instruction and retrieve the instruction params.
4169
+ */
4170
+ static decodeAuthorize(
4171
+ instruction: TransactionInstruction
4172
+ ): AuthorizeVoteParams;
4173
+
4174
+ /**
4175
+ * Decode a withdraw instruction and retrieve the instruction params.
4176
+ */
4177
+ static decodeWithdraw(
4178
+ instruction: TransactionInstruction
4179
+ ): WithdrawFromVoteAccountParams;
4180
+ }
4181
+
4182
+ /**
4183
+ * An enumeration of valid VoteInstructionType's
4184
+ */
4185
+ declare export type VoteInstructionType =
4186
+ | "Authorize"
4187
+ | "InitializeAccount"
4188
+ | "Withdraw";
4189
+
4190
+ /**
4191
+ * VoteAuthorize type
4192
+ */
4193
+ declare export type VoteAuthorizationType = {
4194
+ /**
4195
+ * The VoteAuthorize index (from solana-vote-program)
4196
+ */
4197
+ index: number,
4198
+ ...
4199
+ };
4200
+
4201
+ /**
4202
+ * An enumeration of valid VoteAuthorization layouts.
4203
+ */
4204
+ declare export var VoteAuthorizationLayout: $ReadOnly<{
4205
+ Voter: {
4206
+ index: number,
4207
+ ...
4208
+ },
4209
+ Withdrawer: {
4210
+ index: number,
4211
+ ...
4212
+ },
4213
+ ...
4214
+ }>;
4215
+
4216
+ /**
4217
+ * Factory class for transactions to interact with the Vote program
4218
+ */
4219
+ declare export class VoteProgram {
4220
+ /**
4221
+ * Public key that identifies the Vote program
4222
+ */
4223
+ static programId: PublicKey;
4224
+
4225
+ /**
4226
+ * Max space of a Vote account
4227
+ *
4228
+ * This is generated from the solana-vote-program VoteState struct as
4229
+ * `VoteState::size_of()`:
4230
+ * https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of
4231
+ */
4232
+ static space: number;
4233
+
4234
+ /**
4235
+ * Generate an Initialize instruction.
4236
+ */
4237
+ static initializeAccount(
4238
+ params: InitializeAccountParams
4239
+ ): TransactionInstruction;
4240
+
4241
+ /**
4242
+ * Generate a transaction that creates a new Vote account.
4243
+ */
4244
+ static createAccount(params: CreateVoteAccountParams): Transaction;
4245
+
4246
+ /**
4247
+ * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account.
4248
+ */
4249
+ static authorize(params: AuthorizeVoteParams): Transaction;
4250
+
4251
+ /**
4252
+ * Generate a transaction to withdraw from a Vote account.
4253
+ */
4254
+ static withdraw(params: WithdrawFromVoteAccountParams): Transaction;
4255
+ }
4004
4256
  declare export var SYSVAR_CLOCK_PUBKEY: PublicKey;
4005
4257
  declare export var SYSVAR_EPOCH_SCHEDULE_PUBKEY: PublicKey;
4006
4258
  declare export var SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.32.0",
3
+ "version": "1.34.0",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",