Feat/caip 25 include examples of wallet methods#224
Conversation
| "methods": ["get_balance"], | ||
| "notifications": ["accountsChanged", "chainChanged"] | ||
| }, | ||
| "wallet": { |
There was a problem hiding this comment.
I'm unclear, are these methods:
- execution API methods defined in an eip155 namespace with empty scopes and empty chains or
- a new namespace named
walletfor chainagnostic methods that needs to be created based on thewallet_-prefixed subset of eip155 methods, with CAIP-169 thrown in for good measure?
If you meant this as (2), I would be glad to open a PR in namespaces, and if it's (1), it might also double as a convenient example of when scopes and accounts are both empty by design:
| "wallet": { | |
| "eip155": { | |
| "scopes":[], | |
| "acounts":[], |
Either way, give me a little more context here and I'll see if this helps us get over the line on consensus with 217!
There was a problem hiding this comment.
IMO the biggest advantage to renaming "namespaces" to "scopes" is that we get to define a set of methods and notifications which are not necessarily associated with a given chain or namespace
Many of these methods exist today in production (wallet_addEthereumChain, wallet_switchEthereumChain, wallet_watchAsset, wallet_getPermissions and wallet_requestPermisions) yet they are generic wallet methods which are not directly related to any chain
Plus it gets even more powerful once you add CAIP-169 methods ("wallet_creds_store", "wallet_creds_verify", "wallet_creds_issue" and "wallet_creds_present") which are also generic wallet methods that are not directly related to any chain
In my understanding, this PR describes an example that complies with CAIP-217 and CAIP-25 but I thought it was really important to showcase in the spec to share how powerful scopes are
There was a problem hiding this comment.
OK that sounds more like interpretation # 2 -- I was mostly just thinking ahead to how this relates to the OpenRPC/CAIP-211 stuff (i.e. what the implicit rpcDocuments are for the wallets namespace!), but happy to open a PR on namespaces (I like all examples to be currently-conformant at time of merge haha)
hmalik88
left a comment
There was a problem hiding this comment.
LGTM.
We do need to think about rpcDocuments for the wallet namespace like @bumblefudge mentioned, multiple wallets can have overlapping wallet_ methods.
Since we haven't merged #217 I thought it would be useful to include
wallet_prefixed methods to the CAIP-25 example to show how it would work with the new scopes