diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 5bf6e7287e..c398d02423 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -195,9 +195,6 @@ type RpcRequest = (methodName: string, args: Array) => Promise; type RpcBatchRequest = (requests: RpcParams[]) => Promise; -const NO_COMMITMENT = - typeof Symbol === 'function' ? Symbol('NO_COMMITMENT') : ({} as const); - /** * @internal */ @@ -3434,10 +3431,9 @@ export class Connection { async getRecentPerformanceSamples( limit?: number, ): Promise> { - const args = this._buildArgs(limit ? [limit] : [], NO_COMMITMENT); const unsafeRes = await this._rpcRequest( 'getRecentPerformanceSamples', - args, + limit ? [limit] : [], ); const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult); if ('error' in res) { @@ -5065,12 +5061,11 @@ export class Connection { _buildArgs( args: Array, - override?: Commitment | typeof NO_COMMITMENT, + override?: Commitment, encoding?: 'jsonParsed' | 'base64', extra?: any, ): Array { - const commitment = - override === NO_COMMITMENT ? undefined : override || this._commitment; + const commitment = override || this._commitment; if (commitment || encoding || extra) { let options: any = {}; if (encoding) {