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

Add tally wallet #506

Merged
merged 78 commits into from
May 12, 2022
Merged

Add tally wallet #506

merged 78 commits into from
May 12, 2022

Conversation

0xzoz
Copy link
Contributor

@0xzoz 0xzoz commented Apr 7, 2022

Preliminary work to be able to use the Tally Ho wallet in the Shapeshift app. The new tally-hdwallet package is mostly similar to the Metamask package but refactored for Tally.

Testing

Was built as a standalone wallet here and imported to in the Shapeshift UI. All tests succeeded. It was then modified to use the @shapeshiftoss namespace. I'm unsure how these packages are built but I'm guessing it's during the CI?

@vercel
Copy link

vercel bot commented Apr 7, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shapeshift/hdwallet/2wqytyTi8cRS2wDwSwfHLjpkuqqa
✅ Preview: https://hdwallet-git-fork-0xzoz-add-tally-wallet-shapeshift.vercel.app

Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

LGTM, a few comments regarding references to Metamask that should be changed to Tally.

Suggesting changes as this doesn't build yet (running yarn && yarn build and cding into packages/hdwallet-tally there is no dist folder). An entry should be added in the root tsconfig https://github.com/shapeshift/hdwallet/blob/master/tsconfig.json#L63 :

diff --git a/tsconfig.json b/tsconfig.json
index 09798d13..19bdf295 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -60,6 +60,7 @@
     { "path": "./packages/hdwallet-portis" },
     { "path": "./packages/hdwallet-trezor" },
     { "path": "./packages/hdwallet-trezor-connect" },
-    { "path": "./packages/hdwallet-xdefi" }
+    { "path": "./packages/hdwallet-xdefi" },
+    { "path": "./packages/hdwallet-tally" }
   ]
 }

Tested it out locally and it successfully builds a packages/hdwallet-tally/dist folder after this entry is added.

packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/ethereum.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/ethereum.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/ethereum.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/ethereum.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@mrnerdhair mrnerdhair left a comment

Choose a reason for hiding this comment

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

  • There's a bunch of quality improvements needed that haven't made it into the main hdwallet-metamask package yet; not your fault, but we do need to make sure we're not multiplying the maintenance problems via cut-n-paste.
  • This will need unit and integration tests; you may find hdwallet-xdefi a good starting point for those.

packages/hdwallet-tally/package.json Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/tsconfig.json Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
packages/hdwallet-tally/src/tally.ts Outdated Show resolved Hide resolved
@pastaghost
Copy link
Collaborator

@0xzoz Does the Tally wallet support offline signing?

Copy link
Contributor Author

@0xzoz 0xzoz left a comment

Choose a reason for hiding this comment

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

Addressed the comments and issues @0xdef1cafe @pastaghost. Please let me know if there is anything else

packages/hdwallet-tallyho/src/adapter.ts Outdated Show resolved Hide resolved
packages/hdwallet-tallyho/src/adapter.ts Outdated Show resolved Hide resolved
packages/hdwallet-tallyho/src/adapter.ts Show resolved Hide resolved
return wallet;
}

public async detectTallyProvider(): Promise<TallyHoEthereumProvider | null> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public async detectTallyProvider(): Promise<TallyHoEthereumProvider | null> {
/**
* Tally works the same way as metamask.
* This code is copied from the @metamask/detect-provider package
* @see https://www.npmjs.com/package/@metamask/detect-provider
*/
private async detectTallyProvider(): Promise<TallyHoEthereumProvider | null> {

@cjthompson cjthompson dismissed stale reviews from mrnerdhair, gomesalexandre, 0xdef1cafe, and pastaghost May 12, 2022 17:49

changes made

@0xdef1cafe 0xdef1cafe merged commit 84e453a into shapeshift:master May 12, 2022
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.

7 participants