UNPKG

@vechain/sdk-errors

Version:

This module is dedicated to managing and customizing errors within the VeChain SDK

8 lines 5.12 kB
var tr=Object.defineProperty;var er=(t,a)=>{for(var o in a)tr(t,o,{get:a[o],enumerable:true});};var v={};er(v,{CannotFindTransaction:()=>C,CertificateSignatureMismatch:()=>y,ContractCallError:()=>b,ContractDeploymentFailed:()=>D,InvalidAbiDataToEncodeOrDecode:()=>f,InvalidAbiItem:()=>i,InvalidAbiSignatureFormat:()=>g,InvalidAddress:()=>E,InvalidBloom:()=>d,InvalidBloomParams:()=>u,InvalidCommandLineArguments:()=>q,InvalidConfigurationFile:()=>T,InvalidConfigurationFilePath:()=>L,InvalidDataType:()=>j,InvalidHDKey:()=>h,InvalidHDKeyMnemonic:()=>O,InvalidHTTPParams:()=>V,InvalidHTTPRequest:()=>w,InvalidKeystore:()=>k,InvalidKeystoreParams:()=>K,InvalidOperation:()=>I,InvalidRLP:()=>A,InvalidSecp256k1MessageHash:()=>H,InvalidSecp256k1PrivateKey:()=>B,InvalidSecp256k1Signature:()=>M,InvalidTransactionField:()=>F,InvalidTransactionType:()=>P,JSONRPCInternalError:()=>Q,JSONRPCInvalidDefaultBlock:()=>X,JSONRPCInvalidParams:()=>G,JSONRPCInvalidRequest:()=>z,JSONRPCMethodNotFound:()=>W,JSONRPCMethodNotImplemented:()=>Z,JSONRPCParseError:()=>U,JSONRPCProviderError:()=>c,JSONRPCServerError:()=>Y,JSONRPCTransactionRevertError:()=>_,NotDelegatedTransaction:()=>R,PollExecution:()=>S,ProviderMethodError:()=>$,SignerMethodError:()=>J,UnavailableTransactionField:()=>N,UnsupportedOperation:()=>l,VechainSDKError:()=>r,assertInnerError:()=>x,createErrorMessage:()=>m,stringifyData:()=>p});var p=t=>JSON.stringify(t,(()=>{let o=new WeakSet;return (s,e)=>{if(typeof e=="object"&&e!==null&&s!==""){if(o.has(e))return;o.add(e);}return typeof e=="bigint"?e.toString()+"n":e}})(),2);function x(t){return t instanceof Error?t:new Error(`Inner error is not an instance of Error. Object: ${p(t)}`)}function m(t,a,o,s){let e=s?.message!==void 0?` -Internal error: ${s.message}`:"";return `Method '${t}' failed. -Reason: '${a}' -Parameters: ${p(o)}`+e}var r=class extends Error{constructor(o,s,e,n){super(m(o,s,e,n===void 0?void 0:x(n)));this.methodName=o;this.errorMessage=s;this.data=e;this.innerError=n;}};var f=class extends r{},i=class extends r{},g=class extends r{};var E=class extends r{};var d=class extends r{},u=class extends r{};var y=class extends r{};var D=class extends r{},b=class extends r{};var j=class extends r{},l=class extends r{};var O=class extends r{},h=class extends r{};var w=class extends r{},V=class extends r{};var k=class extends r{},K=class extends r{};var S=class extends r{};var $=class extends r{},c=class extends r{constructor(o,s,e,n,rr){super(o,e,{code:s,message:e,data:n},rr);this.methodName=o;this.innerError=rr;}},U=class extends c{constructor(o,s,e,n){super(o,-32700,s,e,n);this.methodName=o;this.innerError=n;}},z=class extends c{constructor(o,s,e,n){super(o,-32600,s,e,n);this.methodName=o;this.innerError=n;}},W=class extends c{constructor(o,s,e,n){super(o,-32601,s,e,n);this.methodName=o;this.innerError=n;}},G=class extends c{constructor(o,s,e,n){super(o,-32602,s,e,n);this.methodName=o;this.innerError=n;}},Q=class extends c{constructor(o,s,e,n){super(o,-32603,s,e,n);this.methodName=o;this.innerError=n;}},X=class extends r{},Y=class extends c{constructor(o,s,e,n){super(o,-32e3,s,e,n);this.methodName=o;this.innerError=n;}},Z=class extends c{constructor(o,s,e,n){super(o,-32004,s,e,n);this.methodName=o;this.innerError=n;}},_=class extends Error{code;data;message;constructor(a,o){super(a||"execution reverted"),this.message=a,this.name="JSONRPCTransactionRevertError",this.code=-32e3,this.data=o,Object.setPrototypeOf(this,new.target.prototype);}};var A=class extends r{};var q=class extends r{},L=class extends r{},T=class extends r{};var B=class extends r{},H=class extends r{},M=class extends r{};var J=class extends r{};var N=class extends r{},F=class extends r{},R=class extends r{},C=class extends r{},P=class extends r{};var I=class extends r{};export{C as CannotFindTransaction,y as CertificateSignatureMismatch,b as ContractCallError,D as ContractDeploymentFailed,f as InvalidAbiDataToEncodeOrDecode,i as InvalidAbiItem,g as InvalidAbiSignatureFormat,E as InvalidAddress,d as InvalidBloom,u as InvalidBloomParams,q as InvalidCommandLineArguments,T as InvalidConfigurationFile,L as InvalidConfigurationFilePath,j as InvalidDataType,h as InvalidHDKey,O as InvalidHDKeyMnemonic,V as InvalidHTTPParams,w as InvalidHTTPRequest,k as InvalidKeystore,K as InvalidKeystoreParams,I as InvalidOperation,A as InvalidRLP,H as InvalidSecp256k1MessageHash,B as InvalidSecp256k1PrivateKey,M as InvalidSecp256k1Signature,F as InvalidTransactionField,P as InvalidTransactionType,Q as JSONRPCInternalError,X as JSONRPCInvalidDefaultBlock,G as JSONRPCInvalidParams,z as JSONRPCInvalidRequest,W as JSONRPCMethodNotFound,Z as JSONRPCMethodNotImplemented,U as JSONRPCParseError,c as JSONRPCProviderError,Y as JSONRPCServerError,_ as JSONRPCTransactionRevertError,R as NotDelegatedTransaction,S as PollExecution,$ as ProviderMethodError,J as SignerMethodError,N as UnavailableTransactionField,l as UnsupportedOperation,r as VechainSDKError,x as assertInnerError,m as createErrorMessage,v as errors,p as stringifyData};//# sourceMappingURL=index.mjs.map //# sourceMappingURL=index.mjs.map