@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.
package/lib/index.esm.js CHANGED
@@ -7,6 +7,7 @@ import { serialize, deserialize, deserializeUnchecked } from 'borsh';
7
7
  import * as BufferLayout from '@solana/buffer-layout';
8
8
  import { blob } from '@solana/buffer-layout';
9
9
  import { toBigIntLE, toBufferLE } from 'bigint-buffer';
10
+ import fastStableStringify from '@solana/fast-stable-stringify';
10
11
  import require$$0 from 'util';
11
12
  import require$$0$1 from 'http';
12
13
  import require$$0$2, { Agent as Agent$1 } from 'https';
@@ -3929,82 +3930,6 @@ agentkeepalive.exports.constants = constants;
3929
3930
  var agentkeepaliveExports = agentkeepalive.exports;
3930
3931
  var HttpKeepAliveAgent = /*@__PURE__*/getDefaultExportFromCjs(agentkeepaliveExports);
3931
3932
 
3932
- var objToString = Object.prototype.toString;
3933
- var objKeys = Object.keys || function(obj) {
3934
- var keys = [];
3935
- for (var name in obj) {
3936
- keys.push(name);
3937
- }
3938
- return keys;
3939
- };
3940
-
3941
- function stringify(val, isArrayProp) {
3942
- var i, max, str, keys, key, propVal, toStr;
3943
- if (val === true) {
3944
- return "true";
3945
- }
3946
- if (val === false) {
3947
- return "false";
3948
- }
3949
- switch (typeof val) {
3950
- case "object":
3951
- if (val === null) {
3952
- return null;
3953
- } else if (val.toJSON && typeof val.toJSON === "function") {
3954
- return stringify(val.toJSON(), isArrayProp);
3955
- } else {
3956
- toStr = objToString.call(val);
3957
- if (toStr === "[object Array]") {
3958
- str = '[';
3959
- max = val.length - 1;
3960
- for(i = 0; i < max; i++) {
3961
- str += stringify(val[i], true) + ',';
3962
- }
3963
- if (max > -1) {
3964
- str += stringify(val[i], true);
3965
- }
3966
- return str + ']';
3967
- } else if (toStr === "[object Object]") {
3968
- // only object is left
3969
- keys = objKeys(val).sort();
3970
- max = keys.length;
3971
- str = "";
3972
- i = 0;
3973
- while (i < max) {
3974
- key = keys[i];
3975
- propVal = stringify(val[key], false);
3976
- if (propVal !== undefined) {
3977
- if (str) {
3978
- str += ',';
3979
- }
3980
- str += JSON.stringify(key) + ':' + propVal;
3981
- }
3982
- i++;
3983
- }
3984
- return '{' + str + '}';
3985
- } else {
3986
- return JSON.stringify(val);
3987
- }
3988
- }
3989
- case "function":
3990
- case "undefined":
3991
- return isArrayProp ? null : undefined;
3992
- case "string":
3993
- return JSON.stringify(val);
3994
- default:
3995
- return isFinite(val) ? val : null;
3996
- }
3997
- }
3998
-
3999
- var fastStableStringify = function(val) {
4000
- var returnVal = stringify(val, false);
4001
- if (returnVal !== undefined) {
4002
- return ''+ returnVal;
4003
- }
4004
- };
4005
-
4006
- var fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);
4007
-
4008
3933
  const MINIMUM_SLOT_PER_EPOCH = 32;
4009
3934
 
4010
3935
  // Returns the number of trailing zeros in the binary representation of self.
@@ -5904,7 +5829,7 @@ class Connection {
5904
5829
  config
5905
5830
  } = extractCommitmentFromConfig(commitmentOrConfig);
5906
5831
  const args = this._buildArgs([], commitment, undefined /* encoding */, config);
5907
- const requestHash = fastStableStringify$1(args);
5832
+ const requestHash = fastStableStringify(args);
5908
5833
  requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
5909
5834
  try {
5910
5835
  const unsafeRes = await this._rpcRequest('getBlockHeight', args);
@@ -7995,7 +7920,8 @@ class Connection {
7995
7920
  encoding: 'base64'
7996
7921
  };
7997
7922
  const skipPreflight = options && options.skipPreflight;
7998
- const preflightCommitment = options && options.preflightCommitment || this.commitment;
7923
+ const preflightCommitment = skipPreflight === true ? 'processed' // FIXME Remove when https://github.com/anza-xyz/agave/pull/483 is deployed.
7924
+ : options && options.preflightCommitment || this.commitment;
7999
7925
  if (options && options.maxRetries != null) {
8000
7926
  config.maxRetries = options.maxRetries;
8001
7927
  }
@@ -8339,7 +8265,7 @@ class Connection {
8339
8265
  */
8340
8266
  args) {
8341
8267
  const clientSubscriptionId = this._nextClientSubscriptionId++;
8342
- const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);
8268
+ const hash = fastStableStringify([subscriptionConfig.method, args]);
8343
8269
  const existingSubscription = this._subscriptionsByHash[hash];
8344
8270
  if (existingSubscription === undefined) {
8345
8271
  this._subscriptionsByHash[hash] = {