@solana/web3.js 1.90.0 → 1.90.1

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.
@@ -9436,12 +9436,14 @@ class StakeProgram {
9436
9436
  /**
9437
9437
  * Generate a Transaction that splits Stake tokens into another stake account
9438
9438
  */
9439
- static split(params) {
9439
+ static split(params,
9440
+ // Compute the cost of allocating the new stake account in lamports
9441
+ rentExemptReserve) {
9440
9442
  const transaction = new Transaction();
9441
9443
  transaction.add(SystemProgram.createAccount({
9442
9444
  fromPubkey: params.authorizedPubkey,
9443
9445
  newAccountPubkey: params.splitStakePubkey,
9444
- lamports: 0,
9446
+ lamports: rentExemptReserve,
9445
9447
  space: this.space,
9446
9448
  programId: this.programId
9447
9449
  }));
@@ -9452,7 +9454,9 @@ class StakeProgram {
9452
9454
  * Generate a Transaction that splits Stake tokens into another account
9453
9455
  * derived from a base public key and seed
9454
9456
  */
9455
- static splitWithSeed(params) {
9457
+ static splitWithSeed(params,
9458
+ // If this stake account is new, compute the cost of allocating it in lamports
9459
+ rentExemptReserve) {
9456
9460
  const {
9457
9461
  stakePubkey,
9458
9462
  authorizedPubkey,
@@ -9469,6 +9473,13 @@ class StakeProgram {
9469
9473
  space: this.space,
9470
9474
  programId: this.programId
9471
9475
  }));
9476
+ if (rentExemptReserve && rentExemptReserve > 0) {
9477
+ transaction.add(SystemProgram.transfer({
9478
+ fromPubkey: params.authorizedPubkey,
9479
+ toPubkey: splitStakePubkey,
9480
+ lamports: rentExemptReserve
9481
+ }));
9482
+ }
9472
9483
  return transaction.add(this.splitInstruction({
9473
9484
  stakePubkey,
9474
9485
  authorizedPubkey,
@@ -9599,8 +9610,8 @@ StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111
9599
9610
  * Max space of a Stake account
9600
9611
  *
9601
9612
  * This is generated from the solana-stake-program StakeState struct as
9602
- * `StakeState::size_of()`:
9603
- * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
9613
+ * `StakeStateV2::size_of()`:
9614
+ * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
9604
9615
  */
9605
9616
  StakeProgram.space = 200;
9606
9617