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

Add Trezor wallet connector #206

Merged
merged 19 commits into from
Jul 3, 2020
Merged

Add Trezor wallet connector #206

merged 19 commits into from
Jul 3, 2020

Conversation

liamzebedee
Copy link
Contributor

@liamzebedee liamzebedee commented Apr 16, 2020

This PR implements wallet support for Trezor. It introduces a custom subprovider and connector, so as to support our internal testnet's chainId.

  • Inject RPC URL and chain ID

Depends on: #205

Epic: #177

There's a known issue that Trezor's API will throw for larger network ID's. Next commit should fix that.
Much like our Ledger subprovider, this provider mitigates issues with the Trezor subprovider provided by 0x - namely, chainId's < 255 are not supported.
@liamzebedee liamzebedee marked this pull request as ready for review April 17, 2020 05:00
src/connectors/trezor.js Outdated Show resolved Hide resolved
src/connectors/trezor.js Outdated Show resolved Hide resolved
src/components/lib/ConnectWalletDialog.js Outdated Show resolved Hide resolved
The `AbstractConnector` returns only first account by default. With our
custom implementation of `TrezorConnector` allows users to get eg. 15
accounts and sotres the selected account. The `TrezorConnector`
overrides a `getAccount` fn from the `AbstractConnector`, and this
function returns a selected account instead of the first account.
The ChooseAccount component allows user to choose a any address from the
hardware wallet.
Extracted the components from the `ConnectWalletDialog` component into separate
functional components.
Pass a number of accounts arg to the `getAccounts` fn in the trezor
provider and set to default value (15).
Removed unused variables, used a common functions.
src/connectors/utils.js Outdated Show resolved Hide resolved
{(chosenWallet.name && !active) &&
<ConnectToWalletStep
wallet={chosenWallet}
error={error}onTryAgainClick={reconnectWallet}
Copy link
Contributor

Choose a reason for hiding this comment

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

Spacing and indentation is odd here but we can fix it when we do a pass with prettier

@ironng
Copy link
Contributor

ironng commented Jul 3, 2020

@r-czajkowski going to merge - looks like you've addressed all your comments! 🙇‍♀️ If there is anything else we can do it on the heath-ledger one.

@ironng ironng merged commit 6753685 into heath-ledger Jul 3, 2020
@ironng ironng deleted the tresor-317-integration branch July 3, 2020 02:09
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

3 participants