stackup-wallet / userop.js

A simple JS library for building ERC-4337 UserOperations.
MIT License
113 stars 32 forks source link

Reason for use of defaultOp in UserOperationBuilder #118

Open sushisilence opened 7 months ago

sushisilence commented 7 months ago

Hello team,

What is the purpose of defaultOp in the UserOperationBuilder? https://github.com/stackup-wallet/userop.js/blob/1d9d0e034691cd384e194c9e8b3165680a334180/src/builder.ts#L28-L38

I'm asking because in SimpleAccount.init(): https://github.com/stackup-wallet/userop.js/blob/1d9d0e034691cd384e194c9e8b3165680a334180/src/preset/builder/simpleAccount.ts#L89-L98 A default message is being signed, and some defaults are being set. For a normal EOA an extra signature is okay, but if an MPC/Hardware wallet is used, then an extra signature is not ideal.

Is it possible to skip signing a message in the SimpleAccount.init() method? Thanks!