@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.
@@ -163,7 +163,8 @@ class PublicKey extends Struct {
163
163
  return new PublicKey(key.toBuffer());
164
164
  }
165
165
  /**
166
- * Default public key value. (All zeros)
166
+ * Default public key value. The base58-encoded string representation is all ones (as seen below)
167
+ * The underlying BN number is 32 bytes that are all zeros
167
168
  */
168
169
 
169
170
 
@@ -4397,6 +4398,28 @@ const GetBlockRpcResult = jsonRpcResult(nullable(type({
4397
4398
  blockTime: nullable(number()),
4398
4399
  blockHeight: nullable(number())
4399
4400
  })));
4401
+ /**
4402
+ * Expected parsed JSON RPC response for the "getBlock" message
4403
+ */
4404
+
4405
+ const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({
4406
+ blockhash: string(),
4407
+ previousBlockhash: string(),
4408
+ parentSlot: number(),
4409
+ transactions: array(type({
4410
+ transaction: ParsedConfirmedTransactionResult,
4411
+ meta: nullable(ParsedConfirmedTransactionMetaResult),
4412
+ version: optional(TransactionVersionStruct)
4413
+ })),
4414
+ rewards: optional(array(type({
4415
+ pubkey: string(),
4416
+ lamports: number(),
4417
+ postBalance: nullable(number()),
4418
+ rewardType: nullable(string())
4419
+ }))),
4420
+ blockTime: nullable(number()),
4421
+ blockHeight: nullable(number())
4422
+ })));
4400
4423
  /**
4401
4424
  * Expected JSON RPC response for the "getConfirmedBlock" message
4402
4425
  *
@@ -5736,6 +5759,28 @@ class Connection {
5736
5759
  }))
5737
5760
  };
5738
5761
  }
5762
+ /**
5763
+ * Fetch parsed transaction details for a confirmed or finalized block
5764
+ */
5765
+
5766
+
5767
+ async getParsedBlock(slot, rawConfig) {
5768
+ const {
5769
+ commitment,
5770
+ config
5771
+ } = extractCommitmentFromConfig(rawConfig);
5772
+
5773
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
5774
+
5775
+ const unsafeRes = await this._rpcRequest('getBlock', args);
5776
+ const res = create(unsafeRes, GetParsedBlockRpcResult);
5777
+
5778
+ if ('error' in res) {
5779
+ throw new SolanaJSONRPCError(res.error, 'failed to get block');
5780
+ }
5781
+
5782
+ return res.result;
5783
+ }
5739
5784
  /*
5740
5785
  * Returns the current block height of the node
5741
5786
  */