@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.
@@ -193,7 +193,8 @@ class PublicKey extends Struct {
193
193
  return new PublicKey(key.toBuffer());
194
194
  }
195
195
  /**
196
- * Default public key value. (All zeros)
196
+ * Default public key value. The base58-encoded string representation is all ones (as seen below)
197
+ * The underlying BN number is 32 bytes that are all zeros
197
198
  */
198
199
 
199
200
 
@@ -4427,6 +4428,28 @@ const GetBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
4427
4428
  blockTime: superstruct.nullable(superstruct.number()),
4428
4429
  blockHeight: superstruct.nullable(superstruct.number())
4429
4430
  })));
4431
+ /**
4432
+ * Expected parsed JSON RPC response for the "getBlock" message
4433
+ */
4434
+
4435
+ const GetParsedBlockRpcResult = jsonRpcResult(superstruct.nullable(superstruct.type({
4436
+ blockhash: superstruct.string(),
4437
+ previousBlockhash: superstruct.string(),
4438
+ parentSlot: superstruct.number(),
4439
+ transactions: superstruct.array(superstruct.type({
4440
+ transaction: ParsedConfirmedTransactionResult,
4441
+ meta: superstruct.nullable(ParsedConfirmedTransactionMetaResult),
4442
+ version: superstruct.optional(TransactionVersionStruct)
4443
+ })),
4444
+ rewards: superstruct.optional(superstruct.array(superstruct.type({
4445
+ pubkey: superstruct.string(),
4446
+ lamports: superstruct.number(),
4447
+ postBalance: superstruct.nullable(superstruct.number()),
4448
+ rewardType: superstruct.nullable(superstruct.string())
4449
+ }))),
4450
+ blockTime: superstruct.nullable(superstruct.number()),
4451
+ blockHeight: superstruct.nullable(superstruct.number())
4452
+ })));
4430
4453
  /**
4431
4454
  * Expected JSON RPC response for the "getConfirmedBlock" message
4432
4455
  *
@@ -5766,6 +5789,28 @@ class Connection {
5766
5789
  }))
5767
5790
  };
5768
5791
  }
5792
+ /**
5793
+ * Fetch parsed transaction details for a confirmed or finalized block
5794
+ */
5795
+
5796
+
5797
+ async getParsedBlock(slot, rawConfig) {
5798
+ const {
5799
+ commitment,
5800
+ config
5801
+ } = extractCommitmentFromConfig(rawConfig);
5802
+
5803
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
5804
+
5805
+ const unsafeRes = await this._rpcRequest('getBlock', args);
5806
+ const res = superstruct.create(unsafeRes, GetParsedBlockRpcResult);
5807
+
5808
+ if ('error' in res) {
5809
+ throw new SolanaJSONRPCError(res.error, 'failed to get block');
5810
+ }
5811
+
5812
+ return res.result;
5813
+ }
5769
5814
  /*
5770
5815
  * Returns the current block height of the node
5771
5816
  */