@solana/web3.js 1.90.1 → 1.91.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.iife.js CHANGED
@@ -22143,7 +22143,7 @@ var solanaWeb3 = (function (exports) {
22143
22143
  /**
22144
22144
  * Deregister an account notification callback
22145
22145
  *
22146
- * @param id client subscription id to deregister
22146
+ * @param clientSubscriptionId client subscription id to deregister
22147
22147
  */
22148
22148
  async removeAccountChangeListener(clientSubscriptionId) {
22149
22149
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'account change');
@@ -22189,7 +22189,7 @@ var solanaWeb3 = (function (exports) {
22189
22189
  /**
22190
22190
  * Deregister an account notification callback
22191
22191
  *
22192
- * @param id client subscription id to deregister
22192
+ * @param clientSubscriptionId client subscription id to deregister
22193
22193
  */
22194
22194
  async removeProgramAccountChangeListener(clientSubscriptionId) {
22195
22195
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'program account change');
@@ -22213,7 +22213,7 @@ var solanaWeb3 = (function (exports) {
22213
22213
  /**
22214
22214
  * Deregister a logs callback.
22215
22215
  *
22216
- * @param id client subscription id to deregister.
22216
+ * @param clientSubscriptionId client subscription id to deregister.
22217
22217
  */
22218
22218
  async removeOnLogsListener(clientSubscriptionId) {
22219
22219
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'logs');
@@ -22258,7 +22258,7 @@ var solanaWeb3 = (function (exports) {
22258
22258
  /**
22259
22259
  * Deregister a slot notification callback
22260
22260
  *
22261
- * @param id client subscription id to deregister
22261
+ * @param clientSubscriptionId client subscription id to deregister
22262
22262
  */
22263
22263
  async removeSlotChangeListener(clientSubscriptionId) {
22264
22264
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot change');
@@ -22293,7 +22293,7 @@ var solanaWeb3 = (function (exports) {
22293
22293
  /**
22294
22294
  * Deregister a slot update notification callback
22295
22295
  *
22296
- * @param id client subscription id to deregister
22296
+ * @param clientSubscriptionId client subscription id to deregister
22297
22297
  */
22298
22298
  async removeSlotUpdateListener(clientSubscriptionId) {
22299
22299
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot update');
@@ -22443,7 +22443,7 @@ var solanaWeb3 = (function (exports) {
22443
22443
  /**
22444
22444
  * Deregister a signature notification callback
22445
22445
  *
22446
- * @param id client subscription id to deregister
22446
+ * @param clientSubscriptionId client subscription id to deregister
22447
22447
  */
22448
22448
  async removeSignatureListener(clientSubscriptionId) {
22449
22449
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'signature result');
@@ -22477,7 +22477,7 @@ var solanaWeb3 = (function (exports) {
22477
22477
  /**
22478
22478
  * Deregister a root notification callback
22479
22479
  *
22480
- * @param id client subscription id to deregister
22480
+ * @param clientSubscriptionId client subscription id to deregister
22481
22481
  */
22482
22482
  async removeRootChangeListener(clientSubscriptionId) {
22483
22483
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'root change');
@@ -25519,6 +25519,10 @@ var solanaWeb3 = (function (exports) {
25519
25519
  * Withdraw from vote account transaction params
25520
25520
  */
25521
25521
 
25522
+ /**
25523
+ * Update validator identity (node pubkey) vote account instruction params.
25524
+ */
25525
+
25522
25526
  /**
25523
25527
  * Vote Instruction class
25524
25528
  */
@@ -25665,6 +25669,10 @@ var solanaWeb3 = (function (exports) {
25665
25669
  index: 3,
25666
25670
  layout: struct([u32('instruction'), ns64('lamports')])
25667
25671
  },
25672
+ UpdateValidatorIdentity: {
25673
+ index: 4,
25674
+ layout: struct([u32('instruction')])
25675
+ },
25668
25676
  AuthorizeWithSeed: {
25669
25677
  index: 10,
25670
25678
  layout: struct([u32('instruction'), voteAuthorizeWithSeedArgs()])
@@ -25882,10 +25890,41 @@ var solanaWeb3 = (function (exports) {
25882
25890
  */
25883
25891
  static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) {
25884
25892
  if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) {
25885
- throw new Error('Withdraw will leave vote account with insuffcient funds.');
25893
+ throw new Error('Withdraw will leave vote account with insufficient funds.');
25886
25894
  }
25887
25895
  return VoteProgram.withdraw(params);
25888
25896
  }
25897
+
25898
+ /**
25899
+ * Generate a transaction to update the validator identity (node pubkey) of a Vote account.
25900
+ */
25901
+ static updateValidatorIdentity(params) {
25902
+ const {
25903
+ votePubkey,
25904
+ authorizedWithdrawerPubkey,
25905
+ nodePubkey
25906
+ } = params;
25907
+ const type = VOTE_INSTRUCTION_LAYOUTS.UpdateValidatorIdentity;
25908
+ const data = encodeData(type);
25909
+ const keys = [{
25910
+ pubkey: votePubkey,
25911
+ isSigner: false,
25912
+ isWritable: true
25913
+ }, {
25914
+ pubkey: nodePubkey,
25915
+ isSigner: true,
25916
+ isWritable: false
25917
+ }, {
25918
+ pubkey: authorizedWithdrawerPubkey,
25919
+ isSigner: true,
25920
+ isWritable: false
25921
+ }];
25922
+ return new Transaction().add({
25923
+ keys,
25924
+ programId: this.programId,
25925
+ data
25926
+ });
25927
+ }
25889
25928
  }
25890
25929
  VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
25891
25930
  /**
@@ -25897,7 +25936,7 @@ var solanaWeb3 = (function (exports) {
25897
25936
  *
25898
25937
  * KEEP IN SYNC WITH `VoteState::size_of()` in https://github.com/solana-labs/solana/blob/a474cb24b9238f5edcc982f65c0b37d4a1046f7e/sdk/program/src/vote/state/mod.rs#L340-L342
25899
25938
  */
25900
- VoteProgram.space = 3731;
25939
+ VoteProgram.space = 3762;
25901
25940
 
25902
25941
  const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
25903
25942