This repository was archived by the owner on Oct 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " userop" ,
3
- "version" : " 0.1.0 " ,
3
+ "version" : " 0.1.1 " ,
4
4
"description" : " A simple JS library for building ERC-4337 UserOperations." ,
5
5
"types" : " ./dist/index.d.ts" ,
6
6
"main" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change @@ -89,12 +89,11 @@ export class SimpleAccount extends UserOperationBuilder {
89
89
) ,
90
90
} )
91
91
. useMiddleware ( instance . resolveAccount )
92
- . useMiddleware ( getGasPrice ( instance . provider ) )
93
- . useMiddleware ( estimateUserOperationGas ( instance . provider ) ) ;
92
+ . useMiddleware ( getGasPrice ( instance . provider ) ) ;
94
93
95
94
const withPM = paymasterMiddleware
96
95
? base . useMiddleware ( paymasterMiddleware )
97
- : base ;
96
+ : base . useMiddleware ( estimateUserOperationGas ( instance . provider ) ) ;
98
97
99
98
return withPM . useMiddleware ( EOASignature ( instance . signer ) ) ;
100
99
}
Original file line number Diff line number Diff line change @@ -6,12 +6,17 @@ interface VerifyingPaymasterResult {
6
6
paymasterAndData : string ;
7
7
preVerificationGas : string ;
8
8
verificationGasLimit : string ;
9
+ callGasLimit : string ;
9
10
}
10
11
11
12
// Assumes the paymaster interface in https://hackmd.io/@stackup /H1oIvV-qi
12
13
export const verifyingPaymaster =
13
14
( paymasterRpc : string , context : any ) : UserOperationMiddlewareFn =>
14
15
async ( ctx ) => {
16
+ ctx . op . verificationGasLimit = ethers . BigNumber . from (
17
+ ctx . op . verificationGasLimit
18
+ ) . mul ( 3 ) ;
19
+
15
20
const provider = new ethers . providers . JsonRpcProvider ( paymasterRpc ) ;
16
21
const pm = ( await provider . send ( "pm_sponsorUserOperation" , [
17
22
OpToJSON ( ctx . op ) ,
@@ -23,4 +28,5 @@ export const verifyingPaymaster =
23
28
ctx . op . paymasterAndData = pm . paymasterAndData ;
24
29
ctx . op . preVerificationGas = pm . preVerificationGas ;
25
30
ctx . op . verificationGasLimit = pm . verificationGasLimit ;
31
+ ctx . op . callGasLimit = pm . callGasLimit ;
26
32
} ;
You can’t perform that action at this time.
0 commit comments