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

Metamask could connect, but the personal_sign method did not respond #108

Open
SWCheng1122 opened this issue Apr 9, 2022 · 6 comments
Open
Labels
bug Something isn't working wallets

Comments

@SWCheng1122
Copy link

Metamask could connect, but the personal_sign method did not respond

@yunanni
Copy link

yunanni commented Apr 9, 2022

You will need to synchronize your wallet and then you debug it with bech13

@DmitryBespalov DmitryBespalov added bug Something isn't working wallets labels Jun 28, 2022
@feynman-x
Copy link

feynman-x commented Sep 25, 2022

@SWCheng1122 This problem happends to me and my friend. You need add extra code to open metamask after call personal_sign method.

Hopes to help.

@ljs19923
Copy link

ljs19923 commented Oct 27, 2022

Hey @Drolmen, thanks for your answer

Another question with personal_sign

  try? client.personal_sign(url: session.url, message: message, account: session.walletInfo!.accounts[0]) {
     [weak self] response in
     // handle the response from Wallet here
     
     print("reee \(response)")
  }

What's the format of the response? Im not able to find how to read the content...
Thanks a lot

@DmitryBespalov
Copy link
Collaborator

@ljs19923 the response should be as documented https://docs.walletconnect.com/1.0/json-rpc-api-methods/ethereum#personal_sign

i.e. it's a hexadecimal data of the signature

@ljs19923
Copy link

ljs19923 commented Oct 28, 2022

@DmitryBespalov thanks for your answer,

I'm not able to extract the content of response. It's a dictionary? Because the type of response is "Response", how can I convert that to a dictionary?

Can you show me how to do that in code please? If you would like to print the hexadecimal data of the signature

Screen Shot 2022-10-28 at 08 57 04

@DmitryBespalov
Copy link
Collaborator

@ljs19923 please try out

You can convert the received response result to a Decodable type.

let hexSignature = try response.result(as: String.self)

You can also check if the wallet responded with error:

if let error = response.error { // NSError
  // handle error
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wallets
Projects
None yet
Development

No branches or pull requests

5 participants