@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.cjs.js
CHANGED
|
@@ -6453,6 +6453,16 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
|
|
|
6453
6453
|
amount: superstruct.number(),
|
|
6454
6454
|
postBalance: superstruct.number()
|
|
6455
6455
|
}))));
|
|
6456
|
+
|
|
6457
|
+
/**
|
|
6458
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6459
|
+
*/
|
|
6460
|
+
const GetInflationRateResult = superstruct.type({
|
|
6461
|
+
total: superstruct.number(),
|
|
6462
|
+
validator: superstruct.number(),
|
|
6463
|
+
foundation: superstruct.number(),
|
|
6464
|
+
epoch: superstruct.number()
|
|
6465
|
+
});
|
|
6456
6466
|
/**
|
|
6457
6467
|
* Information about the current epoch
|
|
6458
6468
|
*/
|
|
@@ -6682,6 +6692,11 @@ function createRpcBatchRequest(client) {
|
|
|
6682
6692
|
|
|
6683
6693
|
|
|
6684
6694
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
6695
|
+
/**
|
|
6696
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6697
|
+
*/
|
|
6698
|
+
|
|
6699
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
6685
6700
|
/**
|
|
6686
6701
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
6687
6702
|
*/
|
|
@@ -7364,7 +7379,7 @@ const LogsNotificationResult = superstruct.type({
|
|
|
7364
7379
|
|
|
7365
7380
|
/** @internal */
|
|
7366
7381
|
const COMMON_HTTP_HEADERS = {
|
|
7367
|
-
'solana-client': `js/${(_process$env$npm_pack = "1.
|
|
7382
|
+
'solana-client': `js/${(_process$env$npm_pack = "1.72.1") !== null && _process$env$npm_pack !== void 0 ? _process$env$npm_pack : 'UNKNOWN'}`
|
|
7368
7383
|
};
|
|
7369
7384
|
/**
|
|
7370
7385
|
* A connection to a fullnode JSON RPC endpoint
|
|
@@ -8632,6 +8647,21 @@ class Connection {
|
|
|
8632
8647
|
|
|
8633
8648
|
return res.result;
|
|
8634
8649
|
}
|
|
8650
|
+
/**
|
|
8651
|
+
* Fetch the specific inflation values for the current epoch
|
|
8652
|
+
*/
|
|
8653
|
+
|
|
8654
|
+
|
|
8655
|
+
async getInflationRate() {
|
|
8656
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
8657
|
+
const res = superstruct.create(unsafeRes, GetInflationRateRpcResult);
|
|
8658
|
+
|
|
8659
|
+
if ('error' in res) {
|
|
8660
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
8661
|
+
}
|
|
8662
|
+
|
|
8663
|
+
return res.result;
|
|
8664
|
+
}
|
|
8635
8665
|
/**
|
|
8636
8666
|
* Fetch the Epoch Info parameters
|
|
8637
8667
|
*/
|