@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/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
# Solana JavaScript SDK
|
|
16
16
|
|
|
17
|
-
Use this to interact with accounts and programs on the Solana network through the Solana [JSON RPC API](https://
|
|
17
|
+
Use this to interact with accounts and programs on the Solana network through the Solana [JSON RPC API](https://solana.com/docs/rpc).
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
package/lib/index.browser.cjs.js
CHANGED
|
@@ -3234,10 +3234,15 @@ class Loader {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
Loader.chunkSize = CHUNK_SIZE;
|
|
3236
3236
|
|
|
3237
|
+
/**
|
|
3238
|
+
* @deprecated Deprecated since Solana v1.17.20.
|
|
3239
|
+
*/
|
|
3237
3240
|
const BPF_LOADER_PROGRAM_ID = new PublicKey('BPFLoader2111111111111111111111111111111111');
|
|
3238
3241
|
|
|
3239
3242
|
/**
|
|
3240
3243
|
* Factory class for transactions to interact with a program loader
|
|
3244
|
+
*
|
|
3245
|
+
* @deprecated Deprecated since Solana v1.17.20.
|
|
3241
3246
|
*/
|
|
3242
3247
|
class BpfLoader {
|
|
3243
3248
|
/**
|
|
@@ -9431,12 +9436,14 @@ class StakeProgram {
|
|
|
9431
9436
|
/**
|
|
9432
9437
|
* Generate a Transaction that splits Stake tokens into another stake account
|
|
9433
9438
|
*/
|
|
9434
|
-
static split(params
|
|
9439
|
+
static split(params,
|
|
9440
|
+
// Compute the cost of allocating the new stake account in lamports
|
|
9441
|
+
rentExemptReserve) {
|
|
9435
9442
|
const transaction = new Transaction();
|
|
9436
9443
|
transaction.add(SystemProgram.createAccount({
|
|
9437
9444
|
fromPubkey: params.authorizedPubkey,
|
|
9438
9445
|
newAccountPubkey: params.splitStakePubkey,
|
|
9439
|
-
lamports:
|
|
9446
|
+
lamports: rentExemptReserve,
|
|
9440
9447
|
space: this.space,
|
|
9441
9448
|
programId: this.programId
|
|
9442
9449
|
}));
|
|
@@ -9447,7 +9454,9 @@ class StakeProgram {
|
|
|
9447
9454
|
* Generate a Transaction that splits Stake tokens into another account
|
|
9448
9455
|
* derived from a base public key and seed
|
|
9449
9456
|
*/
|
|
9450
|
-
static splitWithSeed(params
|
|
9457
|
+
static splitWithSeed(params,
|
|
9458
|
+
// If this stake account is new, compute the cost of allocating it in lamports
|
|
9459
|
+
rentExemptReserve) {
|
|
9451
9460
|
const {
|
|
9452
9461
|
stakePubkey,
|
|
9453
9462
|
authorizedPubkey,
|
|
@@ -9464,6 +9473,13 @@ class StakeProgram {
|
|
|
9464
9473
|
space: this.space,
|
|
9465
9474
|
programId: this.programId
|
|
9466
9475
|
}));
|
|
9476
|
+
if (rentExemptReserve && rentExemptReserve > 0) {
|
|
9477
|
+
transaction.add(SystemProgram.transfer({
|
|
9478
|
+
fromPubkey: params.authorizedPubkey,
|
|
9479
|
+
toPubkey: splitStakePubkey,
|
|
9480
|
+
lamports: rentExemptReserve
|
|
9481
|
+
}));
|
|
9482
|
+
}
|
|
9467
9483
|
return transaction.add(this.splitInstruction({
|
|
9468
9484
|
stakePubkey,
|
|
9469
9485
|
authorizedPubkey,
|
|
@@ -9594,8 +9610,8 @@ StakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111
|
|
|
9594
9610
|
* Max space of a Stake account
|
|
9595
9611
|
*
|
|
9596
9612
|
* This is generated from the solana-stake-program StakeState struct as
|
|
9597
|
-
* `
|
|
9598
|
-
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.
|
|
9613
|
+
* `StakeStateV2::size_of()`:
|
|
9614
|
+
* https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
|
|
9599
9615
|
*/
|
|
9600
9616
|
StakeProgram.space = 200;
|
|
9601
9617
|
|