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

feat: add WalletConnect integration for Ledger devices #720

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

polymorpher
Copy link
Contributor

Fixes #719

Problem:

  • Sign-in with Ledger is broken after updating to new Ethereum-based Ledger app
  • Current direct Ledger integration is incompatible with new app

Solution:

  • Implement WalletConnect integration for Ledger devices
  • Users can now connect through Ledger Live using WalletConnect
  • Follow MetaMask integration pattern for contract interactions
  • Use modern libraries (@wagmi/vue, viem, @reown/appkit-cli)

Testing:

  • Connect Ledger through Ledger Live using WalletConnect
  • Verify address derivation
  • Test staking operations

Note: This implementation follows the new approach suggested in #719, using WalletConnect instead of modifying the existing Ledger integration.

Link to Devin run: https://app.devin.ai/sessions/9e403c268ac34438a5e04b2de9cc557e
Requested by: Aaron

devin-ai-integration bot and others added 2 commits February 6, 2025 11:53
- Add WalletConnect integration using @reown/appkit
- Replace direct Ledger integration with WalletConnect
- Update session management to support WalletConnect
- Add Harmony Mainnet chain configuration

Link to Devin run: https://app.devin.ai/sessions/9e403c268ac34438a5e04b2de9cc557e
Requested by: Aaron

Co-Authored-By: Aaron Li <[email protected]>
const { gasEstimate } = fee
const { chain_id, rpc_url } = networkConfig

const harmony = new Harmony(rpc_url, {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. Harmony class is undefined. Please do not simply copy from old implementations. Instead, properly invoke correct contract calling methods from wagmi


switch (transactionData.type) {
case "MsgSend":
return harmony.transactions.signTransaction({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this is incorrect because the instance harmony would not exist and would not have the field transactions

})

case "MsgDelegate":
return harmony.stakings.delegate({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

})

case "MsgUndelegate":
return harmony.stakings.undelegate({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

})

case "MsgWithdrawDelegationReward":
return harmony.stakings.collectRewards({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

devin-ai-integration bot and others added 15 commits February 6, 2025 12:21
- Replace Harmony class usage with wagmi's writeContract
- Add proper error handling in WalletConnect component
- Use correct contract ABI and address for staking operations
- Implement gas estimation using wagmi methods

Co-Authored-By: Aaron Li <[email protected]>
# Conflicts:
#	frontend/src/components/common/TmSessionExisting.vue
#	frontend/yarn.lock
…one#718)"

This reverts commit 6a3e2ee.

# Conflicts:
#	frontend/yarn.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign-in with updated ledger app is broken
1 participant