shapeshift / web

ShapeShift Web
https://app.shapeshift.com
MIT License
171 stars 181 forks source link

Phantom support for imported HW wallet accounts #7973

Open 0xean opened 3 weeks ago

0xean commented 3 weeks ago

Currently in prod (with solana flag enabled) if you attempt to connect phantom wallet for an imported ledger account the app enters an error state and phantom throws the following:

Screenshot 2024-10-21 at 12 04 16 PM

We should allow phantom to be used even when an EVM based account is not present

0xean commented 3 weeks ago

https://jam.dev/c/0eeab9c6-1578-4f10-80fa-d7be593683b7

gomesalexandre commented 3 weeks ago

Going to try and repro @0xean - assuming Solana support, we should definitely be able to connect to at least Solana and handle failures gracefully. @NeOMakinG could confirm but iirc pairing is only done on EVM accounts, and so is the deviceId for Phantom, which would explain why this happens.

gomesalexandre commented 3 weeks ago

@0xean looks like a chicken and egg scenario here - we need to request ETH permissions (or Solana permissions, same idea in case we're trying to connect to Solana with only ETH account present) in Phantom to try and get accounts and check for support, but we would like to know support before doing said request, so this looks like a feature with no technical inherently possible with our multichain nature, unless we did the same thing for Phantom that we do for Ledger (remove autodiscovery and make users add chains one by one).

Can you confirm you're eventually able to connect? i.e I do see the one error popup from the eth_request, though can eventually see Solana accounts here

https://jam.dev/c/445eb069-e9f0-45e2-835e-8094147571f8

gomesalexandre commented 3 weeks ago
image

Not sure if we want to spent such UX effort on that feature but this could be a relatively quick win @twblack88 (which just happen not to work on jumper with hardware wallets not supported the selected chain, btw, just a dead click)

0xean commented 2 weeks ago

Hmm....

I think it might be a quick and dirty option to reverse the order of this, so instead we connect Solana first on phantom and then later check for ETH / BTC... which may ofc fail. At that point, alteast the user has connected their wallet succesfully.

I was NOT able to get connected at all when I first opened this ticket, but can try again to confirm

0xean commented 2 weeks ago

And also agree that perhaps the Ledger like flow is ideal for Phantom. Always connect Solana and then ask about other chains. @twblack88 ?

twblack88 commented 2 weeks ago

Yeah, always connect solana and detect other chins would be smart.

and would capture the ledger with a phantom wrapper use case right?

gomesalexandre commented 2 weeks ago

Going to give a try to "assume Solana support" for deviceId and initial connection @0xean @twblack88