cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos ⚛️
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
173 stars 129 forks source link

`addChain` should return if a chain is already supported #474

Open pyramation opened 1 month ago

pyramation commented 1 month ago

So what im seeing now is that we are using the useChains hook, with some chains in there that are already in my Keplr wallet, but still they pop up as if they are new chains and need to be added to Keplr as new chain

https://github.com/cosmology-tech/cosmos-kit/blob/d5f38a315a29b5672f83504038ee083467c5ba3e/wallets/keplr-extension/src/extension/client.ts#L123-L140

for now, only do keplr mobile and keplr extension, you can leverage JSON from

https://github.com/cosmos/wallet-registry/blob/8a644ef3d1cadbb8ab240b969d381d07b79897e0/wallets/keplrextension/wallet.json#L8C3-L35C5

https://github.com/cosmos/wallet-registry/blob/8a644ef3d1cadbb8ab240b969d381d07b79897e0/wallets/keplrmobile/wallet.json#L8C2-L46C20

pyramation commented 1 month ago

modify this to have supportedChains? property that stores an array of chain names https://github.com/cosmology-tech/cosmos-kit/blob/d5f38a315a29b5672f83504038ee083467c5ba3e/packages/core/src/types/wallet.ts#L77