Skip to content
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

Add wallet_requestPermissions method #21

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

felipelincoln
Copy link

Was implemented following the standards from RPC API | MetaMask Docs and EIP-2255: Wallet Permissions System

Copy link
Member

@jessgusclark jessgusclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing! This looks great, one small change to reduce duplicate code.

Comment on lines +86 to +89
return new Promise((resolve, reject) => {
this.acceptEnable = resolve
this.rejectEnable = reject
}).then(() => permissions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we combine this with the one from eth_accounts (line 71) so we don't have repeated code?

Perhaps something like this:

private handleManualConfirm(response: any): Promise<any> {
   // create the promise and then return the response
}

That will make it easier to extend the confirm/reject to other methods.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏻

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants