-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add multichain error codes #2063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -383,4 +383,18 @@ according to [CAIP-217](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/c | |
} | ||
} | ||
} | ||
``` | ||
``` | ||
|
||
## Error codes | ||
|
||
The Multichain API can return the following JSON-RPC error codes: | ||
|
||
| Code | Description | Related methods | | ||
| ---- | ----------- | --------------- | | ||
| 5000 | Unknown error with request | `wallet_revokeSession`, `wallet_createSession` | | ||
| 5100 | Requested networks are not supported | `wallet_createSession` | | ||
| 5101 | Requested methods are not supported | `wallet_createSession` | | ||
| 5102 | Requested notifications are not supported | `wallet_createSession` | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we aren't technically firing this yet. thoughts, @adonesky1 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lol do we fire any of these errors? 5100, 5101, 5102, 5300? I'm pretty sure we've decided all of these are way too restrictive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also don't see 5300 or 5301 thrown anywhere in our code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should remove these from the OpenRPC doc: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only one of these errors I can see us actually throwing all the way through to the dApp is 5302 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry actually we also throw 5100 so its just 5100 and 5302 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created a ticket to do cleanup of this in the YAML file and |
||
| 5300 | Invalid `scopedProperties` requested | `wallet_createSession`| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i believe we treat this as invalid scope object and simply ignore the scopeobject. thoughts, @adonesky1 ? |
||
| 5301 | `scopedProperties` can only be outside of `sessionScopes` | `wallet_createSession`| | ||
| 5302 | Invalid `sessionProperties` requested | `wallet_createSession` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vandan @adonesky1 we're firing
-32603
on wallet_revokeSession, same for wallet_createSessionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I don't see error codes in that range anywhere in the CAIP standards for this so it seems like we should instead map any errors fired to codes in the 5000 range (ex. 5500, 5501, or 5502 for
wallet_revokeSession
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should throw CAIP-25's unknown error code (5000) instead of -32602 here