@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.cjs.js
CHANGED
|
@@ -2593,7 +2593,7 @@ const SimulatedTransactionResponseStruct = jsonRpcResultAndContext(superstruct.t
|
|
|
2593
2593
|
logs: superstruct.nullable(superstruct.array(superstruct.string()))
|
|
2594
2594
|
}));
|
|
2595
2595
|
|
|
2596
|
-
function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware) {
|
|
2596
|
+
function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit) {
|
|
2597
2597
|
let agentManager;
|
|
2598
2598
|
|
|
2599
2599
|
{
|
|
@@ -2645,6 +2645,10 @@ function createRpcClient(url, useHttps, httpHeaders, fetchMiddleware) {
|
|
|
2645
2645
|
break;
|
|
2646
2646
|
}
|
|
2647
2647
|
|
|
2648
|
+
if (disableRetryOnRateLimit === true) {
|
|
2649
|
+
break;
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2648
2652
|
too_many_requests_retries -= 1;
|
|
2649
2653
|
|
|
2650
2654
|
if (too_many_requests_retries === 0) {
|
|
@@ -3378,6 +3382,7 @@ class Connection {
|
|
|
3378
3382
|
let wsEndpoint;
|
|
3379
3383
|
let httpHeaders;
|
|
3380
3384
|
let fetchMiddleware;
|
|
3385
|
+
let disableRetryOnRateLimit;
|
|
3381
3386
|
|
|
3382
3387
|
if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
|
|
3383
3388
|
this._commitment = commitmentOrConfig;
|
|
@@ -3386,11 +3391,12 @@ class Connection {
|
|
|
3386
3391
|
wsEndpoint = commitmentOrConfig.wsEndpoint;
|
|
3387
3392
|
httpHeaders = commitmentOrConfig.httpHeaders;
|
|
3388
3393
|
fetchMiddleware = commitmentOrConfig.fetchMiddleware;
|
|
3394
|
+
disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
|
|
3389
3395
|
}
|
|
3390
3396
|
|
|
3391
3397
|
this._rpcEndpoint = endpoint;
|
|
3392
3398
|
this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
|
|
3393
|
-
this._rpcClient = createRpcClient(url$1.href, useHttps, httpHeaders, fetchMiddleware);
|
|
3399
|
+
this._rpcClient = createRpcClient(url$1.href, useHttps, httpHeaders, fetchMiddleware, disableRetryOnRateLimit);
|
|
3394
3400
|
this._rpcRequest = createRpcRequest(this._rpcClient);
|
|
3395
3401
|
this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
|
|
3396
3402
|
this._rpcWebSocket = new rpcWebsockets.Client(this._rpcWsEndpoint, {
|