@solana/web3.js 1.70.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/web3.js",
3
- "version": "1.70.3",
3
+ "version": "1.72.0",
4
4
  "description": "Solana Javascript API",
5
5
  "keywords": [
6
6
  "api",
package/src/connection.ts CHANGED
@@ -785,6 +785,27 @@ const GetInflationRewardResult = jsonRpcResult(
785
785
  ),
786
786
  );
787
787
 
788
+ export type InflationRate = {
789
+ /** total inflation */
790
+ total: number;
791
+ /** inflation allocated to validators */
792
+ validator: number;
793
+ /** inflation allocated to the foundation */
794
+ foundation: number;
795
+ /** epoch for which these values are valid */
796
+ epoch: number;
797
+ };
798
+
799
+ /**
800
+ * Expected JSON RPC response for the "getInflationRate" message
801
+ */
802
+ const GetInflationRateResult = pick({
803
+ total: number(),
804
+ validator: number(),
805
+ foundation: number(),
806
+ epoch: number(),
807
+ });
808
+
788
809
  /**
789
810
  * Information about the current epoch
790
811
  */
@@ -1626,6 +1647,11 @@ function createRpcBatchRequest(client: RpcClient): RpcBatchRequest {
1626
1647
  */
1627
1648
  const GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);
1628
1649
 
1650
+ /**
1651
+ * Expected JSON RPC response for the "getInflationRate" message
1652
+ */
1653
+ const GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);
1654
+
1629
1655
  /**
1630
1656
  * Expected JSON RPC response for the "getEpochInfo" message
1631
1657
  */
@@ -4254,6 +4280,18 @@ export class Connection {
4254
4280
  return res.result;
4255
4281
  }
4256
4282
 
4283
+ /**
4284
+ * Fetch the specific inflation values for the current epoch
4285
+ */
4286
+ async getInflationRate(): Promise<InflationRate> {
4287
+ const unsafeRes = await this._rpcRequest('getInflationRate', []);
4288
+ const res = create(unsafeRes, GetInflationRateRpcResult);
4289
+ if ('error' in res) {
4290
+ throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');
4291
+ }
4292
+ return res.result;
4293
+ }
4294
+
4257
4295
  /**
4258
4296
  * Fetch the Epoch Info parameters
4259
4297
  */
@@ -726,10 +726,15 @@ export class Transaction {
726
726
  }
727
727
 
728
728
  /**
729
- * Verify signatures of a complete, signed Transaction
730
- */
731
- verifySignatures(): boolean {
732
- return this._verifySignatures(this.serializeMessage(), true);
729
+ * Verify signatures of a Transaction
730
+ * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.
731
+ * If no boolean is provided, we expect a fully signed Transaction by default.
732
+ */
733
+ verifySignatures(requireAllSignatures?: boolean): boolean {
734
+ return this._verifySignatures(
735
+ this.serializeMessage(),
736
+ requireAllSignatures === undefined ? true : requireAllSignatures,
737
+ );
733
738
  }
734
739
 
735
740
  /**