perawallet / pera-wallet

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

WalletConnect identifying the selected network for the connected account #93

Closed rubendg closed 1 year ago

rubendg commented 1 year ago

When connecting from a dApp to Pera wallet through WalletConnect the chainId property is always set to 4610 regardless of whether Pera was in mainnet or testnet mode.

The result is that on the dApp side, after establishing a connection, there doesn't seem to be a way for to infer the appropriate network for the connected account.

I would expect that chainId to be set to the genesis hash of the network, but I noticed that in WalletConnect specification the chainId is of type number which doesn't accommodate the genesis hash directly.

Any thoughts on this issue?

Update: I've found that in the new WalletConnect spec chainId will change to type string: https://github.com/WalletConnect/walletconnect-specs/blob/main/sign/rpc-methods.md#wc_sessionrequest