WalletConnect / kotlin-walletconnect-lib

library to use WalletConnect with Kotlin or Java
MIT License
147 stars 100 forks source link

How can I sign message #61

Open s2g090123 opened 2 years ago

s2g090123 commented 2 years ago

I can connect to metamask, and get the wallet address. Now, I want to sign message by the address.

I use

Session.preformMethodCall(
     Session.MethodCall.SignMessage(
          System.currentTimeMillis(),
          address,
          message
     ),
     callback
)

But the callback didn't be invoked.

I paste my log below here:

D/#####: Message: {"topic":"79bd6a79-5ca8-4156-a74f-b91987e1e43f","type":"pub","payload":"{\"data\":\"8147a49da277be922fe8d2ccf35d83e6826ed9e9e0eafd3f9a8a2442bc34c04acb18c40e0180e075b6a9ec6d148017d2dc3f12ced7e0b98fd28c02b87d156fd48fe32ca795895442f5559780f283e19da8b4bc56ec7d9b48db88bd40b601a2efe6321b5c90455f53d644d18e646ff2b2e8d6f3c4a1fa966636cf9170242f7d890d94bd7674156ebf12d9308d2d9f4385178450a38393dd3ccd3bf275a92e097adc844bd41f39e289bbd8e83d019063b595ff1c8309514163d52b3af90b5086ad13e3d26a13c733a56bdb0c8546926855ae71fc146335f079082698dfa29c5acd402e31b427e7b803e9fb0006c732ca363411c8f3a725edd1d956eec968ba08666ed295a24ebcbcd575d0b88c4ca4ae9e33228309ab2e008ef3cc6ceaf8ff71e2e417bddce3f909d2041b7144c4f93d83ea51ef8738daf794ee1168a80b554860\",\"hmac\":\"9f9bada49e44fa078525c818dbf7ac0c6effc249a3de94fcda12037744813df0\",\"iv\":\"10d665ce1699bba96a8ebe573828901e\"}"}

D/#####: Message: {"topic":"79bd6a79-5ca8-4156-a74f-b91987e1e43f","type":"ack","payload":"","silent":true}

W/System.err: java.lang.IllegalStateException: Unknown type
sjhawar11 commented 2 years ago

I am having the same issue, Did you find any workaround for this.

guoqingzhu commented 2 years ago

SignMessage is eth_sign ,if you want sign "ethsignTypedData"

session.performMethodCall(Session.MethodCall.Custom(System.currentTimeMillis(),"eth_signTypedData",parmList),::handleResponse)

q-Mony commented 2 years ago

SignMessage 是 eth_sign ,如果要签名 "ethsignTypedData"

session.performMethodCall(Session.MethodCall.Custom(System.currentTimeMillis(),"eth_signTypedData",parmList),::handleResponse)

I want to know where is this method called parmList and what are the parameters