File tree Expand file tree Collapse file tree 5 files changed +13
-3
lines changed
Expand file tree Collapse file tree 5 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ export const toTransactionSchema = (
266266 if ( transaction . status === "sent" ) {
267267 return transaction . gasPrice ?. toString ( ) ?? null ;
268268 }
269- return null ;
269+ return transaction . overrides ?. gasPrice ?. toString ( ) ?? null ;
270270 } ;
271271
272272 const resolveMaxFeePerGas = ( ) : string | null => {
Original file line number Diff line number Diff line change @@ -10,8 +10,11 @@ export const txOverridesSchema = Type.Object({
1010 description : "Gas limit for the transaction" ,
1111 } ) ,
1212
13- // Overriding `gasPrice` is currently not supported.
14-
13+ gasPrice : Type . Optional ( {
14+ ...WeiAmountStringSchema ,
15+ description :
16+ "Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions." ,
17+ } ) ,
1518 maxFeePerGas : Type . Optional ( {
1619 ...WeiAmountStringSchema ,
1720 description : "Maximum fee per gas" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export const parseTransactionOverrides = (
1818 return {
1919 overrides : {
2020 gas : maybeBigInt ( overrides . gas ) ,
21+ gasPrice : maybeBigInt ( overrides . gasPrice ) ,
2122 maxFeePerGas : maybeBigInt ( overrides . maxFeePerGas ) ,
2223 maxPriorityFeePerGas : maybeBigInt ( overrides . maxPriorityFeePerGas ) ,
2324 } ,
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export type InsertedTransaction = {
2828 // User-provided overrides.
2929 overrides ?: {
3030 gas ?: bigint ;
31+ gasPrice ?: bigint ;
3132 maxFeePerGas ?: bigint ;
3233 maxPriorityFeePerGas ?: bigint ;
3334 } ;
Original file line number Diff line number Diff line change @@ -305,6 +305,8 @@ const _sendTransaction = async (
305305 // This call throws if the execution would be reverted.
306306 // The nonce is _not_ set yet.
307307
308+ console . log ( "override gas price" , overrides ?. gasPrice ) ;
309+
308310 let populatedTransaction : PopulatedTransaction ;
309311 try {
310312 populatedTransaction = await toSerializableTransaction ( {
@@ -320,6 +322,7 @@ const _sendTransaction = async (
320322 // Apply gas setting overrides.
321323 // Do not set `maxFeePerGas` to estimate the onchain value.
322324 gas : overrides ?. gas ,
325+ gasPrice : overrides ?. gasPrice ,
323326 maxPriorityFeePerGas : overrides ?. maxPriorityFeePerGas ,
324327 } ,
325328 } ) ;
@@ -403,6 +406,8 @@ const _sendTransaction = async (
403406 }
404407
405408 await addSentNonce ( chainId , from , nonce ) ;
409+ console . log ( "populated transaction gas price" , populatedTransaction . gasPrice ) ;
410+
406411 return {
407412 ...queuedTransaction ,
408413 status : "sent" ,
You can’t perform that action at this time.
0 commit comments