Closed Gagandeep0312 closed 5 months ago
Hi @Gagandeep0312 thanks for the issue! We have tried to replicate it but were not able to get it. But looking at your request, there are a few mistakes:
chainName
, and this would result in a -32602
error code with error message "Expected non-empty string 'chainName'. Received null". rpcUrls
should be an array not a string
The request The request should like this (in Kotlin):
val params: MutableMap<String, Any> = mutableMapOf(
"chainId" to "0xa86a",
"chainName" to "Avalanche",
"rpcUrls" to listOf("https://api.avax.network/ext/bc/C/rpc")
)
val addChainRequest = EthereumRequest(
method = EthereumMethod.ADD_ETHEREUM_CHAIN.value,
params = listOf(params)
)
See the demos below showing the modified the test dapp to add a connect with add chain request
• chainName
is missing on the video on the left - the request fails
• All expected params provided on the video on the right - the request succeeds
Please fix your request and try again and let us know?
Missing chainName | All params provided |
---|---|
Hi @Gagandeep0312 ! I'm going to be closing this issue since there hasn't been any activity on it. Please feel free to open a new issue if you're still experiencing issues.
Provide environment information
I am trying to use connect with function with Method EthereumMethod.ADD_ETHEREUM_CHAIN to connect and add the Chain.
MetaMask Android SDK Version
0.5.4
MetaMask Mobile app Version
v7.21.0(1317)
Android Version
14
Describe the Bug
` val request = EthereumRequest(method = EthereumMethod.ADD_ETHEREUM_CHAIN.value, params = listOf(mapOf( "chainId" to "0xa86a",
Expected Behavior
when trying to connect with Any request, It should execute the connect then requested function on follow to execute. What really my job is to Connect-> Add Chain-> Switch to new Chain on single transaction, without doing Back and forth. Is it visible?
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
No response
To Reproduce
` ethereum.disconnect(true) val request = EthereumRequest(method = EthereumMethod.ADD_ETHEREUM_CHAIN.value, params = listOf(mapOf( "chainId" to AppVariables.ETHEREUM_CHAIN_ID,