@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.
@@ -7701,7 +7701,7 @@ class Connection {
7701
7701
  /**
7702
7702
  * Deregister an account notification callback
7703
7703
  *
7704
- * @param id client subscription id to deregister
7704
+ * @param clientSubscriptionId client subscription id to deregister
7705
7705
  */
7706
7706
  async removeAccountChangeListener(clientSubscriptionId) {
7707
7707
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'account change');
@@ -7747,7 +7747,7 @@ class Connection {
7747
7747
  /**
7748
7748
  * Deregister an account notification callback
7749
7749
  *
7750
- * @param id client subscription id to deregister
7750
+ * @param clientSubscriptionId client subscription id to deregister
7751
7751
  */
7752
7752
  async removeProgramAccountChangeListener(clientSubscriptionId) {
7753
7753
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'program account change');
@@ -7771,7 +7771,7 @@ class Connection {
7771
7771
  /**
7772
7772
  * Deregister a logs callback.
7773
7773
  *
7774
- * @param id client subscription id to deregister.
7774
+ * @param clientSubscriptionId client subscription id to deregister.
7775
7775
  */
7776
7776
  async removeOnLogsListener(clientSubscriptionId) {
7777
7777
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'logs');
@@ -7816,7 +7816,7 @@ class Connection {
7816
7816
  /**
7817
7817
  * Deregister a slot notification callback
7818
7818
  *
7819
- * @param id client subscription id to deregister
7819
+ * @param clientSubscriptionId client subscription id to deregister
7820
7820
  */
7821
7821
  async removeSlotChangeListener(clientSubscriptionId) {
7822
7822
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot change');
@@ -7851,7 +7851,7 @@ class Connection {
7851
7851
  /**
7852
7852
  * Deregister a slot update notification callback
7853
7853
  *
7854
- * @param id client subscription id to deregister
7854
+ * @param clientSubscriptionId client subscription id to deregister
7855
7855
  */
7856
7856
  async removeSlotUpdateListener(clientSubscriptionId) {
7857
7857
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot update');
@@ -8001,7 +8001,7 @@ class Connection {
8001
8001
  /**
8002
8002
  * Deregister a signature notification callback
8003
8003
  *
8004
- * @param id client subscription id to deregister
8004
+ * @param clientSubscriptionId client subscription id to deregister
8005
8005
  */
8006
8006
  async removeSignatureListener(clientSubscriptionId) {
8007
8007
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'signature result');
@@ -8035,7 +8035,7 @@ class Connection {
8035
8035
  /**
8036
8036
  * Deregister a root notification callback
8037
8037
  *
8038
- * @param id client subscription id to deregister
8038
+ * @param clientSubscriptionId client subscription id to deregister
8039
8039
  */
8040
8040
  async removeRootChangeListener(clientSubscriptionId) {
8041
8041
  await this._unsubscribeClientSubscription(clientSubscriptionId, 'root change');
@@ -9653,6 +9653,10 @@ class VoteInit {
9653
9653
  * Withdraw from vote account transaction params
9654
9654
  */
9655
9655
 
9656
+ /**
9657
+ * Update validator identity (node pubkey) vote account instruction params.
9658
+ */
9659
+
9656
9660
  /**
9657
9661
  * Vote Instruction class
9658
9662
  */
@@ -9799,6 +9803,10 @@ const VOTE_INSTRUCTION_LAYOUTS = Object.freeze({
9799
9803
  index: 3,
9800
9804
  layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), BufferLayout__namespace.ns64('lamports')])
9801
9805
  },
9806
+ UpdateValidatorIdentity: {
9807
+ index: 4,
9808
+ layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction')])
9809
+ },
9802
9810
  AuthorizeWithSeed: {
9803
9811
  index: 10,
9804
9812
  layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), voteAuthorizeWithSeedArgs()])
@@ -10016,10 +10024,41 @@ class VoteProgram {
10016
10024
  */
10017
10025
  static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) {
10018
10026
  if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) {
10019
- throw new Error('Withdraw will leave vote account with insuffcient funds.');
10027
+ throw new Error('Withdraw will leave vote account with insufficient funds.');
10020
10028
  }
10021
10029
  return VoteProgram.withdraw(params);
10022
10030
  }
10031
+
10032
+ /**
10033
+ * Generate a transaction to update the validator identity (node pubkey) of a Vote account.
10034
+ */
10035
+ static updateValidatorIdentity(params) {
10036
+ const {
10037
+ votePubkey,
10038
+ authorizedWithdrawerPubkey,
10039
+ nodePubkey
10040
+ } = params;
10041
+ const type = VOTE_INSTRUCTION_LAYOUTS.UpdateValidatorIdentity;
10042
+ const data = encodeData(type);
10043
+ const keys = [{
10044
+ pubkey: votePubkey,
10045
+ isSigner: false,
10046
+ isWritable: true
10047
+ }, {
10048
+ pubkey: nodePubkey,
10049
+ isSigner: true,
10050
+ isWritable: false
10051
+ }, {
10052
+ pubkey: authorizedWithdrawerPubkey,
10053
+ isSigner: true,
10054
+ isWritable: false
10055
+ }];
10056
+ return new Transaction().add({
10057
+ keys,
10058
+ programId: this.programId,
10059
+ data
10060
+ });
10061
+ }
10023
10062
  }
10024
10063
  VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
10025
10064
  /**
@@ -10031,7 +10070,7 @@ VoteProgram.programId = new PublicKey('Vote1111111111111111111111111111111111111
10031
10070
  *
10032
10071
  * 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
10033
10072
  */
10034
- VoteProgram.space = 3731;
10073
+ VoteProgram.space = 3762;
10035
10074
 
10036
10075
  const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
10037
10076