From 7e7785fc192b2d1b53eaf8f3d27c87c05b1d589c Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 11 Aug 2022 15:28:54 +0100 Subject: [PATCH] feat: support minContextSlot in getParsedAccountInfo method (#27084) --- web3.js/src/connection.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 4da88bd642..0e68fca94f 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -2871,14 +2871,17 @@ export class Connection { */ async getParsedAccountInfo( publicKey: PublicKey, - commitment?: Commitment, + commitmentOrConfig?: Commitment | GetAccountInfoConfig, ): Promise< RpcResponseAndContext | null> > { + const {commitment, config} = + extractCommitmentFromConfig(commitmentOrConfig); const args = this._buildArgs( [publicKey.toBase58()], commitment, 'jsonParsed', + config, ); const unsafeRes = await this._rpcRequest('getAccountInfo', args); const res = create(