leather-io / extension

Leather browser extension
https://leather.io
MIT License
294 stars 141 forks source link

Switch account gradients to address-hash instead of public-key data #4487

Open janniks opened 11 months ago

janniks commented 11 months ago
[15:42]Andres: I’m trying to get the public key per account to generate the profile pic gradient that’s generated on Leather as well
[15:51]jannik: That might be tricky, I don't think they're exported on any of the interfaces right now. We could check with Leather if they want to generate from the address hash instead, then you would only need the address.
[15:52]Andres: I have tried with the address and still don’t get the same gradient pattern. I’m using their hook for generating this gradient tho
[15:53]jannik: Yeah it would be different colors, but maybe they are willing to switch as well, to allow this in the future.

:point_up: Might be interesting to switch to address-hash based account-gradients, so websites could show the same avatar in their UI

markmhendrickson commented 10 months ago

@kyranjamie curious if this is a simple change?

kyranjamie commented 10 months ago

This would be a fairly trivial change, not against it (though worth noting we're not committed to keeping the gradient).

Code that needs changing: 👇🏼 https://github.com/leather-wallet/extension/blob/3215076390bb92bffeec45d39200da24fc14170b/src/app/features/switch-account-drawer/components/switch-account-list-item.tsx#L74-L78

markmhendrickson commented 10 months ago

It appears @fbwoolf has already removed the custom gradient and replaced it with Vercel's package here. Though this issue's change should allow apps to show the same account-specific visual as the wallet, regardless of the one gradient / visualization technique we use.