@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.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:
|
|
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
|
-
* `
|
|
10295
|
-
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.
|
|
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
|
|