@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.cjs.js
CHANGED
|
@@ -3844,6 +3844,16 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
|
|
|
3844
3844
|
amount: superstruct.number(),
|
|
3845
3845
|
postBalance: superstruct.number()
|
|
3846
3846
|
}))));
|
|
3847
|
+
|
|
3848
|
+
/**
|
|
3849
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
3850
|
+
*/
|
|
3851
|
+
const GetInflationRateResult = superstruct.type({
|
|
3852
|
+
total: superstruct.number(),
|
|
3853
|
+
validator: superstruct.number(),
|
|
3854
|
+
foundation: superstruct.number(),
|
|
3855
|
+
epoch: superstruct.number()
|
|
3856
|
+
});
|
|
3847
3857
|
/**
|
|
3848
3858
|
* Information about the current epoch
|
|
3849
3859
|
*/
|
|
@@ -4047,6 +4057,11 @@ function createRpcBatchRequest(client) {
|
|
|
4047
4057
|
|
|
4048
4058
|
|
|
4049
4059
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
4060
|
+
/**
|
|
4061
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
4062
|
+
*/
|
|
4063
|
+
|
|
4064
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
4050
4065
|
/**
|
|
4051
4066
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
4052
4067
|
*/
|
|
@@ -4729,7 +4744,7 @@ const LogsNotificationResult = superstruct.type({
|
|
|
4729
4744
|
|
|
4730
4745
|
/** @internal */
|
|
4731
4746
|
const COMMON_HTTP_HEADERS = {
|
|
4732
|
-
'solana-client': `js/${(_process$env$npm_pack = "1.
|
|
4747
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.72.1") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
4733
4748
|
};
|
|
4734
4749
|
/**
|
|
4735
4750
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -5997,6 +6012,21 @@ class Connection {
|
|
|
5997
6012
|
|
|
5998
6013
|
return res.result;
|
|
5999
6014
|
}
|
|
6015
|
+
/**
|
|
6016
|
+
* Fetch the specific inflation values for the current epoch
|
|
6017
|
+
*/
|
|
6018
|
+
|
|
6019
|
+
|
|
6020
|
+
async getInflationRate() {
|
|
6021
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
6022
|
+
const res = superstruct.create(unsafeRes, GetInflationRateRpcResult);
|
|
6023
|
+
|
|
6024
|
+
if ('error' in res) {
|
|
6025
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
6026
|
+
}
|
|
6027
|
+
|
|
6028
|
+
return res.result;
|
|
6029
|
+
}
|
|
6000
6030
|
/**
|
|
6001
6031
|
* Fetch the Epoch Info parameters
|
|
6002
6032
|
*/
|