@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.
@@ -7673,7 +7673,7 @@ class Connection {
7673
7673
  /**
7674
7674
  * Deregister an account notification callback
7675
7675
  *
7676
- * @param id client subscription id to deregister
7676
+ * @param clientSubscriptionId client subscription id to deregister
7677
7677
  */
7678
7678
  async removeAccountChangeListener(clientSubscriptionId) {
7679
7679
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'account change');
@@ -7719,7 +7719,7 @@ class Connection {
7719
7719
  /**
7720
7720
  * Deregister an account notification callback
7721
7721
  *
7722
- * @param id client subscription id to deregister
7722
+ * @param clientSubscriptionId client subscription id to deregister
7723
7723
  */
7724
7724
  async removeProgramAccountChangeListener(clientSubscriptionId) {
7725
7725
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'program account change');
@@ -7743,7 +7743,7 @@ class Connection {
7743
7743
  /**
7744
7744
  * Deregister a logs callback.
7745
7745
  *
7746
- * @param id client subscription id to deregister.
7746
+ * @param clientSubscriptionId client subscription id to deregister.
7747
7747
  */
7748
7748
  async removeOnLogsListener(clientSubscriptionId) {
7749
7749
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'logs');
@@ -7788,7 +7788,7 @@ class Connection {
7788
7788
  /**
7789
7789
  * Deregister a slot notification callback
7790
7790
  *
7791
- * @param id client subscription id to deregister
7791
+ * @param clientSubscriptionId client subscription id to deregister
7792
7792
  */
7793
7793
  async removeSlotChangeListener(clientSubscriptionId) {
7794
7794
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot change');
@@ -7823,7 +7823,7 @@ class Connection {
7823
7823
  /**
7824
7824
  * Deregister a slot update notification callback
7825
7825
  *
7826
- * @param id client subscription id to deregister
7826
+ * @param clientSubscriptionId client subscription id to deregister
7827
7827
  */
7828
7828
  async removeSlotUpdateListener(clientSubscriptionId) {
7829
7829
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot update');
@@ -7973,7 +7973,7 @@ class Connection {
7973
7973
  /**
7974
7974
  * Deregister a signature notification callback
7975
7975
  *
7976
- * @param id client subscription id to deregister
7976
+ * @param clientSubscriptionId client subscription id to deregister
7977
7977
  */
7978
7978
  async removeSignatureListener(clientSubscriptionId) {
7979
7979
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'signature result');
@@ -8007,7 +8007,7 @@ class Connection {
8007
8007
  /**
8008
8008
  * Deregister a root notification callback
8009
8009
  *
8010
- * @param id client subscription id to deregister
8010
+ * @param clientSubscriptionId client subscription id to deregister
8011
8011
  */
8012
8012
  async removeRootChangeListener(clientSubscriptionId) {
8013
8013
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'root change');
@@ -9625,6 +9625,10 @@ class VoteInit {
9625
9625
  * Withdraw from vote account transaction params
9626
9626
  */
9627
9627
 
9628
+ /**
9629
+ * Update validator identity (node pubkey) vote account instruction params.
9630
+ */
9631
+
9628
9632
  /**
9629
9633
  * Vote Instruction class
9630
9634
  */
@@ -9771,6 +9775,10 @@ const VOTE_INSTRUCTION_LAYOUTS = Object.freeze({
9771
9775
  index: 3,
9772
9776
  layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('lamports')])
9773
9777
  },
9778
+ UpdateValidatorIdentity: {
9779
+ index: 4,
9780
+ layout: BufferLayout.struct([BufferLayout.u32('instruction')])
9781
+ },
9774
9782
  AuthorizeWithSeed: {
9775
9783
  index: 10,
9776
9784
  layout: BufferLayout.struct([BufferLayout.u32('instruction'), voteAuthorizeWithSeedArgs()])
@@ -9988,10 +9996,41 @@ class VoteProgram {
9988
9996
  */
9989
9997
  static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) {
9990
9998
  if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) {
9991
- throw new Error('Withdraw will leave vote account with insuffcient funds.');
9999
+ throw new Error('Withdraw will leave vote account with insufficient funds.');
9992
10000
  }
9993
10001
  return VoteProgram.withdraw(params);
9994
10002
  }
10003
+
10004
+ /**
10005
+ * Generate a transaction to update the validator identity (node pubkey) of a Vote account.
10006
+ */
10007
+ static updateValidatorIdentity(params) {
10008
+ const {
10009
+ votePubkey,
10010
+ authorizedWithdrawerPubkey,
10011
+ nodePubkey
10012
+ } = params;
10013
+ const type = VOTE_INSTRUCTION_LAYOUTS.UpdateValidatorIdentity;
10014
+ const data = encodeData(type);
10015
+ const keys = [{
10016
+ pubkey: votePubkey,
10017
+ isSigner: false,
10018
+ isWritable: true
10019
+ }, {
10020
+ pubkey: nodePubkey,
10021
+ isSigner: true,
10022
+ isWritable: false
10023
+ }, {
10024
+ pubkey: authorizedWithdrawerPubkey,
10025
+ isSigner: true,
10026
+ isWritable: false
10027
+ }];
10028
+ return new Transaction().add({
10029
+ keys,
10030
+ programId: this.programId,
10031
+ data
10032
+ });
10033
+ }
9995
10034
  }
9996
10035
  VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
9997
10036
  /**
@@ -10003,7 +10042,7 @@ VoteProgram.programId = new PublicKey('Vote1111111111111111111111111111111111111
10003
10042
  *
10004
10043
  * 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
10005
10044
  */
10006
- VoteProgram.space = 3731;
10045
+ VoteProgram.space = 3762;
10007
10046
 
10008
10047
  const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
10009
10048