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