@solana/web3.js 1.43.1 → 1.43.2
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 +21 -586
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +21 -586
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +70 -56
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +14 -5
- package/lib/index.esm.js +69 -55
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +18226 -17895
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +4 -4
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +6 -5
- package/src/__forks__/browser/fetch-impl.ts +4 -0
- package/src/connection.ts +17 -14
- package/src/fetch-impl.ts +13 -0
package/lib/index.cjs.js
CHANGED
|
@@ -9,12 +9,12 @@ var bs58 = require('bs58');
|
|
|
9
9
|
var borsh = require('borsh');
|
|
10
10
|
var BufferLayout = require('@solana/buffer-layout');
|
|
11
11
|
var bigintBuffer = require('bigint-buffer');
|
|
12
|
-
var crossFetch = require('cross-fetch');
|
|
13
12
|
var superstruct = require('superstruct');
|
|
14
13
|
var rpcWebsockets = require('rpc-websockets');
|
|
15
14
|
var RpcClient = require('jayson/lib/client/browser');
|
|
16
15
|
var http = require('http');
|
|
17
16
|
var https = require('https');
|
|
17
|
+
var nodeFetch = require('node-fetch');
|
|
18
18
|
var secp256k1 = require('secp256k1');
|
|
19
19
|
var sha3 = require('js-sha3');
|
|
20
20
|
|
|
@@ -42,10 +42,10 @@ var nacl__default = /*#__PURE__*/_interopDefaultLegacy(nacl);
|
|
|
42
42
|
var BN__default = /*#__PURE__*/_interopDefaultLegacy(BN);
|
|
43
43
|
var bs58__default = /*#__PURE__*/_interopDefaultLegacy(bs58);
|
|
44
44
|
var BufferLayout__namespace = /*#__PURE__*/_interopNamespace(BufferLayout);
|
|
45
|
-
var crossFetch__default = /*#__PURE__*/_interopDefaultLegacy(crossFetch);
|
|
46
45
|
var RpcClient__default = /*#__PURE__*/_interopDefaultLegacy(RpcClient);
|
|
47
46
|
var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
|
48
47
|
var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
|
|
48
|
+
var nodeFetch__namespace = /*#__PURE__*/_interopNamespace(nodeFetch);
|
|
49
49
|
var secp256k1__default = /*#__PURE__*/_interopDefaultLegacy(secp256k1);
|
|
50
50
|
var sha3__default = /*#__PURE__*/_interopDefaultLegacy(sha3);
|
|
51
51
|
|
|
@@ -79,43 +79,52 @@ var inherits$1 = {exports: {}};
|
|
|
79
79
|
|
|
80
80
|
var inherits_browser = {exports: {}};
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
82
|
+
var hasRequiredInherits_browser;
|
|
83
|
+
|
|
84
|
+
function requireInherits_browser () {
|
|
85
|
+
if (hasRequiredInherits_browser) return inherits_browser.exports;
|
|
86
|
+
hasRequiredInherits_browser = 1;
|
|
87
|
+
if (typeof Object.create === 'function') {
|
|
88
|
+
// implementation from standard node.js 'util' module
|
|
89
|
+
inherits_browser.exports = function inherits(ctor, superCtor) {
|
|
90
|
+
if (superCtor) {
|
|
91
|
+
ctor.super_ = superCtor;
|
|
92
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
93
|
+
constructor: {
|
|
94
|
+
value: ctor,
|
|
95
|
+
enumerable: false,
|
|
96
|
+
writable: true,
|
|
97
|
+
configurable: true
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
} else {
|
|
103
|
+
// old school shim for old browsers
|
|
104
|
+
inherits_browser.exports = function inherits(ctor, superCtor) {
|
|
105
|
+
if (superCtor) {
|
|
106
|
+
ctor.super_ = superCtor;
|
|
107
|
+
var TempCtor = function () {};
|
|
108
|
+
TempCtor.prototype = superCtor.prototype;
|
|
109
|
+
ctor.prototype = new TempCtor();
|
|
110
|
+
ctor.prototype.constructor = ctor;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return inherits_browser.exports;
|
|
108
115
|
}
|
|
109
116
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
(function (module) {
|
|
118
|
+
try {
|
|
119
|
+
var util = require('util');
|
|
120
|
+
/* istanbul ignore next */
|
|
121
|
+
if (typeof util.inherits !== 'function') throw '';
|
|
122
|
+
module.exports = util.inherits;
|
|
123
|
+
} catch (e) {
|
|
124
|
+
/* istanbul ignore next */
|
|
125
|
+
module.exports = requireInherits_browser();
|
|
126
|
+
}
|
|
127
|
+
} (inherits$1));
|
|
119
128
|
|
|
120
129
|
var assert$5 = minimalisticAssert;
|
|
121
130
|
var inherits = inherits$1.exports;
|
|
@@ -1307,22 +1316,22 @@ Hmac.prototype.digest = function digest(enc) {
|
|
|
1307
1316
|
};
|
|
1308
1317
|
|
|
1309
1318
|
(function (exports) {
|
|
1310
|
-
var hash = exports;
|
|
1311
|
-
|
|
1312
|
-
hash.utils = utils$9;
|
|
1313
|
-
hash.common = common$5;
|
|
1314
|
-
hash.sha = sha;
|
|
1315
|
-
hash.ripemd = ripemd;
|
|
1316
|
-
hash.hmac = hmac;
|
|
1317
|
-
|
|
1318
|
-
// Proxy hash functions to the main object
|
|
1319
|
-
hash.sha1 = hash.sha.sha1;
|
|
1320
|
-
hash.sha256 = hash.sha.sha256;
|
|
1321
|
-
hash.sha224 = hash.sha.sha224;
|
|
1322
|
-
hash.sha384 = hash.sha.sha384;
|
|
1323
|
-
hash.sha512 = hash.sha.sha512;
|
|
1324
|
-
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
1325
|
-
}(hash$1));
|
|
1319
|
+
var hash = exports;
|
|
1320
|
+
|
|
1321
|
+
hash.utils = utils$9;
|
|
1322
|
+
hash.common = common$5;
|
|
1323
|
+
hash.sha = sha;
|
|
1324
|
+
hash.ripemd = ripemd;
|
|
1325
|
+
hash.hmac = hmac;
|
|
1326
|
+
|
|
1327
|
+
// Proxy hash functions to the main object
|
|
1328
|
+
hash.sha1 = hash.sha.sha1;
|
|
1329
|
+
hash.sha256 = hash.sha.sha256;
|
|
1330
|
+
hash.sha224 = hash.sha.sha224;
|
|
1331
|
+
hash.sha384 = hash.sha.sha384;
|
|
1332
|
+
hash.sha512 = hash.sha.sha512;
|
|
1333
|
+
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
1334
|
+
} (hash$1));
|
|
1326
1335
|
|
|
1327
1336
|
var hash = hash$1;
|
|
1328
1337
|
|
|
@@ -4584,6 +4593,11 @@ class SendTransactionError extends Error {
|
|
|
4584
4593
|
|
|
4585
4594
|
}
|
|
4586
4595
|
|
|
4596
|
+
async function fetchImpl (input, init) {
|
|
4597
|
+
const processedInput = typeof input === 'string' && input.slice(0, 2) === '//' ? 'https:' + input : input;
|
|
4598
|
+
return await nodeFetch__namespace.default(processedInput, init);
|
|
4599
|
+
}
|
|
4600
|
+
|
|
4587
4601
|
// TODO: These constants should be removed in favor of reading them out of a
|
|
4588
4602
|
// Syscall account
|
|
4589
4603
|
|
|
@@ -4833,7 +4847,7 @@ const BlockProductionResponseStruct = jsonRpcResultAndContext(superstruct.type({
|
|
|
4833
4847
|
*/
|
|
4834
4848
|
|
|
4835
4849
|
function createRpcClient(url, useHttps, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
|
|
4836
|
-
const fetch = customFetch ? customFetch :
|
|
4850
|
+
const fetch = customFetch ? customFetch : fetchImpl;
|
|
4837
4851
|
let agentManager;
|
|
4838
4852
|
|
|
4839
4853
|
{
|
|
@@ -4843,10 +4857,10 @@ function createRpcClient(url, useHttps, httpHeaders, customFetch, fetchMiddlewar
|
|
|
4843
4857
|
let fetchWithMiddleware;
|
|
4844
4858
|
|
|
4845
4859
|
if (fetchMiddleware) {
|
|
4846
|
-
fetchWithMiddleware = async (
|
|
4860
|
+
fetchWithMiddleware = async (info, init) => {
|
|
4847
4861
|
const modifiedFetchArgs = await new Promise((resolve, reject) => {
|
|
4848
4862
|
try {
|
|
4849
|
-
fetchMiddleware(
|
|
4863
|
+
fetchMiddleware(info, init, (modifiedInfo, modifiedInit) => resolve([modifiedInfo, modifiedInit]));
|
|
4850
4864
|
} catch (error) {
|
|
4851
4865
|
reject(error);
|
|
4852
4866
|
}
|