import { ErrorCodes , ITkeyError , TkeyError } from "@tkey/common-types" ; class ShareSerializationError extends TkeyError { protected static messages : ErrorCodes = { 7000 : "Custom" , 7010 : "Type is not supported" , 7011 : "Invalid Entropy" , 7012 : "Invalid Checksum" , 7013 : "Invalid mnemonic" , } ; code : number ; message : string ; public constructor ( code , message ? ) { super ( code , message ) ; Object . defineProperty ( this , "name" , { value : "ShareSerializationError" } ) ; } public static fromCode ( code , extraMessage = "" ) { return new ShareSerializationError ( code , `${ ShareSerializationError . messages [ code ] }${ extraMessage }` ) ; } public static default ( extraMessage = "" ) { return new ShareSerializationError ( 7000 , `${ ShareSerializationError . messages [ 7000 ] }${ extraMessage }` ) ; } public static typeNotSupported ( extraMessage = "" ) { return ShareSerializationError . fromCode ( 7010 , extraMessage ) ; } public static invalidEntropy ( extraMessage = "" ) { return ShareSerializationError . fromCode ( 7011 , extraMessage ) ; } public static invalidChecksum ( extraMessage = "" ) { return ShareSerializationError . fromCode ( 7012 , extraMessage ) ; } public static invalidMnemonic ( extraMessage = "" ) { return ShareSerializationError . fromCode ( 7013 , extraMessage ) ; } } export default ShareSerializationError ;