@solana/web3.js 1.63.0 → 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.
package/lib/index.iife.js CHANGED
@@ -11461,13 +11461,13 @@ var solanaWeb3 = (function (exports) {
11461
11461
  getAccountKeys(args) {
11462
11462
  let accountKeysFromLookups;
11463
11463
 
11464
- if (args && 'accountKeysFromLookups' in args) {
11464
+ if (args && 'accountKeysFromLookups' in args && args.accountKeysFromLookups) {
11465
11465
  if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) {
11466
11466
  throw new Error('Failed to get account keys because of a mismatch in the number of account keys from lookups');
11467
11467
  }
11468
11468
 
11469
11469
  accountKeysFromLookups = args.accountKeysFromLookups;
11470
- } else if (args && 'addressLookupTableAccounts' in args) {
11470
+ } else if (args && 'addressLookupTableAccounts' in args && args.addressLookupTableAccounts) {
11471
11471
  accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts);
11472
11472
  } else if (this.addressTableLookups.length > 0) {
11473
11473
  throw new Error('Failed to get account keys because address table lookups were not resolved');
@@ -18050,6 +18050,28 @@ var solanaWeb3 = (function (exports) {
18050
18050
  blockTime: nullable(number()),
18051
18051
  blockHeight: nullable(number())
18052
18052
  })));
18053
+ /**
18054
+ * Expected parsed JSON RPC response for the "getBlock" message
18055
+ */
18056
+
18057
+ const GetParsedBlockRpcResult = jsonRpcResult(nullable(type({
18058
+ blockhash: string(),
18059
+ previousBlockhash: string(),
18060
+ parentSlot: number(),
18061
+ transactions: array(type({
18062
+ transaction: ParsedConfirmedTransactionResult,
18063
+ meta: nullable(ParsedConfirmedTransactionMetaResult),
18064
+ version: optional(TransactionVersionStruct)
18065
+ })),
18066
+ rewards: optional(array(type({
18067
+ pubkey: string(),
18068
+ lamports: number(),
18069
+ postBalance: nullable(number()),
18070
+ rewardType: nullable(string())
18071
+ }))),
18072
+ blockTime: nullable(number()),
18073
+ blockHeight: nullable(number())
18074
+ })));
18053
18075
  /**
18054
18076
  * Expected JSON RPC response for the "getConfirmedBlock" message
18055
18077
  *
@@ -19389,6 +19411,28 @@ var solanaWeb3 = (function (exports) {
19389
19411
  }))
19390
19412
  };
19391
19413
  }
19414
+ /**
19415
+ * Fetch parsed transaction details for a confirmed or finalized block
19416
+ */
19417
+
19418
+
19419
+ async getParsedBlock(slot, rawConfig) {
19420
+ const {
19421
+ commitment,
19422
+ config
19423
+ } = extractCommitmentFromConfig(rawConfig);
19424
+
19425
+ const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);
19426
+
19427
+ const unsafeRes = await this._rpcRequest('getBlock', args);
19428
+ const res = create(unsafeRes, GetParsedBlockRpcResult);
19429
+
19430
+ if ('error' in res) {
19431
+ throw new SolanaJSONRPCError(res.error, 'failed to get block');
19432
+ }
19433
+
19434
+ return res.result;
19435
+ }
19392
19436
  /*
19393
19437
  * Returns the current block height of the node
19394
19438
  */