cosmos / chain-registry

Creative Commons Attribution 4.0 International
515 stars 1.25k forks source link

Make Keplr Suggest Chain derivable from Registration #404

Closed JeremyParish69 closed 2 years ago

JeremyParish69 commented 2 years ago

Keplr wallet, being a leadier wallet among the comsos, it makes sense to keep in mind how the Cosmos Chain Registry can cooperate with the Wallet's API. As per Keplr's Suggest Chain documentation, we need many input parameters in order to properly and completely add a chain to a user's Keplr walllet if not already added as a default chain (most aren't). Currently, many dapp frontends have to have hardcoded every chain's corresponding values to work with the Keplr API. It would be nice to have all the required data be registered to the Cosmos Chain registry so that each dapp doesn't have to individually maintain their own copy--simply update the chain registry which updates for all dapps.

Although much of the information is already added to the chain registry, there is much info that isn't. Here is what the ChainInfo interface accepts:

Personally thinking that, to save from having to make several lists of tokens in chain.json, one for staking, one for fees, one for governance, and more for whatever functions may arise in the future, I think these should probably just be properties under the corresponding tokens in assetlist.json. Imagine a chain where fees are payable by any token on the chain--that'd require essentially repeating the entire assetlist in the chain.json file, and any token additions would require an update to both files, when it could've been done in just one file.

JeremyParish69 commented 2 years ago

Perhaps the discussion on IBC properties should be continued on #39

JeremyParish69 commented 2 years ago

Discussion for cosmos sdk version can be continued on #40

JeremyParish69 commented 2 years ago

Discussion of identifying staking and fee assets (and gas step?) can continue on #126

JeremyParish69 commented 2 years ago

Discussion of whether and how to include cosmwasm data can continue on #419

JeremyParish69 commented 2 years ago

Should we add ability for WalletUrl and WalletUrlForStaking?

pyramation commented 2 years ago

prototyping this here

module: https://www.npmjs.com/package/@chain-registry/keplr code: https://github.com/cosmology-tech/chain-registry/blob/main/packages/keplr/src/index.ts

JeremyParish69 commented 2 years ago

Keplr's suggest chain API feature is now theoretically fully derivable from data that can be stored on the Chain Registry! Next step is to fill in missing data that other dApps already have and bring it over to the Chain Registry.