@solana/web3.js 1.34.0 → 1.35.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.cjs.js CHANGED
@@ -8265,30 +8265,22 @@ class StakeProgram {
8265
8265
  });
8266
8266
  }
8267
8267
  /**
8268
- * Generate a Transaction that splits Stake tokens into another stake account
8268
+ * @internal
8269
8269
  */
8270
8270
 
8271
8271
 
8272
- static split(params) {
8272
+ static splitInstruction(params) {
8273
8273
  const {
8274
8274
  stakePubkey,
8275
8275
  authorizedPubkey,
8276
8276
  splitStakePubkey,
8277
8277
  lamports
8278
8278
  } = params;
8279
- const transaction = new Transaction();
8280
- transaction.add(SystemProgram.createAccount({
8281
- fromPubkey: authorizedPubkey,
8282
- newAccountPubkey: splitStakePubkey,
8283
- lamports: 0,
8284
- space: this.space,
8285
- programId: this.programId
8286
- }));
8287
8279
  const type = STAKE_INSTRUCTION_LAYOUTS.Split;
8288
8280
  const data = encodeData(type, {
8289
8281
  lamports
8290
8282
  });
8291
- return transaction.add({
8283
+ return new TransactionInstruction({
8292
8284
  keys: [{
8293
8285
  pubkey: stakePubkey,
8294
8286
  isSigner: false,
@@ -8306,6 +8298,52 @@ class StakeProgram {
8306
8298
  data
8307
8299
  });
8308
8300
  }
8301
+ /**
8302
+ * Generate a Transaction that splits Stake tokens into another stake account
8303
+ */
8304
+
8305
+
8306
+ static split(params) {
8307
+ const transaction = new Transaction();
8308
+ transaction.add(SystemProgram.createAccount({
8309
+ fromPubkey: params.authorizedPubkey,
8310
+ newAccountPubkey: params.splitStakePubkey,
8311
+ lamports: 0,
8312
+ space: this.space,
8313
+ programId: this.programId
8314
+ }));
8315
+ return transaction.add(this.splitInstruction(params));
8316
+ }
8317
+ /**
8318
+ * Generate a Transaction that splits Stake tokens into another account
8319
+ * derived from a base public key and seed
8320
+ */
8321
+
8322
+
8323
+ static splitWithSeed(params) {
8324
+ const {
8325
+ stakePubkey,
8326
+ authorizedPubkey,
8327
+ splitStakePubkey,
8328
+ basePubkey,
8329
+ seed,
8330
+ lamports
8331
+ } = params;
8332
+ const transaction = new Transaction();
8333
+ transaction.add(SystemProgram.allocate({
8334
+ accountPubkey: splitStakePubkey,
8335
+ basePubkey,
8336
+ seed,
8337
+ space: this.space,
8338
+ programId: this.programId
8339
+ }));
8340
+ return transaction.add(this.splitInstruction({
8341
+ stakePubkey,
8342
+ authorizedPubkey,
8343
+ splitStakePubkey,
8344
+ lamports
8345
+ }));
8346
+ }
8309
8347
  /**
8310
8348
  * Generate a Transaction that merges Stake accounts.
8311
8349
  */