Closed Rathore2696 closed 4 months ago
Hi @Rathore2696 see the MetaMask documentation regarding that RPC method https://docs.metamask.io/wallet/reference/eth_getencryptionpublickey/
How do you wish to use the wallet's public key?
Hi @elefantel,
I am using MetaMask SDK v5.4 for Android in Android Studio - Koala
Below is the code I use to connect with the MetaMask(Wallet) mobile application in an Android smartphone from my Android application:
And the MetaMask wallet gets connected to my application and in the callback I am storing the result that contains my wallet address in a variable of type LiveData
With the help of the JSON RPC API(https://docs.metamask.io/wallet/reference/eth_getencryptionpublickey/) I am able to get the encrypted public key but not via the SDK. How to get it in my mobile app?. Please suggest a way, thank you in advance.
Ok I see what the issue is. We did not include eth_getEncryptionPublicKey
among the supported methods for working with the wallet because it is marked as deprecated in that MetaMask documentation I sent you.
The way you can make it to work in the meantime would be to not provide the SDKOptions
and then all traffic will default to the wallet. Currently that RPC call is going via Infura and Infura does not support it.
I tried as per your suggestion by removing the SDKOptions from the parameters passed in the Ethereum constructor to create the Ethereum instance, but still the same error message is received after calling the eth_getEncryptionPublicKey logic I am using in the Android Studio.
@Rathore2696 ok that means MetaMask no longer supports that method. As you can see in the documentation in the link above I shared the method is marked as deprecated, with a note: "This method is deprecated and may be removed in the future." I will close this ticket.
I need to retrieve that encryption public key. If it is not supported in the MetaMask mobile SDK for android, then how do I get that key?
Bug Report
There is a method in MetaMask SDK that gets the encryptionpublic key using the "eth_getEncryptionPublicKey" method in the request
How to use this in the Android application? Is this feature implemented but removed in the latest version of the MetaMask SDK for Android, if so which version should I have to use this method? Is there any alternative way to get the same result in the MetaMask SDK for Android?