Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

feat: add ledger connector #11

Merged
merged 7 commits into from
Dec 12, 2022

Conversation

jxom
Copy link
Member

@jxom jxom commented Dec 12, 2022

Dupe of #4 – below description from @hlopes-ledger

Description

Adds a Ledger connector that makes use of the Ledger Connect Kit to either show the Ledger Connect extension on Safari if installed, guide the user to install it if supported, or allow them to directly connect to Ledger Live through Wallet Connect on other platforms.

Let me know if there are any other changes needed. It seems that the docs and playground will be kept on the main wagmi repo but they reference the connectors.

This PR is based on #3, so the changes will be reduced after that one is merged.

Additional Information

hlopes-ledger and others added 7 commits December 12, 2022 07:00
- sort connector lists and some properties in alphabetical order
- remove `infuraId` from the connector options
- use the # symbol instead of the private keyword
- move Connect Kit initialization to `#getConnectKit`
  - replace `#connectKitPromise` with `#connectKit`, and instead of
    assigning it in the constructor, make it optional and assign it
    inside `#getConnectKit`
  - optionaly get chainId as a parameter when called by getProvider
    since we need to pass it to connectKit.checkSupport
  - instead of passing the `infuraId` build the rpc from the chain list
- fixes in `connect()`
  - replace the `getAccount` call in connect with a request for
    `eth_requestAccounts`
  - add `chainId` and rename create parameter on `getProvider` for
    consistency with ither connectors
  - now calls `#getConnectKit` passing `chainId` instead of
    just resolving the Connect Kit promise
- replace request for `eth_requestAccounts` with one for
  `eth_accounts` in `getAccount` and call it from
  `this.isAuthorized()`
- add `chainId` argument to `getSigner` and pass it to `getProvider`
@jxom jxom mentioned this pull request Dec 12, 2022
1 task
@jxom jxom merged commit 5db7cba into wevm:main Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants