UNPKG

@vechain/sdk-errors

Version:

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

8 lines 5.36 kB
'use strict';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{};exports.CannotFindTransaction=C;exports.CertificateSignatureMismatch=y;exports.ContractCallError=b;exports.ContractDeploymentFailed=D;exports.InvalidAbiDataToEncodeOrDecode=f;exports.InvalidAbiItem=i;exports.InvalidAbiSignatureFormat=g;exports.InvalidAddress=E;exports.InvalidBloom=d;exports.InvalidBloomParams=u;exports.InvalidCommandLineArguments=q;exports.InvalidConfigurationFile=T;exports.InvalidConfigurationFilePath=L;exports.InvalidDataType=j;exports.InvalidHDKey=h;exports.InvalidHDKeyMnemonic=O;exports.InvalidHTTPParams=V;exports.InvalidHTTPRequest=w;exports.InvalidKeystore=k;exports.InvalidKeystoreParams=K;exports.InvalidOperation=I;exports.InvalidRLP=A;exports.InvalidSecp256k1MessageHash=H;exports.InvalidSecp256k1PrivateKey=B;exports.InvalidSecp256k1Signature=M;exports.InvalidTransactionField=F;exports.InvalidTransactionType=P;exports.JSONRPCInternalError=Q;exports.JSONRPCInvalidDefaultBlock=X;exports.JSONRPCInvalidParams=G;exports.JSONRPCInvalidRequest=z;exports.JSONRPCMethodNotFound=W;exports.JSONRPCMethodNotImplemented=Z;exports.JSONRPCParseError=U;exports.JSONRPCProviderError=c;exports.JSONRPCServerError=Y;exports.JSONRPCTransactionRevertError=_;exports.NotDelegatedTransaction=R;exports.PollExecution=S;exports.ProviderMethodError=$;exports.SignerMethodError=J;exports.UnavailableTransactionField=N;exports.UnsupportedOperation=l;exports.VechainSDKError=r;exports.assertInnerError=x;exports.createErrorMessage=m;exports.errors=v;exports.stringifyData=p;//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map