@signumjs/contracts
Version:
Smart Contracts package for Signum Network
3 lines (2 loc) • 38.5 kB
JavaScript
"use strict";var sig$contracts=(()=>{var rr=Object.create;var Ue=Object.defineProperty;var nr=Object.getOwnPropertyDescriptor;var ir=Object.getOwnPropertyNames;var or=Object.getPrototypeOf,ur=Object.prototype.hasOwnProperty;var nt=(s,r)=>()=>(s&&(r=s(s=0)),r);var E=(s,r)=>()=>(r||s((r={exports:{}}).exports,r),r.exports),it=(s,r)=>{for(var p in r)Ue(s,p,{get:r[p],enumerable:!0})},Fe=(s,r,p,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let y of ir(r))!ur.call(s,y)&&y!==p&&Ue(s,y,{get:()=>r[y],enumerable:!(m=nr(r,y))||m.enumerable});return s},fe=(s,r,p)=>(Fe(s,r,"default"),p&&Fe(p,r,"default")),Ne=(s,r,p)=>(p=s!=null?rr(or(s)):{},Fe(r||!s||!s.__esModule?Ue(p,"default",{value:s,enumerable:!0}):p,s)),ot=s=>Fe(Ue({},"__esModule",{value:!0}),s);var Bt=E(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.asyncRetry=Ct;async function Ct(s){let{asyncFn:r,onFailureAsync:p,retryCount:m=1,maxRetrials:y=20}=s;try{return await r()}catch(P){if(m>y)throw P;if(await p(P,m))await Ct({asyncFn:r,onFailureAsync:p,retryCount:m+1});else throw P}}});var Et=E(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.ChainTime=void 0;var Ot=Date.UTC(2014,7,11,2,0,0,0)/1e3,at=class s{_chainTimestamp;constructor(r){this._chainTimestamp=r}static fromChainTimestamp(r){return new s(r)}static fromDate(r){let p=new s(0);return p.setDate(r),p}getChainTimestamp(){return this._chainTimestamp}setChainTimestamp(r){this._chainTimestamp=r}getEpoch(){return(Ot+this._chainTimestamp)*1e3}getDate(){return new Date(this.getEpoch())}setDate(r){this._chainTimestamp=Math.round(r.getTime()/1e3)-Ot}equals(r){return this._chainTimestamp===r._chainTimestamp}before(r){return this._chainTimestamp<r._chainTimestamp}after(r){return this._chainTimestamp>r._chainTimestamp}};He.ChainTime=at});var Ae=E((Tt,Re)=>{(function(s){"use strict";var r,p=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,m=Math.ceil,y=Math.floor,P="[BigNumber Error] ",le=P+"Number primitive has more than 15 significant digits: ",X=1e14,b=14,I=9007199254740991,ye=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],oe=1e7,j=1e9;function Te(x){var A,M,F,_=i.prototype={constructor:i,toString:null,valueOf:null},U=new i(1),B=20,q=4,$=-7,J=21,se=-1e7,K=1e7,he=!1,me=1,ue=0,xe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},ge="0123456789abcdefghijklmnopqrstuvwxyz",pe=!0;function i(e,t){var n,l,u,c,g,o,a,h,f=this;if(!(f instanceof i))return new i(e,t);if(t==null){if(e&&e._isBigNumber===!0){f.s=e.s,!e.c||e.e>K?f.c=f.e=null:e.e<se?f.c=[f.e=0]:(f.e=e.e,f.c=e.c.slice());return}if((o=typeof e=="number")&&e*0==0){if(f.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,g=e;g>=10;g/=10,c++);c>K?f.c=f.e=null:(f.e=c,f.c=[e]);return}h=String(e)}else{if(!p.test(h=String(e)))return F(f,h,o);f.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(c=h.indexOf("."))>-1&&(h=h.replace(".","")),(g=h.search(/e/i))>0?(c<0&&(c=g),c+=+h.slice(g+1),h=h.substring(0,g)):c<0&&(c=h.length)}else{if(N(t,2,ge.length,"Base"),t==10&&pe)return f=new i(e),k(f,B+f.e+1,q);if(h=String(e),o=typeof e=="number"){if(e*0!=0)return F(f,h,o,t);if(f.s=1/e<0?(h=h.slice(1),-1):1,i.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(le+e)}else f.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(n=ge.slice(0,t),c=g=0,a=h.length;g<a;g++)if(n.indexOf(l=h.charAt(g))<0){if(l=="."){if(g>c){c=a;continue}}else if(!u&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){u=!0,g=-1,c=0;continue}return F(f,String(e),o,t)}o=!1,h=M(h,t,10,f.s),(c=h.indexOf("."))>-1?h=h.replace(".",""):c=h.length}for(g=0;h.charCodeAt(g)===48;g++);for(a=h.length;h.charCodeAt(--a)===48;);if(h=h.slice(g,++a)){if(a-=g,o&&i.DEBUG&&a>15&&(e>I||e!==y(e)))throw Error(le+f.s*e);if((c=c-g-1)>K)f.c=f.e=null;else if(c<se)f.c=[f.e=0];else{if(f.e=c,f.c=[],g=(c+1)%b,c<0&&(g+=b),g<a){for(g&&f.c.push(+h.slice(0,g)),a-=b;g<a;)f.c.push(+h.slice(g,g+=b));g=b-(h=h.slice(g)).length}else g-=a;for(;g--;h+="0");f.c.push(+h)}}else f.c=[f.e=0]}i.clone=Te,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=function(e){var t,n;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(n=e[t],N(n,0,j,t),B=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(n=e[t],N(n,0,8,t),q=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&(n=e[t],n&&n.pop?(N(n[0],-j,0,t),N(n[1],0,j,t),$=n[0],J=n[1]):(N(n,-j,j,t),$=-(J=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if(n=e[t],n&&n.pop)N(n[0],-j,-1,t),N(n[1],1,j,t),se=n[0],K=n[1];else if(N(n,-j,j,t),n)se=-(K=n<0?-n:n);else throw Error(P+t+" cannot be zero: "+n);if(e.hasOwnProperty(t="CRYPTO"))if(n=e[t],n===!!n)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))he=n;else throw he=!n,Error(P+"crypto unavailable");else he=n;else throw Error(P+t+" not true or false: "+n);if(e.hasOwnProperty(t="MODULO_MODE")&&(n=e[t],N(n,0,9,t),me=n),e.hasOwnProperty(t="POW_PRECISION")&&(n=e[t],N(n,0,j,t),ue=n),e.hasOwnProperty(t="FORMAT"))if(n=e[t],typeof n=="object")xe=n;else throw Error(P+t+" not an object: "+n);if(e.hasOwnProperty(t="ALPHABET"))if(n=e[t],typeof n=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))pe=n.slice(0,10)=="0123456789",ge=n;else throw Error(P+t+" invalid: "+n)}else throw Error(P+"Object expected: "+e);return{DECIMAL_PLACES:B,ROUNDING_MODE:q,EXPONENTIAL_AT:[$,J],RANGE:[se,K],CRYPTO:he,MODULO_MODE:me,POW_PRECISION:ue,FORMAT:xe,ALPHABET:ge}},i.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!i.DEBUG)return!0;var t,n,l=e.c,u=e.e,c=e.s;e:if({}.toString.call(l)=="[object Array]"){if((c===1||c===-1)&&u>=-j&&u<=j&&u===y(u)){if(l[0]===0){if(u===0&&l.length===1)return!0;break e}if(t=(u+1)%b,t<1&&(t+=b),String(l[0]).length==t){for(t=0;t<l.length;t++)if(n=l[t],n<0||n>=X||n!==y(n))break e;if(n!==0)return!0}}}else if(l===null&&u===null&&(c===null||c===1||c===-1))return!0;throw Error(P+"Invalid BigNumber: "+e)},i.maximum=i.max=function(){return L(arguments,-1)},i.minimum=i.min=function(){return L(arguments,1)},i.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return y(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(n){var l,u,c,g,o,a=0,h=[],f=new i(U);if(n==null?n=B:N(n,0,j),g=m(n/b),he)if(crypto.getRandomValues){for(l=crypto.getRandomValues(new Uint32Array(g*=2));a<g;)o=l[a]*131072+(l[a+1]>>>11),o>=9e15?(u=crypto.getRandomValues(new Uint32Array(2)),l[a]=u[0],l[a+1]=u[1]):(h.push(o%1e14),a+=2);a=g/2}else if(crypto.randomBytes){for(l=crypto.randomBytes(g*=7);a<g;)o=(l[a]&31)*281474976710656+l[a+1]*1099511627776+l[a+2]*4294967296+l[a+3]*16777216+(l[a+4]<<16)+(l[a+5]<<8)+l[a+6],o>=9e15?crypto.randomBytes(7).copy(l,a):(h.push(o%1e14),a+=7);a=g/7}else throw he=!1,Error(P+"crypto unavailable");if(!he)for(;a<g;)o=t(),o<9e15&&(h[a++]=o%1e14);for(g=h[--a],n%=b,g&&n&&(o=ye[b-n],h[a]=y(g/o)*o);h[a]===0;h.pop(),a--);if(a<0)h=[c=0];else{for(c=-1;h[0]===0;h.splice(0,1),c-=b);for(a=1,o=h[0];o>=10;o/=10,a++);a<b&&(c-=b-a)}return f.e=c,f.c=h,f}}(),i.sum=function(){for(var e=1,t=arguments,n=new i(t[0]);e<t.length;)n=n.plus(t[e++]);return n},M=function(){var e="0123456789";function t(n,l,u,c){for(var g,o=[0],a,h=0,f=n.length;h<f;){for(a=o.length;a--;o[a]*=l);for(o[0]+=c.indexOf(n.charAt(h++)),g=0;g<o.length;g++)o[g]>u-1&&(o[g+1]==null&&(o[g+1]=0),o[g+1]+=o[g]/u|0,o[g]%=u)}return o.reverse()}return function(n,l,u,c,g){var o,a,h,f,d,S,w,C,H=n.indexOf("."),V=B,D=q;for(H>=0&&(f=ue,ue=0,n=n.replace(".",""),C=new i(l),S=C.pow(n.length-H),ue=f,C.c=t(ne(W(S.c),S.e,"0"),10,u,e),C.e=C.c.length),w=t(n,l,u,g?(o=ge,e):(o=e,ge)),h=f=w.length;w[--f]==0;w.pop());if(!w[0])return o.charAt(0);if(H<0?--h:(S.c=w,S.e=h,S.s=c,S=A(S,C,V,D,u),w=S.c,d=S.r,h=S.e),a=h+V+1,H=w[a],f=u/2,d=d||a<0||w[a+1]!=null,d=D<4?(H!=null||d)&&(D==0||D==(S.s<0?3:2)):H>f||H==f&&(D==4||d||D==6&&w[a-1]&1||D==(S.s<0?8:7)),a<1||!w[0])n=d?ne(o.charAt(1),-V,o.charAt(0)):o.charAt(0);else{if(w.length=a,d)for(--u;++w[--a]>u;)w[a]=0,a||(++h,w=[1].concat(w));for(f=w.length;!w[--f];);for(H=0,n="";H<=f;n+=o.charAt(w[H++]));n=ne(n,h,o.charAt(0))}return n}}(),A=function(){function e(l,u,c){var g,o,a,h,f=0,d=l.length,S=u%oe,w=u/oe|0;for(l=l.slice();d--;)a=l[d]%oe,h=l[d]/oe|0,g=w*a+h*S,o=S*a+g%oe*oe+f,f=(o/c|0)+(g/oe|0)+w*h,l[d]=o%c;return f&&(l=[f].concat(l)),l}function t(l,u,c,g){var o,a;if(c!=g)a=c>g?1:-1;else for(o=a=0;o<c;o++)if(l[o]!=u[o]){a=l[o]>u[o]?1:-1;break}return a}function n(l,u,c,g){for(var o=0;c--;)l[c]-=o,o=l[c]<u[c]?1:0,l[c]=o*g+l[c]-u[c];for(;!l[0]&&l.length>1;l.splice(0,1));}return function(l,u,c,g,o){var a,h,f,d,S,w,C,H,V,D,O,Y,qe,tt,rt,ce,Pe,ie=l.s==u.s?1:-1,ee=l.c,R=u.c;if(!ee||!ee[0]||!R||!R[0])return new i(!l.s||!u.s||(ee?R&&ee[0]==R[0]:!R)?NaN:ee&&ee[0]==0||!R?ie*0:ie/0);for(H=new i(ie),V=H.c=[],h=l.e-u.e,ie=c+h+1,o||(o=X,h=Z(l.e/b)-Z(u.e/b),ie=ie/b|0),f=0;R[f]==(ee[f]||0);f++);if(R[f]>(ee[f]||0)&&h--,ie<0)V.push(1),d=!0;else{for(tt=ee.length,ce=R.length,f=0,ie+=2,S=y(o/(R[0]+1)),S>1&&(R=e(R,S,o),ee=e(ee,S,o),ce=R.length,tt=ee.length),qe=ce,D=ee.slice(0,ce),O=D.length;O<ce;D[O++]=0);Pe=R.slice(),Pe=[0].concat(Pe),rt=R[0],R[1]>=o/2&&rt++;do{if(S=0,a=t(R,D,ce,O),a<0){if(Y=D[0],ce!=O&&(Y=Y*o+(D[1]||0)),S=y(Y/rt),S>1)for(S>=o&&(S=o-1),w=e(R,S,o),C=w.length,O=D.length;t(w,D,C,O)==1;)S--,n(w,ce<C?Pe:R,C,o),C=w.length,a=1;else S==0&&(a=S=1),w=R.slice(),C=w.length;if(C<O&&(w=[0].concat(w)),n(D,w,O,o),O=D.length,a==-1)for(;t(R,D,ce,O)<1;)S++,n(D,ce<O?Pe:R,O,o),O=D.length}else a===0&&(S++,D=[0]);V[f++]=S,D[0]?D[O++]=ee[qe]||0:(D=[ee[qe]],O=1)}while((qe++<tt||D[0]!=null)&&ie--);d=D[0]!=null,V[0]||V.splice(0,1)}if(o==X){for(f=1,ie=V[0];ie>=10;ie/=10,f++);k(H,c+(H.e=f+h*b-1)+1,g,d)}else H.e=h,H.r=+d;return H}}();function v(e,t,n,l){var u,c,g,o,a;if(n==null?n=q:N(n,0,8),!e.c)return e.toString();if(u=e.c[0],g=e.e,t==null)a=W(e.c),a=l==1||l==2&&(g<=$||g>=J)?ve(a,g):ne(a,g,"0");else if(e=k(new i(e),t,n),c=e.e,a=W(e.c),o=a.length,l==1||l==2&&(t<=c||c<=$)){for(;o<t;a+="0",o++);a=ve(a,c)}else if(t-=g,a=ne(a,c,"0"),c+1>o){if(--t>0)for(a+=".";t--;a+="0");}else if(t+=c-o,t>0)for(c+1==o&&(a+=".");t--;a+="0");return e.s<0&&u?"-"+a:a}function L(e,t){for(var n,l,u=1,c=new i(e[0]);u<e.length;u++)l=new i(e[u]),(!l.s||(n=re(c,l))===t||n===0&&c.s===t)&&(c=l);return c}function Q(e,t,n){for(var l=1,u=t.length;!t[--u];t.pop());for(u=t[0];u>=10;u/=10,l++);return(n=l+n*b-1)>K?e.c=e.e=null:n<se?e.c=[e.e=0]:(e.e=n,e.c=t),e}F=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(c,g,o,a){var h,f=o?g:g.replace(u,"");if(l.test(f))c.s=isNaN(f)?null:f<0?-1:1;else{if(!o&&(f=f.replace(e,function(d,S,w){return h=(w=w.toLowerCase())=="x"?16:w=="b"?2:8,!a||a==h?S:d}),a&&(h=a,f=f.replace(t,"$1").replace(n,"0.$1")),g!=f))return new i(f,h);if(i.DEBUG)throw Error(P+"Not a"+(a?" base "+a:"")+" number: "+g);c.s=null}c.c=c.e=null}}();function k(e,t,n,l){var u,c,g,o,a,h,f,d=e.c,S=ye;if(d){e:{for(u=1,o=d[0];o>=10;o/=10,u++);if(c=t-u,c<0)c+=b,g=t,a=d[h=0],f=y(a/S[u-g-1]%10);else if(h=m((c+1)/b),h>=d.length)if(l){for(;d.length<=h;d.push(0));a=f=0,u=1,c%=b,g=c-b+1}else break e;else{for(a=o=d[h],u=1;o>=10;o/=10,u++);c%=b,g=c-b+u,f=g<0?0:y(a/S[u-g-1]%10)}if(l=l||t<0||d[h+1]!=null||(g<0?a:a%S[u-g-1]),l=n<4?(f||l)&&(n==0||n==(e.s<0?3:2)):f>5||f==5&&(n==4||l||n==6&&(c>0?g>0?a/S[u-g]:0:d[h-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=S[(b-t%b)%b],e.e=-t||0):d[0]=e.e=0,e;if(c==0?(d.length=h,o=1,h--):(d.length=h+1,o=S[b-c],d[h]=g>0?y(a/S[u-g]%S[g])*o:0),l)for(;;)if(h==0){for(c=1,g=d[0];g>=10;g/=10,c++);for(g=d[0]+=o,o=1;g>=10;g/=10,o++);c!=o&&(e.e++,d[0]==X&&(d[0]=1));break}else{if(d[h]+=o,d[h]!=X)break;d[h--]=0,o=1}for(c=d.length;d[--c]===0;d.pop());}e.e>K?e.c=e.e=null:e.e<se&&(e.c=[e.e=0])}return e}function z(e){var t,n=e.e;return n===null?e.toString():(t=W(e.c),t=n<=$||n>=J?ve(t,n):ne(t,n,"0"),e.s<0?"-"+t:t)}return _.absoluteValue=_.abs=function(){var e=new i(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return re(this,new i(e,t))},_.decimalPlaces=_.dp=function(e,t){var n,l,u,c=this;if(e!=null)return N(e,0,j),t==null?t=q:N(t,0,8),k(new i(c),e+c.e+1,t);if(!(n=c.c))return null;if(l=((u=n.length-1)-Z(this.e/b))*b,u=n[u])for(;u%10==0;u/=10,l--);return l<0&&(l=0),l},_.dividedBy=_.div=function(e,t){return A(this,new i(e,t),B,q)},_.dividedToIntegerBy=_.idiv=function(e,t){return A(this,new i(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var n,l,u,c,g,o,a,h,f,d=this;if(e=new i(e),e.c&&!e.isInteger())throw Error(P+"Exponent not an integer: "+z(e));if(t!=null&&(t=new i(t)),o=e.e>14,!d.c||!d.c[0]||d.c[0]==1&&!d.e&&d.c.length==1||!e.c||!e.c[0])return f=new i(Math.pow(+z(d),o?e.s*(2-we(e)):+z(e))),t?f.mod(t):f;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new i(NaN);l=!a&&d.isInteger()&&t.isInteger(),l&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(d.e==0?d.c[0]>1||o&&d.c[1]>=24e7:d.c[0]<8e13||o&&d.c[0]<=9999975e7)))return c=d.s<0&&we(e)?-0:0,d.e>-1&&(c=1/c),new i(a?1/c:c);ue&&(c=m(ue/b+2))}for(o?(n=new i(.5),a&&(e.s=1),h=we(e)):(u=Math.abs(+z(e)),h=u%2),f=new i(U);;){if(h){if(f=f.times(d),!f.c)break;c?f.c.length>c&&(f.c.length=c):l&&(f=f.mod(t))}if(u){if(u=y(u/2),u===0)break;h=u%2}else if(e=e.times(n),k(e,e.e+1,1),e.e>14)h=we(e);else{if(u=+z(e),u===0)break;h=u%2}d=d.times(d),c?d.c&&d.c.length>c&&(d.c.length=c):l&&(d=d.mod(t))}return l?f:(a&&(f=U.div(f)),t?f.mod(t):c?k(f,ue,q,g):f)},_.integerValue=function(e){var t=new i(this);return e==null?e=q:N(e,0,8),k(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return re(this,new i(e,t))===0},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return re(this,new i(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return(t=re(this,new i(e,t)))===1||t===0},_.isInteger=function(){return!!this.c&&Z(this.e/b)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return re(this,new i(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return(t=re(this,new i(e,t)))===-1||t===0},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&this.c[0]==0},_.minus=function(e,t){var n,l,u,c,g=this,o=g.s;if(e=new i(e,t),t=e.s,!o||!t)return new i(NaN);if(o!=t)return e.s=-t,g.plus(e);var a=g.e/b,h=e.e/b,f=g.c,d=e.c;if(!a||!h){if(!f||!d)return f?(e.s=-t,e):new i(d?g:NaN);if(!f[0]||!d[0])return d[0]?(e.s=-t,e):new i(f[0]?g:q==3?-0:0)}if(a=Z(a),h=Z(h),f=f.slice(),o=a-h){for((c=o<0)?(o=-o,u=f):(h=a,u=d),u.reverse(),t=o;t--;u.push(0));u.reverse()}else for(l=(c=(o=f.length)<(t=d.length))?o:t,o=t=0;t<l;t++)if(f[t]!=d[t]){c=f[t]<d[t];break}if(c&&(u=f,f=d,d=u,e.s=-e.s),t=(l=d.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=X-1;l>o;){if(f[--l]<d[l]){for(n=l;n&&!f[--n];f[n]=t);--f[n],f[l]+=X}f[l]-=d[l]}for(;f[0]==0;f.splice(0,1),--h);return f[0]?Q(e,f,h):(e.s=q==3?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,t){var n,l,u=this;return e=new i(e,t),!u.c||!e.s||e.c&&!e.c[0]?new i(NaN):!e.c||u.c&&!u.c[0]?new i(u):(me==9?(l=e.s,e.s=1,n=A(u,e,0,3),e.s=l,n.s*=l):n=A(u,e,0,me),e=u.minus(n.times(e)),!e.c[0]&&me==1&&(e.s=u.s),e)},_.multipliedBy=_.times=function(e,t){var n,l,u,c,g,o,a,h,f,d,S,w,C,H,V,D=this,O=D.c,Y=(e=new i(e,t)).c;if(!O||!Y||!O[0]||!Y[0])return!D.s||!e.s||O&&!O[0]&&!Y||Y&&!Y[0]&&!O?e.c=e.e=e.s=null:(e.s*=D.s,!O||!Y?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(l=Z(D.e/b)+Z(e.e/b),e.s*=D.s,a=O.length,d=Y.length,a<d&&(C=O,O=Y,Y=C,u=a,a=d,d=u),u=a+d,C=[];u--;C.push(0));for(H=X,V=oe,u=d;--u>=0;){for(n=0,S=Y[u]%V,w=Y[u]/V|0,g=a,c=u+g;c>u;)h=O[--g]%V,f=O[g]/V|0,o=w*h+f*S,h=S*h+o%V*V+C[c]+n,n=(h/H|0)+(o/V|0)+w*f,C[c--]=h%H;C[c]=n}return n?++l:C.splice(0,1),Q(e,C,l)},_.negated=function(){var e=new i(this);return e.s=-e.s||null,e},_.plus=function(e,t){var n,l=this,u=l.s;if(e=new i(e,t),t=e.s,!u||!t)return new i(NaN);if(u!=t)return e.s=-t,l.minus(e);var c=l.e/b,g=e.e/b,o=l.c,a=e.c;if(!c||!g){if(!o||!a)return new i(u/0);if(!o[0]||!a[0])return a[0]?e:new i(o[0]?l:u*0)}if(c=Z(c),g=Z(g),o=o.slice(),u=c-g){for(u>0?(g=c,n=a):(u=-u,n=o),n.reverse();u--;n.push(0));n.reverse()}for(u=o.length,t=a.length,u-t<0&&(n=a,a=o,o=n,t=u),u=0;t;)u=(o[--t]=o[t]+a[t]+u)/X|0,o[t]=X===o[t]?0:o[t]%X;return u&&(o=[u].concat(o),++g),Q(e,o,g)},_.precision=_.sd=function(e,t){var n,l,u,c=this;if(e!=null&&e!==!!e)return N(e,1,j),t==null?t=q:N(t,0,8),k(new i(c),e,t);if(!(n=c.c))return null;if(u=n.length-1,l=u*b+1,u=n[u]){for(;u%10==0;u/=10,l--);for(u=n[0];u>=10;u/=10,l++);}return e&&c.e+1>l&&(l=c.e+1),l},_.shiftedBy=function(e){return N(e,-I,I),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,n,l,u,c=this,g=c.c,o=c.s,a=c.e,h=B+4,f=new i("0.5");if(o!==1||!g||!g[0])return new i(!o||o<0&&(!g||g[0])?NaN:g?c:1/0);if(o=Math.sqrt(+z(c)),o==0||o==1/0?(t=W(g),(t.length+a)%2==0&&(t+="0"),o=Math.sqrt(+t),a=Z((a+1)/2)-(a<0||a%2),o==1/0?t="5e"+a:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),n=new i(t)):n=new i(o+""),n.c[0]){for(a=n.e,o=a+h,o<3&&(o=0);;)if(u=n,n=f.times(u.plus(A(c,u,h,1))),W(u.c).slice(0,o)===(t=W(n.c)).slice(0,o))if(n.e<a&&--o,t=t.slice(o-3,o+1),t=="9999"||!l&&t=="4999"){if(!l&&(k(u,u.e+B+2,0),u.times(u).eq(c))){n=u;break}h+=4,o+=4,l=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,n.e+B+2,1),e=!n.times(n).eq(c));break}}return k(n,n.e+B+1,q,e)},_.toExponential=function(e,t){return e!=null&&(N(e,0,j),e++),v(this,e,t,1)},_.toFixed=function(e,t){return e!=null&&(N(e,0,j),e=e+this.e+1),v(this,e,t)},_.toFormat=function(e,t,n){var l,u=this;if(n==null)e!=null&&t&&typeof t=="object"?(n=t,t=null):e&&typeof e=="object"?(n=e,e=t=null):n=xe;else if(typeof n!="object")throw Error(P+"Argument not an object: "+n);if(l=u.toFixed(e,t),u.c){var c,g=l.split("."),o=+n.groupSize,a=+n.secondaryGroupSize,h=n.groupSeparator||"",f=g[0],d=g[1],S=u.s<0,w=S?f.slice(1):f,C=w.length;if(a&&(c=o,o=a,a=c,C-=c),o>0&&C>0){for(c=C%o||o,f=w.substr(0,c);c<C;c+=o)f+=h+w.substr(c,o);a>0&&(f+=h+w.slice(c)),S&&(f="-"+f)}l=d?f+(n.decimalSeparator||"")+((a=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):f}return(n.prefix||"")+l+(n.suffix||"")},_.toFraction=function(e){var t,n,l,u,c,g,o,a,h,f,d,S,w=this,C=w.c;if(e!=null&&(o=new i(e),!o.isInteger()&&(o.c||o.s!==1)||o.lt(U)))throw Error(P+"Argument "+(o.isInteger()?"out of range: ":"not an integer: ")+z(o));if(!C)return new i(w);for(t=new i(U),h=n=new i(U),l=a=new i(U),S=W(C),c=t.e=S.length-w.e-1,t.c[0]=ye[(g=c%b)<0?b+g:g],e=!e||o.comparedTo(t)>0?c>0?t:h:o,g=K,K=1/0,o=new i(S),a.c[0]=0;f=A(o,t,0,1),u=n.plus(f.times(l)),u.comparedTo(e)!=1;)n=l,l=u,h=a.plus(f.times(u=h)),a=u,t=o.minus(f.times(u=t)),o=u;return u=A(e.minus(n),l,0,1),a=a.plus(u.times(h)),n=n.plus(u.times(l)),a.s=h.s=w.s,c=c*2,d=A(h,l,c,q).minus(w).abs().comparedTo(A(a,n,c,q).minus(w).abs())<1?[h,l]:[a,n],K=g,d},_.toNumber=function(){return+z(this)},_.toPrecision=function(e,t){return e!=null&&N(e,1,j),v(this,e,t,2)},_.toString=function(e){var t,n=this,l=n.s,u=n.e;return u===null?l?(t="Infinity",l<0&&(t="-"+t)):t="NaN":(e==null?t=u<=$||u>=J?ve(W(n.c),u):ne(W(n.c),u,"0"):e===10&&pe?(n=k(new i(n),B+u+1,q),t=ne(W(n.c),n.e,"0")):(N(e,2,ge.length,"Base"),t=M(ne(W(n.c),u,"0"),10,e,l,!0)),l<0&&n.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return z(this)},_._isBigNumber=!0,x!=null&&i.set(x),i}function Z(x){var A=x|0;return x>0||x===A?A:A-1}function W(x){for(var A,M,F=1,_=x.length,U=x[0]+"";F<_;){for(A=x[F++]+"",M=b-A.length;M--;A="0"+A);U+=A}for(_=U.length;U.charCodeAt(--_)===48;);return U.slice(0,_+1||1)}function re(x,A){var M,F,_=x.c,U=A.c,B=x.s,q=A.s,$=x.e,J=A.e;if(!B||!q)return null;if(M=_&&!_[0],F=U&&!U[0],M||F)return M?F?0:-q:B;if(B!=q)return B;if(M=B<0,F=$==J,!_||!U)return F?0:!_^M?1:-1;if(!F)return $>J^M?1:-1;for(q=($=_.length)<(J=U.length)?$:J,B=0;B<q;B++)if(_[B]!=U[B])return _[B]>U[B]^M?1:-1;return $==J?0:$>J^M?1:-1}function N(x,A,M,F){if(x<A||x>M||x!==y(x))throw Error(P+(F||"Argument")+(typeof x=="number"?x<A||x>M?" out of range: ":" not an integer: ":" not a primitive number: ")+String(x))}function we(x){var A=x.c.length-1;return Z(x.e/b)==A&&x.c[A]%2!=0}function ve(x,A){return(x.length>1?x.charAt(0)+"."+x.slice(1):x)+(A<0?"e":"e+")+A}function ne(x,A,M){var F,_;if(A<0){for(_=M+".";++A;_+=M);x=_+x}else if(F=x.length,++A>F){for(_=M,A-=F;--A;_+=M);x+=_}else A<F&&(x=x.slice(0,A)+"."+x.slice(A));return x}r=Te(),r.default=r.BigNumber=r,typeof define=="function"&&define.amd?define(function(){return r}):typeof Re<"u"&&Re.exports?Re.exports=r:(s||(s=typeof self<"u"&&self?self:window),s.BigNumber=r)})(Tt)});var ct=E(de=>{"use strict";var ar=de&&de.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(de,"__esModule",{value:!0});de.ChainValue=de.ChainValueFormats=void 0;var Me=ar(Ae());Me.default.config({EXPONENTIAL_AT:[-9,20],DECIMAL_PLACES:8});var sr={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0,suffix:""},cr={decimalSeparator:",",groupSeparator:".",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0,suffix:""};de.ChainValueFormats={DotDecimal:sr,CommaDecimal:cr};function Ie(s){if(!(s&&/^-?\d*(\.\d+)?$/.test(s)))throw new Error(`Invalid value: ${s}`)}var st=class s{_big;_decimals;constructor(r){if(r<0||r>8)throw new Error("Decimals must be between 0 and 8");this._big=new Me.default(0),this._decimals=r}static create(r){return new s(r)}getDecimals(){return this._decimals}getRaw(){return this._big}getAtomic(){return this._big.dp(0).toString()}setAtomic(r){return typeof r=="number"?this._big=new Me.default(Math.floor(r)):(Ie(r),this._big=new Me.default(r)),this}getCompound(){return this._big.dividedBy(10**this._decimals).dp(this._decimals).toString()}setCompound(r){return typeof r=="string"&&Ie(r),this._big=new Me.default(r||0).multipliedBy(10**this._decimals),this}equals(r){return this._big.eq(r._big)}lessOrEqual(r){return this._big.lte(r._big)}less(r){return this._big.lt(r._big)}greaterOrEqual(r){return this._big.gte(r._big)}greater(r){return this._big.gt(r._big)}add(r){return this._big=this._big.plus(r._big),this}subtract(r){return this._big=this._big.minus(r._big),this}multiply(r){let p=r;return typeof r=="string"&&(Ie(r),p=parseFloat(r)),this._big=this._big.multipliedBy(p),this}divide(r){let p=r;if(typeof r=="string"&&(Ie(r),p=parseFloat(r)),p===0)throw new Error("Division by zero");return this._big=this._big.div(p),this}toFormat(r,p=de.ChainValueFormats.DotDecimal){return this._big.dividedBy(10**this._decimals).toFormat({...p,prefix:r})}clone(){let r=new s(this._decimals);return r._big=this._big,r}};de.ChainValue=st});var ft=E(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.OneSignaPlanck=_e.FeeQuantPlanck=_e.CurrencySymbol=void 0;_e.CurrencySymbol="\uA7A8";_e.FeeQuantPlanck=1e6;_e.OneSignaPlanck=1e8});var je=E(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.Amount=te.AmountFormats=te.FormatCommaDecimal=te.FormatDotDecimal=void 0;var ht=ft(),fr=ct();te.FormatDotDecimal={prefix:ht.CurrencySymbol+" ",decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0,suffix:""};te.FormatCommaDecimal={prefix:ht.CurrencySymbol+" ",decimalSeparator:",",groupSeparator:".",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0,suffix:""};te.AmountFormats={DotDecimal:te.FormatDotDecimal,CommaDecimal:te.FormatCommaDecimal};var lt=class s{_value;constructor(r){this._value=new fr.ChainValue(8).setAtomic(r)}static CurrencySymbol(){return ht.CurrencySymbol}static Zero(){return new s(0)}static fromPlanck(r){return new s(r)}static fromSigna(r){let p=new s("0");return p.setSigna(typeof r=="number"?r.toString(10):r),p}getRaw(){return this._value.getRaw()}getPlanck(){return this._value.getAtomic()}setPlanck(r){return this._value.setAtomic(r),this}getSigna(){return this._value.getCompound()}setSigna(r){return this._value.setCompound(r),this}equals(r){return this._value.equals(r._value)}lessOrEqual(r){return this._value.lessOrEqual(r._value)}less(r){return this._value.less(r._value)}greaterOrEqual(r){return this._value.greaterOrEqual(r._value)}greater(r){return this._value.greater(r._value)}add(r){return this._value.add(r._value),this}subtract(r){return this._value.subtract(r._value),this}multiply(r){return this._value.multiply(r),this}divide(r){return this._value.divide(r),this}toString(r=te.AmountFormats.DotDecimal){return this._value.toFormat(r.prefix,r)}clone(){return s.fromPlanck(this.getPlanck())}};te.Amount=lt});var Pt=E(be=>{"use strict";var lr=be&&be.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(be,"__esModule",{value:!0});be.convertBase36StringToHexString=void 0;var hr=lr(Ae()),gr=s=>new hr.default(s,36).toString(16);be.convertBase36StringToHexString=gr});var dt=E((gt,pt)=>{(function(s,r){typeof gt=="object"&&typeof pt<"u"?pt.exports=r():typeof define=="function"&&define.amd?define(r):function(){var p=s.Base64,m=r();m.noConflict=function(){return s.Base64=p,m},s.Meteor&&(Base64=m),s.Base64=m}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:gt,function(){"use strict";var s="3.7.7",r=s,p=typeof Buffer=="function",m=typeof TextDecoder=="function"?new TextDecoder:void 0,y=typeof TextEncoder=="function"?new TextEncoder:void 0,P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",le=Array.prototype.slice.call(P),X=function(i){var v={};return i.forEach(function(L,Q){return v[L]=Q}),v}(le),b=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,I=String.fromCharCode.bind(String),ye=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(i){return new Uint8Array(Array.prototype.slice.call(i,0))},oe=function(i){return i.replace(/=/g,"").replace(/[+\/]/g,function(v){return v=="+"?"-":"_"})},j=function(i){return i.replace(/[^A-Za-z0-9\+\/]/g,"")},Te=function(i){for(var v,L,Q,k,z="",e=i.length%3,t=0;t<i.length;){if((L=i.charCodeAt(t++))>255||(Q=i.charCodeAt(t++))>255||(k=i.charCodeAt(t++))>255)throw new TypeError("invalid character found");v=L<<16|Q<<8|k,z+=le[v>>18&63]+le[v>>12&63]+le[v>>6&63]+le[v&63]}return e?z.slice(0,e-3)+"===".substring(e):z},Z=typeof btoa=="function"?function(i){return btoa(i)}:p?function(i){return Buffer.from(i,"binary").toString("base64")}:Te,W=p?function(i){return Buffer.from(i).toString("base64")}:function(i){for(var v=4096,L=[],Q=0,k=i.length;Q<k;Q+=v)L.push(I.apply(null,i.subarray(Q,Q+v)));return Z(L.join(""))},re=function(i,v){return v===void 0&&(v=!1),v?oe(W(i)):W(i)},N=function(i){if(i.length<2){var v=i.charCodeAt(0);return v<128?i:v<2048?I(192|v>>>6)+I(128|v&63):I(224|v>>>12&15)+I(128|v>>>6&63)+I(128|v&63)}else{var v=65536+(i.charCodeAt(0)-55296)*1024+(i.charCodeAt(1)-56320);return I(240|v>>>18&7)+I(128|v>>>12&63)+I(128|v>>>6&63)+I(128|v&63)}},we=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ve=function(i){return i.replace(we,N)},ne=p?function(i){return Buffer.from(i,"utf8").toString("base64")}:y?function(i){return W(y.encode(i))}:function(i){return Z(ve(i))},x=function(i,v){return v===void 0&&(v=!1),v?oe(ne(i)):ne(i)},A=function(i){return x(i,!0)},M=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,F=function(i){switch(i.length){case 4:var v=(7&i.charCodeAt(0))<<18|(63&i.charCodeAt(1))<<12|(63&i.charCodeAt(2))<<6|63&i.charCodeAt(3),L=v-65536;return I((L>>>10)+55296)+I((L&1023)+56320);case 3:return I((15&i.charCodeAt(0))<<12|(63&i.charCodeAt(1))<<6|63&i.charCodeAt(2));default:return I((31&i.charCodeAt(0))<<6|63&i.charCodeAt(1))}},_=function(i){return i.replace(M,F)},U=function(i){if(i=i.replace(/\s+/g,""),!b.test(i))throw new TypeError("malformed base64.");i+="==".slice(2-(i.length&3));for(var v,L="",Q,k,z=0;z<i.length;)v=X[i.charAt(z++)]<<18|X[i.charAt(z++)]<<12|(Q=X[i.charAt(z++)])<<6|(k=X[i.charAt(z++)]),L+=Q===64?I(v>>16&255):k===64?I(v>>16&255,v>>8&255):I(v>>16&255,v>>8&255,v&255);return L},B=typeof atob=="function"?function(i){return atob(j(i))}:p?function(i){return Buffer.from(i,"base64").toString("binary")}:U,q=p?function(i){return ye(Buffer.from(i,"base64"))}:function(i){return ye(B(i).split("").map(function(v){return v.charCodeAt(0)}))},$=function(i){return q(se(i))},J=p?function(i){return Buffer.from(i,"base64").toString("utf8")}:m?function(i){return m.decode(q(i))}:function(i){return _(B(i))},se=function(i){return j(i.replace(/[-_]/g,function(v){return v=="-"?"+":"/"}))},K=function(i){return J(se(i))},he=function(i){if(typeof i!="string")return!1;var v=i.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(v)||!/[^\s0-9a-zA-Z\-_]/.test(v)},me=function(i){return{value:i,enumerable:!1,writable:!0,configurable:!0}},ue=function(){var i=function(v,L){return Object.defineProperty(String.prototype,v,me(L))};i("fromBase64",function(){return K(this)}),i("toBase64",function(v){return x(this,v)}),i("toBase64URI",function(){return x(this,!0)}),i("toBase64URL",function(){return x(this,!0)}),i("toUint8Array",function(){return $(this)})},xe=function(){var i=function(v,L){return Object.defineProperty(Uint8Array.prototype,v,me(L))};i("toBase64",function(v){return re(this,v)}),i("toBase64URI",function(){return re(this,!0)}),i("toBase64URL",function(){return re(this,!0)})},ge=function(){ue(),xe()},pe={version:s,VERSION:r,atob:B,atobPolyfill:U,btoa:Z,btoaPolyfill:Te,fromBase64:K,toBase64:x,encode:x,encodeURI:A,encodeURL:A,utob:ve,btou:_,decode:K,isValid:he,fromUint8Array:re,toUint8Array:$,extendString:ue,extendUint8Array:xe,extendBuiltins:ge};return pe.Base64={},Object.keys(pe).forEach(function(i){return pe.Base64[i]=pe[i]}),pe})});var Nt=E(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.convertBase64StringToString=void 0;var pr=dt(),dr=s=>pr.Base64.decode(s);Ge.convertBase64StringToString=dr});var mt=E(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.convertByteArrayToHexString=void 0;var mr=(s,r=!1)=>{let p=[];for(let m of s)p.push((m>>>4).toString(16)),p.push((m&15).toString(16));return r?p.join("").toUpperCase():p.join("")};Le.convertByteArrayToHexString=mr});var _t=E(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.convertByteArrayToString=void 0;var _r=(s,r=0,p=null)=>{if(p===0)return"";let m=s;if(r!==0){let P=p===null?s.length-r:p;vr(m,P,r),m=s.slice(r,r+P)}let y=escape(String.fromCharCode.apply(null,Array.from(m)));try{return decodeURIComponent(y)}catch{throw new Error("Error decoding utf-8 data")}};ke.convertByteArrayToString=_r;function vr(s,r,p=0){if(p<0)throw new Error("Start index should not be negative");if(s.length<p+r)throw new Error("Need at least "+r+" bytes to convert to an integer");return p}});var qt=E(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});String.prototype.padStart||(String.prototype.padStart=function(r,p){return r=r>>0,p=String(p!==void 0?p:" "),this.length>=r?String(this):(r=r-this.length,r>p.length&&(p+=p.repeat(r/p.length)),p.slice(0,r)+String(this))})});var Ft=E(De=>{"use strict";var Sr=De&&De.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(De,"__esModule",{value:!0});De.twosComplementBinary=void 0;var yr=Sr(Ae()),wr=s=>{let r=s.multipliedBy(-1).toString(2);for(;r.length%8;)r="0"+r;let p=r[0]==="1"&&r.slice(1).indexOf("1")!==-1?"11111111":"";return r=r.split("").map(m=>m==="0"?"1":"0").join(""),new yr.default(p+r,2).plus(1)};De.twosComplementBinary=wr});var Ut=E(Ce=>{"use strict";var xr=Ce&&Ce.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.convertDecStringToHexString=void 0;qt();var Ar=xr(Ae()),br=Ft(),Dr=(s,r=2)=>{let p=typeof s=="string"?new Ar.default(s):s;if(p.isNaN())throw new Error(`Invalid decimal argument: [${s}] - Expected a valid decimal value`);if(r<0)throw new Error(`Invalid padding argument: [${r}] - Expected a positive value`);let m=p.lt(0);m&&(p=(0,br.twosComplementBinary)(p));let y=p.toString(16),P=Math.ceil(y.length/r);return y.padStart(P*r,m?"f":"0")};Ce.convertDecStringToHexString=Dr});var Ht=E(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.convertHexEndianess=void 0;var Cr=s=>{let r="",p=s;for(let m=p.length-1;m>=0;m-=2)r+=p[m-1]+p[m];return r};ze.convertHexEndianess=Cr});var Rt=E(Be=>{"use strict";var Br=Be&&Be.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Be,"__esModule",{value:!0});Be.convertHexStringToBase36String=void 0;var Or=Br(Ae()),Er=s=>new Or.default(s,16).toString(36);Be.convertHexStringToBase36String=Er});var vt=E(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.convertHexStringToByteArray=void 0;var Tr=s=>{if(s.length%2)throw new Error(`Invalid Hex String: ${s}`);let r=new Uint8Array(s.length/2);for(let p=0;p<s.length;p+=2){let m=parseInt(s.substr(p,2),16);if(Number.isNaN(m))throw new Error(`Invalid Hex String: ${s}`);r[p/2]=m}return r};Ve.convertHexStringToByteArray=Tr});var It=E($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.convertHexStringToDecString=void 0;var Pr=s=>{let r=[0],p,m,y;for(p=0;p<s.length;p+=1){for(y=parseInt(s.charAt(p),16),m=0;m<r.length;m+=1)r[m]=r[m]*16+y,y=r[m]/10|0,r[m]%=10;for(;y>0;)r.push(y%10),y=y/10|0}return r.reverse().join("")};$e.convertHexStringToDecString=Pr});var jt=E(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.convertHexStringToString=void 0;var Nr=_t(),Mr=vt(),qr=s=>(0,Nr.convertByteArrayToString)((0,Mr.convertHexStringToByteArray)(s));Xe.convertHexStringToString=qr});var Lt=E(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.convertStringToBase64String=void 0;var Gt=dt(),Fr=(s,r=!0)=>r?Gt.Base64.encodeURI(s):Gt.Base64.encode(s);Ze.convertStringToBase64String=Fr});var St=E(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.convertStringToByteArray=void 0;var Ur=s=>{let r=unescape(encodeURIComponent(s)),p=new Uint8Array(r.length);for(let m=0;m<r.length;++m)p[m]=r.charCodeAt(m);return p};We.convertStringToByteArray=Ur});var kt=E(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.convertStringToHexString=void 0;var Hr=St(),Rr=mt(),Ir=s=>(0,Rr.convertByteArrayToHexString)((0,Hr.convertStringToByteArray)(s));Qe.convertStringToHexString=Ir});var zt=E(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.convertAssetPriceToPlanck=Gr;var jr=je();function Gr(s,r){return jr.Amount.fromSigna(s).multiply(10**(r-8)).getPlanck()}});var Vt=E(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.convertPlanckToAssetPrice=kr;var Lr=je();function kr(s,r){return Lr.Amount.fromSigna(s).divide(10**r).getSigna()}});var Xt=E($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0})});var Zt=E(Se=>{"use strict";var zr=Se&&Se.__createBinding||(Object.create?function(s,r,p,m){m===void 0&&(m=p);var y=Object.getOwnPropertyDescriptor(r,p);(!y||("get"in y?!r.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return r[p]}}),Object.defineProperty(s,m,y)}:function(s,r,p,m){m===void 0&&(m=p),s[m]=r[p]}),Vr=Se&&Se.__exportStar||function(s,r){for(var p in s)p!=="default"&&!Object.prototype.hasOwnProperty.call(r,p)&&zr(r,s,p)};Object.defineProperty(Se,"__esModule",{value:!0});Vr(Xt(),Se)});var Oe=E(T=>{"use strict";var $r=T&&T.__createBinding||(Object.create?function(s,r,p,m){m===void 0&&(m=p);var y=Object.getOwnPropertyDescriptor(r,p);(!y||("get"in y?!r.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return r[p]}}),Object.defineProperty(s,m,y)}:function(s,r,p,m){m===void 0&&(m=p),s[m]=r[p]}),G=T&&T.__exportStar||function(s,r){for(var p in s)p!=="default"&&!Object.prototype.hasOwnProperty.call(r,p)&&$r(r,s,p)};Object.defineProperty(T,"__esModule",{value:!0});G(Bt(),T);G(Et(),T);G(ct(),T);G(je(),T);G(ft(),T);G(Pt(),T);G(Nt(),T);G(mt(),T);G(_t(),T);G(Ut(),T);G(Ht(),T);G(Rt(),T);G(vt(),T);G(It(),T);G(jt(),T);G(Lt(),T);G(St(),T);G(kt(),T);G(zt(),T);G(Vt(),T);G(Zt(),T)});var Yt={};it(Yt,{getContractDatablock:()=>Qt});function Qt(s,r,p=16){let m=r*16,y=m+p;if(y>s.machineData.length)throw new Error(`Insufficient length for variable at position: ${m} (and given length: ${p})`);if(y%2!==0)throw new Error(`Invalid position: ${m} (or given length: ${p}) - must be at least multiple of 2`);return(0,Wt.convertHexEndianess)(s.machineData.substr(m,p))}var Wt,xt=nt(()=>{"use strict";Wt=Ne(Oe())});var Zr,Jt=nt(()=>{"use strict";Zr=256});var er={};it(er,{countCodePages:()=>Kt});function Kt(s){return Math.ceil(s.length/2/256)}var At=nt(()=>{"use strict"});var tr=E(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ContractDataView=void 0;var bt=Oe(),Wr=(xt(),ot(Yt)),Qr=(At(),ot(er)),Dt=class s{_contract;static VariableLength=16;constructor(r){this._contract=r}getContract(){return this._contract}countCodePages(){return(0,Qr.countCodePages)(this._contract.machineCode)}getVariableAsString(r){let p=this.getHexDataAt(r,s.VariableLength);return(0,bt.convertHexStringToString)(p.replace(/00/g,""))}getDataBlocksAsString(r,p){let m=this.getHexDataAt(r,p*s.VariableLength);return(0,bt.convertHexStringToString)(m.replace(/00/g,""))}getVariableAsDecimal(r){return(0,bt.convertHexStringToDecString)(this.getVariable(r))}getVariable(r){return this.getHexDataAt(r,s.VariableLength)}getHexDataAt(r,p){let m=p||this._contract.machineData.length-s.VariableLength*r;return(0,Wr.getContractDatablock)(this._contract,r,m)}};Ye.ContractDataView=Dt});var ae={};it(ae,{CodePageSize:()=>Zr,convertShortStringToContractData:()=>Xr,countCodePages:()=>Kt,generateDataStack:()=>Jr,generateMethodCall:()=>Yr,getContractDatablock:()=>Qt});xt();var Ee=Ne(Oe());function Xr(s){if(s.length>8)throw new Error("At maximum 8 bytes/characters are supported");return(0,Ee.convertHexStringToDecString)((0,Ee.convertHexEndianess)((0,Ee.convertStringToHexString)(s)))}fe(ae,Ne(tr()));Jt();At();var Ke=Ne(Oe());var Je=s=>typeof s=="boolean"?s?"1":"0":typeof s=="number"?`${s}`:s;var Yr=s=>(s.methodArgs?[s.methodId,...s.methodArgs]:[s.methodId]).map(Je).map(p=>(0,Ke.convertDecStringToHexString)(p,16)).map(Ke.convertHexEndianess).join("");var et=Ne(Oe());var Jr=s=>s.map(Je).map(r=>(0,et.convertDecStringToHexString)(r,16)).map(et.convertHexEndianess).join("");return ot(ae);})();
//# sourceMappingURL=signumjs.contracts.min.js.map