@solana/web3.js 1.69.0 → 1.70.0-pr-29130
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 +0 -13
- package/lib/index.browser.cjs.js +11 -4
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +11 -4
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +2632 -62
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.esm.js +2625 -60
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +11 -4
- 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/lib/index.native.js +11 -4
- package/lib/index.native.js.map +1 -1
- package/package.json +3 -2
- package/src/connection.ts +53 -7
- package/src/agent-manager.ts +0 -44
package/README.md
CHANGED
|
@@ -102,19 +102,6 @@ This library requires a JavaScript runtime that supports [`BigInt`](https://deve
|
|
|
102
102
|
- React Native:
|
|
103
103
|
- \>=0.7.0 using the [Hermes](https://reactnative.dev/blog/2022/07/08/hermes-as-the-default) engine ([integration guide](https://solanacookbook.com/integrations/react-native.html#how-to-use-solana-web3-js-in-a-react-native-app)):
|
|
104
104
|
|
|
105
|
-
## Flow Support (Discontinued)
|
|
106
|
-
|
|
107
|
-
Flow types are no longer supported in new releases. The last release with Flow support is v1.37.2 and its
|
|
108
|
-
[Flow library definition](https://flow.org/en/docs/libdefs/) is provided at
|
|
109
|
-
https://unpkg.com/@solana/web3.js@v1.37.2/module.flow.js.
|
|
110
|
-
Download the file and add the following line under the [libs] section of your project's `.flowconfig` to
|
|
111
|
-
activate it:
|
|
112
|
-
|
|
113
|
-
```ini
|
|
114
|
-
[libs]
|
|
115
|
-
node_modules/@solana/web3.js/module.flow.js
|
|
116
|
-
```
|
|
117
|
-
|
|
118
105
|
## Releases
|
|
119
106
|
|
|
120
107
|
Releases are available on [Github](https://github.com/solana-labs/solana-web3.js/releases)
|
package/lib/index.browser.cjs.js
CHANGED
|
@@ -3891,8 +3891,15 @@ const BlockProductionResponseStruct = jsonRpcResultAndContext(superstruct.type({
|
|
|
3891
3891
|
* A performance sample
|
|
3892
3892
|
*/
|
|
3893
3893
|
|
|
3894
|
-
function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit) {
|
|
3894
|
+
function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) {
|
|
3895
3895
|
const fetch = customFetch ? customFetch : fetchImpl;
|
|
3896
|
+
let agent;
|
|
3897
|
+
|
|
3898
|
+
{
|
|
3899
|
+
if (httpAgent != null) {
|
|
3900
|
+
console.warn('You have supplied an `httpAgent` when creating a `Connection` in a browser environment.' + 'It has been ignored; `httpAgent` is only used in Node environments.');
|
|
3901
|
+
}
|
|
3902
|
+
}
|
|
3896
3903
|
|
|
3897
3904
|
let fetchWithMiddleware;
|
|
3898
3905
|
|
|
@@ -3910,7 +3917,6 @@ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disable
|
|
|
3910
3917
|
}
|
|
3911
3918
|
|
|
3912
3919
|
const clientBrowser = new RpcClient__default["default"](async (request, callback) => {
|
|
3913
|
-
const agent = undefined;
|
|
3914
3920
|
const options = {
|
|
3915
3921
|
method: 'POST',
|
|
3916
3922
|
body: request,
|
|
@@ -3962,7 +3968,6 @@ function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disable
|
|
|
3962
3968
|
}
|
|
3963
3969
|
} catch (err) {
|
|
3964
3970
|
if (err instanceof Error) callback(err);
|
|
3965
|
-
} finally {
|
|
3966
3971
|
}
|
|
3967
3972
|
}, {});
|
|
3968
3973
|
return clientBrowser;
|
|
@@ -4800,6 +4805,7 @@ class Connection {
|
|
|
4800
4805
|
let fetch;
|
|
4801
4806
|
let fetchMiddleware;
|
|
4802
4807
|
let disableRetryOnRateLimit;
|
|
4808
|
+
let httpAgent;
|
|
4803
4809
|
|
|
4804
4810
|
if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
|
|
4805
4811
|
this._commitment = commitmentOrConfig;
|
|
@@ -4811,11 +4817,12 @@ class Connection {
|
|
|
4811
4817
|
fetch = commitmentOrConfig.fetch;
|
|
4812
4818
|
fetchMiddleware = commitmentOrConfig.fetchMiddleware;
|
|
4813
4819
|
disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
|
|
4820
|
+
httpAgent = commitmentOrConfig.httpAgent;
|
|
4814
4821
|
}
|
|
4815
4822
|
|
|
4816
4823
|
this._rpcEndpoint = assertEndpointUrl(endpoint);
|
|
4817
4824
|
this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
|
|
4818
|
-
this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
|
|
4825
|
+
this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);
|
|
4819
4826
|
this._rpcRequest = createRpcRequest(this._rpcClient);
|
|
4820
4827
|
this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
|
|
4821
4828
|
this._rpcWebSocket = new rpcWebsockets.Client(this._rpcWsEndpoint, {
|