import { ErrorCodes , ITkeyError , TkeyError } from "@tkey/common-types" ; class ShareTransferError extends TkeyError { protected static messages : ErrorCodes = { 8000 : "Custom" , 8010 : "Missing current enc key" , 8011 : "Current request already exists" , 8012 : "User cancelled request" , } ; code : number ; message : string ; public constructor ( code , message ? ) { super ( code , message ) ; Object . defineProperty ( this , "name" , { value : "ShareTransferError" } ) ; } public static fromCode ( code , extraMessage = "" ) { return new ShareTransferError ( code , `${ ShareTransferError . messages [ code ] }${ extraMessage }` ) ; } public static default ( extraMessage = "" ) { return new ShareTransferError ( 8000 , `${ ShareTransferError . messages [ 8000 ] }${ extraMessage }` ) ; } public static missingEncryptionKey ( extraMessage = "" ) { return ShareTransferError . fromCode ( 8010 , extraMessage ) ; } public static requestExists ( extraMessage = "" ) { return ShareTransferError . fromCode ( 8011 , extraMessage ) ; } public static userCancelledRequest ( extraMessage = "" ) { return ShareTransferError . fromCode ( 8012 , extraMessage ) ; } } export default ShareTransferError ;