@@ -171,11 +171,27 @@ export const processTx = async () => {
171171 ...gasOverrides ,
172172 } ) ;
173173
174- // TODO: We need to target specific cases
175- // Bump gas limit to avoid occasional out of gas errors
176- txRequest . gasLimit = txRequest . gasLimit
177- ? BigNumber . from ( txRequest . gasLimit ) . mul ( 120 ) . div ( 100 )
178- : undefined ;
174+ // Gas limit override
175+ if ( tx . gasLimit ) {
176+ txRequest . gasLimit = BigNumber . from ( tx . gasLimit ) ;
177+ } else {
178+ // TODO: We need to target specific cases
179+ // Bump gas limit to avoid occasional out of gas errors
180+ txRequest . gasLimit = txRequest . gasLimit
181+ ? BigNumber . from ( txRequest . gasLimit ) . mul ( 120 ) . div ( 100 )
182+ : undefined ;
183+ }
184+
185+ // Gas price overrides
186+ if ( tx . maxFeePerGas ) {
187+ txRequest . maxFeePerGas = BigNumber . from ( tx . maxFeePerGas ) ;
188+ }
189+
190+ if ( tx . maxPriorityFeePerGas ) {
191+ txRequest . maxPriorityFeePerGas = BigNumber . from (
192+ tx . maxPriorityFeePerGas ,
193+ ) ;
194+ }
179195
180196 const signature = await signer . signTransaction ( txRequest ) ;
181197 const rpcRequest = {
@@ -378,6 +394,24 @@ export const processTx = async () => {
378394 nonce,
379395 } ,
380396 ) ;
397+
398+ // Temporary fix untill SDK allows us to do this
399+ if ( tx . gasLimit ) {
400+ unsignedOp . callGasLimit = BigNumber . from ( tx . gasLimit ) ;
401+ unsignedOp . paymasterAndData = "0x" ;
402+ const DUMMY_SIGNATURE =
403+ "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c" ;
404+ unsignedOp . signature = DUMMY_SIGNATURE ;
405+ const paymasterResult =
406+ await signer . smartAccountAPI . paymasterAPI . getPaymasterAndData (
407+ unsignedOp ,
408+ ) ;
409+ const paymasterAndData = paymasterResult . paymasterAndData ;
410+ if ( paymasterAndData && paymasterAndData !== "0x" ) {
411+ unsignedOp . paymasterAndData = paymasterAndData ;
412+ }
413+ }
414+
381415 const userOp = await signer . smartAccountAPI . signUserOp ( unsignedOp ) ;
382416 const userOpHash = await signer . smartAccountAPI . getUserOpHash (
383417 userOp ,
0 commit comments