@solana/web3.js 1.37.1 → 1.39.0
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/README.md +4 -3
- package/lib/index.browser.cjs.js +15 -4
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +15 -4
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +18 -7
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.esm.js +15 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +15 -4
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +2 -7
- package/src/connection.ts +19 -2
- package/module.flow.js +0 -4412
package/lib/index.browser.esm.js
CHANGED
|
@@ -4557,7 +4557,7 @@ exports.Response = ctx.Response;
|
|
|
4557
4557
|
module.exports = exports;
|
|
4558
4558
|
}(browserPonyfill, browserPonyfill.exports));
|
|
4559
4559
|
|
|
4560
|
-
var
|
|
4560
|
+
var crossFetch = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill.exports);
|
|
4561
4561
|
|
|
4562
4562
|
const MINIMUM_SLOT_PER_EPOCH = 32; // Returns the number of trailing zeros in the binary representation of self.
|
|
4563
4563
|
|
|
@@ -4894,7 +4894,8 @@ const BlockProductionResponseStruct = jsonRpcResultAndContext(type({
|
|
|
4894
4894
|
* A performance sample
|
|
4895
4895
|
*/
|
|
4896
4896
|
|
|
4897
|
-
function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit) {
|
|
4897
|
+
function createRpcClient(url, useHttps, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
|
|
4898
|
+
const fetch = customFetch ? customFetch : crossFetch;
|
|
4898
4899
|
|
|
4899
4900
|
let fetchWithMiddleware;
|
|
4900
4901
|
|
|
@@ -5696,6 +5697,7 @@ class Connection {
|
|
|
5696
5697
|
const useHttps = url.protocol === 'https:';
|
|
5697
5698
|
let wsEndpoint;
|
|
5698
5699
|
let httpHeaders;
|
|
5700
|
+
let fetch;
|
|
5699
5701
|
let fetchMiddleware;
|
|
5700
5702
|
let disableRetryOnRateLimit;
|
|
5701
5703
|
|
|
@@ -5706,13 +5708,14 @@ class Connection {
|
|
|
5706
5708
|
this._confirmTransactionInitialTimeout = commitmentOrConfig.confirmTransactionInitialTimeout;
|
|
5707
5709
|
wsEndpoint = commitmentOrConfig.wsEndpoint;
|
|
5708
5710
|
httpHeaders = commitmentOrConfig.httpHeaders;
|
|
5711
|
+
fetch = commitmentOrConfig.fetch;
|
|
5709
5712
|
fetchMiddleware = commitmentOrConfig.fetchMiddleware;
|
|
5710
5713
|
disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
|
|
5711
5714
|
}
|
|
5712
5715
|
|
|
5713
5716
|
this._rpcEndpoint = endpoint;
|
|
5714
5717
|
this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
|
|
5715
|
-
this._rpcClient = createRpcClient(url.toString(), useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit);
|
|
5718
|
+
this._rpcClient = createRpcClient(url.toString(), useHttps, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
|
|
5716
5719
|
this._rpcRequest = createRpcRequest(this._rpcClient);
|
|
5717
5720
|
this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
|
|
5718
5721
|
this._rpcWebSocket = new Client(this._rpcWsEndpoint, {
|
|
@@ -7218,7 +7221,14 @@ class Connection {
|
|
|
7218
7221
|
let transaction;
|
|
7219
7222
|
|
|
7220
7223
|
if (transactionOrMessage instanceof Transaction) {
|
|
7221
|
-
|
|
7224
|
+
let originalTx = transactionOrMessage;
|
|
7225
|
+
transaction = new Transaction({
|
|
7226
|
+
recentBlockhash: originalTx.recentBlockhash,
|
|
7227
|
+
nonceInfo: originalTx.nonceInfo,
|
|
7228
|
+
feePayer: originalTx.feePayer,
|
|
7229
|
+
signatures: [...originalTx.signatures]
|
|
7230
|
+
});
|
|
7231
|
+
transaction.instructions = transactionOrMessage.instructions;
|
|
7222
7232
|
} else {
|
|
7223
7233
|
transaction = Transaction.populate(transactionOrMessage);
|
|
7224
7234
|
}
|
|
@@ -7491,6 +7501,7 @@ class Connection {
|
|
|
7491
7501
|
|
|
7492
7502
|
_resetSubscriptions() {
|
|
7493
7503
|
Object.values(this._accountChangeSubscriptions).forEach(s => s.subscriptionId = null);
|
|
7504
|
+
Object.values(this._logsSubscriptions).forEach(s => s.subscriptionId = null);
|
|
7494
7505
|
Object.values(this._programAccountChangeSubscriptions).forEach(s => s.subscriptionId = null);
|
|
7495
7506
|
Object.values(this._rootSubscriptions).forEach(s => s.subscriptionId = null);
|
|
7496
7507
|
Object.values(this._signatureSubscriptions).forEach(s => s.subscriptionId = null);
|