You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we pass eth_getBalance on methods or optionalMethods to ethereum-provider's init(), the request to that method will not work. The only way it works is by not passing it at all, which is does not make much sense. Users have also reported the same problem with the eth_call method.
We've created a demo app to test the three scenarios: not passing it, passing it on methods and passing it on optionalMethods. These are the results that we get when using our Ledger Live app (mobile or desktop), you can see which parameters are being passed in the init options are line on the browser console when connecting
if we don't pass eth_getBalance, neither in methods or optionalMethods, it works, the request is made and returns a response
if we pass eth_getBalance on methods, it seems the request is made, at least we don't get any error, but no response is returned
if we pass eth_getBalance on optionalMethods, we get the error 'Missing or invalid. request() method: eth_getBalance'
When connecting using the Trust wallet mobile app scenario 3 behaves like scenario 2, so I don't know how much this depends on the wallet implementation.
Click on the 'WalletConnect gB in optionalMethods' button, which passes eth_getBalance to ethereum-provider's init() in the optionalMethods property, you can see it on init options are on the browser console
Accept the connection in the wallet
If using Ledger Live you'll see 'Missing or invalid. request() method: eth_getBalance', if you're using for e.g. Trust mobile app it shows no error but you get no balance back
Expected behavior
To get a balance back when you call eth_getBalance and that method is passed to the ethereum-provider's init() function in either the methods or optionalMethods property.
Maybe to get the error if eth_getBalance is not passed in either methods or optionalMethods, but not when it is.
Screenshots
The text was updated successfully, but these errors were encountered:
@hlopes-ledger hey, in optionalMethods (or even in required) you can set any method you wish.
It's up to the wallet to approve what they support.
I've tested your dapp with our example wallet & I'm able to receive the get_balance request
I guess Trust Wallet doesn't handle this method, hence the no response.
For Ledger Live, they have to approve this method to be able to receive requests for it
Closing as the protocol sends the request correctly as expected. It's up to wallets to decide which and how to handle different methods.
Describe the bug
If we pass eth_getBalance on methods or optionalMethods to ethereum-provider's init(), the request to that method will not work. The only way it works is by not passing it at all, which is does not make much sense. Users have also reported the same problem with the eth_call method.
We've created a demo app to test the three scenarios: not passing it, passing it on methods and passing it on optionalMethods. These are the results that we get when using our Ledger Live app (mobile or desktop), you can see which parameters are being passed in the
init options are
line on the browser console when connecting'Missing or invalid. request() method: eth_getBalance'
When connecting using the Trust wallet mobile app scenario 3 behaves like scenario 2, so I don't know how much this depends on the wallet implementation.
SDK Version (if relevant)
To Reproduce
init options are
on the browser console'Missing or invalid. request() method: eth_getBalance'
, if you're using for e.g. Trust mobile app it shows no error but you get no balance backExpected behavior
To get a balance back when you call eth_getBalance and that method is passed to the ethereum-provider's init() function in either the methods or optionalMethods property.
Maybe to get the error if eth_getBalance is not passed in either methods or optionalMethods, but not when it is.
Screenshots
The text was updated successfully, but these errors were encountered: