cardano-foundation / CIPs

Cardano Improvement Proposals (CIPs)
https://cips.cardano.org/
Creative Commons Attribution 4.0 International
507 stars 319 forks source link

CIP-0030: API to enumerate avilable wallets #253

Open rosieks opened 2 years ago

rosieks commented 2 years ago

Please provide API to enumerate wallets available for dApp. Right now the only way is to iterate over properties in window.cardano but this lead to duplicated entries if you have Eternl installed as due to avoid breaking changes to existing apps it's exposed twice via: window.cardano.ccvault and window.cardano.eternl

Mercurial commented 2 years ago

I do something like this https://github.com/ADAPhilippines/Bifrost/blob/203b0a54c2b7ff691274ce45dd2c5747ebe7fb52/src/Bifrost.ts#L34

rosieks commented 2 years ago

I do something similar but then ccvault/eternl is twice as it's exposed as window.cardano.ccvault and window.cardano.eternl. And yoroi is not there as they don't have icon property - but maybe that's actually good because they are missing a lot of APIs

GGAlanSmithee commented 1 year ago

I do something similar - but much less accurate - https://github.com/GGAlanSmithee/use-cardano/blob/main/src/hooks/use-wallet-providers.tsx#L17. I think this issue is valid, what would the path be to move this to an actual CIP or ammendment? Just make a CPS?

rphair commented 1 year ago

@GGAlanSmithee the last resolution of the CIP editors (it was back when minutes were still being transcribed into the repo, so you can probably find it) was for additional features for CIP-0030 to be submitted as CIPs with new numbers, because (as I remember; @KtorZ may remember in more detail or correct me if I'm wrong):

  1. the CIP-0030 document was getting too big
  2. tagging additional features for the API with CIP numbers would provide a convenient way of indicating support for a new feature set (i.e. indicating "supports CIP-0XXX" rather than having to describe the feature)

I don't work in this area so I can't advise about the right way of enumerating the available wallets. If there is a straightforward implementation that everyone can agree on quickly to do that, it should definitely be a CIP (with a Path to Active that drives adoption by wallets) rather than a CPS (with only a vague incentive for wallets to support the enumeration somehow).

(edit, p.s.: some of this may also apply to your last posting in https://github.com/cardano-foundation/CIPs/pull/151#issuecomment-1336376766)

GGAlanSmithee commented 1 year ago

@rphair many thanks for your quick reply. I will try to move this to a CIP then, since I think it could easily be done in the bridge API itself with introspection, much like @Mercurial does it.

Regarding #151 I'm a bit more hesitant because I am not a wallet provider, but rather a consumer and idk the implications for the different implementations. As a consumer, i like how nami does it though.