@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.
package/lib/index.iife.js CHANGED
@@ -14714,81 +14714,79 @@ var solanaWeb3 = (function (exports) {
14714
14714
  }
14715
14715
  }
14716
14716
 
14717
+ // src/index.ts
14717
14718
  var objToString = Object.prototype.toString;
14718
- var objKeys = Object.keys || function(obj) {
14719
- var keys = [];
14720
- for (var name in obj) {
14721
- keys.push(name);
14722
- }
14723
- return keys;
14724
- };
14725
-
14719
+ var objKeys = Object.keys || function (obj) {
14720
+ const keys = [];
14721
+ for (const name in obj) {
14722
+ keys.push(name);
14723
+ }
14724
+ return keys;
14725
+ };
14726
14726
  function stringify$1(val, isArrayProp) {
14727
- var i, max, str, keys, key, propVal, toStr;
14728
- if (val === true) {
14729
- return "true";
14730
- }
14731
- if (val === false) {
14732
- return "false";
14733
- }
14734
- switch (typeof val) {
14735
- case "object":
14736
- if (val === null) {
14737
- return null;
14738
- } else if (val.toJSON && typeof val.toJSON === "function") {
14739
- return stringify$1(val.toJSON(), isArrayProp);
14740
- } else {
14741
- toStr = objToString.call(val);
14742
- if (toStr === "[object Array]") {
14743
- str = '[';
14744
- max = val.length - 1;
14745
- for(i = 0; i < max; i++) {
14746
- str += stringify$1(val[i], true) + ',';
14747
- }
14748
- if (max > -1) {
14749
- str += stringify$1(val[i], true);
14750
- }
14751
- return str + ']';
14752
- } else if (toStr === "[object Object]") {
14753
- // only object is left
14754
- keys = objKeys(val).sort();
14755
- max = keys.length;
14756
- str = "";
14757
- i = 0;
14758
- while (i < max) {
14759
- key = keys[i];
14760
- propVal = stringify$1(val[key], false);
14761
- if (propVal !== undefined) {
14762
- if (str) {
14763
- str += ',';
14764
- }
14765
- str += JSON.stringify(key) + ':' + propVal;
14766
- }
14767
- i++;
14768
- }
14769
- return '{' + str + '}';
14770
- } else {
14771
- return JSON.stringify(val);
14772
- }
14773
- }
14774
- case "function":
14775
- case "undefined":
14776
- return isArrayProp ? null : undefined;
14777
- case "string":
14778
- return JSON.stringify(val);
14779
- default:
14780
- return isFinite(val) ? val : null;
14781
- }
14727
+ let i, max, str, keys, key, propVal, toStr;
14728
+ if (val === true) {
14729
+ return "true";
14730
+ }
14731
+ if (val === false) {
14732
+ return "false";
14733
+ }
14734
+ switch (typeof val) {
14735
+ case "object":
14736
+ if (val === null) {
14737
+ return null;
14738
+ } else if ("toJSON" in val && typeof val.toJSON === "function") {
14739
+ return stringify$1(val.toJSON(), isArrayProp);
14740
+ } else {
14741
+ toStr = objToString.call(val);
14742
+ if (toStr === "[object Array]") {
14743
+ str = "[";
14744
+ max = val.length - 1;
14745
+ for (i = 0; i < max; i++) {
14746
+ str += stringify$1(val[i], true) + ",";
14747
+ }
14748
+ if (max > -1) {
14749
+ str += stringify$1(val[i], true);
14750
+ }
14751
+ return str + "]";
14752
+ } else if (toStr === "[object Object]") {
14753
+ keys = objKeys(val).sort();
14754
+ max = keys.length;
14755
+ str = "";
14756
+ i = 0;
14757
+ while (i < max) {
14758
+ key = keys[i];
14759
+ propVal = stringify$1(val[key], false);
14760
+ if (propVal !== void 0) {
14761
+ if (str) {
14762
+ str += ",";
14763
+ }
14764
+ str += JSON.stringify(key) + ":" + propVal;
14765
+ }
14766
+ i++;
14767
+ }
14768
+ return "{" + str + "}";
14769
+ } else {
14770
+ return JSON.stringify(val);
14771
+ }
14772
+ }
14773
+ case "function":
14774
+ case "undefined":
14775
+ return isArrayProp ? null : void 0;
14776
+ case "bigint":
14777
+ return JSON.stringify(val.toString() + "n");
14778
+ case "string":
14779
+ return JSON.stringify(val);
14780
+ default:
14781
+ return isFinite(val) ? val : null;
14782
+ }
14783
+ }
14784
+ function src_default(val) {
14785
+ const returnVal = stringify$1(val, false);
14786
+ if (returnVal !== void 0) {
14787
+ return "" + returnVal;
14788
+ }
14782
14789
  }
14783
-
14784
- var fastStableStringify = function(val) {
14785
- var returnVal = stringify$1(val, false);
14786
- if (returnVal !== undefined) {
14787
- return ''+ returnVal;
14788
- }
14789
- };
14790
-
14791
- var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
14792
14790
 
14793
14791
  /**
14794
14792
  * A `StructFailure` represents a single specific failure in validation.
@@ -19680,7 +19678,7 @@ var solanaWeb3 = (function (exports) {
19680
19678
  config
19681
19679
  } = extractCommitmentFromConfig(commitmentOrConfig);
19682
19680
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
19683
- const requestHash = fastStableStringify$1(args);
19681
+ const requestHash = src_default(args);
19684
19682
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
19685
19683
  try {
19686
19684
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -22116,7 +22114,7 @@ var solanaWeb3 = (function (exports) {
22116
22114
  */
22117
22115
  args) {
22118
22116
  const clientSubscriptionId = this._nextClientSubscriptionId++;
22119
- const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
22117
+ const hash = src_default([subscriptionConfig.method, args]);
22120
22118
  const existingSubscription = this._subscriptionsByHash[hash];
22121
22119
  if (existingSubscription === undefined) {
22122
22120
  this._subscriptionsByHash[hash] = {