@solana/web3.js 1.89.1 → 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.
@@ -3206,10 +3206,15 @@ class Loader {
3206
3206
  }
3207
3207
  Loader.chunkSize = CHUNK_SIZE;
3208
3208
 
3209
+ /**
3210
+ * @deprecated Deprecated since Solana v1.17.20.
3211
+ */
3209
3212
  const BPF_LOADER_PROGRAM_ID = new PublicKey('BPFLoader2111111111111111111111111111111111');
3210
3213
 
3211
3214
  /**
3212
3215
  * Factory class for transactions to interact with a program loader
3216
+ *
3217
+ * @deprecated Deprecated since Solana v1.17.20.
3213
3218
  */
3214
3219
  class BpfLoader {
3215
3220
  /**
@@ -9403,12 +9408,14 @@ class StakeProgram {
9403
9408
  /**
9404
9409
  * Generate a Transaction that splits Stake tokens into another stake account
9405
9410
  */
9406
- static split(params) {
9411
+ static split(params,
9412
+ // Compute the cost of allocating the new stake account in lamports
9413
+ rentExemptReserve) {
9407
9414
  const transaction = new Transaction();
9408
9415
  transaction.add(SystemProgram.createAccount({
9409
9416
  fromPubkey: params.authorizedPubkey,
9410
9417
  newAccountPubkey: params.splitStakePubkey,
9411
- lamports: 0,
9418
+ lamports: rentExemptReserve,
9412
9419
  space: this.space,
9413
9420
  programId: this.programId
9414
9421
  }));
@@ -9419,7 +9426,9 @@ class StakeProgram {
9419
9426
  * Generate a Transaction that splits Stake tokens into another account
9420
9427
  * derived from a base public key and seed
9421
9428
  */
9422
- static splitWithSeed(params) {
9429
+ static splitWithSeed(params,
9430
+ // If this stake account is new, compute the cost of allocating it in lamports
9431
+ rentExemptReserve) {
9423
9432
  const {
9424
9433
  stakePubkey,
9425
9434
  authorizedPubkey,
@@ -9436,6 +9445,13 @@ class StakeProgram {
9436
9445
  space: this.space,
9437
9446
  programId: this.programId
9438
9447
  }));
9448
+ if (rentExemptReserve && rentExemptReserve > 0) {
9449
+ transaction.add(SystemProgram.transfer({
9450
+ fromPubkey: params.authorizedPubkey,
9451
+ toPubkey: splitStakePubkey,
9452
+ lamports: rentExemptReserve
9453
+ }));
9454
+ }
9439
9455
  return transaction.add(this.splitInstruction({
9440
9456
  stakePubkey,
9441
9457
  authorizedPubkey,
@@ -9566,8 +9582,8 @@ StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111
9566
9582
  * Max space of a Stake account
9567
9583
  *
9568
9584
  * This is generated from the solana-stake-program StakeState struct as
9569
- * `StakeState::size_of()`:
9570
- * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
9585
+ * `StakeStateV2::size_of()`:
9586
+ * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
9571
9587
  */
9572
9588
  StakeProgram.space = 200;
9573
9589