@solana/web3.js 1.90.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.90.0",
3
+ "version": "1.90.1",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
@@ -43,7 +43,9 @@
43
43
  "build:fixtures": "set -ex; ./test/fixtures/noop-program/build.sh",
44
44
  "clean": "rimraf ./doc ./declarations ./lib",
45
45
  "dev": "cross-env NODE_ENV=development rollup -c --watch",
46
- "publish-packages": "semantic-release --repository-url git@github.com:solana-labs/solana-web3.js.git",
46
+ "prepublishOnly": "pnpm pkg delete devDependencies",
47
+ "publish-impl": "semantic-release --repository-url git@github.com:solana-labs/solana-web3.js.git",
48
+ "publish-packages": "pnpm publish-impl",
47
49
  "test:lint": "eslint src/ test/ --ext .js,.ts",
48
50
  "test:lint:fix": "eslint src/ test/ --fix --ext .js,.ts",
49
51
  "test:live": "TEST_LIVE=1 pnpm run test:unit:node",
@@ -56,7 +58,7 @@
56
58
  "dependencies": {
57
59
  "@babel/runtime": "^7.23.4",
58
60
  "@noble/curves": "^1.2.0",
59
- "@noble/hashes": "^1.3.2",
61
+ "@noble/hashes": "^1.3.3",
60
62
  "@solana/buffer-layout": "^4.0.1",
61
63
  "agentkeepalive": "^4.5.0",
62
64
  "bigint-buffer": "^1.1.5",
@@ -69,64 +71,5 @@
69
71
  "node-fetch": "^2.7.0",
70
72
  "rpc-websockets": "^7.5.1",
71
73
  "superstruct": "^0.14.2"
72
- },
73
- "devDependencies": {
74
- "@babel/core": "^7.23.7",
75
- "@babel/plugin-transform-class-properties": "^7.23.3",
76
- "@babel/plugin-transform-private-methods": "^7.23.3",
77
- "@babel/plugin-transform-private-property-in-object": "^7.23.4",
78
- "@babel/plugin-transform-runtime": "^7.23.7",
79
- "@babel/preset-env": "^7.23.3",
80
- "@babel/preset-typescript": "^7.23.3",
81
- "@rollup/plugin-alias": "^4.0.3",
82
- "@rollup/plugin-babel": "^6.0.4",
83
- "@rollup/plugin-commonjs": "^25.0.4",
84
- "@rollup/plugin-json": "^6.0.1",
85
- "@rollup/plugin-multi-entry": "^6.0.0",
86
- "@rollup/plugin-node-resolve": "^15.2.3",
87
- "@rollup/plugin-replace": "^5.0.2",
88
- "@rollup/plugin-terser": "^0.4.3",
89
- "@solana/spl-token": "^0.4.0",
90
- "@types/bn.js": "^5.1.1",
91
- "@types/bs58": "^4.0.1",
92
- "@types/chai": "^4.3.5",
93
- "@types/chai-as-promised": "^7.1.8",
94
- "@types/express-serve-static-core": "^4.17.41",
95
- "@types/mocha": "^10.0.6",
96
- "@types/mz": "^2.7.4",
97
- "@types/node": "18.11.19",
98
- "@types/node-fetch": "2",
99
- "@types/sinon": "^10.0.16",
100
- "@types/sinon-chai": "^3.2.12",
101
- "@typescript-eslint/eslint-plugin": "^6.13.2",
102
- "@typescript-eslint/parser": "^6.3.0",
103
- "chai": "^4.3.7",
104
- "chai-as-promised": "^7.1.1",
105
- "cross-env": "7.0.3",
106
- "eslint": "^8.45.0",
107
- "eslint-config-prettier": "^9.1.0",
108
- "eslint-plugin-import": "^2.29.0",
109
- "eslint-plugin-mocha": "^10.1.0",
110
- "eslint-plugin-prettier": "^5.0.1",
111
- "esm": "^3.2.25",
112
- "mocha": "^10.2.0",
113
- "mockttp": "^3.10.0",
114
- "mz": "^2.7.0",
115
- "node-abort-controller": "^3.0.1",
116
- "prettier": "^3.1",
117
- "rimraf": "5.0.5",
118
- "rollup": "^4.7.0",
119
- "rollup-plugin-dts": "^6.1.0",
120
- "rollup-plugin-node-polyfills": "^0.2.1",
121
- "semantic-release": "^21.0.7",
122
- "sinon": "^15.2.0",
123
- "sinon-chai": "^3.7.0",
124
- "start-server-and-test": "^2.0.0",
125
- "ts-mocha": "^10.0.0",
126
- "ts-node": "^10.9.1",
127
- "tsconfig": "workspace:*",
128
- "tslib": "^2.6.2",
129
- "typedoc": "^0.25.4",
130
- "typescript": "^5.1.6"
131
74
  }
132
75
  }
@@ -601,8 +601,8 @@ export class StakeProgram {
601
601
  * Max space of a Stake account
602
602
  *
603
603
  * This is generated from the solana-stake-program StakeState struct as
604
- * `StakeState::size_of()`:
605
- * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html
604
+ * `StakeStateV2::size_of()`:
605
+ * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeStateV2.html
606
606
  */
607
607
  static space: number = 200;
608
608
 
@@ -808,13 +808,17 @@ export class StakeProgram {
808
808
  /**
809
809
  * Generate a Transaction that splits Stake tokens into another stake account
810
810
  */
811
- static split(params: SplitStakeParams): Transaction {
811
+ static split(
812
+ params: SplitStakeParams,
813
+ // Compute the cost of allocating the new stake account in lamports
814
+ rentExemptReserve: number,
815
+ ): Transaction {
812
816
  const transaction = new Transaction();
813
817
  transaction.add(
814
818
  SystemProgram.createAccount({
815
819
  fromPubkey: params.authorizedPubkey,
816
820
  newAccountPubkey: params.splitStakePubkey,
817
- lamports: 0,
821
+ lamports: rentExemptReserve,
818
822
  space: this.space,
819
823
  programId: this.programId,
820
824
  }),
@@ -826,7 +830,11 @@ export class StakeProgram {
826
830
  * Generate a Transaction that splits Stake tokens into another account
827
831
  * derived from a base public key and seed
828
832
  */
829
- static splitWithSeed(params: SplitStakeWithSeedParams): Transaction {
833
+ static splitWithSeed(
834
+ params: SplitStakeWithSeedParams,
835
+ // If this stake account is new, compute the cost of allocating it in lamports
836
+ rentExemptReserve?: number,
837
+ ): Transaction {
830
838
  const {
831
839
  stakePubkey,
832
840
  authorizedPubkey,
@@ -845,6 +853,15 @@ export class StakeProgram {
845
853
  programId: this.programId,
846
854
  }),
847
855
  );
856
+ if (rentExemptReserve && rentExemptReserve > 0) {
857
+ transaction.add(
858
+ SystemProgram.transfer({
859
+ fromPubkey: params.authorizedPubkey,
860
+ toPubkey: splitStakePubkey,
861
+ lamports: rentExemptReserve,
862
+ }),
863
+ );
864
+ }
848
865
  return transaction.add(
849
866
  this.splitInstruction({
850
867
  stakePubkey,