perawallet / pera-wallet

Source code for Pera Wallet, simply the best Algorand wallet.
https://perawallet.app
Other
178 stars 62 forks source link

Launch on wc:// #81

Closed 2i2i closed 2 years ago

2i2i commented 2 years ago

Algorand Wallet used to open and use WalletConnect if an app launched a wc:// url.

Pera seems to not do that.

Since Pera is supposed to be WalletConnect compliant, it should support those URLs.

P.s. This is quite urgent for our app release. Would really appreciate to get this to work.

taylanpince commented 2 years ago

This is not the case, Algorand Wallet never supported wc:// since it causes conflicts with Ethereum wallets that use WalletConnect (and also because iOS doesn't have a launch selector like Android). Instead Algorand decided to use the algorand-wc:// prefix on iOS and Pera Wallet continues to support that. Please use algorand-wc:// on iOS.

2i2i commented 2 years ago

Could you please share an example with algorand-wc://? We have tried this prefix and the app opens, but does not ask to connect to an account. (iOS)

taylanpince commented 2 years ago

@2i2i Sounds like you are misconfiguring the WalletConnect parameters. It's unrelated to the call path. We are working on preparing some documentation for this. I will give an update here when it's up.

2i2i commented 2 years ago

Thanks. I am quite sure that we used to simply launch the uri provided by the WalletConnect service (wc://) and that used to open Algorand Wallet. We tried algorand-wc://wc?uri=$x where x is the uri returned by the WalletConnect service. Is there something obvious missing?

taylanpince commented 2 years ago

AFAIK wc:// was never supported on iOS. Here are some high-level tips:

-> The scheme must be algorand-wc -> It must have uri for the connection url as a query parameter -> uri must have prefix wc: at least

Sample url: algorand-wc://wc?uri=wc:9b93d28d-0de0-4566-8455-6f79209a092f@1?bridge=https%3A%2F%2Fwallet-connect-a.perawallet.app&key=232f2fb532acc0904d05a2c5e44991f09d6f4bfd1f81ccbaf3740578f18f0def

Regarding the WC server URL, you need to make a request to https://wc.perawallet.app/servers.json and use one of the servers listed there for that user. Since WalletConnect servers can't scale easily, this method is being used.

2i2i commented 2 years ago

Actually, you are right. We only ever tested wc:// on Android. Should we use the same method that you described for Android as well?

taylanpince commented 2 years ago

Yes, the same method will work on Android. You can use wc:// on Android safely as well. I'll send the link here once we have official docs on this.

jasonhtpham commented 1 year ago

I face the same issue. It might be because of the update on WalletConnect. But I have tried multiple schemes:

perawallet-wc://wc?uri=wc://7f838d9c-a772-4e32-acaf-a00da0c38cb2@1?bridge=https%3A%2F%2Fb.bridge.walletconnect.org&key=3091...

algorand://wc?uri=wc://7f838d9c-a772-4e32-acaf-a00da0c38cb2@1?bridge=https%3A%2F%2Fb.bridge.walletconnect.org&key=3091...

algorand-wc://wc?uri=wc://7f838d9c-a772-4e32-acaf-a00da0c38cb2@1?bridge=https%3A%2F%2Fb.bridge.walletconnect.org&key=3091...

https://perawallet.app/qr/perawallet-wc/wc?uri=wc:d2ad8fbc-5d92-425a-9e5b-24ddbfa6e9ed@1?bridge=https%3A%2F%2Fa.bridge.walletconnect.org&key=bf7...

They all open the Pera Wallet app without the popup asking to connect the account.