@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.browser.cjs.js +48 -9
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +48 -9
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +48 -9
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +20 -8
- package/lib/index.esm.js +48 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +48 -9
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +48 -9
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +7 -7
- package/src/programs/vote.ts +46 -3
package/lib/index.cjs.js
CHANGED
|
@@ -8398,7 +8398,7 @@ class Connection {
|
|
|
8398
8398
|
/**
|
|
8399
8399
|
* Deregister an account notification callback
|
|
8400
8400
|
*
|
|
8401
|
-
* @param
|
|
8401
|
+
* @param clientSubscriptionId client subscription id to deregister
|
|
8402
8402
|
*/
|
|
8403
8403
|
async removeAccountChangeListener(clientSubscriptionId) {
|
|
8404
8404
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'account change');
|
|
@@ -8444,7 +8444,7 @@ class Connection {
|
|
|
8444
8444
|
/**
|
|
8445
8445
|
* Deregister an account notification callback
|
|
8446
8446
|
*
|
|
8447
|
-
* @param
|
|
8447
|
+
* @param clientSubscriptionId client subscription id to deregister
|
|
8448
8448
|
*/
|
|
8449
8449
|
async removeProgramAccountChangeListener(clientSubscriptionId) {
|
|
8450
8450
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'program account change');
|
|
@@ -8468,7 +8468,7 @@ class Connection {
|
|
|
8468
8468
|
/**
|
|
8469
8469
|
* Deregister a logs callback.
|
|
8470
8470
|
*
|
|
8471
|
-
* @param
|
|
8471
|
+
* @param clientSubscriptionId client subscription id to deregister.
|
|
8472
8472
|
*/
|
|
8473
8473
|
async removeOnLogsListener(clientSubscriptionId) {
|
|
8474
8474
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'logs');
|
|
@@ -8513,7 +8513,7 @@ class Connection {
|
|
|
8513
8513
|
/**
|
|
8514
8514
|
* Deregister a slot notification callback
|
|
8515
8515
|
*
|
|
8516
|
-
* @param
|
|
8516
|
+
* @param clientSubscriptionId client subscription id to deregister
|
|
8517
8517
|
*/
|
|
8518
8518
|
async removeSlotChangeListener(clientSubscriptionId) {
|
|
8519
8519
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot change');
|
|
@@ -8548,7 +8548,7 @@ class Connection {
|
|
|
8548
8548
|
/**
|
|
8549
8549
|
* Deregister a slot update notification callback
|
|
8550
8550
|
*
|
|
8551
|
-
* @param
|
|
8551
|
+
* @param clientSubscriptionId client subscription id to deregister
|
|
8552
8552
|
*/
|
|
8553
8553
|
async removeSlotUpdateListener(clientSubscriptionId) {
|
|
8554
8554
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot update');
|
|
@@ -8698,7 +8698,7 @@ class Connection {
|
|
|
8698
8698
|
/**
|
|
8699
8699
|
* Deregister a signature notification callback
|
|
8700
8700
|
*
|
|
8701
|
-
* @param
|
|
8701
|
+
* @param clientSubscriptionId client subscription id to deregister
|
|
8702
8702
|
*/
|
|
8703
8703
|
async removeSignatureListener(clientSubscriptionId) {
|
|
8704
8704
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'signature result');
|
|
@@ -8732,7 +8732,7 @@ class Connection {
|
|
|
8732
8732
|
/**
|
|
8733
8733
|
* Deregister a root notification callback
|
|
8734
8734
|
*
|
|
8735
|
-
* @param
|
|
8735
|
+
* @param clientSubscriptionId client subscription id to deregister
|
|
8736
8736
|
*/
|
|
8737
8737
|
async removeRootChangeListener(clientSubscriptionId) {
|
|
8738
8738
|
await this._unsubscribeClientSubscription(clientSubscriptionId, 'root change');
|
|
@@ -10350,6 +10350,10 @@ class VoteInit {
|
|
|
10350
10350
|
* Withdraw from vote account transaction params
|
|
10351
10351
|
*/
|
|
10352
10352
|
|
|
10353
|
+
/**
|
|
10354
|
+
* Update validator identity (node pubkey) vote account instruction params.
|
|
10355
|
+
*/
|
|
10356
|
+
|
|
10353
10357
|
/**
|
|
10354
10358
|
* Vote Instruction class
|
|
10355
10359
|
*/
|
|
@@ -10496,6 +10500,10 @@ const VOTE_INSTRUCTION_LAYOUTS = Object.freeze({
|
|
|
10496
10500
|
index: 3,
|
|
10497
10501
|
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), BufferLayout__namespace.ns64('lamports')])
|
|
10498
10502
|
},
|
|
10503
|
+
UpdateValidatorIdentity: {
|
|
10504
|
+
index: 4,
|
|
10505
|
+
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction')])
|
|
10506
|
+
},
|
|
10499
10507
|
AuthorizeWithSeed: {
|
|
10500
10508
|
index: 10,
|
|
10501
10509
|
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u32('instruction'), voteAuthorizeWithSeedArgs()])
|
|
@@ -10713,10 +10721,41 @@ class VoteProgram {
|
|
|
10713
10721
|
*/
|
|
10714
10722
|
static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) {
|
|
10715
10723
|
if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) {
|
|
10716
|
-
throw new Error('Withdraw will leave vote account with
|
|
10724
|
+
throw new Error('Withdraw will leave vote account with insufficient funds.');
|
|
10717
10725
|
}
|
|
10718
10726
|
return VoteProgram.withdraw(params);
|
|
10719
10727
|
}
|
|
10728
|
+
|
|
10729
|
+
/**
|
|
10730
|
+
* Generate a transaction to update the validator identity (node pubkey) of a Vote account.
|
|
10731
|
+
*/
|
|
10732
|
+
static updateValidatorIdentity(params) {
|
|
10733
|
+
const {
|
|
10734
|
+
votePubkey,
|
|
10735
|
+
authorizedWithdrawerPubkey,
|
|
10736
|
+
nodePubkey
|
|
10737
|
+
} = params;
|
|
10738
|
+
const type = VOTE_INSTRUCTION_LAYOUTS.UpdateValidatorIdentity;
|
|
10739
|
+
const data = encodeData(type);
|
|
10740
|
+
const keys = [{
|
|
10741
|
+
pubkey: votePubkey,
|
|
10742
|
+
isSigner: false,
|
|
10743
|
+
isWritable: true
|
|
10744
|
+
}, {
|
|
10745
|
+
pubkey: nodePubkey,
|
|
10746
|
+
isSigner: true,
|
|
10747
|
+
isWritable: false
|
|
10748
|
+
}, {
|
|
10749
|
+
pubkey: authorizedWithdrawerPubkey,
|
|
10750
|
+
isSigner: true,
|
|
10751
|
+
isWritable: false
|
|
10752
|
+
}];
|
|
10753
|
+
return new Transaction().add({
|
|
10754
|
+
keys,
|
|
10755
|
+
programId: this.programId,
|
|
10756
|
+
data
|
|
10757
|
+
});
|
|
10758
|
+
}
|
|
10720
10759
|
}
|
|
10721
10760
|
VoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');
|
|
10722
10761
|
/**
|
|
@@ -10728,7 +10767,7 @@ VoteProgram.programId = new PublicKey('Vote1111111111111111111111111111111111111
|
|
|
10728
10767
|
*
|
|
10729
10768
|
* 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
|
|
10730
10769
|
*/
|
|
10731
|
-
VoteProgram.space =
|
|
10770
|
+
VoteProgram.space = 3762;
|
|
10732
10771
|
|
|
10733
10772
|
const VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');
|
|
10734
10773
|
|