@solana/web3.js 1.91.4 → 1.91.5

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.
@@ -3262,85 +3262,79 @@ class BpfLoader {
3262
3262
  }
3263
3263
  }
3264
3264
 
3265
- function getDefaultExportFromCjs (x) {
3266
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3267
- }
3268
-
3265
+ // src/index.ts
3269
3266
  var objToString = Object.prototype.toString;
3270
- var objKeys = Object.keys || function(obj) {
3271
- var keys = [];
3272
- for (var name in obj) {
3273
- keys.push(name);
3274
- }
3275
- return keys;
3276
- };
3277
-
3267
+ var objKeys = Object.keys || function (obj) {
3268
+ const keys = [];
3269
+ for (const name in obj) {
3270
+ keys.push(name);
3271
+ }
3272
+ return keys;
3273
+ };
3278
3274
  function stringify(val, isArrayProp) {
3279
- var i, max, str, keys, key, propVal, toStr;
3280
- if (val === true) {
3281
- return "true";
3282
- }
3283
- if (val === false) {
3284
- return "false";
3285
- }
3286
- switch (typeof val) {
3287
- case "object":
3288
- if (val === null) {
3289
- return null;
3290
- } else if (val.toJSON && typeof val.toJSON === "function") {
3291
- return stringify(val.toJSON(), isArrayProp);
3292
- } else {
3293
- toStr = objToString.call(val);
3294
- if (toStr === "[object Array]") {
3295
- str = '[';
3296
- max = val.length - 1;
3297
- for(i = 0; i < max; i++) {
3298
- str += stringify(val[i], true) + ',';
3299
- }
3300
- if (max > -1) {
3301
- str += stringify(val[i], true);
3302
- }
3303
- return str + ']';
3304
- } else if (toStr === "[object Object]") {
3305
- // only object is left
3306
- keys = objKeys(val).sort();
3307
- max = keys.length;
3308
- str = "";
3309
- i = 0;
3310
- while (i < max) {
3311
- key = keys[i];
3312
- propVal = stringify(val[key], false);
3313
- if (propVal !== undefined) {
3314
- if (str) {
3315
- str += ',';
3316
- }
3317
- str += JSON.stringify(key) + ':' + propVal;
3318
- }
3319
- i++;
3320
- }
3321
- return '{' + str + '}';
3322
- } else {
3323
- return JSON.stringify(val);
3324
- }
3325
- }
3326
- case "function":
3327
- case "undefined":
3328
- return isArrayProp ? null : undefined;
3329
- case "string":
3330
- return JSON.stringify(val);
3331
- default:
3332
- return isFinite(val) ? val : null;
3333
- }
3275
+ let i, max, str, keys, key, propVal, toStr;
3276
+ if (val === true) {
3277
+ return "true";
3278
+ }
3279
+ if (val === false) {
3280
+ return "false";
3281
+ }
3282
+ switch (typeof val) {
3283
+ case "object":
3284
+ if (val === null) {
3285
+ return null;
3286
+ } else if ("toJSON" in val && typeof val.toJSON === "function") {
3287
+ return stringify(val.toJSON(), isArrayProp);
3288
+ } else {
3289
+ toStr = objToString.call(val);
3290
+ if (toStr === "[object Array]") {
3291
+ str = "[";
3292
+ max = val.length - 1;
3293
+ for (i = 0; i < max; i++) {
3294
+ str += stringify(val[i], true) + ",";
3295
+ }
3296
+ if (max > -1) {
3297
+ str += stringify(val[i], true);
3298
+ }
3299
+ return str + "]";
3300
+ } else if (toStr === "[object Object]") {
3301
+ keys = objKeys(val).sort();
3302
+ max = keys.length;
3303
+ str = "";
3304
+ i = 0;
3305
+ while (i < max) {
3306
+ key = keys[i];
3307
+ propVal = stringify(val[key], false);
3308
+ if (propVal !== void 0) {
3309
+ if (str) {
3310
+ str += ",";
3311
+ }
3312
+ str += JSON.stringify(key) + ":" + propVal;
3313
+ }
3314
+ i++;
3315
+ }
3316
+ return "{" + str + "}";
3317
+ } else {
3318
+ return JSON.stringify(val);
3319
+ }
3320
+ }
3321
+ case "function":
3322
+ case "undefined":
3323
+ return isArrayProp ? null : void 0;
3324
+ case "bigint":
3325
+ return JSON.stringify(val.toString() + "n");
3326
+ case "string":
3327
+ return JSON.stringify(val);
3328
+ default:
3329
+ return isFinite(val) ? val : null;
3330
+ }
3331
+ }
3332
+ function src_default(val) {
3333
+ const returnVal = stringify(val, false);
3334
+ if (returnVal !== void 0) {
3335
+ return "" + returnVal;
3336
+ }
3334
3337
  }
3335
-
3336
- var fastStableStringify = function(val) {
3337
- var returnVal = stringify(val, false);
3338
- if (returnVal !== undefined) {
3339
- return ''+ returnVal;
3340
- }
3341
- };
3342
-
3343
- var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
3344
3338
 
3345
3339
  const MINIMUM_SLOT_PER_EPOCH = 32;
3346
3340
 
@@ -5211,7 +5205,7 @@ class Connection {
5211
5205
  config
5212
5206
  } = extractCommitmentFromConfig(commitmentOrConfig);
5213
5207
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5214
- const requestHash = fastStableStringify$1(args);
5208
+ const requestHash = src_default(args);
5215
5209
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5216
5210
  try {
5217
5211
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7647,7 +7641,7 @@ class Connection {
7647
7641
  */
7648
7642
  args) {
7649
7643
  const clientSubscriptionId = this._nextClientSubscriptionId++;
7650
- const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
7644
+ const hash = src_default([subscriptionConfig.method, args]);
7651
7645
  const existingSubscription = this._subscriptionsByHash[hash];
7652
7646
  if (existingSubscription === undefined) {
7653
7647
  this._subscriptionsByHash[hash] = {