Error Codes
These are the standard AIP-62 wallet adapter error codes StarKey returns:
| Code | Name | Meaning |
|---|---|---|
4000 | No Accounts | No accounts found in the wallet. |
4001 | User Rejection | User declined the request. |
4100 | Unauthorized | The requested method and/or account has not been authorized by the user. |
Handling errors
Wrap calls to connect, signAndSubmitTransaction, signTransaction, and signMessage in try/catch — the user can decline any of these prompts at any point.
try {
await connect('StarKey Wallet')
} catch (error) {
// { code: 4001, message: 'The user rejected the request.' }
}Related pages
Last updated on