@solana/web3.js 1.95.2 → 1.95.4

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 CHANGED
@@ -12,7 +12,9 @@
12
12
  [semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
13
13
  [semantic-release-url]: https://github.com/semantic-release/semantic-release
14
14
 
15
- # Solana JavaScript SDK
15
+ > [!NOTE] This is the maintenance branch for the 1.x line of `@solana/web3.js`. The current development branch can be found [here](https://github.com/solana-labs/solana-web3.js).
16
+
17
+ # Solana JavaScript SDK (v1.x)
16
18
 
17
19
  Use this to interact with accounts and programs on the Solana network through the Solana [JSON RPC API](https://solana.com/docs/rpc).
18
20
 
@@ -96,19 +98,6 @@ $ cd packages/library-legacy
96
98
  $ npm run test:live-with-test-validator
97
99
  ```
98
100
 
99
- ### Speed up build times with remote caching
100
-
101
- Cache build artifacts remotely so that you, others, and the CI server can take advantage of each others' build efforts.
102
-
103
- 1. Log the Turborepo CLI into the Solana Vercel account
104
- ```shell
105
- pnpm turbo login
106
- ```
107
- 2. Link the repository to the remote cache
108
- ```shell
109
- pnpm turbo link
110
- ```
111
-
112
101
  ## Contributing
113
102
 
114
103
  If you found a bug or would like to request a feature, please [file an issue](https://github.com/solana-labs/solana-web3.js/issues/new). If, based on the discussion on an issue you would like to offer a code change, please make a [pull request](https://github.com/solana-labs/solana-web3.js/compare). If neither of these describes what you would like to contribute, read the [getting help](#getting-help) section above.
@@ -2957,7 +2957,7 @@ class SystemProgram {
2957
2957
  isSigner: false,
2958
2958
  isWritable: true
2959
2959
  }];
2960
- if (params.basePubkey != params.fromPubkey) {
2960
+ if (!params.basePubkey.equals(params.fromPubkey)) {
2961
2961
  keys.push({
2962
2962
  pubkey: params.basePubkey,
2963
2963
  isSigner: true,
@@ -3394,81 +3394,90 @@ function getDefaultExportFromCjs (x) {
3394
3394
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3395
3395
  }
3396
3396
 
3397
- var objToString = Object.prototype.toString;
3398
- var objKeys = Object.keys || function(obj) {
3399
- var keys = [];
3400
- for (var name in obj) {
3401
- keys.push(name);
3402
- }
3403
- return keys;
3404
- };
3397
+ var fastStableStringify$1;
3398
+ var hasRequiredFastStableStringify;
3399
+
3400
+ function requireFastStableStringify () {
3401
+ if (hasRequiredFastStableStringify) return fastStableStringify$1;
3402
+ hasRequiredFastStableStringify = 1;
3403
+ var objToString = Object.prototype.toString;
3404
+ var objKeys = Object.keys || function(obj) {
3405
+ var keys = [];
3406
+ for (var name in obj) {
3407
+ keys.push(name);
3408
+ }
3409
+ return keys;
3410
+ };
3405
3411
 
3406
- function stringify(val, isArrayProp) {
3407
- var i, max, str, keys, key, propVal, toStr;
3408
- if (val === true) {
3409
- return "true";
3410
- }
3411
- if (val === false) {
3412
- return "false";
3413
- }
3414
- switch (typeof val) {
3415
- case "object":
3416
- if (val === null) {
3417
- return null;
3418
- } else if (val.toJSON && typeof val.toJSON === "function") {
3419
- return stringify(val.toJSON(), isArrayProp);
3420
- } else {
3421
- toStr = objToString.call(val);
3422
- if (toStr === "[object Array]") {
3423
- str = '[';
3424
- max = val.length - 1;
3425
- for(i = 0; i < max; i++) {
3426
- str += stringify(val[i], true) + ',';
3427
- }
3428
- if (max > -1) {
3429
- str += stringify(val[i], true);
3430
- }
3431
- return str + ']';
3432
- } else if (toStr === "[object Object]") {
3433
- // only object is left
3434
- keys = objKeys(val).sort();
3435
- max = keys.length;
3436
- str = "";
3437
- i = 0;
3438
- while (i < max) {
3439
- key = keys[i];
3440
- propVal = stringify(val[key], false);
3441
- if (propVal !== undefined) {
3442
- if (str) {
3443
- str += ',';
3412
+ function stringify(val, isArrayProp) {
3413
+ var i, max, str, keys, key, propVal, toStr;
3414
+ if (val === true) {
3415
+ return "true";
3416
+ }
3417
+ if (val === false) {
3418
+ return "false";
3419
+ }
3420
+ switch (typeof val) {
3421
+ case "object":
3422
+ if (val === null) {
3423
+ return null;
3424
+ } else if (val.toJSON && typeof val.toJSON === "function") {
3425
+ return stringify(val.toJSON(), isArrayProp);
3426
+ } else {
3427
+ toStr = objToString.call(val);
3428
+ if (toStr === "[object Array]") {
3429
+ str = '[';
3430
+ max = val.length - 1;
3431
+ for(i = 0; i < max; i++) {
3432
+ str += stringify(val[i], true) + ',';
3433
+ }
3434
+ if (max > -1) {
3435
+ str += stringify(val[i], true);
3436
+ }
3437
+ return str + ']';
3438
+ } else if (toStr === "[object Object]") {
3439
+ // only object is left
3440
+ keys = objKeys(val).sort();
3441
+ max = keys.length;
3442
+ str = "";
3443
+ i = 0;
3444
+ while (i < max) {
3445
+ key = keys[i];
3446
+ propVal = stringify(val[key], false);
3447
+ if (propVal !== undefined) {
3448
+ if (str) {
3449
+ str += ',';
3450
+ }
3451
+ str += JSON.stringify(key) + ':' + propVal;
3444
3452
  }
3445
- str += JSON.stringify(key) + ':' + propVal;
3453
+ i++;
3446
3454
  }
3447
- i++;
3455
+ return '{' + str + '}';
3456
+ } else {
3457
+ return JSON.stringify(val);
3448
3458
  }
3449
- return '{' + str + '}';
3450
- } else {
3451
- return JSON.stringify(val);
3452
3459
  }
3453
- }
3454
- case "function":
3455
- case "undefined":
3456
- return isArrayProp ? null : undefined;
3457
- case "string":
3458
- return JSON.stringify(val);
3459
- default:
3460
- return isFinite(val) ? val : null;
3460
+ case "function":
3461
+ case "undefined":
3462
+ return isArrayProp ? null : undefined;
3463
+ case "string":
3464
+ return JSON.stringify(val);
3465
+ default:
3466
+ return isFinite(val) ? val : null;
3467
+ }
3461
3468
  }
3462
- }
3463
3469
 
3464
- var fastStableStringify = function(val) {
3465
- var returnVal = stringify(val, false);
3466
- if (returnVal !== undefined) {
3467
- return ''+ returnVal;
3468
- }
3469
- };
3470
+ fastStableStringify$1 = function(val) {
3471
+ var returnVal = stringify(val, false);
3472
+ if (returnVal !== undefined) {
3473
+ return ''+ returnVal;
3474
+ }
3475
+ };
3476
+ return fastStableStringify$1;
3477
+ }
3470
3478
 
3471
- var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
3479
+ var fastStableStringifyExports = /*@__PURE__*/ requireFastStableStringify();
3480
+ var fastStableStringify = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringifyExports);
3472
3481
 
3473
3482
  const MINIMUM_SLOT_PER_EPOCH = 32;
3474
3483
 
@@ -5230,7 +5239,7 @@ const LogsNotificationResult = superstruct.type({
5230
5239
 
5231
5240
  /** @internal */
5232
5241
  const COMMON_HTTP_HEADERS = {
5233
- 'solana-client': `js/${"0.0.0-development"}`
5242
+ 'solana-client': `js/${"1.0.0-maintenance"}`
5234
5243
  };
5235
5244
 
5236
5245
  /**
@@ -5323,7 +5332,7 @@ class Connection {
5323
5332
  config
5324
5333
  } = extractCommitmentFromConfig(commitmentOrConfig);
5325
5334
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5326
- const requestHash = fastStableStringify$1(args);
5335
+ const requestHash = fastStableStringify(args);
5327
5336
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5328
5337
  try {
5329
5338
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7642,9 +7651,10 @@ class Connection {
7642
7651
  this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks;
7643
7652
  await this._updateSubscriptions();
7644
7653
  } catch (e) {
7645
- if (e instanceof Error) {
7646
- console.error(`${method} error for argument`, args, e.message);
7647
- }
7654
+ console.error(`Received ${e instanceof Error ? '' : 'JSON-RPC '}error calling \`${method}\``, {
7655
+ args,
7656
+ error: e
7657
+ });
7648
7658
  if (!isCurrentConnectionStillActive()) {
7649
7659
  return;
7650
7660
  }
@@ -7780,7 +7790,7 @@ class Connection {
7780
7790
  */
7781
7791
  args) {
7782
7792
  const clientSubscriptionId = this._nextClientSubscriptionId++;
7783
- const hash = fastStableStringify$1([subscriptionConfig.method, args]);
7793
+ const hash = fastStableStringify([subscriptionConfig.method, args]);
7784
7794
  const existingSubscription = this._subscriptionsByHash[hash];
7785
7795
  if (existingSubscription === undefined) {
7786
7796
  this._subscriptionsByHash[hash] = {