@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.
- package/lib/index.browser.cjs.js +78 -72
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +78 -72
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +78 -4
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +78 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +222 -181
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +5 -5
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +78 -72
- package/lib/index.native.js.map +1 -1
- package/package.json +3 -3
- package/src/connection.ts +2 -1
package/lib/index.esm.js
CHANGED
|
@@ -7,7 +7,6 @@ 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';
|
|
11
10
|
import require$$0 from 'util';
|
|
12
11
|
import require$$0$1 from 'http';
|
|
13
12
|
import require$$0$2, { Agent as Agent$1 } from 'https';
|
|
@@ -3930,6 +3929,82 @@ agentkeepalive.exports.constants = constants;
|
|
|
3930
3929
|
var agentkeepaliveExports = agentkeepalive.exports;
|
|
3931
3930
|
var HttpKeepAliveAgent = /*@__PURE__*/getDefaultExportFromCjs(agentkeepaliveExports);
|
|
3932
3931
|
|
|
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
|
+
|
|
3933
4008
|
const MINIMUM_SLOT_PER_EPOCH = 32;
|
|
3934
4009
|
|
|
3935
4010
|
// Returns the number of trailing zeros in the binary representation of self.
|
|
@@ -5829,7 +5904,7 @@ class Connection {
|
|
|
5829
5904
|
config
|
|
5830
5905
|
} = extractCommitmentFromConfig(commitmentOrConfig);
|
|
5831
5906
|
const args = this._buildArgs([], commitment, undefined /* encoding */, config);
|
|
5832
|
-
const requestHash = fastStableStringify(args);
|
|
5907
|
+
const requestHash = fastStableStringify$1(args);
|
|
5833
5908
|
requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {
|
|
5834
5909
|
try {
|
|
5835
5910
|
const unsafeRes = await this._rpcRequest('getBlockHeight', args);
|
|
@@ -8265,7 +8340,7 @@ class Connection {
|
|
|
8265
8340
|
*/
|
|
8266
8341
|
args) {
|
|
8267
8342
|
const clientSubscriptionId = this._nextClientSubscriptionId++;
|
|
8268
|
-
const hash = fastStableStringify([subscriptionConfig.method, args]);
|
|
8343
|
+
const hash = fastStableStringify$1([subscriptionConfig.method, args]);
|
|
8269
8344
|
const existingSubscription = this._subscriptionsByHash[hash];
|
|
8270
8345
|
if (existingSubscription === undefined) {
|
|
8271
8346
|
this._subscriptionsByHash[hash] = {
|