@solana/web3.js 1.71.0 → 1.72.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.
@@ -3819,6 +3819,16 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
3819
3819
  amount: superstruct.number(),
3820
3820
  postBalance: superstruct.number()
3821
3821
  }))));
3822
+
3823
+ /**
3824
+ * Expected JSON RPC response for the "getInflationRate" message
3825
+ */
3826
+ const GetInflationRateResult = superstruct.type({
3827
+ total: superstruct.number(),
3828
+ validator: superstruct.number(),
3829
+ foundation: superstruct.number(),
3830
+ epoch: superstruct.number()
3831
+ });
3822
3832
  /**
3823
3833
  * Information about the current epoch
3824
3834
  */
@@ -4022,6 +4032,11 @@ function createRpcBatchRequest(client) {
4022
4032
 
4023
4033
 
4024
4034
  const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
4035
+ /**
4036
+ * Expected JSON RPC response for the "getInflationRate" message
4037
+ */
4038
+
4039
+ const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
4025
4040
  /**
4026
4041
  * Expected JSON RPC response for the "getEpochInfo" message
4027
4042
  */
@@ -5972,6 +5987,21 @@ class Connection {
5972
5987
 
5973
5988
  return res.result;
5974
5989
  }
5990
+ /**
5991
+ * Fetch the specific inflation values for the current epoch
5992
+ */
5993
+
5994
+
5995
+ async getInflationRate() {
5996
+ const unsafeRes = await this._rpcRequest('getInflationRate', []);
5997
+ const res = superstruct.create(unsafeRes, GetInflationRateRpcResult);
5998
+
5999
+ if ('error' in res) {
6000
+ throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
6001
+ }
6002
+
6003
+ return res.result;
6004
+ }
5975
6005
  /**
5976
6006
  * Fetch the Epoch Info parameters
5977
6007
  */