@solana/web3.js 1.63.1 → 1.64.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.
@@ -4397,6 +4397,28 @@ const GetBlockRpcResult = jsonRpcResult(nullable(type({
4397
4397
  blockTime: nullable(number()),
4398
4398
  blockHeight: nullable(number())
4399
4399
  })));
4400
+ /**
4401
+ * Expected parsed JSON RPC response for the "getBlock" message
4402
+ */
4403
+
4404
+ const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({
4405
+ blockhash: string(),
4406
+ previousBlockhash: string(),
4407
+ parentSlot: number(),
4408
+ transactions: array(type({
4409
+ transaction: ParsedConfirmedTransactionResult,
4410
+ meta: nullable(ParsedConfirmedTransactionMetaResult),
4411
+ version: optional(TransactionVersionStruct)
4412
+ })),
4413
+ rewards: optional(array(type({
4414
+ pubkey: string(),
4415
+ lamports: number(),
4416
+ postBalance: nullable(number()),
4417
+ rewardType: nullable(string())
4418
+ }))),
4419
+ blockTime: nullable(number()),
4420
+ blockHeight: nullable(number())
4421
+ })));
4400
4422
  /**
4401
4423
  * Expected JSON RPC response for the "getConfirmedBlock" message
4402
4424
  *
@@ -5736,6 +5758,28 @@ class Connection {
5736
5758
  }))
5737
5759
  };
5738
5760
  }
5761
+ /**
5762
+ * Fetch parsed transaction details for a confirmed or finalized block
5763
+ */
5764
+
5765
+
5766
+ async getParsedBlock(slot, rawConfig) {
5767
+ const {
5768
+ commitment,
5769
+ config
5770
+ } = extractCommitmentFromConfig(rawConfig);
5771
+
5772
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
5773
+
5774
+ const unsafeRes = await this._rpcRequest('getBlock', args);
5775
+ const res = create(unsafeRes, GetParsedBlockRpcResult);
5776
+
5777
+ if ('error' in res) {
5778
+ throw new SolanaJSONRPCError(res.error, 'failed to get block');
5779
+ }
5780
+
5781
+ return res.result;
5782
+ }
5739
5783
  /*
5740
5784
  * Returns the current block height of the node
5741
5785
  */