Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support CAIP-10 addresses in Snaps (#26799)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> Add support for showing CAIP-10 addresses in Snaps by introducing `SnapUIAddress`. This component mimics the original implementation of `ConfirmInfoRowAddress` but also adds parsing logic for CAIP-10 addresses. CAIP-10 addresses are parsed in the component and the address part is passed to the jazzicon or blockie implementation to render an avatar. The blockie implementation supports arbitrary strings and did not need to be altered. For jazzicons, this PR implements seed generation that is compatible with any address string by seeding the PRNG used for jazzicons with the normalized byte array of the address. Plain Ethereum addresses are still supported and will use the regular jazzicon seed generation logic. This PR will also need a release of the Snaps packages to update the JSX validation to allow passing CAIP-10 addresses. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26799?quickstart=1) <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <img width="385" alt="Screenshot 2024-09-02 at 14 35 33" src="https://github.com/user-attachments/assets/344d849b-9121-4bcb-bf58-8cb0b1286112"> <img width="384" alt="Screenshot 2024-09-02 at 14 45 30" src="https://github.com/user-attachments/assets/158e3421-4f9f-46e1-a4cf-93daec45db66">
- Loading branch information