@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.cjs.js
CHANGED
|
@@ -3817,8 +3817,19 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
|
|
|
3817
3817
|
epoch: superstruct.number(),
|
|
3818
3818
|
effectiveSlot: superstruct.number(),
|
|
3819
3819
|
amount: superstruct.number(),
|
|
3820
|
-
postBalance: superstruct.number()
|
|
3820
|
+
postBalance: superstruct.number(),
|
|
3821
|
+
commission: superstruct.optional(superstruct.nullable(superstruct.number()))
|
|
3821
3822
|
}))));
|
|
3823
|
+
|
|
3824
|
+
/**
|
|
3825
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
3826
|
+
*/
|
|
3827
|
+
const GetInflationRateResult = superstruct.type({
|
|
3828
|
+
total: superstruct.number(),
|
|
3829
|
+
validator: superstruct.number(),
|
|
3830
|
+
foundation: superstruct.number(),
|
|
3831
|
+
epoch: superstruct.number()
|
|
3832
|
+
});
|
|
3822
3833
|
/**
|
|
3823
3834
|
* Information about the current epoch
|
|
3824
3835
|
*/
|
|
@@ -4022,6 +4033,11 @@ function createRpcBatchRequest(client) {
|
|
|
4022
4033
|
|
|
4023
4034
|
|
|
4024
4035
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
4036
|
+
/**
|
|
4037
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
4038
|
+
*/
|
|
4039
|
+
|
|
4040
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
4025
4041
|
/**
|
|
4026
4042
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
4027
4043
|
*/
|
|
@@ -4481,7 +4497,8 @@ const RewardsResult = superstruct.type({
|
|
|
4481
4497
|
pubkey: superstruct.string(),
|
|
4482
4498
|
lamports: superstruct.number(),
|
|
4483
4499
|
postBalance: superstruct.nullable(superstruct.number()),
|
|
4484
|
-
rewardType: superstruct.nullable(superstruct.string())
|
|
4500
|
+
rewardType: superstruct.nullable(superstruct.string()),
|
|
4501
|
+
commission: superstruct.optional(superstruct.nullable(superstruct.number()))
|
|
4485
4502
|
});
|
|
4486
4503
|
/**
|
|
4487
4504
|
* Expected JSON RPC response for the "getBlock" message
|
|
@@ -5972,6 +5989,21 @@ class Connection {
|
|
|
5972
5989
|
|
|
5973
5990
|
return res.result;
|
|
5974
5991
|
}
|
|
5992
|
+
/**
|
|
5993
|
+
* Fetch the specific inflation values for the current epoch
|
|
5994
|
+
*/
|
|
5995
|
+
|
|
5996
|
+
|
|
5997
|
+
async getInflationRate() {
|
|
5998
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
5999
|
+
const res = superstruct.create(unsafeRes, GetInflationRateRpcResult);
|
|
6000
|
+
|
|
6001
|
+
if ('error' in res) {
|
|
6002
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
6003
|
+
}
|
|
6004
|
+
|
|
6005
|
+
return res.result;
|
|
6006
|
+
}
|
|
5975
6007
|
/**
|
|
5976
6008
|
* Fetch the Epoch Info parameters
|
|
5977
6009
|
*/
|