@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.
package/lib/index.cjs.js CHANGED
@@ -3242,10 +3242,15 @@ class Loader {
3242
3242
  }
3243
3243
  Loader.chunkSize = CHUNK_SIZE;
3244
3244
 
3245
+ /**
3246
+ * @deprecated Deprecated since Solana v1.17.20.
3247
+ */
3245
3248
  const BPF_LOADER_PROGRAM_ID = new PublicKey('BPFLoader2111111111111111111111111111111111');
3246
3249
 
3247
3250
  /**
3248
3251
  * Factory class for transactions to interact with a program loader
3252
+ *
3253
+ * @deprecated Deprecated since Solana v1.17.20.
3249
3254
  */
3250
3255
  class BpfLoader {
3251
3256
  /**
@@ -10128,12 +10133,14 @@ class StakeProgram {
10128
10133
  /**
10129
10134
  * Generate a Transaction that splits Stake tokens into another stake account
10130
10135
  */
10131
- static split(params) {
10136
+ static split(params,
10137
+ // Compute the cost of allocating the new stake account in lamports
10138
+ rentExemptReserve) {
10132
10139
  const transaction = new Transaction();
10133
10140
  transaction.add(SystemProgram.createAccount({
10134
10141
  fromPubkey: params.authorizedPubkey,
10135
10142
  newAccountPubkey: params.splitStakePubkey,
10136
- lamports: 0,
10143
+ lamports: rentExemptReserve,
10137
10144
  space: this.space,
10138
10145
  programId: this.programId
10139
10146
  }));
@@ -10144,7 +10151,9 @@ class StakeProgram {
10144
10151
  * Generate a Transaction that splits Stake tokens into another account
10145
10152
  * derived from a base public key and seed
10146
10153
  */
10147
- static splitWithSeed(params) {
10154
+ static splitWithSeed(params,
10155
+ // If this stake account is new, compute the cost of allocating it in lamports
10156
+ rentExemptReserve) {
10148
10157
  const {
10149
10158
  stakePubkey,
10150
10159
  authorizedPubkey,
@@ -10161,6 +10170,13 @@ class StakeProgram {
10161
10170
  space: this.space,
10162
10171
  programId: this.programId
10163
10172
  }));
10173
+ if (rentExemptReserve && rentExemptReserve > 0) {
10174
+ transaction.add(SystemProgram.transfer({
10175
+ fromPubkey: params.authorizedPubkey,
10176
+ toPubkey: splitStakePubkey,
10177
+ lamports: rentExemptReserve
10178
+ }));
10179
+ }
10164
10180
  return transaction.add(this.splitInstruction({
10165
10181
  stakePubkey,
10166
10182
  authorizedPubkey,
@@ -10291,8 +10307,8 @@ StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111
10291
10307
  * Max space of a Stake account
10292
10308
  *
10293
10309
  * This is generated from the solana-stake-program StakeState struct as
10294
- * `StakeState::size_of()`:
10295
- * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
10310
+ * `StakeStateV2::size_of()`:
10311
+ * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
10296
10312
  */
10297
10313
  StakeProgram.space = 200;
10298
10314