-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/devx 337 abstract module #333
Conversation
packages/account/src/utils/Types.ts
Outdated
nodeClientUrl?: string; // very specific to Biconomy | ||
defaultValidationModule: BaseValidationModule; | ||
module?: ValidationModule; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider renaming var name and type name as discussed above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed i
* @param {AuthorizationModuleType} authorizationModuleType - The type of authorization module to create. | ||
* @returns {Promise<BaseValidationModule>} A promise that resolves to the created authorization module. | ||
*/ | ||
async checkAndCreateModule(signer: Signer, authorizationModuleType: AuthorizationModuleType): Promise<BaseValidationModule> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bunch of mistakes in this entire code block. can discuss in a call
return MultiChainValidationModule.create({ | ||
signer, | ||
}); | ||
case AuthorizationModuleType.SESSION: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session key manager module or batched session router module can not be default authorization modules.
Summary
Related Issue: # DEVX 337
Change Type
Checklist
Additional Information
The context of this PR is to optimize developer experience of the SDK.
This PR will removes the need for the user/developer to create the Module instance in his application, reducing the amount of boilerplate code that needs to be written.
User/developer can now choose to provide only "module" field in the config of the "create()" method, specifying between ECDSA_OWNERSHIP or MULTICHAIN modules.
The "signer" field is now required in config.
Added a new enum type "ValidationModule" which will map a module key to module address.
This will not work for Session and Batched Session modules as they require smart account address in order to be created which are available only after the creation of the smart account instance.
The creation of module instance by the user/developer is still available for compatibility reasons.