WalletConnect / kotlin-walletconnect-lib

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

How do I sign with personal_sign #73

Closed jiaweio closed 2 years ago

jiaweio commented 2 years ago

val from = ExampleApplication.session.approvedAccounts()?.first() ?: return Log.i(TAG, "---click-->$from") ExampleApplication.session.performMethodCall( Session.MethodCall.Custom( System.currentTimeMillis(), "personal_sign", arrayListOf( "0xdeadbeaf", from) ) ) { response -> Log.d(TAG, "------>{response.result}--->{response.error}") }

I use the Custom method, but I get no response, I can't find what the problem is

SnailMyth commented 2 years ago

和signMessage一样的处理方式,把签名hash传出去就行了

jiaweio commented 2 years ago

和signMessage一样的处理方式,把签名hash传出去就行了

你好,我尝试使用custom Api 进行persnal sign 进行签名,但是跳转到metamask 后没有任何反应,不会显示弹窗,不知道是为什么 想问下是我传递的参数不对导致的么

wjx0805 commented 2 years ago

我是这样解决的

初始化的时候 Session.PeerMeta(name = "demo", url = "xx.xx.xx.") ,url必传,

原因查的是 MetaTask 5.3.0之后会检验appurl. 我加上参数后可以获取签名了

jiaweio commented 2 years ago

我是这样解决的

初始化的时候 Session.PeerMeta(name = "demo", url = "xx.xx.xx.") ,url必传,

原因查的是 MetaTask 5.3.0之后会检验appurl. 我加上参数后可以获取签名了

好的,感谢你的回复,已经找到原因了