@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.cjs.js
CHANGED
|
@@ -6253,6 +6253,16 @@ const GetInflationRewardResult = jsonRpcResult(superstruct.array(superstruct.nul
|
|
|
6253
6253
|
amount: superstruct.number(),
|
|
6254
6254
|
postBalance: superstruct.number()
|
|
6255
6255
|
}))));
|
|
6256
|
+
|
|
6257
|
+
/**
|
|
6258
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6259
|
+
*/
|
|
6260
|
+
const GetInflationRateResult = superstruct.type({
|
|
6261
|
+
total: superstruct.number(),
|
|
6262
|
+
validator: superstruct.number(),
|
|
6263
|
+
foundation: superstruct.number(),
|
|
6264
|
+
epoch: superstruct.number()
|
|
6265
|
+
});
|
|
6256
6266
|
/**
|
|
6257
6267
|
* Information about the current epoch
|
|
6258
6268
|
*/
|
|
@@ -6482,6 +6492,11 @@ function createRpcBatchRequest(client) {
|
|
|
6482
6492
|
|
|
6483
6493
|
|
|
6484
6494
|
const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
|
|
6495
|
+
/**
|
|
6496
|
+
* Expected JSON RPC response for the "getInflationRate" message
|
|
6497
|
+
*/
|
|
6498
|
+
|
|
6499
|
+
const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
|
|
6485
6500
|
/**
|
|
6486
6501
|
* Expected JSON RPC response for the "getEpochInfo" message
|
|
6487
6502
|
*/
|
|
@@ -8432,6 +8447,21 @@ class Connection {
|
|
|
8432
8447
|
|
|
8433
8448
|
return res.result;
|
|
8434
8449
|
}
|
|
8450
|
+
/**
|
|
8451
|
+
* Fetch the specific inflation values for the current epoch
|
|
8452
|
+
*/
|
|
8453
|
+
|
|
8454
|
+
|
|
8455
|
+
async getInflationRate() {
|
|
8456
|
+
const unsafeRes = await this._rpcRequest('getInflationRate', []);
|
|
8457
|
+
const res = superstruct.create(unsafeRes, GetInflationRateRpcResult);
|
|
8458
|
+
|
|
8459
|
+
if ('error' in res) {
|
|
8460
|
+
throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
|
|
8461
|
+
}
|
|
8462
|
+
|
|
8463
|
+
return res.result;
|
|
8464
|
+
}
|
|
8435
8465
|
/**
|
|
8436
8466
|
* Fetch the Epoch Info parameters
|
|
8437
8467
|
*/
|