@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.iife.js CHANGED
@@ -23756,30 +23756,22 @@ var solanaWeb3 = (function (exports) {
23756
23756
  });
23757
23757
  }
23758
23758
  /**
23759
- * Generate a Transaction that splits Stake tokens into another stake account
23759
+ * @internal
23760
23760
  */
23761
23761
 
23762
23762
 
23763
- static split(params) {
23763
+ static splitInstruction(params) {
23764
23764
  const {
23765
23765
  stakePubkey,
23766
23766
  authorizedPubkey,
23767
23767
  splitStakePubkey,
23768
23768
  lamports
23769
23769
  } = params;
23770
- const transaction = new Transaction();
23771
- transaction.add(SystemProgram.createAccount({
23772
- fromPubkey: authorizedPubkey,
23773
- newAccountPubkey: splitStakePubkey,
23774
- lamports: 0,
23775
- space: this.space,
23776
- programId: this.programId
23777
- }));
23778
23770
  const type = STAKE_INSTRUCTION_LAYOUTS.Split;
23779
23771
  const data = encodeData(type, {
23780
23772
  lamports
23781
23773
  });
23782
- return transaction.add({
23774
+ return new TransactionInstruction({
23783
23775
  keys: [{
23784
23776
  pubkey: stakePubkey,
23785
23777
  isSigner: false,
@@ -23797,6 +23789,52 @@ var solanaWeb3 = (function (exports) {
23797
23789
  data
23798
23790
  });
23799
23791
  }
23792
+ /**
23793
+ * Generate a Transaction that splits Stake tokens into another stake account
23794
+ */
23795
+
23796
+
23797
+ static split(params) {
23798
+ const transaction = new Transaction();
23799
+ transaction.add(SystemProgram.createAccount({
23800
+ fromPubkey: params.authorizedPubkey,
23801
+ newAccountPubkey: params.splitStakePubkey,
23802
+ lamports: 0,
23803
+ space: this.space,
23804
+ programId: this.programId
23805
+ }));
23806
+ return transaction.add(this.splitInstruction(params));
23807
+ }
23808
+ /**
23809
+ * Generate a Transaction that splits Stake tokens into another account
23810
+ * derived from a base public key and seed
23811
+ */
23812
+
23813
+
23814
+ static splitWithSeed(params) {
23815
+ const {
23816
+ stakePubkey,
23817
+ authorizedPubkey,
23818
+ splitStakePubkey,
23819
+ basePubkey,
23820
+ seed,
23821
+ lamports
23822
+ } = params;
23823
+ const transaction = new Transaction();
23824
+ transaction.add(SystemProgram.allocate({
23825
+ accountPubkey: splitStakePubkey,
23826
+ basePubkey,
23827
+ seed,
23828
+ space: this.space,
23829
+ programId: this.programId
23830
+ }));
23831
+ return transaction.add(this.splitInstruction({
23832
+ stakePubkey,
23833
+ authorizedPubkey,
23834
+ splitStakePubkey,
23835
+ lamports
23836
+ }));
23837
+ }
23800
23838
  /**
23801
23839
  * Generate a Transaction that merges Stake accounts.
23802
23840
  */