@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/README.md +1 -1
- package/lib/index.browser.cjs.js +21 -5
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +21 -5
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +21 -5
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +9 -4
- package/lib/index.esm.js +21 -5
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +431 -84
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +8 -7
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +21 -5
- package/lib/index.native.js.map +1 -1
- package/package.json +5 -62
- package/src/bpf-loader.ts +5 -0
- package/src/programs/stake.ts +22 -5
package/lib/index.d.ts
CHANGED
|
@@ -844,8 +844,8 @@ export class StakeProgram {
|
|
|
844
844
|
* Max space of a Stake account
|
|
845
845
|
*
|
|
846
846
|
* This is generated from the solana-stake-program StakeState struct as
|
|
847
|
-
* `
|
|
848
|
-
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.
|
|
847
|
+
* `StakeStateV2::size_of()`:
|
|
848
|
+
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
|
|
849
849
|
*/
|
|
850
850
|
static space: number;
|
|
851
851
|
/**
|
|
@@ -880,12 +880,12 @@ export class StakeProgram {
|
|
|
880
880
|
/**
|
|
881
881
|
* Generate a Transaction that splits Stake tokens into another stake account
|
|
882
882
|
*/
|
|
883
|
-
static split(params: SplitStakeParams): Transaction;
|
|
883
|
+
static split(params: SplitStakeParams, rentExemptReserve: number): Transaction;
|
|
884
884
|
/**
|
|
885
885
|
* Generate a Transaction that splits Stake tokens into another account
|
|
886
886
|
* derived from a base public key and seed
|
|
887
887
|
*/
|
|
888
|
-
static splitWithSeed(params: SplitStakeWithSeedParams): Transaction;
|
|
888
|
+
static splitWithSeed(params: SplitStakeWithSeedParams, rentExemptReserve?: number): Transaction;
|
|
889
889
|
/**
|
|
890
890
|
* Generate a Transaction that merges Stake accounts.
|
|
891
891
|
*/
|
|
@@ -3710,9 +3710,14 @@ export class Connection {
|
|
|
3710
3710
|
removeRootChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
3711
3711
|
}
|
|
3712
3712
|
|
|
3713
|
+
/**
|
|
3714
|
+
* @deprecated Deprecated since Solana v1.17.20.
|
|
3715
|
+
*/
|
|
3713
3716
|
export const BPF_LOADER_PROGRAM_ID: PublicKey;
|
|
3714
3717
|
/**
|
|
3715
3718
|
* Factory class for transactions to interact with a program loader
|
|
3719
|
+
*
|
|
3720
|
+
* @deprecated Deprecated since Solana v1.17.20.
|
|
3716
3721
|
*/
|
|
3717
3722
|
export class BpfLoader {
|
|
3718
3723
|
/**
|
package/lib/index.esm.js
CHANGED
|
@@ -3210,10 +3210,15 @@ class Loader {
|
|
|
3210
3210
|
}
|
|
3211
3211
|
Loader.chunkSize = CHUNK_SIZE;
|
|
3212
3212
|
|
|
3213
|
+
/**
|
|
3214
|
+
* @deprecated Deprecated since Solana v1.17.20.
|
|
3215
|
+
*/
|
|
3213
3216
|
const BPF_LOADER_PROGRAM_ID = new PublicKey('BPFLoader2111111111111111111111111111111111');
|
|
3214
3217
|
|
|
3215
3218
|
/**
|
|
3216
3219
|
* Factory class for transactions to interact with a program loader
|
|
3220
|
+
*
|
|
3221
|
+
* @deprecated Deprecated since Solana v1.17.20.
|
|
3217
3222
|
*/
|
|
3218
3223
|
class BpfLoader {
|
|
3219
3224
|
/**
|
|
@@ -10096,12 +10101,14 @@ class StakeProgram {
|
|
|
10096
10101
|
/**
|
|
10097
10102
|
* Generate a Transaction that splits Stake tokens into another stake account
|
|
10098
10103
|
*/
|
|
10099
|
-
static split(params
|
|
10104
|
+
static split(params,
|
|
10105
|
+
// Compute the cost of allocating the new stake account in lamports
|
|
10106
|
+
rentExemptReserve) {
|
|
10100
10107
|
const transaction = new Transaction();
|
|
10101
10108
|
transaction.add(SystemProgram.createAccount({
|
|
10102
10109
|
fromPubkey: params.authorizedPubkey,
|
|
10103
10110
|
newAccountPubkey: params.splitStakePubkey,
|
|
10104
|
-
lamports:
|
|
10111
|
+
lamports: rentExemptReserve,
|
|
10105
10112
|
space: this.space,
|
|
10106
10113
|
programId: this.programId
|
|
10107
10114
|
}));
|
|
@@ -10112,7 +10119,9 @@ class StakeProgram {
|
|
|
10112
10119
|
* Generate a Transaction that splits Stake tokens into another account
|
|
10113
10120
|
* derived from a base public key and seed
|
|
10114
10121
|
*/
|
|
10115
|
-
static splitWithSeed(params
|
|
10122
|
+
static splitWithSeed(params,
|
|
10123
|
+
// If this stake account is new, compute the cost of allocating it in lamports
|
|
10124
|
+
rentExemptReserve) {
|
|
10116
10125
|
const {
|
|
10117
10126
|
stakePubkey,
|
|
10118
10127
|
authorizedPubkey,
|
|
@@ -10129,6 +10138,13 @@ class StakeProgram {
|
|
|
10129
10138
|
space: this.space,
|
|
10130
10139
|
programId: this.programId
|
|
10131
10140
|
}));
|
|
10141
|
+
if (rentExemptReserve && rentExemptReserve > 0) {
|
|
10142
|
+
transaction.add(SystemProgram.transfer({
|
|
10143
|
+
fromPubkey: params.authorizedPubkey,
|
|
10144
|
+
toPubkey: splitStakePubkey,
|
|
10145
|
+
lamports: rentExemptReserve
|
|
10146
|
+
}));
|
|
10147
|
+
}
|
|
10132
10148
|
return transaction.add(this.splitInstruction({
|
|
10133
10149
|
stakePubkey,
|
|
10134
10150
|
authorizedPubkey,
|
|
@@ -10259,8 +10275,8 @@ StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111
|
|
|
10259
10275
|
* Max space of a Stake account
|
|
10260
10276
|
*
|
|
10261
10277
|
* This is generated from the solana-stake-program StakeState struct as
|
|
10262
|
-
* `
|
|
10263
|
-
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.
|
|
10278
|
+
* `StakeStateV2::size_of()`:
|
|
10279
|
+
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
|
|
10264
10280
|
*/
|
|
10265
10281
|
StakeProgram.space = 200;
|
|
10266
10282
|
|