Skip to content

Commit

Permalink
Add gasLimit option to EvmSignerOptions for overriding default gas li…
Browse files Browse the repository at this point in the history
…mit (#755)

Co-authored-by: Berg Jefferson <berg@degate.com>
  • Loading branch information
clar and bergjefferson authored Dec 18, 2024
1 parent 2a49af9 commit a0daa38
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platforms/evm/src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { _platform } from './types.js';
export type EvmSignerOptions = {
// Whether or not to log messages
debug?: boolean;
// Override gas limit
gasLimit?: bigint;
// Do not exceed this gas limit
maxGasLimit?: bigint;
// Partially override specific transaction request fields
Expand Down Expand Up @@ -117,6 +119,10 @@ export class EvmNativeSigner<N extends Network, C extends EvmChains = EvmChains>
}
}

if (this.opts?.gasLimit !== undefined) {
gasLimit = this.opts.gasLimit;
}

if (this.opts?.maxGasLimit !== undefined) {
// why doesnt math.min work for bigints?
gasLimit =
Expand Down

0 comments on commit a0daa38

Please sign in to comment.