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

Heath Ledger: Add Ledger wallet support #205

Merged
merged 56 commits into from Aug 6, 2020
Merged

Heath Ledger: Add Ledger wallet support #205

merged 56 commits into from Aug 6, 2020

Conversation

liamzebedee
Copy link
Contributor

@liamzebedee liamzebedee commented Apr 15, 2020

Heath Andrew Ledger (4 April 1979 – 22 January 2008) was an Australian actor, photographer, and music video director. After performing roles in several Australian television and film productions during the 1990s, Ledger left for the United States in 1998 to further develop his film career. His work comprised nineteen films, including 10 Things I Hate About You, which is a seminal work for engineers in the Ethereum ecosystem.

This PR implements Ledger hardware wallet support, cutting work out from #184. Due to 0x and ledgerjs API's not fully supporting chainId's greater than 255 (ie. our geth testnets), we had to implement a custom LedgerSubprovider for signing transactions. @r-czajkowski helped a lot with kickstarting the solution to this issue.

There's also some cleanup of the ChooseWalletDialog, based on previous feedback in #184.

Epic: #177
Depends on: keep-network/tbtc.js#55

Feeling kinda documenting, might delete later.
The 0x API's are generally of a higher engineering quality. The exceptions encapsulate the error cases better, and they also manage the Ledger Transport lifecycle, which was a flaw of the previous implementation. We use them in keep-core too.
We use @0x/subproviders for the Ledger/Trezor integration.

@ledgerhq/hw-app-eth is being upgraded as an older version was installed by accident.
"Stolen" from the Compound dApp. We'll leave these here as a placeholder, until we get the real UX in.
This introduces a custom LedgerSubprovider, which mitigates the existing 0x LedgerSubprovider's failure to produce the correct transaction signature values.
Colocate connector with other wallet info
We don't need this anymore - it was only supported by InjectedConnector and didn't appear to be useful for our case anyways.
Copy link
Contributor

@ironng ironng left a comment

Choose a reason for hiding this comment

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

Just need to figure out how we are sourcing CHAIN_ID and ETH_RPC_URL in the wallet component, otherwise this looks good to me!

@mhluongo
Copy link
Member

Let's get this dooonnnnneeeee

@r-czajkowski
Copy link
Contributor

Added a config.json file with map networkId -> wsURL. Not sure about wsURLs. Also opened PR in the tbtc.js repo which adds helper function that returns network id from tbtc artifact. See keep-network/tbtc.js#55

@Shadowfiend Shadowfiend self-assigned this Jul 24, 2020
ironng
ironng previously approved these changes Jul 24, 2020
@Shadowfiend Shadowfiend mentioned this pull request Jul 24, 2020
4 tasks
@r-czajkowski
Copy link
Contributor

@Shadowfiend, @ironng could you double-check if everything works, please?

@Shadowfiend
Copy link
Contributor

I probably won't have a chance to do it before merging (though I'll test-drive it on Ropsten).

We do still need to do a tbtc.js version bump, which means we'll need to bump the dependency, which means to release this we'll also need a tbtc contract release.

@r-czajkowski
Copy link
Contributor

Yeah, I see. For local dev, we can use npm link to link the local version of tbtc.js to tbtc-dapp.

@Shadowfiend
Copy link
Contributor

Shadowfiend commented Jul 24, 2020

That will work with a local network, but the current version of tbtc.js is incompatible with the current version of Ropsten* tbtc contracts due to some function name changes. We're about to land a handful of additional such changes today or Monday, and will need to update tbtc.js one more time---then we can do a full deploy.

@Shadowfiend Shadowfiend dismissed r-czajkowski’s stale review August 6, 2020 20:53

I believe these have been attended to.

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

Okayyyy let's do this thing.

@Shadowfiend Shadowfiend merged commit 47675e9 into master Aug 6, 2020
@Shadowfiend Shadowfiend deleted the heath-ledger branch August 6, 2020 23:08
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.

None yet

5 participants