@solana/web3.js 1.71.1 → 1.72.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.cjs.js +31 -1
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +31 -1
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +31 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +14 -0
- package/lib/index.esm.js +31 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +31 -1
- 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 +31 -1
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +38 -0
package/lib/index.browser.esm.js
CHANGED
|
@@ -3814,6 +3814,16 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
|
|
|
3814
3814
|
amount: number(),
|
|
3815
3815
|
postBalance: number()
|
|
3816
3816
|
}))));
|
|
3817
|
+
|
|
3818
|
+
/**
|
|
3819
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
3820
|
+
*/
|
|
3821
|
+
const GetInflationRateResult = type({
|
|
3822
|
+
total: number(),
|
|
3823
|
+
validator: number(),
|
|
3824
|
+
foundation: number(),
|
|
3825
|
+
epoch: number()
|
|
3826
|
+
});
|
|
3817
3827
|
/**
|
|
3818
3828
|
* Information about the current epoch
|
|
3819
3829
|
*/
|
|
@@ -4017,6 +4027,11 @@ function createRpcBatchRequest(client) {
|
|
|
4017
4027
|
|
|
4018
4028
|
|
|
4019
4029
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
4030
|
+
/**
|
|
4031
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
4032
|
+
*/
|
|
4033
|
+
|
|
4034
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
4020
4035
|
/**
|
|
4021
4036
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
4022
4037
|
*/
|
|
@@ -4699,7 +4714,7 @@ const LogsNotificationResult = type({
|
|
|
4699
4714
|
|
|
4700
4715
|
/** @internal */
|
|
4701
4716
|
const COMMON_HTTP_HEADERS = {
|
|
4702
|
-
'solana-client': `js/${(_process$env$npm_pack = "1.
|
|
4717
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.72.1") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
4703
4718
|
};
|
|
4704
4719
|
/**
|
|
4705
4720
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -5967,6 +5982,21 @@ class Connection {
|
|
|
5967
5982
|
|
|
5968
5983
|
return res.result;
|
|
5969
5984
|
}
|
|
5985
|
+
/**
|
|
5986
|
+
* Fetch the specific inflation values for the current epoch
|
|
5987
|
+
*/
|
|
5988
|
+
|
|
5989
|
+
|
|
5990
|
+
async getInflationRate() {
|
|
5991
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
5992
|
+
const res = create(unsafeRes, GetInflationRateRpcResult);
|
|
5993
|
+
|
|
5994
|
+
if ('error' in res) {
|
|
5995
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
5996
|
+
}
|
|
5997
|
+
|
|
5998
|
+
return res.result;
|
|
5999
|
+
}
|
|
5970
6000
|
/**
|
|
5971
6001
|
* Fetch the Epoch Info parameters
|
|
5972
6002
|
*/
|