There can sometimes be an issue e.g. getting the Neutron address, which then results in the Cosmos-prefixed address being used instead. This could happen because:
Maybe just outright give an error and tell them to refresh? or retry if we get errors?
If we're confident that simply converting an address with a bech32 prefix like "cosmos" into one with the correct bech32 prefix is 100% safe, we could consider doing this
I am not confident that swapping out the bech32 prefix is sufficient. There may be utilities to correctly convert it but given the noise that incorrect addresses have made already, it seems safer to just error.
There can sometimes be an issue e.g. getting the Neutron address, which then results in the Cosmos-prefixed address being used instead. This could happen because:
The
SelfButton
address is retrieved here https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/neutron/src/features/transfer/TransferTokenForm.tsx#L390which uses this logic https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/neutron/src/features/wallet/hooks.tsx#L137-L152
which gets a list of accounts from
useAccounts
, which iiuc tries to get an address for each Cosmos chain in this call https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/neutron/src/features/wallet/hooks.tsx#L88. This includescosmoshub
in the addresses, and if it's unable to get an address for a chain then it's just skipped. Something must've happened here with the Neutron address, where the Neutron address wasn't able to be retreived. This is consistent with there being no neutron wallet address on the SideBarMenu as shown in https://discord.com/channels/935678348330434570/935678477246554132/1175864482430451722Back in the logic for deciding what address to use for
Self
, we fallback to the first address if we can't find an address for the desired chain. The first address must be the cosmoshub one https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/neutron/src/features/wallet/hooks.tsx#L146-L151Some suggestions: