Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ledger] Ledger connect via WCv2 fails on eth_getBalance, but WalletConnect itself succeeds #1873

Open
1 task done
tuckerchapin opened this issue Aug 8, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@tuckerchapin
Copy link

Current Behavior

Originally I had Ledger configured identically to WalletConnect, however eth_getBalance and eth_call calls were all failing using the provider from the Ledger module, even though they were succeeding via the WalletConnect module. Using Ledger Live, I can connect via the Ledger module, which does not respond to eth_getBalance. However, connecting to Ledger Live via WalletConnect works entirely as expected.

Also, enableDebugLogs does not seem to really have any impact?

Expected Behavior

For the Ledger connect module to return a provider that handles eth_getBalance calls properly where WalletConnect does as well.

Steps To Reproduce

const injected = injectedModule()
const walletConnectConfig = {
    projectId: PROJECT_ID,
    requiredChains: [1],
    dappUrl: APP_URL,
}
const ledgerConfig = {
    ...walletConnectConfig,
    enableDebugLogs: true,
    walletConnectVersion: 2,
    requiredMethods: ['eth_call', 'eth_getBalance'],
    optionalMethods: ['eth_call', 'eth_getBalance'],
    additionalOptionalMethods: ['eth_call', 'eth_getBalance'],
}

const walletConnect = walletConnectModule(walletConnectConfig)
const ledger = ledgerModule(ledgerConfig)

onboard = Onboard({
    wallets: [injected, walletConnect, ledger, trezor],
    chains: [{
        id: '0x1',
        token: 'ETH',
        label: 'Ethereum Mainnet',
        rpcUrl: RPC_URL
    }],
    ...
}]

...

web3.setProvider(onboard.state.get().wallets[0].provider || RPC_URL)

What package is effected by this issue?

@web3-onboard/ledger

Is this a build or a runtime issue?

Runtime

Package Version

core: 2.20.4, ledger: 2.5.1

Node Version

No response

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.
@tuckerchapin tuckerchapin added the bug Something isn't working label Aug 8, 2023
@hlopes-ledger
Copy link
Contributor

Hi @tuckerchapin!
Thanks for the report, we're looking into this.

@hlopes-ledger
Copy link
Contributor

I've created an issue on the WalletConnect's repo, WalletConnect/walletconnect-monorepo#3411.

This happens on the Ledger connector because we are passing eth_getBalance by default on the optionalMethods property on the call to WalletConnect's ethereum-provider init(). It does not happens using the web3-onboard's WalletConnect connector because in that case it is not passed. We're fixing it on our side by updating Connect Kit.

@tuckerchapin
Copy link
Author

Thank you so much, looking forward to these upstream changes!

@taylorjdawson
Copy link
Contributor

Thanks @hlopes-ledger for looking into this!

@tuckerchapin
Copy link
Author

Just wanted to follow up on this!

@Adamj1232
Copy link
Member

@tuckerchapin unfortunately @hlopes-ledger is no longer with Ledger. I have reached out to the Ledger team for more insight into the developing fixes ongoing. I will update here with any information.

@tuckerchapin
Copy link
Author

Any updates?

@tuckerchapin
Copy link
Author

Hi! Just checking in again... has this been resolved?

@tuckerchapin
Copy link
Author

@Adamj1232 @taylorjdawson Hey there, just wanted to see if this has been addressed yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants