UNPKG

@keyban/sdk-base

Version:

Keyban Javascript SDK provides core functionalities for the MPC wallet solution, supporting web and Node.js apps with TypeScript, custom storage, and Ethereum blockchain integration.

2 lines 3.62 kB
var n=class extends Error{type;title;instance;status;detail;timestamp;rootError;toJSON(){return {type:this.type,title:this.title,instance:this.instance,status:this.status,detail:this.detail,timestamp:this.timestamp,rootError:this.rootError}}constructor({type:r,title:t,instance:o,rootError:y,detail:s,status:h}){super(s??t??r),this.type=r,this.title=t??r,this.instance=o,this.detail=s,this.status=h,this.timestamp=new Date().toISOString(),this.rootError=y;}};var d=(s=>(s.GenerateKey="GenerateKey",s.ExportKey="ExportKey",s.ImportKey="ImportKey",s.Encrypt="Encrypt",s.Decrypt="Decrypt",s))(d||{}),i=class a extends n{static types=d;constructor(r,t,o){super({type:r,instance:t,rootError:o,title:a.#r(r)});}static#r(r){switch(r){case "GenerateKey":return "Error generating a cryptographic key";case "ExportKey":return "Error exporting a cryptographic key";case "ImportKey":return "Error importing a cryptographic key";case "Encrypt":return "Error encrypting data";case "Decrypt":return "Error decrypting data";default:return `Unknown error type: ${r}`}}};var u=(t=>(t.InvalidOrigin="InvalidOrigin",t.InvalidCall="InvalidCall",t))(u||{}),c=class a extends n{static types=u;constructor(r,t,o){super({type:r,instance:t,rootError:o,title:a.#r(r)});}static#r(r){switch(r){case "InvalidOrigin":return "The current domain is not allowed for this appId";case "InvalidCall":return "Invalid method call, either the method does not exists or is not allowed";default:return `Unknown error type: ${r}`}}};var l=(r=>(r.InvalidToken="InvalidToken",r))(l||{}),p=class a extends n{static types=l;constructor(r,t,o){super({type:r,instance:t,rootError:o,title:a.#r(r)});}static#r(r){switch(r){case "InvalidToken":return "You provided an invalid access token";default:return `Unknown error type: ${r}`}}};var E=(e=>(e.UnknownTransactionError="UnknownTransactionError",e.UnknownIframeRpcError="UnknownIframeRpcError",e.AddressInvalid="AddressInvalid",e.AmountInvalid="AmountInvalid",e.AmountRequired="AmountRequired",e.AmountIrrelevant="AmountIrrelevant",e.RecipientAddressEqualsSender="RecipientAddressEqualsSender",e.EstimateGasExecution="EstimateGasExecution",e.InsufficientFunds="InsufficientFunds",e.InvalidNftStandard="InvalidNftStandard",e.NftNotFound="NftNotFound",e.TokenBalanceNotFound="TokenBalanceNotFound",e))(E||{}),m=class a extends n{static types=E;constructor(r,t,o){super({type:r,instance:t,rootError:o,title:a.#r(r)});}static#r(r){switch(r){case "UnknownTransactionError":return "An unknown error occurred with the transaction";case "UnknownIframeRpcError":return "An unknown error occured with iframe rpc call";case "AddressInvalid":return "Address is invalid";case "AmountInvalid":return "The specified amount is invalid";case "AmountRequired":return "An amount is required for this operation";case "AmountIrrelevant":return "The amount provided is irrelevant and should not be included";case "RecipientAddressEqualsSender":return "Recipient address cannot be the same as the sender address";case "EstimateGasExecution":return "Gas estimation failed";case "InsufficientFunds":return "Insufficient funds to complete the transaction";case "InvalidNftStandard":return "Invalid NFT standard. Supported standards are ERC721 and ERC1155";case "NftNotFound":return "NFT not found with the provided contract address and token ID";case "TokenBalanceNotFound":return "Token balance not found with the provided contract address";default:return `Unknown error type: ${r}`}}};export{n as a,d as b,i as c,u as d,c as e,l as f,p as g,E as h,m as i};//# sourceMappingURL=chunk-VGFAFYVC.mjs.map //# sourceMappingURL=chunk-VGFAFYVC.mjs.map