hdwallet icon indicating copy to clipboard operation
hdwallet copied to clipboard

research: refactor adapter/wallet `initialize()`

Open mrnerdhair opened this issue 3 years ago • 3 comments

  • Makes initialize() on adapters private and removes unnecessary dummy implementations
  • Makes initialize() on wallets always return a boolean
  • On adapters with do have initialize(), it consistently turns a single device into a wallet. pairDevice() now picks the default device and delegates to wallet creation to initialize().

mrnerdhair avatar Feb 12 '22 06:02 mrnerdhair

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/5FxCTFauUujVVxodjgwoKdQUqxhT
✅ Preview: https://hdwallet-git-initialization-refactor-shapeshift.vercel.app

vercel[bot] avatar Feb 12 '22 06:02 vercel[bot]

for reference, I've checked axiom and platform-shared and neither use the return value of initialize() at all (beyond awaiting it).

mrnerdhair avatar Mar 04 '22 22:03 mrnerdhair

I've reopened this as a draft; will be doing some refactoring to work towards making this non-breaking. My goal is to get to an Adapter<WalletType extends HDWallet> type in core to replace e.g. https://github.com/shapeshift/web/blob/60ffe3ffaa2e2198c72ad475dabbdcaa88d65819/src/context/WalletProvider/WalletProvider.tsx#L20-L23

mrnerdhair avatar Apr 11 '22 16:04 mrnerdhair

closing as stale draft PR

0xean avatar Jan 23 '24 13:01 0xean