diff --git a/sdk/src/driftClient.ts b/sdk/src/driftClient.ts index 8151c5355..bc84926b4 100644 --- a/sdk/src/driftClient.ts +++ b/sdk/src/driftClient.ts @@ -243,9 +243,12 @@ export class DriftClient { this.wallet = config.wallet; this.opts = config.opts || { ...DEFAULT_CONFIRMATION_OPTS, - commitment: config?.connection?.commitment, - preflightCommitment: config?.connection?.commitment, // At the moment this ensures that our transaction simulations (which use Connection object) will use the same commitment level as our Transaction blockhashes (which use these opts) }; + if (config?.connection?.commitment) { + // At the moment this ensures that our transaction simulations (which use Connection object) will use the same commitment level as our Transaction blockhashes (which use these opts) + this.opts.commitment = config.connection.commitment; + this.opts.preflightCommitment = config.connection.commitment; + } this.provider = new AnchorProvider( config.connection, // @ts-ignore