@solana/web3.js 1.91.5 → 1.91.7

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.
@@ -3290,80 +3290,86 @@ class BpfLoader {
3290
3290
  }
3291
3291
  }
3292
3292
 
3293
- // src/index.ts
3293
+ function getDefaultExportFromCjs (x) {
3294
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3295
+ }
3296
+
3294
3297
  var objToString = Object.prototype.toString;
3295
- var objKeys = Object.keys || function (obj) {
3296
- const keys = [];
3297
- for (const name in obj) {
3298
- keys.push(name);
3299
- }
3300
- return keys;
3301
- };
3298
+ var objKeys = Object.keys || function(obj) {
3299
+ var keys = [];
3300
+ for (var name in obj) {
3301
+ keys.push(name);
3302
+ }
3303
+ return keys;
3304
+ };
3305
+
3302
3306
  function stringify(val, isArrayProp) {
3303
- let i, max, str, keys, key, propVal, toStr;
3304
- if (val === true) {
3305
- return "true";
3306
- }
3307
- if (val === false) {
3308
- return "false";
3309
- }
3310
- switch (typeof val) {
3311
- case "object":
3312
- if (val === null) {
3313
- return null;
3314
- } else if ("toJSON" in val && typeof val.toJSON === "function") {
3315
- return stringify(val.toJSON(), isArrayProp);
3316
- } else {
3317
- toStr = objToString.call(val);
3318
- if (toStr === "[object Array]") {
3319
- str = "[";
3320
- max = val.length - 1;
3321
- for (i = 0; i < max; i++) {
3322
- str += stringify(val[i], true) + ",";
3323
- }
3324
- if (max > -1) {
3325
- str += stringify(val[i], true);
3326
- }
3327
- return str + "]";
3328
- } else if (toStr === "[object Object]") {
3329
- keys = objKeys(val).sort();
3330
- max = keys.length;
3331
- str = "";
3332
- i = 0;
3333
- while (i < max) {
3334
- key = keys[i];
3335
- propVal = stringify(val[key], false);
3336
- if (propVal !== void 0) {
3337
- if (str) {
3338
- str += ",";
3339
- }
3340
- str += JSON.stringify(key) + ":" + propVal;
3341
- }
3342
- i++;
3343
- }
3344
- return "{" + str + "}";
3345
- } else {
3346
- return JSON.stringify(val);
3347
- }
3348
- }
3349
- case "function":
3350
- case "undefined":
3351
- return isArrayProp ? null : void 0;
3352
- case "bigint":
3353
- return JSON.stringify(val.toString() + "n");
3354
- case "string":
3355
- return JSON.stringify(val);
3356
- default:
3357
- return isFinite(val) ? val : null;
3358
- }
3359
- }
3360
- function src_default(val) {
3361
- const returnVal = stringify(val, false);
3362
- if (returnVal !== void 0) {
3363
- return "" + returnVal;
3364
- }
3307
+ var i, max, str, keys, key, propVal, toStr;
3308
+ if (val === true) {
3309
+ return "true";
3310
+ }
3311
+ if (val === false) {
3312
+ return "false";
3313
+ }
3314
+ switch (typeof val) {
3315
+ case "object":
3316
+ if (val === null) {
3317
+ return null;
3318
+ } else if (val.toJSON && typeof val.toJSON === "function") {
3319
+ return stringify(val.toJSON(), isArrayProp);
3320
+ } else {
3321
+ toStr = objToString.call(val);
3322
+ if (toStr === "[object Array]") {
3323
+ str = '[';
3324
+ max = val.length - 1;
3325
+ for(i = 0; i < max; i++) {
3326
+ str += stringify(val[i], true) + ',';
3327
+ }
3328
+ if (max > -1) {
3329
+ str += stringify(val[i], true);
3330
+ }
3331
+ return str + ']';
3332
+ } else if (toStr === "[object Object]") {
3333
+ // only object is left
3334
+ keys = objKeys(val).sort();
3335
+ max = keys.length;
3336
+ str = "";
3337
+ i = 0;
3338
+ while (i < max) {
3339
+ key = keys[i];
3340
+ propVal = stringify(val[key], false);
3341
+ if (propVal !== undefined) {
3342
+ if (str) {
3343
+ str += ',';
3344
+ }
3345
+ str += JSON.stringify(key) + ':' + propVal;
3346
+ }
3347
+ i++;
3348
+ }
3349
+ return '{' + str + '}';
3350
+ } else {
3351
+ return JSON.stringify(val);
3352
+ }
3353
+ }
3354
+ case "function":
3355
+ case "undefined":
3356
+ return isArrayProp ? null : undefined;
3357
+ case "string":
3358
+ return JSON.stringify(val);
3359
+ default:
3360
+ return isFinite(val) ? val : null;
3361
+ }
3365
3362
  }
3366
3363
 
3364
+ var fastStableStringify = function(val) {
3365
+ var returnVal = stringify(val, false);
3366
+ if (returnVal !== undefined) {
3367
+ return ''+ returnVal;
3368
+ }
3369
+ };
3370
+
3371
+ var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
3372
+
3367
3373
  const MINIMUM_SLOT_PER_EPOCH = 32;
3368
3374
 
3369
3375
  // Returns the number of trailing zeros in the binary representation of self.
@@ -5233,7 +5239,7 @@ class Connection {
5233
5239
  config
5234
5240
  } = extractCommitmentFromConfig(commitmentOrConfig);
5235
5241
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5236
- const requestHash = src_default(args);
5242
+ const requestHash = fastStableStringify$1(args);
5237
5243
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5238
5244
  try {
5239
5245
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7669,7 +7675,7 @@ class Connection {
7669
7675
  */
7670
7676
  args) {
7671
7677
  const clientSubscriptionId = this._nextClientSubscriptionId++;
7672
- const hash = src_default([subscriptionConfig.method, args]);
7678
+ const hash = fastStableStringify$1([subscriptionConfig.method, args]);
7673
7679
  const existingSubscription = this._subscriptionsByHash[hash];
7674
7680
  if (existingSubscription === undefined) {
7675
7681
  this._subscriptionsByHash[hash] = {