Skip to main content

Error codes

All known errors we wrap adding some extra fields to make it easier controlling exceptions. Also, it's possible to use message field of Error object to inform users about the details of exception.

Additional fields to Error object:

  • code: number - error code
  • codeDesc: string - error code definition

This table lists the error code information returned by the SolidoSDK when it is called.

Error codeError code definitionMessage
100CANNOT_CONFIRM_TRANSACTIONGot error from Solana blockchain during transaction confirmation, so this error could have different messages (signature is not base58 encoded/transaction was not confirmed in N seconds/signature has invalid length etc.)
200NO_VALIDATORSCouldn't fetch validators list
300UNSUPPORTED_CLUSTERSolidoSDK doesn't support devnet, specify mainnet-beta or testnet
301UNSTAKE_UNAVAILABLESorry, unStake is not available right now. Please contact lido developers for details.
302NO_PUBLIC_KEYSolidoSDK: publicKey is null in wallet
303NO_ACCOUNT_INFOCouldn't fetch getAccountInfo
304NO_APY_DATACouldn't fetch apy data
400EXCEED_MAXAmount must not exceed MAX(..)


try {
const { transactionHash, stSolAccountAddress } = await solidoSDK.stake({
amount: 20, // The amount of SOL-s which need to stake
wallet: wallet, // Wallet instance with 1 Sol left
} catch (error) {
console.error(error.code); // -> 400
console.error(error.codeDesc); // -> 'EXCEED_MAX'
console.error(error.message); // -> 'Amount must not exceed MAX(0.9988)'