@solana/web3.js 1.16.2 → 1.17.1
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.esm.js +8 -2
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +8 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.esm.js +8 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +8 -2
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +1 -1
- package/lib/index.iife.min.js.map +1 -1
- package/module.flow.js +5 -0
- package/package.json +2 -2
- package/src/connection.ts +9 -0
package/lib/index.browser.esm.js
CHANGED
|
@@ -4497,7 +4497,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({
|
|
|
4497
4497
|
logs: nullable(array(string()))
|
|
4498
4498
|
}));
|
|
4499
4499
|
|
|
4500
|
-
function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware) {
|
|
4500
|
+
function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit) {
|
|
4501
4501
|
|
|
4502
4502
|
let fetchWithMiddleware;
|
|
4503
4503
|
|
|
@@ -4544,6 +4544,10 @@ function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware) {
|
|
|
4544
4544
|
break;
|
|
4545
4545
|
}
|
|
4546
4546
|
|
|
4547
|
+
if (disableRetryOnRateLimit === true) {
|
|
4548
|
+
break;
|
|
4549
|
+
}
|
|
4550
|
+
|
|
4547
4551
|
too_many_requests_retries -= 1;
|
|
4548
4552
|
|
|
4549
4553
|
if (too_many_requests_retries === 0) {
|
|
@@ -5276,6 +5280,7 @@ class Connection {
|
|
|
5276
5280
|
let wsEndpoint;
|
|
5277
5281
|
let httpHeaders;
|
|
5278
5282
|
let fetchMiddleware;
|
|
5283
|
+
let disableRetryOnRateLimit;
|
|
5279
5284
|
|
|
5280
5285
|
if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
|
|
5281
5286
|
this._commitment = commitmentOrConfig;
|
|
@@ -5284,11 +5289,12 @@ class Connection {
|
|
|
5284
5289
|
wsEndpoint = commitmentOrConfig.wsEndpoint;
|
|
5285
5290
|
httpHeaders = commitmentOrConfig.httpHeaders;
|
|
5286
5291
|
fetchMiddleware = commitmentOrConfig.fetchMiddleware;
|
|
5292
|
+
disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
|
|
5287
5293
|
}
|
|
5288
5294
|
|
|
5289
5295
|
this._rpcEndpoint = endpoint;
|
|
5290
5296
|
this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
|
|
5291
|
-
this._rpcClient = createRpcClient(url.href, useHttps, httpHeaders, fetchMiddleware);
|
|
5297
|
+
this._rpcClient = createRpcClient(url.href, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit);
|
|
5292
5298
|
this._rpcRequest = createRpcRequest(this._rpcClient);
|
|
5293
5299
|
this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
|
|
5294
5300
|
this._rpcWebSocket = new Client(this._rpcWsEndpoint, {
|