CAIPs icon indicating copy to clipboard operation
CAIPs copied to clipboard

Question about CAIP-25

Open romeo4934 opened this issue 5 years ago • 3 comments

At starname.me, we are happy to use CAIP-25 to get the list of all accounts of a wallets to synchronise wallet addresses into a starname in a very smooth way (https://docs.starname.me/for-wallets/integration-with-wallet-connect-and-the-starname-manager). However two things pops into my mind:

  • it would be great to be able to get the list of accounts of a wallet without specifying the list of chain-id (CAIP-2) the wallet is currently supporting, otherwise you need to know on advance which chain-id to query for each wallet. How to solve this issue with CAIP-25? or Should we create another CAIP to query a wallet and get the list of the chain-id the wallet support?

  • to synchronise accounts into a starname, we don't need any method permission so we would have "method" set to an empty array like []. We just want to get the list of accounts that the wallet supports and being returned as a result by CAIP-25.

What do you think @pedrouid ?

romeo4934 avatar Oct 30 '20 17:10 romeo4934

That's a great question and I think we should add wildcards to the spec

This could be used in two ways:

  • Get multiple accounts for a specific chainId namespace
chains:["eip155:*"] -> accounts:["0xD48F0F5e14262C48961314718113344C770A16B7@eip155:1", "0xD48F0F5e14262C48961314718113344C770A16B7@eip155:5"]
  • Get multiple accounts for any chainId namespace
chains:["*"] -> accounts:["0xD48F0F5e14262C48961314718113344C770A16B7@eip155:1", "cosmos1t2uflqwqe0fsj0shcfkrvpukewcw40yjj6hdc0@cosmos:cosmoshub-3"]

Alternatively we could just take your approach which honestly it's much simpler and it doesn't break any regex rules for CAIP:2

pedrouid avatar Nov 03 '20 14:11 pedrouid

Up to you! I think the Regex is fine. I will submit a PR

romeo4934 avatar Nov 03 '20 20:11 romeo4934

#29 I did this PR following your suggestions

romeo4934 avatar Nov 12 '20 15:11 romeo4934