Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/scss/theme/_markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
text-align: left;
padding: 1.2rem;
}

code {
font-family: var(--font-mm-sans-mono);
font-size: 80%;
}
}

details {
Expand Down
16 changes: 15 additions & 1 deletion wallet/reference/multichain-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| ---- | ----------- | --------------- |
Copy link
Contributor

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_createSession

Copy link
Contributor

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).

| 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` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we aren't technically firing this yet. thoughts, @adonesky1 ?

| 5300 | Invalid `scopedProperties` requested | `wallet_createSession`|
Copy link
Contributor

Choose a reason for hiding this comment

The 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` |
Loading