@solana/web3.js 1.91.3 → 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.
@@ -3290,85 +3290,79 @@ class BpfLoader {
3290
3290
  }
3291
3291
  }
3292
3292
 
3293
- function getDefaultExportFromCjs (x) {
3294
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3295
- }
3296
-
3293
+ // src/index.ts
3297
3294
  var objToString = Object.prototype.toString;
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
-
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
+ };
3306
3302
  function stringify(val, isArrayProp) {
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
- }
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
+ }
3362
3365
  }
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
3366
 
3373
3367
  const MINIMUM_SLOT_PER_EPOCH = 32;
3374
3368
 
@@ -5239,7 +5233,7 @@ class Connection {
5239
5233
  config
5240
5234
  } = extractCommitmentFromConfig(commitmentOrConfig);
5241
5235
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5242
- const requestHash = fastStableStringify$1(args);
5236
+ const requestHash = src_default(args);
5243
5237
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5244
5238
  try {
5245
5239
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7330,7 +7324,8 @@ class Connection {
7330
7324
  encoding: 'base64'
7331
7325
  };
7332
7326
  const skipPreflight = options && options.skipPreflight;
7333
- const preflightCommitment = options && options.preflightCommitment || this.commitment;
7327
+ const preflightCommitment = skipPreflight === true ? 'processed' // FIXME Remove when https://github.com/anza-xyz/agave/pull/483 is deployed.
7328
+ : options && options.preflightCommitment || this.commitment;
7334
7329
  if (options && options.maxRetries != null) {
7335
7330
  config.maxRetries = options.maxRetries;
7336
7331
  }
@@ -7674,7 +7669,7 @@ class Connection {
7674
7669
  */
7675
7670
  args) {
7676
7671
  const clientSubscriptionId = this._nextClientSubscriptionId++;
7677
- const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
7672
+ const hash = src_default([subscriptionConfig.method, args]);
7678
7673
  const existingSubscription = this._subscriptionsByHash[hash];
7679
7674
  if (existingSubscription === undefined) {
7680
7675
  this._subscriptionsByHash[hash] = {