@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.
- package/lib/index.browser.cjs.js +30 -0
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +30 -0
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +30 -0
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +14 -0
- package/lib/index.esm.js +30 -0
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +30 -0
- 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 +30 -0
- 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
|
@@ -3789,6 +3789,16 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
|
|
|
3789
3789
|
amount: number(),
|
|
3790
3790
|
postBalance: number()
|
|
3791
3791
|
}))));
|
|
3792
|
+
|
|
3793
|
+
/**
|
|
3794
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
3795
|
+
*/
|
|
3796
|
+
const GetInflationRateResult = type({
|
|
3797
|
+
total: number(),
|
|
3798
|
+
validator: number(),
|
|
3799
|
+
foundation: number(),
|
|
3800
|
+
epoch: number()
|
|
3801
|
+
});
|
|
3792
3802
|
/**
|
|
3793
3803
|
* Information about the current epoch
|
|
3794
3804
|
*/
|
|
@@ -3992,6 +4002,11 @@ function createRpcBatchRequest(client) {
|
|
|
3992
4002
|
|
|
3993
4003
|
|
|
3994
4004
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
4005
|
+
/**
|
|
4006
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
4007
|
+
*/
|
|
4008
|
+
|
|
4009
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
3995
4010
|
/**
|
|
3996
4011
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
3997
4012
|
*/
|
|
@@ -5942,6 +5957,21 @@ class Connection {
|
|
|
5942
5957
|
|
|
5943
5958
|
return res.result;
|
|
5944
5959
|
}
|
|
5960
|
+
/**
|
|
5961
|
+
* Fetch the specific inflation values for the current epoch
|
|
5962
|
+
*/
|
|
5963
|
+
|
|
5964
|
+
|
|
5965
|
+
async getInflationRate() {
|
|
5966
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
5967
|
+
const res = create(unsafeRes, GetInflationRateRpcResult);
|
|
5968
|
+
|
|
5969
|
+
if ('error' in res) {
|
|
5970
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5973
|
+
return res.result;
|
|
5974
|
+
}
|
|
5945
5975
|
/**
|
|
5946
5976
|
* Fetch the Epoch Info parameters
|
|
5947
5977
|
*/
|