Errors the DogeOS SDK throws or passes on, as of @dogeos/dogeos-sdk 4.0.7. To handle them in your app, see Handle Wallet Errors.
Wallet Error Codes#
Wallet errors carry a numeric code. Check them with isWalletError(error, code).
| Code | WalletErrorCode | Meaning |
|---|---|---|
4001 | UserRejected | The user rejected the request, or closed the connect modal without connecting |
4100 | Unauthorized | The dApp isn’t authorized for this account or method |
4200 | UnsupportedMethod | The wallet doesn’t support the method |
4900 | Disconnected | No wallet is connected, or the wallet disconnected before the request finished |
4901 | ChainDisconnected | The wallet isn’t connected to the requested chain family |
4902 | UnsupportedChain | The wallet doesn’t know the chain |
-32602 | Invalid parameters. In MyDoge: the chain ID doesn’t match the active network | |
-32603 | Internal error. In MyDoge 3.1.1 and later: a transaction failed after the user approved it | |
-1 | In MyDoge: a generic error with the message Unknown. For a network switch, it means cancelled or not supported; it also covers failed read calls and malformed requests |
Inside MyDoge, cancelling a network switch rejects with -1, not 4001.
Connection Messages#
| Message | Code | Cause |
|---|---|---|
The connect modal was closed before a wallet connected. | 4001 | useWalletHost().connect() in a browser, when the user closes the modal |
MyDoge cannot connect <chainType> accounts here. | 4901 | useWalletHost().connect() inside MyDoge with a chain family MyDoge doesn’t offer |
MyDoge did not offer a wallet to connect. Reload the page and try again. | 4900 | useWalletHost().connect() inside MyDoge when no MyDoge wallet is available |
The wallet provider was unmounted. | 4900 | WalletConnectProvider unmounted while a connection was pending |
The wallet was disconnected before the connection finished. | 4900 | Inside MyDoge, a disconnect overtook a pending connection |
Wallet disconnected before request started | 4900 | Inside MyDoge, a queued request was cancelled by a disconnect |
Wallet is already connected | useWalletConnect().connect() with the same wallet and chain family already connected | |
Wallet connection did not return an address | The wallet connected without returning an account | |
Provider not available for this chain type | useWalletConnect().connect() for a chain family the wallet doesn’t support | |
Wallet is performing an action, please wait... | A wallet action started while another was still running | |
WalletConnect requires config.walletConnectProjectId. | WalletConnect was chosen without a project ID | |
Unable to connect the authenticated DogeOS wallet. | The signed-in DogeOS account has no wallet the SDK could connect |
Account Action Messages#
| Message | Cause |
|---|---|
Wallet not connected | signMessage() or signInWithWallet() with no wallet connected |
Message is required | signMessage() with an empty message |
Invalid chain ID | switchChain() with a chainInfo.id the SDK can’t read |
Sign-in chain ID does not match the connected wallet | signInWithWallet() with a chainId other than the connected chain |
Sign-in address does not match the connected wallet | signInWithWallet() with an address other than the connected account |
A valid connected EVM chain ID is required | signInWithWallet() on EVM when the connected chain ID can’t be read |
switchChain Not supported in <chainType> | switchChain() with chainType set to Solana or Dogecoin |
Failed to sign in | signInWithWallet() failed without a more specific error |
Sign-In Messages#
| Message | Code | Cause |
|---|---|---|
Authentication popup was blocked. | temporarily_unavailable | useDogeOSAuth().login() or reauthenticate() was called outside a click handler |
A DogeOSHostError | unavailable_in_native_host | useDogeOSAuth().login() or reauthenticate() inside MyDoge |
Sign-in errors from useDogeOSAuth() are Error objects with a string code. The type of code isn’t exported; get it from the auth state:
import type { DogeOSAuthFacade } from "@dogeos/dogeos-sdk"
type AuthErrorCode = Extract<DogeOSAuthFacade["state"], { kind: "error" }>["error"]["code"]Configuration and Setup Messages#
| Message | Cause |
|---|---|
config.clientId is required. | clientId is missing or blank |
config.<field> is SDK-owned and cannot be overridden by consumers. | The config sets services or authClient, which the SDK manages |
<hook> must be used within WalletConnectProvider | A hook ran in a component outside WalletConnectProvider |
Failed to fetch chains: <status> | getChains() couldn’t reach the chain list |
Invalid chains API response | getChains() received an unreadable chain list |
Web3 Assets returned no chain configuration. | getChains() received an empty chain list |
dApp Link Errors#
getMyDogeDappLink() and getDappHref() throw a TypeError:
| Message | Cause |
|---|---|
Expected an absolute https URL for a MyDoge dApp link, got "<url>" | The target isn’t a valid absolute URL |
Expected an absolute https URL without credentials for a MyDoge dApp link, got "<url>" | The target isn’t https, or contains a username or password |
MyDoge dApp link targets must be at most 8192 bytes | The target is longer than 8 KiB |
Startup Messages#
WalletConnectProvider shows these in place of its children:
| Text | When |
|---|---|
Preparing wallet connection… | While the SDK starts, inside MyDoge and in mobile browsers until the page has loaded |
MyDoge is not ready to connect. Retry, or close and reopen this dApp. | Inside MyDoge, when the wallet isn’t ready after 5 seconds; shown with Retry |
Wallet connection is not ready. Retry after the page finishes loading. | In a mobile browser, when the page hasn’t loaded after 5 seconds; shown with Retry |
See Troubleshooting for fixes.