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(