@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.
@@ -3262,80 +3262,86 @@ class BpfLoader {
3262
3262
  }
3263
3263
  }
3264
3264
 
3265
- // src/index.ts
3265
+ function getDefaultExportFromCjs (x) {
3266
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3267
+ }
3268
+
3266
3269
  var objToString = Object.prototype.toString;
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
- };
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
+
3274
3278
  function stringify(val, isArrayProp) {
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
- }
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
+ }
3337
3334
  }
3338
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
+
3339
3345
  const MINIMUM_SLOT_PER_EPOCH = 32;
3340
3346
 
3341
3347
  // Returns the number of trailing zeros in the binary representation of self.
@@ -5205,7 +5211,7 @@ class Connection {
5205
5211
  config
5206
5212
  } = extractCommitmentFromConfig(commitmentOrConfig);
5207
5213
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5208
- const requestHash = src_default(args);
5214
+ const requestHash = fastStableStringify$1(args);
5209
5215
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5210
5216
  try {
5211
5217
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7641,7 +7647,7 @@ class Connection {
7641
7647
  */
7642
7648
  args) {
7643
7649
  const clientSubscriptionId = this._nextClientSubscriptionId++;
7644
- const hash = src_default([subscriptionConfig.method, args]);
7650
+ const hash = fastStableStringify$1([subscriptionConfig.method, args]);
7645
7651
  const existingSubscription = this._subscriptionsByHash[hash];
7646
7652
  if (existingSubscription === undefined) {
7647
7653
  this._subscriptionsByHash[hash] = {