@solana/web3.js 1.95.3 → 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.
@@ -3368,81 +3368,90 @@ function getDefaultExportFromCjs (x) {
3368
3368
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3369
3369
  }
3370
3370
 
3371
- var objToString = Object.prototype.toString;
3372
- var objKeys = Object.keys || function(obj) {
3373
- var keys = [];
3374
- for (var name in obj) {
3375
- keys.push(name);
3376
- }
3377
- return keys;
3378
- };
3371
+ var fastStableStringify$1;
3372
+ var hasRequiredFastStableStringify;
3373
+
3374
+ function requireFastStableStringify () {
3375
+ if (hasRequiredFastStableStringify) return fastStableStringify$1;
3376
+ hasRequiredFastStableStringify = 1;
3377
+ var objToString = Object.prototype.toString;
3378
+ var objKeys = Object.keys || function(obj) {
3379
+ var keys = [];
3380
+ for (var name in obj) {
3381
+ keys.push(name);
3382
+ }
3383
+ return keys;
3384
+ };
3379
3385
 
3380
- function stringify(val, isArrayProp) {
3381
- var i, max, str, keys, key, propVal, toStr;
3382
- if (val === true) {
3383
- return "true";
3384
- }
3385
- if (val === false) {
3386
- return "false";
3387
- }
3388
- switch (typeof val) {
3389
- case "object":
3390
- if (val === null) {
3391
- return null;
3392
- } else if (val.toJSON && typeof val.toJSON === "function") {
3393
- return stringify(val.toJSON(), isArrayProp);
3394
- } else {
3395
- toStr = objToString.call(val);
3396
- if (toStr === "[object Array]") {
3397
- str = '[';
3398
- max = val.length - 1;
3399
- for(i = 0; i < max; i++) {
3400
- str += stringify(val[i], true) + ',';
3401
- }
3402
- if (max > -1) {
3403
- str += stringify(val[i], true);
3404
- }
3405
- return str + ']';
3406
- } else if (toStr === "[object Object]") {
3407
- // only object is left
3408
- keys = objKeys(val).sort();
3409
- max = keys.length;
3410
- str = "";
3411
- i = 0;
3412
- while (i < max) {
3413
- key = keys[i];
3414
- propVal = stringify(val[key], false);
3415
- if (propVal !== undefined) {
3416
- if (str) {
3417
- str += ',';
3386
+ function stringify(val, isArrayProp) {
3387
+ var i, max, str, keys, key, propVal, toStr;
3388
+ if (val === true) {
3389
+ return "true";
3390
+ }
3391
+ if (val === false) {
3392
+ return "false";
3393
+ }
3394
+ switch (typeof val) {
3395
+ case "object":
3396
+ if (val === null) {
3397
+ return null;
3398
+ } else if (val.toJSON && typeof val.toJSON === "function") {
3399
+ return stringify(val.toJSON(), isArrayProp);
3400
+ } else {
3401
+ toStr = objToString.call(val);
3402
+ if (toStr === "[object Array]") {
3403
+ str = '[';
3404
+ max = val.length - 1;
3405
+ for(i = 0; i < max; i++) {
3406
+ str += stringify(val[i], true) + ',';
3407
+ }
3408
+ if (max > -1) {
3409
+ str += stringify(val[i], true);
3410
+ }
3411
+ return str + ']';
3412
+ } else if (toStr === "[object Object]") {
3413
+ // only object is left
3414
+ keys = objKeys(val).sort();
3415
+ max = keys.length;
3416
+ str = "";
3417
+ i = 0;
3418
+ while (i < max) {
3419
+ key = keys[i];
3420
+ propVal = stringify(val[key], false);
3421
+ if (propVal !== undefined) {
3422
+ if (str) {
3423
+ str += ',';
3424
+ }
3425
+ str += JSON.stringify(key) + ':' + propVal;
3418
3426
  }
3419
- str += JSON.stringify(key) + ':' + propVal;
3427
+ i++;
3420
3428
  }
3421
- i++;
3429
+ return '{' + str + '}';
3430
+ } else {
3431
+ return JSON.stringify(val);
3422
3432
  }
3423
- return '{' + str + '}';
3424
- } else {
3425
- return JSON.stringify(val);
3426
3433
  }
3427
- }
3428
- case "function":
3429
- case "undefined":
3430
- return isArrayProp ? null : undefined;
3431
- case "string":
3432
- return JSON.stringify(val);
3433
- default:
3434
- return isFinite(val) ? val : null;
3434
+ case "function":
3435
+ case "undefined":
3436
+ return isArrayProp ? null : undefined;
3437
+ case "string":
3438
+ return JSON.stringify(val);
3439
+ default:
3440
+ return isFinite(val) ? val : null;
3441
+ }
3435
3442
  }
3436
- }
3437
3443
 
3438
- var fastStableStringify = function(val) {
3439
- var returnVal = stringify(val, false);
3440
- if (returnVal !== undefined) {
3441
- return ''+ returnVal;
3442
- }
3443
- };
3444
+ fastStableStringify$1 = function(val) {
3445
+ var returnVal = stringify(val, false);
3446
+ if (returnVal !== undefined) {
3447
+ return ''+ returnVal;
3448
+ }
3449
+ };
3450
+ return fastStableStringify$1;
3451
+ }
3444
3452
 
3445
- var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
3453
+ var fastStableStringifyExports = /*@__PURE__*/ requireFastStableStringify();
3454
+ var fastStableStringify = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringifyExports);
3446
3455
 
3447
3456
  const MINIMUM_SLOT_PER_EPOCH = 32;
3448
3457
 
@@ -5297,7 +5306,7 @@ class Connection {
5297
5306
  config
5298
5307
  } = extractCommitmentFromConfig(commitmentOrConfig);
5299
5308
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5300
- const requestHash = fastStableStringify$1(args);
5309
+ const requestHash = fastStableStringify(args);
5301
5310
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5302
5311
  try {
5303
5312
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7616,9 +7625,10 @@ class Connection {
7616
7625
  this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks;
7617
7626
  await this._updateSubscriptions();
7618
7627
  } catch (e) {
7619
- if (e instanceof Error) {
7620
- console.error(`${method} error for argument`, args, e.message);
7621
- }
7628
+ console.error(`Received ${e instanceof Error ? '' : 'JSON-RPC '}error calling \`${method}\``, {
7629
+ args,
7630
+ error: e
7631
+ });
7622
7632
  if (!isCurrentConnectionStillActive()) {
7623
7633
  return;
7624
7634
  }
@@ -7754,7 +7764,7 @@ class Connection {
7754
7764
  */
7755
7765
  args) {
7756
7766
  const clientSubscriptionId = this._nextClientSubscriptionId++;
7757
- const hash = fastStableStringify$1([subscriptionConfig.method, args]);
7767
+ const hash = fastStableStringify([subscriptionConfig.method, args]);
7758
7768
  const existingSubscription = this._subscriptionsByHash[hash];
7759
7769
  if (existingSubscription === undefined) {
7760
7770
  this._subscriptionsByHash[hash] = {