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 eth_signTypedData method. #84

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vuongxuantuyen
Copy link

@vuongxuantuyen vuongxuantuyen commented Aug 24, 2024

Description

Add ethnic_signTypedData method.

Resolves #83 (issue)

How Has This Been Tested?

Due Dilligence

  • Breaking change
  • Requires a documentation update

Copy link

sonarcloud bot commented Aug 24, 2024

@@ -7,6 +7,12 @@ public enum W3MJSONRPC: Codable {
address: String,
message: String
)

case eth_signTypedData(
Copy link

Choose a reason for hiding this comment

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

shouldn't this be eth_signTypedData_v4?

public func removeSessionAndAccount() {
store.session = nil
store.account = nil
}
Copy link

Choose a reason for hiding this comment

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

Why is this here?

Copy link
Author

Choose a reason for hiding this comment

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

@mooshee My mistake, just a test function. This should be removed.

@mooshee
Copy link

mooshee commented Sep 2, 2024

While this PR adds the necessary methods, it doesn't make use of it. The WalletDetailViewModel.signSIWE() needs to check if the session supports eth_signTypedData_v4 and then make the request instead of using personal_sign. Furthermore, the signature validation is more complex. A new EIP712Verifier needs to be added to MessageVerifier.

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.

Add eth_signTypedData_v4 Support
2 participants