Error Messages and Codes

When making requests to Phantom in Establishing a Connection, Sending a Transaction, or Signing a Message, Phantom may respond with an error. The following is a list of all possible error codes and their meanings. These error messages are inspired by Ethereum's EIP-1474 and EIP-1193.

Typically, these errors will be easily parseable and have both a code and an explanation. For example:

try {
  await window.solana.signMessage();
} catch (err) {
  //  {code: 4100, message: 'The requested method and/or account has not been authorized by the user.'}
}

Last updated