@solana/web3.js 1.63.1 → 1.65.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
@@ -199,7 +199,8 @@ class PublicKey extends Struct {
199
199
  return new PublicKey(key.toBuffer());
200
200
  }
201
201
  /**
202
- * Default public key value. (All zeros)
202
+ * Default public key value. The base58-encoded string representation is all ones (as seen below)
203
+ * The underlying BN number is 32 bytes that are all zeros
203
204
  */
204
205
 
205
206
 
@@ -4493,6 +4494,28 @@ const GetBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
4493
4494
  blockTime: superstruct.nullable(superstruct.number()),
4494
4495
  blockHeight: superstruct.nullable(superstruct.number())
4495
4496
  })));
4497
+ /**
4498
+ * Expected parsed JSON RPC response for the "getBlock" message
4499
+ */
4500
+
4501
+ const GetParsedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
4502
+ blockhash: superstruct.string(),
4503
+ previousBlockhash: superstruct.string(),
4504
+ parentSlot: superstruct.number(),
4505
+ transactions: superstruct.array(superstruct.type({
4506
+ transaction: ParsedConfirmedTransactionResult,
4507
+ meta: superstruct.nullable(ParsedConfirmedTransactionMetaResult),
4508
+ version: superstruct.optional(TransactionVersionStruct)
4509
+ })),
4510
+ rewards: superstruct.optional(superstruct.array(superstruct.type({
4511
+ pubkey: superstruct.string(),
4512
+ lamports: superstruct.number(),
4513
+ postBalance: superstruct.nullable(superstruct.number()),
4514
+ rewardType: superstruct.nullable(superstruct.string())
4515
+ }))),
4516
+ blockTime: superstruct.nullable(superstruct.number()),
4517
+ blockHeight: superstruct.nullable(superstruct.number())
4518
+ })));
4496
4519
  /**
4497
4520
  * Expected JSON RPC response for the "getConfirmedBlock" message
4498
4521
  *
@@ -5832,6 +5855,28 @@ class Connection {
5832
5855
  }))
5833
5856
  };
5834
5857
  }
5858
+ /**
5859
+ * Fetch parsed transaction details for a confirmed or finalized block
5860
+ */
5861
+
5862
+
5863
+ async getParsedBlock(slot, rawConfig) {
5864
+ const {
5865
+ commitment,
5866
+ config
5867
+ } = extractCommitmentFromConfig(rawConfig);
5868
+
5869
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
5870
+
5871
+ const unsafeRes = await this._rpcRequest('getBlock', args);
5872
+ const res = superstruct.create(unsafeRes, GetParsedBlockRpcResult);
5873
+
5874
+ if ('error' in res) {
5875
+ throw new SolanaJSONRPCError(res.error, 'failed to get block');
5876
+ }
5877
+
5878
+ return res.result;
5879
+ }
5835
5880
  /*
5836
5881
  * Returns the current block height of the node
5837
5882
  */