Address component
Let's introduce a component to parse any arbitrary account address so it can be displayed in a variety of ways depending on the props. E.g. "Gaming Account 1" or the truncated address (e.g. "0xEqT...83x")
Specification
- Unformatted so it can be populated within other components such as Cell, Row, plain text, etc
Props
- address: String
- raw: Boolean
- jazzicon: Boolean
- displayName: Boolean
- truncate: Boolean
To be defined
- accountID: String
I think we should add a requirement for the address to be a CAIP-10 address. We may also need the chain ID information if we decide to customize the address display per chain.
The accountId is a good addition if account Snaps will use this component to display managed accounts, as it's the preferred way to identify managed accounts within MetaMask and account Snaps.
I think we should add a requirement for the address to be a CAIP-10 address. We may also need the chain ID information if we decide to customize the address display per chain.
The address prop already supports CAIP-10 addresses, so we should be good on that front.
The
accountIdis a good addition if account Snaps will use this component to display managed accounts, as it's the preferred way to identify managed accounts within MetaMask and account Snaps.
Curious if it wouldn't be better for the Snap to explicitly choose the CAIP-10 address it wants to display, instead of us maintaining the logic to choose that based on an account ID. At least that seems to match better what we were planning for AccountSelector etc. WDYT?
Curious if it wouldn't be better for the Snap to explicitly choose the CAIP-10 address it wants to display, instead of us maintaining the logic to choose that based on an account ID. At least that seems to match better what we were planning for AccountSelector etc. WDYT?
Agreed, it makes sense for the Address component to expect an address. I think I confused it with the Account component, which could have an accountId prop.