@solana/web3.js 1.71.0 → 1.73.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 +34 -2
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +34 -2
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +34 -2
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +23 -0
- package/lib/index.esm.js +34 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +34 -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 +34 -2
- package/lib/index.native.js.map +1 -1
- package/package.json +5 -5
- package/src/connection.ts +49 -0
package/lib/index.browser.esm.js
CHANGED
|
@@ -3787,8 +3787,19 @@ const GetInflationRewardResult = jsonRpcResult(array(nullable(type({
|
|
|
3787
3787
|
epoch: number(),
|
|
3788
3788
|
effectiveSlot: number(),
|
|
3789
3789
|
amount: number(),
|
|
3790
|
-
postBalance: number()
|
|
3790
|
+
postBalance: number(),
|
|
3791
|
+
commission: optional(nullable(number()))
|
|
3791
3792
|
}))));
|
|
3793
|
+
|
|
3794
|
+
/**
|
|
3795
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
3796
|
+
*/
|
|
3797
|
+
const GetInflationRateResult = type({
|
|
3798
|
+
total: number(),
|
|
3799
|
+
validator: number(),
|
|
3800
|
+
foundation: number(),
|
|
3801
|
+
epoch: number()
|
|
3802
|
+
});
|
|
3792
3803
|
/**
|
|
3793
3804
|
* Information about the current epoch
|
|
3794
3805
|
*/
|
|
@@ -3992,6 +4003,11 @@ function createRpcBatchRequest(client) {
|
|
|
3992
4003
|
|
|
3993
4004
|
|
|
3994
4005
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
4006
|
+
/**
|
|
4007
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
4008
|
+
*/
|
|
4009
|
+
|
|
4010
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
3995
4011
|
/**
|
|
3996
4012
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
3997
4013
|
*/
|
|
@@ -4451,7 +4467,8 @@ const RewardsResult = type({
|
|
|
4451
4467
|
pubkey: string(),
|
|
4452
4468
|
lamports: number(),
|
|
4453
4469
|
postBalance: nullable(number()),
|
|
4454
|
-
rewardType: nullable(string())
|
|
4470
|
+
rewardType: nullable(string()),
|
|
4471
|
+
commission: optional(nullable(number()))
|
|
4455
4472
|
});
|
|
4456
4473
|
/**
|
|
4457
4474
|
* Expected JSON RPC response for the "getBlock" message
|
|
@@ -5942,6 +5959,21 @@ class Connection {
|
|
|
5942
5959
|
|
|
5943
5960
|
return res.result;
|
|
5944
5961
|
}
|
|
5962
|
+
/**
|
|
5963
|
+
* Fetch the specific inflation values for the current epoch
|
|
5964
|
+
*/
|
|
5965
|
+
|
|
5966
|
+
|
|
5967
|
+
async getInflationRate() {
|
|
5968
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
5969
|
+
const res = create(unsafeRes, GetInflationRateRpcResult);
|
|
5970
|
+
|
|
5971
|
+
if ('error' in res) {
|
|
5972
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
5973
|
+
}
|
|
5974
|
+
|
|
5975
|
+
return res.result;
|
|
5976
|
+
}
|
|
5945
5977
|
/**
|
|
5946
5978
|
* Fetch the Epoch Info parameters
|
|
5947
5979
|
*/
|