@solana/web3.js 1.69.0 → 1.70.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 +0 -13
- package/lib/index.browser.cjs.js +10 -2
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +10 -2
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +29 -7
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.esm.js +28 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +10 -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/lib/index.native.js +10 -2
- package/lib/index.native.js.map +1 -1
- package/package.json +2 -2
- package/src/connection.ts +50 -3
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,9 +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
3896
|
|
|
3897
|
+
{
|
|
3898
|
+
if (httpAgent != null) {
|
|
3899
|
+
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.');
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3897
3903
|
let fetchWithMiddleware;
|
|
3898
3904
|
|
|
3899
3905
|
if (fetchMiddleware) {
|
|
@@ -4800,6 +4806,7 @@ class Connection {
|
|
|
4800
4806
|
let fetch;
|
|
4801
4807
|
let fetchMiddleware;
|
|
4802
4808
|
let disableRetryOnRateLimit;
|
|
4809
|
+
let httpAgent;
|
|
4803
4810
|
|
|
4804
4811
|
if (commitmentOrConfig && typeof commitmentOrConfig === 'string') {
|
|
4805
4812
|
this._commitment = commitmentOrConfig;
|
|
@@ -4811,11 +4818,12 @@ class Connection {
|
|
|
4811
4818
|
fetch = commitmentOrConfig.fetch;
|
|
4812
4819
|
fetchMiddleware = commitmentOrConfig.fetchMiddleware;
|
|
4813
4820
|
disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
|
|
4821
|
+
httpAgent = commitmentOrConfig.httpAgent;
|
|
4814
4822
|
}
|
|
4815
4823
|
|
|
4816
4824
|
this._rpcEndpoint = assertEndpointUrl(endpoint);
|
|
4817
4825
|
this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);
|
|
4818
|
-
this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit);
|
|
4826
|
+
this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);
|
|
4819
4827
|
this._rpcRequest = createRpcRequest(this._rpcClient);
|
|
4820
4828
|
this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);
|
|
4821
4829
|
this._rpcWebSocket = new rpcWebsockets.Client(this._rpcWsEndpoint, {
|