New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@burstjs/util

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@burstjs/util - npm Package Compare versions

Comparing version 0.6.0-alpha.9 to 0.6.0-beta.1

dist/convertBase36StringToHexString.d.ts

1

CHANGELOG.md

@@ -6,2 +6,3 @@ # Change Log

- `BurstValue.clone()` added
- Added hex <> base36 conversion

@@ -8,0 +9,0 @@

2

dist/burstjs.util.min.js

@@ -1,2 +0,2 @@

var b$util=function(exports){"use strict";var GenesisBlockTime=Date.UTC(2014,7,11,2,0,0,0)/1e3,initialCodeword=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],gexp=[1,2,4,8,16,5,10,20,13,26,17,7,14,28,29,31,27,19,3,6,12,24,21,15,30,25,23,11,22,9,18,1],glog=[0,0,1,18,2,5,19,11,3,29,6,27,20,8,12,23,4,10,30,17,7,22,28,26,21,25,9,16,13,14,24,15],cwmap=[3,2,1,0,7,6,5,4,13,14,15,16,12,8,9,10,11],alphabet="23456789ABCDEFGHJKLMNPQRSTUVWXYZ".split(""),base32Length=13,gmult=function(e,r){if(0===e||0===r)return 0;var t=(glog[e]+glog[r])%31;return gexp[t]},isValid=function(e){0===e.indexOf("BURST-")&&(e=e.substr(6));for(var r=initialCodeword.slice(),t=0,n=0;n<e.length;n++){var o=alphabet.indexOf(e.charAt(n));if(!(o<=-1||o>alphabet.length)){if(t>16)return!1;r[cwmap[t]]=o,t++}}if(17!==t)return!1;for(var i=0,a=1;a<5;a++){for(var u=0,c=0;c<31;c++)if(!(c>12&&c<27)){var s=c;c>26&&(s-=14),u^=gmult(r[s],gexp[a*c%31])}i|=u}return 0===i},isBurstAddress=function(e){return/^BURST\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{5}/i.test(e)&&isValid(e)},convertAddressToNumericId=function(e){if(null!=e&&0!==e.trim().length&&0===e.indexOf("BURST-")){e=e.substr(6);for(var r=initialCodeword.slice(),t=0,n=0;n<e.length;n++){var o=alphabet.indexOf(e.charAt(n));if(!(o<=-1||o>alphabet.length)){if(t>16)return;r[cwmap[t]]=o,t++}}if(isValid(e)){for(var i=base32Length,a=[],u=0;u<i;u++)a[u]=r[i-u-1];var c,s="",l=0;do{c=0,l=0;for(var f=0;f<i;f++)(l=32*l+a[f])>=10?(a[c]=Math.floor(l/10),l%=10,c+=1):c>0&&(a[c]=0,c+=1);i=c,s+=l}while(i>0);return s.split("").reverse().join("")}}},convertBurstTimeToEpochTime=function(e){return 1e3*(GenesisBlockTime+e)},convertBurstTimeToDate=function(e){return new Date(convertBurstTimeToEpochTime(e))},convertByteArrayToHexString=function(e){for(var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return r?t.join("").toUpperCase():t.join("")},convertByteArrayToString=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(0===t)return"";var n=e;if(0!==r){var o=null===t?e.length-r:t;checkBytesToIntInput(n,o,r),n=e.slice(r,r+o)}return decodeURIComponent(escape(String.fromCharCode.apply(null,Array.from(n))))};function checkBytesToIntInput(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t<0)throw new Error("Start index should not be negative");if(e.length<t+r)throw new Error("Need at least "+r+" bytes to convert to an integer");return t}var convertDateToBurstTime=function(e){return Math.round(e.getTime()/1e3)-GenesisBlockTime},convertHexEndianess=function(e){for(var r="",t=e,n=t.length-1;n>=0;n-=2)r+=t[n-1]+t[n];return r},convertHexStringToByteArray=function(e){if(e.length%2)throw new Error("Invalid Hex String: ".concat(e));for(var r=new Uint8Array(e.length/2),t=0;t<e.length;t+=2){var n=parseInt(e.substr(t,2),16);if(Number.isNaN(n))throw new Error("Invalid Hex String: ".concat(e));r[t/2]=n}return r},convertHexStringToDecString=function(e){var r,t,n,o=[0];for(r=0;r<e.length;r+=1){for(n=parseInt(e.charAt(r),16),t=0;t<o.length;t+=1)o[t]=16*o[t]+n,n=o[t]/10|0,o[t]%=10;for(;n>0;)o.push(n%10),n=n/10|0}return o.reverse().join("")};String.prototype.padStart||(String.prototype.padStart=function(e,r){return e>>=0,r=String(void 0!==r?r:" "),this.length>=e?String(this):((e-=this.length)>r.length&&(r+=r.repeat(e/r.length)),r.slice(0,e)+String(this))});var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var r,t,n,o,i,a,u,c,s,l=y.prototype={constructor:y,toString:null,valueOf:null},f=new y(1),h=20,g=4,d=-7,p=21,m=-1e7,b=1e7,v=!1,S=1,B=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz";function y(e,r){var o,i,a,u,c,s,l,f,d=this;if(!(d instanceof y))return new y(e,r);if(null==r){if(e&&!0===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>b?d.c=d.e=null:e.e<m?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,c=e;c>=10;c/=10,u++);return void(u>b?d.c=d.e=null:(d.e=u,d.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return n(d,f,s);d.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(u<0&&(u=c),u+=+f.slice(c+1),f=f.substring(0,c)):u<0&&(u=f.length)}else{if(intCheck(r,2,E.length,"Base"),10==r)return x(d=new y(e),h+d.e+1,g);if(f=String(e),s="number"==typeof e){if(0*e!=0)return n(d,f,s,r);if(d.s=1/e<0?(f=f.slice(1),-1):1,y.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else d.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(o=E.slice(0,r),u=c=0,l=f.length;c<l;c++)if(o.indexOf(i=f.charAt(c))<0){if("."==i){if(c>u){u=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,c=-1,u=0;continue}return n(d,String(e),s,r)}s=!1,(u=(f=t(f,r,10,d.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,s&&y.DEBUG&&l>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+d.s*e);if((u=u-c-1)>b)d.c=d.e=null;else if(u<m)d.c=[d.e=0];else{if(d.e=u,d.c=[],c=(u+1)%LOG_BASE,u<0&&(c+=LOG_BASE),c<l){for(c&&d.c.push(+f.slice(0,c)),l-=LOG_BASE;c<l;)d.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");d.c.push(+f)}}else d.c=[d.e=0]}function T(e,r,t,n){var o,i,a,u,c;if(null==t?t=g:intCheck(t,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==r)c=coeffToString(e.c),c=1==n||2==n&&(a<=d||a>=p)?toExponential(c,a):toFixedPoint(c,a,"0");else if(i=(e=x(new y(e),r,t)).e,u=(c=coeffToString(e.c)).length,1==n||2==n&&(r<=i||i<=d)){for(;u<r;c+="0",u++);c=toExponential(c,i)}else if(r-=a,c=toFixedPoint(c,i,"0"),i+1>u){if(--r>0)for(c+=".";r--;c+="0");}else if((r+=i-u)>0)for(i+1==u&&(c+=".");r--;c+="0");return e.s<0&&o?"-"+c:c}function _(e,r){for(var t,n=1,o=new y(e[0]);n<e.length;n++){if(!(t=new y(e[n])).s){o=t;break}r.call(o,t)&&(o=t)}return o}function w(e,r,t){for(var n=1,o=r.length;!r[--o];r.pop());for(o=r[0];o>=10;o/=10,n++);return(t=n+t*LOG_BASE-1)>b?e.c=e.e=null:t<m?e.c=[e.e=0]:(e.e=t,e.c=r),e}function x(e,r,t,n){var o,i,a,u,c,s,l,f=e.c,h=POWS_TEN;if(f){e:{for(o=1,u=f[0];u>=10;u/=10,o++);if((i=r-o)<0)i+=LOG_BASE,a=r,l=(c=f[s=0])/h[o-a-1]%10|0;else if((s=mathceil((i+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=s;f.push(0));c=l=0,o=1,a=(i%=LOG_BASE)-LOG_BASE+1}else{for(c=u=f[s],o=1;u>=10;u/=10,o++);l=(a=(i%=LOG_BASE)-LOG_BASE+o)<0?0:c/h[o-a-1]%10|0}if(n=n||r<0||null!=f[s+1]||(a<0?c:c%h[o-a-1]),n=t<4?(l||n)&&(0==t||t==(e.s<0?3:2)):l>5||5==l&&(4==t||n||6==t&&(i>0?a>0?c/h[o-a]:0:f[s-1])%10&1||t==(e.s<0?8:7)),r<1||!f[0])return f.length=0,n?(r-=e.e+1,f[0]=h[(LOG_BASE-r%LOG_BASE)%LOG_BASE],e.e=-r||0):f[0]=e.e=0,e;if(0==i?(f.length=s,u=1,s--):(f.length=s+1,u=h[LOG_BASE-i],f[s]=a>0?mathfloor(c/h[o-a]%h[a])*u:0),n)for(;;){if(0==s){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=u,u=1;a>=10;a/=10,u++);i!=u&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[s]+=u,f[s]!=BASE)break;f[s--]=0,u=1}for(i=f.length;0===f[--i];f.pop());}e.e>b?e.c=e.e=null:e.e<m&&(e.c=[e.e=0])}return e}function C(e){var r,t=e.e;return null===t?e.toString():(r=coeffToString(e.c),r=t<=d||t>=p?toExponential(r,t):toFixedPoint(r,t,"0"),e.s<0?"-"+r:r)}return y.clone=clone,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(e){var r,t;if(null!=e){if("object"!=typeof e)throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(intCheck(t=e[r],0,MAX,r),h=t),e.hasOwnProperty(r="ROUNDING_MODE")&&(intCheck(t=e[r],0,8,r),g=t),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((t=e[r])&&t.pop?(intCheck(t[0],-MAX,0,r),intCheck(t[1],0,MAX,r),d=t[0],p=t[1]):(intCheck(t,-MAX,MAX,r),d=-(p=t<0?-t:t))),e.hasOwnProperty(r="RANGE"))if((t=e[r])&&t.pop)intCheck(t[0],-MAX,-1,r),intCheck(t[1],1,MAX,r),m=t[0],b=t[1];else{if(intCheck(t,-MAX,MAX,r),!t)throw Error(bignumberError+r+" cannot be zero: "+t);m=-(b=t<0?-t:t)}if(e.hasOwnProperty(r="CRYPTO")){if((t=e[r])!==!!t)throw Error(bignumberError+r+" not true or false: "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw v=!t,Error(bignumberError+"crypto unavailable");v=t}else v=t}if(e.hasOwnProperty(r="MODULO_MODE")&&(intCheck(t=e[r],0,9,r),S=t),e.hasOwnProperty(r="POW_PRECISION")&&(intCheck(t=e[r],0,MAX,r),B=t),e.hasOwnProperty(r="FORMAT")){if("object"!=typeof(t=e[r]))throw Error(bignumberError+r+" not an object: "+t);A=t}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(t=e[r])||/^.$|[+-.\s]|(.).*\1/.test(t))throw Error(bignumberError+r+" invalid: "+t);E=t}}return{DECIMAL_PLACES:h,ROUNDING_MODE:g,EXPONENTIAL_AT:[d,p],RANGE:[m,b],CRYPTO:v,MODULO_MODE:S,POW_PRECISION:B,FORMAT:A,ALPHABET:E}},y.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!y.DEBUG)return!0;var r,t,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-MAX&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((r=(o+1)%LOG_BASE)<1&&(r+=LOG_BASE),String(n[0]).length==r){for(r=0;r<n.length;r++)if((t=n[r])<0||t>=BASE||t!==mathfloor(t))break e;if(0!==t)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},y.maximum=y.max=function(){return _(arguments,l.lt)},y.minimum=y.min=function(){return _(arguments,l.gt)},y.random=(o=9007199254740992*Math.random()&2097151?function(){return mathfloor(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,t,n,i,a,u=0,c=[],s=new y(f);if(null==e?e=h:intCheck(e,0,MAX),i=mathceil(e/LOG_BASE),v)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)(a=131072*r[u]+(r[u+1]>>>11))>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),r[u]=t[0],r[u+1]=t[1]):(c.push(a%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw v=!1,Error(bignumberError+"crypto unavailable");for(r=crypto.randomBytes(i*=7);u<i;)(a=281474976710656*(31&r[u])+1099511627776*r[u+1]+4294967296*r[u+2]+16777216*r[u+3]+(r[u+4]<<16)+(r[u+5]<<8)+r[u+6])>=9e15?crypto.randomBytes(7).copy(r,u):(c.push(a%1e14),u+=7);u=i/7}if(!v)for(;u<i;)(a=o())<9e15&&(c[u++]=a%1e14);for(i=c[--u],e%=LOG_BASE,i&&e&&(a=POWS_TEN[LOG_BASE-e],c[u]=mathfloor(i/a)*a);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(u=1,a=c[0];a>=10;a/=10,u++);u<LOG_BASE&&(n-=LOG_BASE-u)}return s.e=n,s.c=c,s}),y.sum=function(){for(var e=1,r=arguments,t=new y(r[0]);e<r.length;)t=t.plus(r[e++]);return t},t=function(){function e(e,r,t,n){for(var o,i,a=[0],u=0,c=e.length;u<c;){for(i=a.length;i--;a[i]*=r);for(a[0]+=n.indexOf(e.charAt(u++)),o=0;o<a.length;o++)a[o]>t-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/t|0,a[o]%=t)}return a.reverse()}return function(t,n,o,i,a){var u,c,s,l,f,d,p,m,b=t.indexOf("."),v=h,S=g;for(b>=0&&(l=B,B=0,t=t.replace(".",""),d=(m=new y(n)).pow(t.length-b),B=l,m.c=e(toFixedPoint(coeffToString(d.c),d.e,"0"),10,o,"0123456789"),m.e=m.c.length),s=l=(p=e(t,n,o,a?(u=E,"0123456789"):(u="0123456789",E))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(b<0?--s:(d.c=p,d.e=s,d.s=i,p=(d=r(d,m,v,S,o)).c,f=d.r,s=d.e),b=p[c=s+v+1],l=o/2,f=f||c<0||null!=p[c+1],f=S<4?(null!=b||f)&&(0==S||S==(d.s<0?3:2)):b>l||b==l&&(4==S||f||6==S&&1&p[c-1]||S==(d.s<0?8:7)),c<1||!p[0])t=f?toFixedPoint(u.charAt(1),-v,u.charAt(0)):u.charAt(0);else{if(p.length=c,f)for(--o;++p[--c]>o;)p[c]=0,c||(++s,p=[1].concat(p));for(l=p.length;!p[--l];);for(b=0,t="";b<=l;t+=u.charAt(p[b++]));t=toFixedPoint(t,s,u.charAt(0))}return t}}(),r=function(){function e(e,r,t){var n,o,i,a,u=0,c=e.length,s=r%SQRT_BASE,l=r/SQRT_BASE|0;for(e=e.slice();c--;)u=((o=s*(i=e[c]%SQRT_BASE)+(n=l*i+(a=e[c]/SQRT_BASE|0)*s)%SQRT_BASE*SQRT_BASE+u)/t|0)+(n/SQRT_BASE|0)+l*a,e[c]=o%t;return u&&(e=[u].concat(e)),e}function r(e,r,t,n){var o,i;if(t!=n)i=t>n?1:-1;else for(o=i=0;o<t;o++)if(e[o]!=r[o]){i=e[o]>r[o]?1:-1;break}return i}function t(e,r,t,n){for(var o=0;t--;)e[t]-=o,o=e[t]<r[t]?1:0,e[t]=o*n+e[t]-r[t];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,u){var c,s,l,f,h,g,d,p,m,b,v,S,B,A,E,T,_,w=n.s==o.s?1:-1,C=n.c,O=o.c;if(!(C&&C[0]&&O&&O[0]))return new y(n.s&&o.s&&(C?!O||C[0]!=O[0]:O)?C&&0==C[0]||!O?0*w:w/0:NaN);for(m=(p=new y(w)).c=[],w=i+(s=n.e-o.e)+1,u||(u=BASE,s=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),w=w/LOG_BASE|0),l=0;O[l]==(C[l]||0);l++);if(O[l]>(C[l]||0)&&s--,w<0)m.push(1),f=!0;else{for(A=C.length,T=O.length,l=0,w+=2,(h=mathfloor(u/(O[0]+1)))>1&&(O=e(O,h,u),C=e(C,h,u),T=O.length,A=C.length),B=T,v=(b=C.slice(0,T)).length;v<T;b[v++]=0);_=O.slice(),_=[0].concat(_),E=O[0],O[1]>=u/2&&E++;do{if(h=0,(c=r(O,b,T,v))<0){if(S=b[0],T!=v&&(S=S*u+(b[1]||0)),(h=mathfloor(S/E))>1)for(h>=u&&(h=u-1),d=(g=e(O,h,u)).length,v=b.length;1==r(g,b,d,v);)h--,t(g,T<d?_:O,d,u),d=g.length,c=1;else 0==h&&(c=h=1),d=(g=O.slice()).length;if(d<v&&(g=[0].concat(g)),t(b,g,v,u),v=b.length,-1==c)for(;r(O,b,T,v)<1;)h++,t(b,T<v?_:O,v,u),v=b.length}else 0===c&&(h++,b=[0]);m[l++]=h,b[0]?b[v++]=C[B]||0:(b=[C[B]],v=1)}while((B++<A||null!=b[0])&&w--);f=null!=b[0],m[0]||m.splice(0,1)}if(u==BASE){for(l=1,w=m[0];w>=10;w/=10,l++);x(p,i+(p.e=l+s*LOG_BASE-1)+1,a,f)}else p.e=s,p.r=+f;return p}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,a=/^([^.]+)\.$/,u=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,s=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,r,t,n){var o,l=t?r:r.replace(s,"");if(c.test(l))e.s=isNaN(l)?null:l<0?-1:1;else{if(!t&&(l=l.replace(i,function(e,r,t){return o="x"==(t=t.toLowerCase())?16:"b"==t?2:8,n&&n!=o?e:r}),n&&(o=n,l=l.replace(a,"$1").replace(u,"0.$1")),r!=l))return new y(l,o);if(y.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+r);e.s=null}e.c=e.e=null},l.absoluteValue=l.abs=function(){var e=new y(this);return e.s<0&&(e.s=1),e},l.comparedTo=function(e,r){return compare(this,new y(e,r))},l.decimalPlaces=l.dp=function(e,r){var t,n,o,i=this;if(null!=e)return intCheck(e,0,MAX),null==r?r=g:intCheck(r,0,8),x(new y(i),e+i.e+1,r);if(!(t=i.c))return null;if(n=((o=t.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=t[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},l.dividedBy=l.div=function(e,t){return r(this,new y(e,t),h,g)},l.dividedToIntegerBy=l.idiv=function(e,t){return r(this,new y(e,t),0,1)},l.exponentiatedBy=l.pow=function(e,r){var t,n,o,i,a,u,c,s,l=this;if((e=new y(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+C(e));if(null!=r&&(r=new y(r)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return s=new y(Math.pow(+C(l),a?2-isOdd(e):+C(e))),r?s.mod(r):s;if(u=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new y(NaN);(n=!u&&l.isInteger()&&r.isInteger())&&(l=l.mod(r))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&isOdd(e)?-0:0,l.e>-1&&(i=1/i),new y(u?1/i:i);B&&(i=mathceil(B/LOG_BASE+2))}for(a?(t=new y(.5),u&&(e.s=1),c=isOdd(e)):c=(o=Math.abs(+C(e)))%2,s=new y(f);;){if(c){if(!(s=s.times(l)).c)break;i?s.c.length>i&&(s.c.length=i):n&&(s=s.mod(r))}if(o){if(0===(o=mathfloor(o/2)))break;c=o%2}else if(x(e=e.times(t),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(o=+C(e)))break;c=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(r))}return n?s:(u&&(s=f.div(s)),r?s.mod(r):i?x(s,B,g,void 0):s)},l.integerValue=function(e){var r=new y(this);return null==e?e=g:intCheck(e,0,8),x(r,r.e+1,e)},l.isEqualTo=l.eq=function(e,r){return 0===compare(this,new y(e,r))},l.isFinite=function(){return!!this.c},l.isGreaterThan=l.gt=function(e,r){return compare(this,new y(e,r))>0},l.isGreaterThanOrEqualTo=l.gte=function(e,r){return 1===(r=compare(this,new y(e,r)))||0===r},l.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},l.isLessThan=l.lt=function(e,r){return compare(this,new y(e,r))<0},l.isLessThanOrEqualTo=l.lte=function(e,r){return-1===(r=compare(this,new y(e,r)))||0===r},l.isNaN=function(){return!this.s},l.isNegative=function(){return this.s<0},l.isPositive=function(){return this.s>0},l.isZero=function(){return!!this.c&&0==this.c[0]},l.minus=function(e,r){var t,n,o,i,a=this,u=a.s;if(r=(e=new y(e,r)).s,!u||!r)return new y(NaN);if(u!=r)return e.s=-r,a.plus(e);var c=a.e/LOG_BASE,s=e.e/LOG_BASE,l=a.c,f=e.c;if(!c||!s){if(!l||!f)return l?(e.s=-r,e):new y(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-r,e):new y(l[0]?a:3==g?-0:0)}if(c=bitFloor(c),s=bitFloor(s),l=l.slice(),u=c-s){for((i=u<0)?(u=-u,o=l):(s=c,o=f),o.reverse(),r=u;r--;o.push(0));o.reverse()}else for(n=(i=(u=l.length)<(r=f.length))?u:r,u=r=0;r<n;r++)if(l[r]!=f[r]){i=l[r]<f[r];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(r=(n=f.length)-(t=l.length))>0)for(;r--;l[t++]=0);for(r=BASE-1;n>u;){if(l[--n]<f[n]){for(t=n;t&&!l[--t];l[t]=r);--l[t],l[n]+=BASE}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--s);return l[0]?w(e,l,s):(e.s=3==g?-1:1,e.c=[e.e=0],e)},l.modulo=l.mod=function(e,t){var n,o,i=this;return e=new y(e,t),!i.c||!e.s||e.c&&!e.c[0]?new y(NaN):!e.c||i.c&&!i.c[0]?new y(i):(9==S?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,S),(e=i.minus(n.times(e))).c[0]||1!=S||(e.s=i.s),e)},l.multipliedBy=l.times=function(e,r){var t,n,o,i,a,u,c,s,l,f,h,g,d,p,m,b=this,v=b.c,S=(e=new y(e,r)).c;if(!(v&&S&&v[0]&&S[0]))return!b.s||!e.s||v&&!v[0]&&!S||S&&!S[0]&&!v?e.c=e.e=e.s=null:(e.s*=b.s,v&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(b.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=b.s,(c=v.length)<(f=S.length)&&(d=v,v=S,S=d,o=c,c=f,f=o),o=c+f,d=[];o--;d.push(0));for(p=BASE,m=SQRT_BASE,o=f;--o>=0;){for(t=0,h=S[o]%m,g=S[o]/m|0,i=o+(a=c);i>o;)t=((s=h*(s=v[--a]%m)+(u=g*s+(l=v[a]/m|0)*h)%m*m+d[i]+t)/p|0)+(u/m|0)+g*l,d[i--]=s%p;d[i]=t}return t?++n:d.splice(0,1),w(e,d,n)},l.negated=function(){var e=new y(this);return e.s=-e.s||null,e},l.plus=function(e,r){var t,n=this,o=n.s;if(r=(e=new y(e,r)).s,!o||!r)return new y(NaN);if(o!=r)return e.s=-r,n.minus(e);var i=n.e/LOG_BASE,a=e.e/LOG_BASE,u=n.c,c=e.c;if(!i||!a){if(!u||!c)return new y(o/0);if(!u[0]||!c[0])return c[0]?e:new y(u[0]?n:0*o)}if(i=bitFloor(i),a=bitFloor(a),u=u.slice(),o=i-a){for(o>0?(a=i,t=c):(o=-o,t=u),t.reverse();o--;t.push(0));t.reverse()}for((o=u.length)-(r=c.length)<0&&(t=c,c=u,u=t,r=o),o=0;r;)o=(u[--r]=u[r]+c[r]+o)/BASE|0,u[r]=BASE===u[r]?0:u[r]%BASE;return o&&(u=[o].concat(u),++a),w(e,u,a)},l.precision=l.sd=function(e,r){var t,n,o,i=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==r?r=g:intCheck(r,0,8),x(new y(i),e,r);if(!(t=i.c))return null;if(n=(o=t.length-1)*LOG_BASE+1,o=t[o]){for(;o%10==0;o/=10,n--);for(o=t[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},l.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},l.squareRoot=l.sqrt=function(){var e,t,n,o,i,a=this,u=a.c,c=a.s,s=a.e,l=h+4,f=new y("0.5");if(1!==c||!u||!u[0])return new y(!c||c<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(c=Math.sqrt(+C(a)))||c==1/0?(((t=coeffToString(u)).length+s)%2==0&&(t+="0"),c=Math.sqrt(+t),s=bitFloor((s+1)/2)-(s<0||s%2),n=new y(t=c==1/0?"1e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new y(c+""),n.c[0])for((c=(s=n.e)+l)<3&&(c=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),coeffToString(i.c).slice(0,c)===(t=coeffToString(n.c)).slice(0,c)){if(n.e<s&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(x(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!o&&(x(i,i.e+h+2,0),i.times(i).eq(a))){n=i;break}l+=4,c+=4,o=1}return x(n,n.e+h+1,g,e)},l.toExponential=function(e,r){return null!=e&&(intCheck(e,0,MAX),e++),T(this,e,r,1)},l.toFixed=function(e,r){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),T(this,e,r)},l.toFormat=function(e,r,t){var n,o=this;if(null==t)null!=e&&r&&"object"==typeof r?(t=r,r=null):e&&"object"==typeof e?(t=e,e=r=null):t=A;else if("object"!=typeof t)throw Error(bignumberError+"Argument not an object: "+t);if(n=o.toFixed(e,r),o.c){var i,a=n.split("."),u=+t.groupSize,c=+t.secondaryGroupSize,s=t.groupSeparator||"",l=a[0],f=a[1],h=o.s<0,g=h?l.slice(1):l,d=g.length;if(c&&(i=u,u=c,c=i,d-=i),u>0&&d>0){for(i=d%u||u,l=g.substr(0,i);i<d;i+=u)l+=s+g.substr(i,u);c>0&&(l+=s+g.slice(i)),h&&(l="-"+l)}n=f?l+(t.decimalSeparator||"")+((c=+t.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(t.fractionGroupSeparator||"")):f):l}return(t.prefix||"")+n+(t.suffix||"")},l.toFraction=function(e){var t,n,o,i,a,u,c,s,l,h,d,p,m=this,v=m.c;if(null!=e&&(!(c=new y(e)).isInteger()&&(c.c||1!==c.s)||c.lt(f)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+C(c));if(!v)return new y(m);for(t=new y(f),l=n=new y(f),o=s=new y(f),p=coeffToString(v),a=t.e=p.length-m.e-1,t.c[0]=POWS_TEN[(u=a%LOG_BASE)<0?LOG_BASE+u:u],e=!e||c.comparedTo(t)>0?a>0?t:l:c,u=b,b=1/0,c=new y(p),s.c[0]=0;h=r(c,t,0,1),1!=(i=n.plus(h.times(o))).comparedTo(e);)n=o,o=i,l=s.plus(h.times(i=l)),s=i,t=c.minus(h.times(i=t)),c=i;return i=r(e.minus(n),o,0,1),s=s.plus(i.times(l)),n=n.plus(i.times(o)),s.s=l.s=m.s,d=r(l,o,a*=2,g).minus(m).abs().comparedTo(r(s,n,a,g).minus(m).abs())<1?[l,o]:[s,n],b=u,d},l.toNumber=function(){return+C(this)},l.toPrecision=function(e,r){return null!=e&&intCheck(e,1,MAX),T(this,e,r,2)},l.toString=function(e){var r,n=this,o=n.s,i=n.e;return null===i?o?(r="Infinity",o<0&&(r="-"+r)):r="NaN":(null==e?r=i<=d||i>=p?toExponential(coeffToString(n.c),i):toFixedPoint(coeffToString(n.c),i,"0"):10===e?r=toFixedPoint(coeffToString((n=x(new y(n),h+i+1,g)).c),n.e,"0"):(intCheck(e,2,E.length,"Base"),r=t(toFixedPoint(coeffToString(n.c),i,"0"),10,e,o,!0)),o<0&&n.c[0]&&(r="-"+r)),r},l.valueOf=l.toJSON=function(){return C(this)},l._isBigNumber=!0,l[Symbol.toStringTag]="BigNumber",l[Symbol.for("nodejs.util.inspect.custom")]=l.valueOf,null!=e&&y.set(e),y}function bitFloor(e){var r=0|e;return e>0||e===r?r:r-1}function coeffToString(e){for(var r,t,n=1,o=e.length,i=e[0]+"";n<o;){for(r=e[n++]+"",t=LOG_BASE-r.length;t--;r="0"+r);i+=r}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function compare(e,r){var t,n,o=e.c,i=r.c,a=e.s,u=r.s,c=e.e,s=r.e;if(!a||!u)return null;if(t=o&&!o[0],n=i&&!i[0],t||n)return t?n?0:-u:a;if(a!=u)return a;if(t=a<0,n=c==s,!o||!i)return n?0:!o^t?1:-1;if(!n)return c>s^t?1:-1;for(u=(c=o.length)<(s=i.length)?c:s,a=0;a<u;a++)if(o[a]!=i[a])return o[a]>i[a]^t?1:-1;return c==s?0:c>s^t?1:-1}function intCheck(e,r,t,n){if(e<r||e>t||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<r||e>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var r=e.c.length-1;return bitFloor(e.e/LOG_BASE)==r&&e.c[r]%2!=0}function toExponential(e,r){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function toFixedPoint(e,r,t){var n,o;if(r<0){for(o=t+".";++r;o+=t);e=o+e}else if(++r>(n=e.length)){for(o=t,r-=n;--r;o+=t);e+=o}else r<n&&(e=e.slice(0,r)+"."+e.slice(r));return e}var BigNumber=clone(),twosComplementBinary=function(e){for(var r=e.multipliedBy(-1).toString(2);r.length%8;)r="0"+r;var t="1"===r[0]&&-1!==r.slice(1).indexOf("1")?"11111111":"";return r=r.split("").map(function(e){return"0"===e?"1":"0"}).join(""),new BigNumber(t+r,2).plus(1)},convertDecStringToHexString=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t="string"==typeof e?new BigNumber(e):e;if(t.isNaN())throw new Error("Invalid decimal argument: [".concat(e,"] - Expected a valid decimal value"));if(r<0)throw new Error("Invalid padding argument: [".concat(r,"] - Expected a positive value"));var n=t.lt(0);n&&(t=twosComplementBinary(t));var o=t.toString(16),i=Math.ceil(o.length/r);return o.padStart(i*r,n?"f":"0")},convertHexStringToString=function(e){return convertByteArrayToString(convertHexStringToByteArray(e))},convertNQTStringToNumber=function(e){if(null==e||""===e)throw new Error("Invalid argument");return parseFloat(e)/1e8},convertNumberToNQTString=function(e){if(null==e)throw new Error("Invalid argument");return parseFloat(e.toString()).toFixed(8).replace(".","")},convertNumericIdToAddress=function(e){if(null!=e&&0!==e.trim().length){for(var r=[],t=initialCodeword.slice(),n=0,o=e.length,i=0;i<o;i++)r[i]=e.charCodeAt(i)-"0".charCodeAt(0);var a=0,u=0;do{a=0,u=0;for(var c=0;c<o;c++)(a=10*a+r[c])>=32?(r[u]=a>>5,a&=31,u++):u>0&&(r[u]=0,u++);o=u,t[n]=a,n++}while(o>0);for(var s=[0,0,0,0],l=base32Length-1;l>=0;l--){var f=t[l]^s[3];s[3]=s[2]^gmult(30,f),s[2]=s[1]^gmult(6,f),s[1]=s[0]^gmult(9,f),s[0]=gmult(17,f)}t[13]=s[0],t[14]=s[1],t[15]=s[2],t[16]=s[3];for(var h="BURST-",g=0;g<17;g++)h+=alphabet[t[cwmap[g]]],3==(3&g)&&g<13&&(h+="-");return h}},convertStringToByteArray=function(e){for(var r=unescape(encodeURIComponent(e)),t=new Uint8Array(r.length),n=0;n<r.length;++n)t[n]=r.charCodeAt(n);return t},convertStringToHexString=function(e){return convertByteArrayToHexString(convertStringToByteArray(e))},EncoderFormat;EncoderFormat=exports.EncoderFormat||(exports.EncoderFormat={}),EncoderFormat[EncoderFormat.Text=0]="Text",EncoderFormat[EncoderFormat.Hexadecimal=1]="Hexadecimal",EncoderFormat[EncoderFormat.Base64=2]="Base64";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,r){return e(r={exports:{}},r.exports),r.exports}var base64=createCommonjsModule(function(module,exports){var global,factory;global="undefined"!=typeof self?self:"undefined"!=typeof window?window:commonjsGlobal,factory=function(global){global=global||{};var _Base64=global.Base64,version="2.5.1",buffer;if(module.exports)try{buffer=eval("require('buffer').Buffer")}catch(e){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var r={},t=0,n=e.length;t<n;t++)r[e.charAt(t)]=t;return r}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2)return(r=e.charCodeAt(0))<128?e:r<2048?fromCharCode(192|r>>>6)+fromCharCode(128|63&r):fromCharCode(224|r>>>12&15)+fromCharCode(128|r>>>6&63)+fromCharCode(128|63&r);var r=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|r>>>18&7)+fromCharCode(128|r>>>12&63)+fromCharCode(128|r>>>6&63)+fromCharCode(128|63&r)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var r=[0,2,1][e.length%3],t=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[b64chars.charAt(t>>>18),b64chars.charAt(t>>>12&63),r>=2?"=":b64chars.charAt(t>>>6&63),r>=1?"=":b64chars.charAt(63&t)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,r){return r?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var r=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(r>>>10))+fromCharCode(56320+(1023&r));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var r=e.length,t=r%4,n=(r>0?b64tab[e.charAt(0)]<<18:0)|(r>1?b64tab[e.charAt(1)]<<12:0)|(r>2?b64tab[e.charAt(2)]<<6:0)|(r>3?b64tab[e.charAt(3)]:0),o=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(255&n)];return o.length-=[0,0,2,1][t],o.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),module.exports&&(module.exports.Base64=global.Base64),{Base64:global.Base64}},module.exports=factory(global)}),base64_1=base64.Base64,convertStringToBase64String=function(e){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?base64_1.encodeURI(e):base64_1.encode(e)};function encodePayload(e,r){var t=e;switch("string"!=typeof e&&(t=JSON.stringify(e)),r){case exports.EncoderFormat.Hexadecimal:return convertStringToHexString(t);case exports.EncoderFormat.Base64:return convertStringToBase64String(t);case exports.EncoderFormat.Text:default:return t}}var createDeeplink=function(e){var r=e.encoderFormat,t=void 0===r?exports.EncoderFormat.Base64:r,n=e.domain,o=e.action,i=e.payload,a="burst.".concat(n,"://v1");return o&&(a+="?action=".concat(o)),i&&(a+="&payload=".concat(encodePayload(i,t))),a},MandatoryPattern=/^burst.(.+):\/\/(v.+?)\??/i,parseDeeplink=function(e){var r=function(){throw new Error("Invalid deeplink: "+e)},t=function(e,t){return e.startsWith(t+"=")||r(),e.split("=")[1]},n=e.match(MandatoryPattern);n&&3===n.length||r();var o={domain:n[1],version:n[2],action:void 0,payload:void 0,decodedPayload:void 0};try{var i=e.indexOf("?");if(-1!==i){var a=e.substring(i+1).split("&");a.length>=1&&(a.length>2&&r(),o.action=t(a[0],"action"),2===a.length&&(o.payload=t(a[1],"payload")))}}catch(e){r()}return o};function sumNQTStringToNumber(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.reduce(function(e,r){return e+convertNQTStringToNumber(r)},0)}var BurstSymbol="Ƀ",BurstPlanckSymbol="ƀ",FeeQuantPlanck=735e3,OneBurstPlanck=1e8;function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),e}var BurstTime=function(){function e(r){_classCallCheck(this,e),this._burstTimestamp=r}return _createClass(e,[{key:"getBurstTimestamp",value:function(){return this._burstTimestamp}},{key:"setBurstTimestamp",value:function(e){this._burstTimestamp=e}},{key:"getEpoch",value:function(){return 1e3*(GenesisBlockTime+this._burstTimestamp)}},{key:"getDate",value:function(){return new Date(this.getEpoch())}},{key:"setDate",value:function(e){this._burstTimestamp=Math.round(e.getTime()/1e3)-GenesisBlockTime}},{key:"equals",value:function(e){return this._burstTimestamp===e._burstTimestamp}},{key:"before",value:function(e){return this._burstTimestamp<e._burstTimestamp}},{key:"after",value:function(e){return this._burstTimestamp>e._burstTimestamp}}],[{key:"fromBurstTimestamp",value:function(r){return new e(r)}},{key:"fromDate",value:function(r){var t=new e(0);return t.setDate(r),t}}]),e}(),BurstValueFormat;function assureValidValue(e){if(!e||!/^-?\d*(\.\d+)?$/.test(e))throw new Error("Invalid value: ".concat(e))}BigNumber.config({EXPONENTIAL_AT:[-9,20]}),BurstValueFormat=exports.BurstValueFormat||(exports.BurstValueFormat={}),BurstValueFormat[BurstValueFormat.PLANCK=0]="PLANCK",BurstValueFormat[BurstValueFormat.BURST=1]="BURST";var BurstValue=function(){function e(r){_classCallCheck(this,e),assureValidValue(r),this._planck=new BigNumber(r)}return _createClass(e,[{key:"getRaw",value:function(){return this._planck}},{key:"getPlanck",value:function(){return this._planck.toString()}},{key:"setPlanck",value:function(e){assureValidValue(e),this._planck=new BigNumber(e)}},{key:"getBurst",value:function(){return this._planck.dividedBy(1e8).toString()}},{key:"setBurst",value:function(e){assureValidValue(e),this._planck=new BigNumber(e).multipliedBy(1e8)}},{key:"equals",value:function(e){return this._planck.eq(e._planck)}},{key:"lessOrEqual",value:function(e){return this._planck.lte(e._planck)}},{key:"less",value:function(e){return this._planck.lt(e._planck)}},{key:"greaterOrEqual",value:function(e){return this._planck.gte(e._planck)}},{key:"greater",value:function(e){return this._planck.gt(e._planck)}},{key:"add",value:function(e){return this._planck=this._planck.plus(e._planck),this}},{key:"subtract",value:function(e){return this._planck=this._planck.minus(e._planck),this}},{key:"multiply",value:function(e){return this._planck=this._planck.multipliedBy(e),this}},{key:"divide",value:function(e){if(0===e)throw new Error("Division by zero");return this._planck=this._planck.div(e),this}},{key:"toString",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:exports.BurstValueFormat.BURST)===exports.BurstValueFormat.BURST?"".concat(BurstSymbol," ").concat(this.getBurst()):"".concat(BurstPlanckSymbol," ").concat(this._planck)}},{key:"clone",value:function(){return e.fromPlanck(this.getPlanck())}}],[{key:"fromPlanck",value:function(r){return new e(r)}},{key:"fromBurst",value:function(r){var t=new e("0");return t.setBurst("number"==typeof r?r.toString(10):r),t}}]),e}();return exports.BurstPlanckSymbol=BurstPlanckSymbol,exports.BurstSymbol=BurstSymbol,exports.BurstTime=BurstTime,exports.BurstValue=BurstValue,exports.FeeQuantPlanck=FeeQuantPlanck,exports.OneBurstPlanck=OneBurstPlanck,exports.convertAddressToNumericId=convertAddressToNumericId,exports.convertBurstTimeToDate=convertBurstTimeToDate,exports.convertBurstTimeToEpochTime=convertBurstTimeToEpochTime,exports.convertByteArrayToHexString=convertByteArrayToHexString,exports.convertByteArrayToString=convertByteArrayToString,exports.convertDateToBurstTime=convertDateToBurstTime,exports.convertDecStringToHexString=convertDecStringToHexString,exports.convertHexEndianess=convertHexEndianess,exports.convertHexStringToByteArray=convertHexStringToByteArray,exports.convertHexStringToDecString=convertHexStringToDecString,exports.convertHexStringToString=convertHexStringToString,exports.convertNQTStringToNumber=convertNQTStringToNumber,exports.convertNumberToNQTString=convertNumberToNQTString,exports.convertNumericIdToAddress=convertNumericIdToAddress,exports.convertStringToByteArray=convertStringToByteArray,exports.convertStringToHexString=convertStringToHexString,exports.createDeeplink=createDeeplink,exports.isBurstAddress=isBurstAddress,exports.isValid=isValid,exports.parseDeeplink=parseDeeplink,exports.sumNQTStringToNumber=sumNQTStringToNumber,exports}({});
var b$util=function(e){"use strict";function r(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function t(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}var i=Date.UTC(2014,7,11,2,0,0,0)/1e3,o=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=[1,2,4,8,16,5,10,20,13,26,17,7,14,28,29,31,27,19,3,6,12,24,21,15,30,25,23,11,22,9,18,1],a=[0,0,1,18,2,5,19,11,3,29,6,27,20,8,12,23,4,10,30,17,7,22,28,26,21,25,9,16,13,14,24,15],c=[3,2,1,0,7,6,5,4,13,14,15,16,12,8,9,10,11],l="23456789ABCDEFGHJKLMNPQRSTUVWXYZ".split(""),s=function(e,r){return 0===e||0===r?0:u[(a[e]+a[r])%31]},f=function(){function e(t){r(this,e),this._burstTimestamp=t}return n(e,[{key:"getBurstTimestamp",value:function(){return this._burstTimestamp}},{key:"setBurstTimestamp",value:function(e){this._burstTimestamp=e}},{key:"getEpoch",value:function(){return 1e3*(i+this._burstTimestamp)}},{key:"getDate",value:function(){return new Date(this.getEpoch())}},{key:"setDate",value:function(e){this._burstTimestamp=Math.round(e.getTime()/1e3)-i}},{key:"equals",value:function(e){return this._burstTimestamp===e._burstTimestamp}},{key:"before",value:function(e){return this._burstTimestamp<e._burstTimestamp}},{key:"after",value:function(e){return this._burstTimestamp>e._burstTimestamp}}],[{key:"fromBurstTimestamp",value:function(r){return new e(r)}},{key:"fromDate",value:function(r){var t=new e(0);return t.setDate(r),t}}]),e}(),h=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,g=Math.ceil,p=Math.floor,d="[BigNumber Error] ",v=d+"Number primitive has more than 15 significant digits: ",m=1e14,w=14,y=9007199254740991,b=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,S=1e9;function T(e){var r=0|e;return e>0||e===r?r:r-1}function E(e){for(var r,t,n=1,i=e.length,o=e[0]+"";n<i;){for(r=e[n++]+"",t=w-r.length;t--;r="0"+r);o+=r}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function k(e,r){var t,n,i=e.c,o=r.c,u=e.s,a=r.s,c=e.e,l=r.e;if(!u||!a)return null;if(t=i&&!i[0],n=o&&!o[0],t||n)return t?n?0:-a:u;if(u!=a)return u;if(t=u<0,n=c==l,!i||!o)return n?0:!i^t?1:-1;if(!n)return c>l^t?1:-1;for(a=(c=i.length)<(l=o.length)?c:l,u=0;u<a;u++)if(i[u]!=o[u])return i[u]>o[u]^t?1:-1;return c==l?0:c>l^t?1:-1}function B(e,r,t,n){if(e<r||e>t||e!==p(e))throw Error(d+(n||"Argument")+("number"==typeof e?e<r||e>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function N(e){var r=e.c.length-1;return T(e.e/w)==r&&e.c[r]%2!=0}function x(e,r){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(r<0?"e":"e+")+r}function O(e,r,t){var n,i;if(r<0){for(i=t+".";++r;i+=t);e=i+e}else if(++r>(n=e.length)){for(i=t,r-=n;--r;i+=t);e+=i}else r<n&&(e=e.slice(0,r)+"."+e.slice(r));return e}var _,C=function e(r){var t,n,i,o,u,a,c,l,s,f=G.prototype={constructor:G,toString:null,valueOf:null},_=new G(1),C=20,D=4,F=-7,U=21,P=-1e7,R=1e7,I=!1,L=1,M=0,H={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},j="0123456789abcdefghijklmnopqrstuvwxyz";function G(e,r){var t,o,u,a,c,l,s,f,g=this;if(!(g instanceof G))return new G(e,r);if(null==r){if(e&&!0===e._isBigNumber)return g.s=e.s,void(!e.c||e.e>R?g.c=g.e=null:e.e<P?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(a=0,c=e;c>=10;c/=10,a++);return void(a>R?g.c=g.e=null:(g.e=a,g.c=[e]))}f=String(e)}else{if(!h.test(f=String(e)))return i(g,f,l);g.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(a=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(a<0&&(a=c),a+=+f.slice(c+1),f=f.substring(0,c)):a<0&&(a=f.length)}else{if(B(r,2,j.length,"Base"),10==r)return $(g=new G(e),C+g.e+1,D);if(f=String(e),l="number"==typeof e){if(0*e!=0)return i(g,f,l,r);if(g.s=1/e<0?(f=f.slice(1),-1):1,G.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(v+e)}else g.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(t=j.slice(0,r),a=c=0,s=f.length;c<s;c++)if(t.indexOf(o=f.charAt(c))<0){if("."==o){if(c>a){a=s;continue}}else if(!u&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){u=!0,c=-1,a=0;continue}return i(g,String(e),l,r)}l=!1,(a=(f=n(f,r,10,g.s)).indexOf("."))>-1?f=f.replace(".",""):a=f.length}for(c=0;48===f.charCodeAt(c);c++);for(s=f.length;48===f.charCodeAt(--s););if(f=f.slice(c,++s)){if(s-=c,l&&G.DEBUG&&s>15&&(e>y||e!==p(e)))throw Error(v+g.s*e);if((a=a-c-1)>R)g.c=g.e=null;else if(a<P)g.c=[g.e=0];else{if(g.e=a,g.c=[],c=(a+1)%w,a<0&&(c+=w),c<s){for(c&&g.c.push(+f.slice(0,c)),s-=w;c<s;)g.c.push(+f.slice(c,c+=w));c=w-(f=f.slice(c)).length}else c-=s;for(;c--;f+="0");g.c.push(+f)}}else g.c=[g.e=0]}function q(e,r,t,n){var i,o,u,a,c;if(null==t?t=D:B(t,0,8),!e.c)return e.toString();if(i=e.c[0],u=e.e,null==r)c=E(e.c),c=1==n||2==n&&(u<=F||u>=U)?x(c,u):O(c,u,"0");else if(o=(e=$(new G(e),r,t)).e,a=(c=E(e.c)).length,1==n||2==n&&(r<=o||o<=F)){for(;a<r;c+="0",a++);c=x(c,o)}else if(r-=u,c=O(c,o,"0"),o+1>a){if(--r>0)for(c+=".";r--;c+="0");}else if((r+=o-a)>0)for(o+1==a&&(c+=".");r--;c+="0");return e.s<0&&i?"-"+c:c}function V(e,r){for(var t,n=1,i=new G(e[0]);n<e.length;n++){if(!(t=new G(e[n])).s){i=t;break}r.call(i,t)&&(i=t)}return i}function z(e,r,t){for(var n=1,i=r.length;!r[--i];r.pop());for(i=r[0];i>=10;i/=10,n++);return(t=n+t*w-1)>R?e.c=e.e=null:t<P?e.c=[e.e=0]:(e.e=t,e.c=r),e}function $(e,r,t,n){var i,o,u,a,c,l,s,f=e.c,h=b;if(f){e:{for(i=1,a=f[0];a>=10;a/=10,i++);if((o=r-i)<0)o+=w,u=r,s=(c=f[l=0])/h[i-u-1]%10|0;else if((l=g((o+1)/w))>=f.length){if(!n)break e;for(;f.length<=l;f.push(0));c=s=0,i=1,u=(o%=w)-w+1}else{for(c=a=f[l],i=1;a>=10;a/=10,i++);s=(u=(o%=w)-w+i)<0?0:c/h[i-u-1]%10|0}if(n=n||r<0||null!=f[l+1]||(u<0?c:c%h[i-u-1]),n=t<4?(s||n)&&(0==t||t==(e.s<0?3:2)):s>5||5==s&&(4==t||n||6==t&&(o>0?u>0?c/h[i-u]:0:f[l-1])%10&1||t==(e.s<0?8:7)),r<1||!f[0])return f.length=0,n?(r-=e.e+1,f[0]=h[(w-r%w)%w],e.e=-r||0):f[0]=e.e=0,e;if(0==o?(f.length=l,a=1,l--):(f.length=l+1,a=h[w-o],f[l]=u>0?p(c/h[i-u]%h[u])*a:0),n)for(;;){if(0==l){for(o=1,u=f[0];u>=10;u/=10,o++);for(u=f[0]+=a,a=1;u>=10;u/=10,a++);o!=a&&(e.e++,f[0]==m&&(f[0]=1));break}if(f[l]+=a,f[l]!=m)break;f[l--]=0,a=1}for(o=f.length;0===f[--o];f.pop());}e.e>R?e.c=e.e=null:e.e<P&&(e.c=[e.e=0])}return e}function Z(e){var r,t=e.e;return null===t?e.toString():(r=E(e.c),r=t<=F||t>=U?x(r,t):O(r,t,"0"),e.s<0?"-"+r:r)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(e){var r,t;if(null!=e){if("object"!=typeof e)throw Error(d+"Object expected: "+e);if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(B(t=e[r],0,S,r),C=t),e.hasOwnProperty(r="ROUNDING_MODE")&&(B(t=e[r],0,8,r),D=t),e.hasOwnProperty(r="EXPONENTIAL_AT")&&((t=e[r])&&t.pop?(B(t[0],-S,0,r),B(t[1],0,S,r),F=t[0],U=t[1]):(B(t,-S,S,r),F=-(U=t<0?-t:t))),e.hasOwnProperty(r="RANGE"))if((t=e[r])&&t.pop)B(t[0],-S,-1,r),B(t[1],1,S,r),P=t[0],R=t[1];else{if(B(t,-S,S,r),!t)throw Error(d+r+" cannot be zero: "+t);P=-(R=t<0?-t:t)}if(e.hasOwnProperty(r="CRYPTO")){if((t=e[r])!==!!t)throw Error(d+r+" not true or false: "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw I=!t,Error(d+"crypto unavailable");I=t}else I=t}if(e.hasOwnProperty(r="MODULO_MODE")&&(B(t=e[r],0,9,r),L=t),e.hasOwnProperty(r="POW_PRECISION")&&(B(t=e[r],0,S,r),M=t),e.hasOwnProperty(r="FORMAT")){if("object"!=typeof(t=e[r]))throw Error(d+r+" not an object: "+t);H=t}if(e.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(t=e[r])||/^.$|[+-.\s]|(.).*\1/.test(t))throw Error(d+r+" invalid: "+t);j=t}}return{DECIMAL_PLACES:C,ROUNDING_MODE:D,EXPONENTIAL_AT:[F,U],RANGE:[P,R],CRYPTO:I,MODULO_MODE:L,POW_PRECISION:M,FORMAT:H,ALPHABET:j}},G.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!G.DEBUG)return!0;var r,t,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-S&&i<=S&&i===p(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((r=(i+1)%w)<1&&(r+=w),String(n[0]).length==r){for(r=0;r<n.length;r++)if((t=n[r])<0||t>=m||t!==p(t))break e;if(0!==t)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(d+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return V(arguments,f.lt)},G.minimum=G.min=function(){return V(arguments,f.gt)},G.random=(o=9007199254740992*Math.random()&2097151?function(){return p(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var r,t,n,i,u,a=0,c=[],l=new G(_);if(null==e?e=C:B(e,0,S),i=g(e/w),I)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(u=131072*r[a]+(r[a+1]>>>11))>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),r[a]=t[0],r[a+1]=t[1]):(c.push(u%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw I=!1,Error(d+"crypto unavailable");for(r=crypto.randomBytes(i*=7);a<i;)(u=281474976710656*(31&r[a])+1099511627776*r[a+1]+4294967296*r[a+2]+16777216*r[a+3]+(r[a+4]<<16)+(r[a+5]<<8)+r[a+6])>=9e15?crypto.randomBytes(7).copy(r,a):(c.push(u%1e14),a+=7);a=i/7}if(!I)for(;a<i;)(u=o())<9e15&&(c[a++]=u%1e14);for(i=c[--a],e%=w,i&&e&&(u=b[w-e],c[a]=p(i/u)*u);0===c[a];c.pop(),a--);if(a<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=w);for(a=1,u=c[0];u>=10;u/=10,a++);a<w&&(n-=w-a)}return l.e=n,l.c=c,l}),G.sum=function(){for(var e=1,r=arguments,t=new G(r[0]);e<r.length;)t=t.plus(r[e++]);return t},n=function(){function e(e,r,t,n){for(var i,o,u=[0],a=0,c=e.length;a<c;){for(o=u.length;o--;u[o]*=r);for(u[0]+=n.indexOf(e.charAt(a++)),i=0;i<u.length;i++)u[i]>t-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/t|0,u[i]%=t)}return u.reverse()}return function(r,n,i,o,u){var a,c,l,s,f,h,g,p,d=r.indexOf("."),v=C,m=D;for(d>=0&&(s=M,M=0,r=r.replace(".",""),h=(p=new G(n)).pow(r.length-d),M=s,p.c=e(O(E(h.c),h.e,"0"),10,i,"0123456789"),p.e=p.c.length),l=s=(g=e(r,n,i,u?(a=j,"0123456789"):(a="0123456789",j))).length;0==g[--s];g.pop());if(!g[0])return a.charAt(0);if(d<0?--l:(h.c=g,h.e=l,h.s=o,g=(h=t(h,p,v,m,i)).c,f=h.r,l=h.e),d=g[c=l+v+1],s=i/2,f=f||c<0||null!=g[c+1],f=m<4?(null!=d||f)&&(0==m||m==(h.s<0?3:2)):d>s||d==s&&(4==m||f||6==m&&1&g[c-1]||m==(h.s<0?8:7)),c<1||!g[0])r=f?O(a.charAt(1),-v,a.charAt(0)):a.charAt(0);else{if(g.length=c,f)for(--i;++g[--c]>i;)g[c]=0,c||(++l,g=[1].concat(g));for(s=g.length;!g[--s];);for(d=0,r="";d<=s;r+=a.charAt(g[d++]));r=O(r,l,a.charAt(0))}return r}}(),t=function(){function e(e,r,t){var n,i,o,u,a=0,c=e.length,l=r%A,s=r/A|0;for(e=e.slice();c--;)a=((i=l*(o=e[c]%A)+(n=s*o+(u=e[c]/A|0)*l)%A*A+a)/t|0)+(n/A|0)+s*u,e[c]=i%t;return a&&(e=[a].concat(e)),e}function r(e,r,t,n){var i,o;if(t!=n)o=t>n?1:-1;else for(i=o=0;i<t;i++)if(e[i]!=r[i]){o=e[i]>r[i]?1:-1;break}return o}function t(e,r,t,n){for(var i=0;t--;)e[t]-=i,i=e[t]<r[t]?1:0,e[t]=i*n+e[t]-r[t];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,u,a){var c,l,s,f,h,g,d,v,y,b,A,S,E,k,B,N,x,O=n.s==i.s?1:-1,_=n.c,C=i.c;if(!(_&&_[0]&&C&&C[0]))return new G(n.s&&i.s&&(_?!C||_[0]!=C[0]:C)?_&&0==_[0]||!C?0*O:O/0:NaN);for(y=(v=new G(O)).c=[],O=o+(l=n.e-i.e)+1,a||(a=m,l=T(n.e/w)-T(i.e/w),O=O/w|0),s=0;C[s]==(_[s]||0);s++);if(C[s]>(_[s]||0)&&l--,O<0)y.push(1),f=!0;else{for(k=_.length,N=C.length,s=0,O+=2,(h=p(a/(C[0]+1)))>1&&(C=e(C,h,a),_=e(_,h,a),N=C.length,k=_.length),E=N,A=(b=_.slice(0,N)).length;A<N;b[A++]=0);x=C.slice(),x=[0].concat(x),B=C[0],C[1]>=a/2&&B++;do{if(h=0,(c=r(C,b,N,A))<0){if(S=b[0],N!=A&&(S=S*a+(b[1]||0)),(h=p(S/B))>1)for(h>=a&&(h=a-1),d=(g=e(C,h,a)).length,A=b.length;1==r(g,b,d,A);)h--,t(g,N<d?x:C,d,a),d=g.length,c=1;else 0==h&&(c=h=1),d=(g=C.slice()).length;if(d<A&&(g=[0].concat(g)),t(b,g,A,a),A=b.length,-1==c)for(;r(C,b,N,A)<1;)h++,t(b,N<A?x:C,A,a),A=b.length}else 0===c&&(h++,b=[0]);y[s++]=h,b[0]?b[A++]=_[E]||0:(b=[_[E]],A=1)}while((E++<k||null!=b[0])&&O--);f=null!=b[0],y[0]||y.splice(0,1)}if(a==m){for(s=1,O=y[0];O>=10;O/=10,s++);$(v,o+(v.e=s+l*w-1)+1,u,f)}else v.e=l,v.r=+f;return v}}(),u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,a=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,s=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,r,t,n){var i,o=t?r:r.replace(s,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!t&&(o=o.replace(u,function(e,r,t){return i="x"==(t=t.toLowerCase())?16:"b"==t?2:8,n&&n!=i?e:r}),n&&(i=n,o=o.replace(a,"$1").replace(c,"0.$1")),r!=o))return new G(o,i);if(G.DEBUG)throw Error(d+"Not a"+(n?" base "+n:"")+" number: "+r);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,r){return k(this,new G(e,r))},f.decimalPlaces=f.dp=function(e,r){var t,n,i,o=this;if(null!=e)return B(e,0,S),null==r?r=D:B(r,0,8),$(new G(o),e+o.e+1,r);if(!(t=o.c))return null;if(n=((i=t.length-1)-T(this.e/w))*w,i=t[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new G(e,r),C,D)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new G(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,r){var t,n,i,o,u,a,c,l,s=this;if((e=new G(e)).c&&!e.isInteger())throw Error(d+"Exponent not an integer: "+Z(e));if(null!=r&&(r=new G(r)),u=e.e>14,!s.c||!s.c[0]||1==s.c[0]&&!s.e&&1==s.c.length||!e.c||!e.c[0])return l=new G(Math.pow(+Z(s),u?2-N(e):+Z(e))),r?l.mod(r):l;if(a=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new G(NaN);(n=!a&&s.isInteger()&&r.isInteger())&&(s=s.mod(r))}else{if(e.e>9&&(s.e>0||s.e<-1||(0==s.e?s.c[0]>1||u&&s.c[1]>=24e7:s.c[0]<8e13||u&&s.c[0]<=9999975e7)))return o=s.s<0&&N(e)?-0:0,s.e>-1&&(o=1/o),new G(a?1/o:o);M&&(o=g(M/w+2))}for(u?(t=new G(.5),a&&(e.s=1),c=N(e)):c=(i=Math.abs(+Z(e)))%2,l=new G(_);;){if(c){if(!(l=l.times(s)).c)break;o?l.c.length>o&&(l.c.length=o):n&&(l=l.mod(r))}if(i){if(0===(i=p(i/2)))break;c=i%2}else if($(e=e.times(t),e.e+1,1),e.e>14)c=N(e);else{if(0==(i=+Z(e)))break;c=i%2}s=s.times(s),o?s.c&&s.c.length>o&&(s.c.length=o):n&&(s=s.mod(r))}return n?l:(a&&(l=_.div(l)),r?l.mod(r):o?$(l,M,D,void 0):l)},f.integerValue=function(e){var r=new G(this);return null==e?e=D:B(e,0,8),$(r,r.e+1,e)},f.isEqualTo=f.eq=function(e,r){return 0===k(this,new G(e,r))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,r){return k(this,new G(e,r))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,r){return 1===(r=k(this,new G(e,r)))||0===r},f.isInteger=function(){return!!this.c&&T(this.e/w)>this.c.length-2},f.isLessThan=f.lt=function(e,r){return k(this,new G(e,r))<0},f.isLessThanOrEqualTo=f.lte=function(e,r){return-1===(r=k(this,new G(e,r)))||0===r},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,r){var t,n,i,o,u=this,a=u.s;if(r=(e=new G(e,r)).s,!a||!r)return new G(NaN);if(a!=r)return e.s=-r,u.plus(e);var c=u.e/w,l=e.e/w,s=u.c,f=e.c;if(!c||!l){if(!s||!f)return s?(e.s=-r,e):new G(f?u:NaN);if(!s[0]||!f[0])return f[0]?(e.s=-r,e):new G(s[0]?u:3==D?-0:0)}if(c=T(c),l=T(l),s=s.slice(),a=c-l){for((o=a<0)?(a=-a,i=s):(l=c,i=f),i.reverse(),r=a;r--;i.push(0));i.reverse()}else for(n=(o=(a=s.length)<(r=f.length))?a:r,a=r=0;r<n;r++)if(s[r]!=f[r]){o=s[r]<f[r];break}if(o&&(i=s,s=f,f=i,e.s=-e.s),(r=(n=f.length)-(t=s.length))>0)for(;r--;s[t++]=0);for(r=m-1;n>a;){if(s[--n]<f[n]){for(t=n;t&&!s[--t];s[t]=r);--s[t],s[n]+=m}s[n]-=f[n]}for(;0==s[0];s.splice(0,1),--l);return s[0]?z(e,s,l):(e.s=3==D?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,i,o=this;return e=new G(e,r),!o.c||!e.s||e.c&&!e.c[0]?new G(NaN):!e.c||o.c&&!o.c[0]?new G(o):(9==L?(i=e.s,e.s=1,n=t(o,e,0,3),e.s=i,n.s*=i):n=t(o,e,0,L),(e=o.minus(n.times(e))).c[0]||1!=L||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,r){var t,n,i,o,u,a,c,l,s,f,h,g,p,d,v,y=this,b=y.c,S=(e=new G(e,r)).c;if(!(b&&S&&b[0]&&S[0]))return!y.s||!e.s||b&&!b[0]&&!S||S&&!S[0]&&!b?e.c=e.e=e.s=null:(e.s*=y.s,b&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=T(y.e/w)+T(e.e/w),e.s*=y.s,(c=b.length)<(f=S.length)&&(p=b,b=S,S=p,i=c,c=f,f=i),i=c+f,p=[];i--;p.push(0));for(d=m,v=A,i=f;--i>=0;){for(t=0,h=S[i]%v,g=S[i]/v|0,o=i+(u=c);o>i;)t=((l=h*(l=b[--u]%v)+(a=g*l+(s=b[u]/v|0)*h)%v*v+p[o]+t)/d|0)+(a/v|0)+g*s,p[o--]=l%d;p[o]=t}return t?++n:p.splice(0,1),z(e,p,n)},f.negated=function(){var e=new G(this);return e.s=-e.s||null,e},f.plus=function(e,r){var t,n=this,i=n.s;if(r=(e=new G(e,r)).s,!i||!r)return new G(NaN);if(i!=r)return e.s=-r,n.minus(e);var o=n.e/w,u=e.e/w,a=n.c,c=e.c;if(!o||!u){if(!a||!c)return new G(i/0);if(!a[0]||!c[0])return c[0]?e:new G(a[0]?n:0*i)}if(o=T(o),u=T(u),a=a.slice(),i=o-u){for(i>0?(u=o,t=c):(i=-i,t=a),t.reverse();i--;t.push(0));t.reverse()}for((i=a.length)-(r=c.length)<0&&(t=c,c=a,a=t,r=i),i=0;r;)i=(a[--r]=a[r]+c[r]+i)/m|0,a[r]=m===a[r]?0:a[r]%m;return i&&(a=[i].concat(a),++u),z(e,a,u)},f.precision=f.sd=function(e,r){var t,n,i,o=this;if(null!=e&&e!==!!e)return B(e,1,S),null==r?r=D:B(r,0,8),$(new G(o),e,r);if(!(t=o.c))return null;if(n=(i=t.length-1)*w+1,i=t[i]){for(;i%10==0;i/=10,n--);for(i=t[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},f.shiftedBy=function(e){return B(e,-y,y),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,i,o,u=this,a=u.c,c=u.s,l=u.e,s=C+4,f=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?u:1/0);if(0==(c=Math.sqrt(+Z(u)))||c==1/0?(((r=E(a)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=T((l+1)/2)-(l<0||l%2),n=new G(r=c==1/0?"1e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):n=new G(c+""),n.c[0])for((c=(l=n.e)+s)<3&&(c=0);;)if(o=n,n=f.times(o.plus(t(u,o,s,1))),E(o.c).slice(0,c)===(r=E(n.c)).slice(0,c)){if(n.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||($(n,n.e+C+2,1),e=!n.times(n).eq(u));break}if(!i&&($(o,o.e+C+2,0),o.times(o).eq(u))){n=o;break}s+=4,c+=4,i=1}return $(n,n.e+C+1,D,e)},f.toExponential=function(e,r){return null!=e&&(B(e,0,S),e++),q(this,e,r,1)},f.toFixed=function(e,r){return null!=e&&(B(e,0,S),e=e+this.e+1),q(this,e,r)},f.toFormat=function(e,r,t){var n,i=this;if(null==t)null!=e&&r&&"object"==typeof r?(t=r,r=null):e&&"object"==typeof e?(t=e,e=r=null):t=H;else if("object"!=typeof t)throw Error(d+"Argument not an object: "+t);if(n=i.toFixed(e,r),i.c){var o,u=n.split("."),a=+t.groupSize,c=+t.secondaryGroupSize,l=t.groupSeparator||"",s=u[0],f=u[1],h=i.s<0,g=h?s.slice(1):s,p=g.length;if(c&&(o=a,a=c,c=o,p-=o),a>0&&p>0){for(o=p%a||a,s=g.substr(0,o);o<p;o+=a)s+=l+g.substr(o,a);c>0&&(s+=l+g.slice(o)),h&&(s="-"+s)}n=f?s+(t.decimalSeparator||"")+((c=+t.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(t.fractionGroupSeparator||"")):f):s}return(t.prefix||"")+n+(t.suffix||"")},f.toFraction=function(e){var r,n,i,o,u,a,c,l,s,f,h,g,p=this,v=p.c;if(null!=e&&(!(c=new G(e)).isInteger()&&(c.c||1!==c.s)||c.lt(_)))throw Error(d+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+Z(c));if(!v)return new G(p);for(r=new G(_),s=n=new G(_),i=l=new G(_),g=E(v),u=r.e=g.length-p.e-1,r.c[0]=b[(a=u%w)<0?w+a:a],e=!e||c.comparedTo(r)>0?u>0?r:s:c,a=R,R=1/0,c=new G(g),l.c[0]=0;f=t(c,r,0,1),1!=(o=n.plus(f.times(i))).comparedTo(e);)n=i,i=o,s=l.plus(f.times(o=s)),l=o,r=c.minus(f.times(o=r)),c=o;return o=t(e.minus(n),i,0,1),l=l.plus(o.times(s)),n=n.plus(o.times(i)),l.s=s.s=p.s,h=t(s,i,u*=2,D).minus(p).abs().comparedTo(t(l,n,u,D).minus(p).abs())<1?[s,i]:[l,n],R=a,h},f.toNumber=function(){return+Z(this)},f.toPrecision=function(e,r){return null!=e&&B(e,1,S),q(this,e,r,2)},f.toString=function(e){var r,t=this,i=t.s,o=t.e;return null===o?i?(r="Infinity",i<0&&(r="-"+r)):r="NaN":(null==e?r=o<=F||o>=U?x(E(t.c),o):O(E(t.c),o,"0"):10===e?r=O(E((t=$(new G(t),C+o+1,D)).c),t.e,"0"):(B(e,2,j.length,"Base"),r=n(O(E(t.c),o,"0"),10,e,i,!0)),i<0&&t.c[0]&&(r="-"+r)),r},f.valueOf=f.toJSON=function(){return Z(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=r&&G.set(r),G}();function D(e){if(!e||!/^-?\d*(\.\d+)?$/.test(e))throw new Error("Invalid value: ".concat(e))}C.config({EXPONENTIAL_AT:[-9,20]}),(_=e.BurstValueFormat||(e.BurstValueFormat={}))[_.PLANCK=0]="PLANCK",_[_.BURST=1]="BURST";var F=function(){function t(e){r(this,t),D(e),this._planck=new C(e)}return n(t,[{key:"getRaw",value:function(){return this._planck}},{key:"getPlanck",value:function(){return this._planck.toString()}},{key:"setPlanck",value:function(e){D(e),this._planck=new C(e)}},{key:"getBurst",value:function(){return this._planck.dividedBy(1e8).toString()}},{key:"setBurst",value:function(e){D(e),this._planck=new C(e).multipliedBy(1e8)}},{key:"equals",value:function(e){return this._planck.eq(e._planck)}},{key:"lessOrEqual",value:function(e){return this._planck.lte(e._planck)}},{key:"less",value:function(e){return this._planck.lt(e._planck)}},{key:"greaterOrEqual",value:function(e){return this._planck.gte(e._planck)}},{key:"greater",value:function(e){return this._planck.gt(e._planck)}},{key:"add",value:function(e){return this._planck=this._planck.plus(e._planck),this}},{key:"subtract",value:function(e){return this._planck=this._planck.minus(e._planck),this}},{key:"multiply",value:function(e){return this._planck=this._planck.multipliedBy(e),this}},{key:"divide",value:function(e){if(0===e)throw new Error("Division by zero");return this._planck=this._planck.div(e),this}},{key:"toString",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.BurstValueFormat.BURST)===e.BurstValueFormat.BURST?"".concat("Ƀ"," ").concat(this.getBurst()):"".concat("ƀ"," ").concat(this._planck)}},{key:"clone",value:function(){return t.fromPlanck(this.getPlanck())}}],[{key:"Zero",value:function(){return new t("0")}},{key:"fromPlanck",value:function(e){return new t(e)}},{key:"fromBurst",value:function(e){var r=new t("0");return r.setBurst("number"==typeof e?e.toString(10):e),r}}]),t}(),U=function(e){0===e.indexOf("".concat("BURST","-"))&&(e=e.substr(6));for(var r=o.slice(),t=0,n=0;n<e.length;n++){var i=l.indexOf(e.charAt(n));if(!(i<=-1||i>l.length)){if(t>16)return!1;r[c[t]]=i,t++}}if(17!==t)return!1;for(var a=0,f=1;f<5;f++){for(var h=0,g=0;g<31;g++)if(!(g>12&&g<27)){var p=g;g>26&&(p-=14),h^=s(r[p],u[f*g%31])}a|=h}return 0===a};const P="function"==typeof atob,R="function"==typeof btoa,I="function"==typeof Buffer,L="function"==typeof TextDecoder?new TextDecoder:void 0,M="function"==typeof TextEncoder?new TextEncoder:void 0,H=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],j=(e=>{let r={};return H.forEach((e,t)=>r[e]=t),r})(),G=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,q=String.fromCharCode.bind(String),V="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,r=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(r)),z=e=>e.replace(/[+\/]/g,e=>"+"==e?"-":"_").replace(/=+$/m,""),$=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Z=e=>{let r,t,n,i,o="";const u=e.length%3;for(let u=0;u<e.length;){if((t=e.charCodeAt(u++))>255||(n=e.charCodeAt(u++))>255||(i=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");o+=H[(r=t<<16|n<<8|i)>>18&63]+H[r>>12&63]+H[r>>6&63]+H[63&r]}return u?o.slice(0,u-3)+"===".substring(u):o},W=R?e=>btoa(e):I?e=>Buffer.from(e,"binary").toString("base64"):Z,Q=I?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let t=0,n=e.length;t<n;t+=4096)r.push(q.apply(null,e.subarray(t,t+4096)));return W(r.join(""))},X=e=>{if(e.length<2)return(r=e.charCodeAt(0))<128?e:r<2048?q(192|r>>>6)+q(128|63&r):q(224|r>>>12&15)+q(128|r>>>6&63)+q(128|63&r);var r=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return q(240|r>>>18&7)+q(128|r>>>12&63)+q(128|r>>>6&63)+q(128|63&r)},J=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,K=e=>e.replace(J,X),Y=I?e=>Buffer.from(e,"utf8").toString("base64"):M?e=>Q(M.encode(e)):e=>W(K(e)),ee=(e,r=!1)=>r?z(Y(e)):Y(e),re=e=>ee(e,!0),te=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ne=e=>{switch(e.length){case 4:var r=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return q(55296+(r>>>10))+q(56320+(1023&r));case 3:return q((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return q((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},ie=e=>e.replace(te,ne),oe=e=>{if(e=e.replace(/\s+/g,""),!G.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let r,t,n,i="";for(let o=0;o<e.length;)r=j[e.charAt(o++)]<<18|j[e.charAt(o++)]<<12|(t=j[e.charAt(o++)])<<6|(n=j[e.charAt(o++)]),i+=64===t?q(r>>16&255):64===n?q(r>>16&255,r>>8&255):q(r>>16&255,r>>8&255,255&r);return i},ue=P?e=>atob($(e)):I?e=>Buffer.from(e,"base64").toString("binary"):oe,ae=I?e=>V(Buffer.from(e,"base64")):e=>V(ue(e),e=>e.charCodeAt(0)),ce=I?e=>Buffer.from(e,"base64").toString("utf8"):L?e=>L.decode(ae(e)):e=>ie(ue(e)),le=e=>$(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),se=e=>ce(le(e)),fe=ee,he=re,ge=se;var pe=function(e){return 1e3*(i+e)},de=function(e){for(var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return r?t.join("").toUpperCase():t.join("")},ve=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(0===t)return"";var n=e;if(0!==r){var i=null===t?e.length-r:t;!function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t<0)throw new Error("Start index should not be negative");if(e.length<t+r)throw new Error("Need at least "+r+" bytes to convert to an integer")}(n,i,r),n=e.slice(r,r+i)}return decodeURIComponent(escape(String.fromCharCode.apply(null,Array.from(n))))};String.prototype.padStart||(String.prototype.padStart=function(e,r){return e>>=0,r=String(void 0!==r?r:" "),this.length>=e?String(this):((e-=this.length)>r.length&&(r+=r.repeat(e/r.length)),r.slice(0,e)+String(this))});var me,we=function(e){if(e.length%2)throw new Error("Invalid Hex String: ".concat(e));for(var r=new Uint8Array(e.length/2),t=0;t<e.length;t+=2){var n=parseInt(e.substr(t,2),16);if(Number.isNaN(n))throw new Error("Invalid Hex String: ".concat(e));r[t/2]=n}return r},ye=function(e){if(null==e||""===e)throw new Error("Invalid argument");return parseFloat(e)/1e8},be=function(e){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?he(e):fe(e)},Ae=function(e){for(var r=unescape(encodeURIComponent(e)),t=new Uint8Array(r.length),n=0;n<r.length;++n)t[n]=r.charCodeAt(n);return t},Se=function(e){return de(Ae(e))};(me=e.EncoderFormat||(e.EncoderFormat={}))[me.Text=0]="Text",me[me.Hexadecimal=1]="Hexadecimal",me[me.Base64=2]="Base64";var Te=/^burst.(.+):\/\/(v.+?)\??/i;return e.BurstPlanckSymbol="ƀ",e.BurstSymbol="Ƀ",e.BurstTime=f,e.BurstValue=F,e.FeeQuantPlanck=735e3,e.OneBurstPlanck=1e8,e.convertAddressToNumericId=function(e){if(null!=e&&0!==e.trim().length&&0===e.indexOf("".concat("BURST","-"))){e=e.substr(6);for(var r=o.slice(),t=0,n=0;n<e.length;n++){var i=l.indexOf(e.charAt(n));if(!(i<=-1||i>l.length)){if(t>16)return;r[c[t]]=i,t++}}if(U(e)){for(var u=13,a=[],s=0;s<u;s++)a[s]=r[u-s-1];var f,h="",g=0;do{f=0,g=0;for(var p=0;p<u;p++)(g=32*g+a[p])>=10?(a[f]=Math.floor(g/10),g%=10,f+=1):f>0&&(a[f]=0,f+=1);u=f,h+=g}while(u>0);return h.split("").reverse().join("")}}},e.convertBase36StringToHexString=function(e){return new C(e,36).toString(16)},e.convertBase64StringToString=function(e){return ge(e)},e.convertBurstTimeToDate=function(e){return new Date(pe(e))},e.convertBurstTimeToEpochTime=pe,e.convertByteArrayToHexString=de,e.convertByteArrayToString=ve,e.convertDateToBurstTime=function(e){return Math.round(e.getTime()/1e3)-i},e.convertDecStringToHexString=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t="string"==typeof e?new C(e):e;if(t.isNaN())throw new Error("Invalid decimal argument: [".concat(e,"] - Expected a valid decimal value"));if(r<0)throw new Error("Invalid padding argument: [".concat(r,"] - Expected a positive value"));var n=t.lt(0);n&&(t=function(e){for(var r=e.multipliedBy(-1).toString(2);r.length%8;)r="0"+r;var t="1"===r[0]&&-1!==r.slice(1).indexOf("1")?"11111111":"";return r=r.split("").map(function(e){return"0"===e?"1":"0"}).join(""),new C(t+r,2).plus(1)}(t));var i=t.toString(16),o=Math.ceil(i.length/r);return i.padStart(o*r,n?"f":"0")},e.convertHexEndianess=function(e){for(var r="",t=e,n=t.length-1;n>=0;n-=2)r+=t[n-1]+t[n];return r},e.convertHexStringToBase36String=function(e){return new C(e,16).toString(36)},e.convertHexStringToByteArray=we,e.convertHexStringToDecString=function(e){var r,t,n,i=[0];for(r=0;r<e.length;r+=1){for(n=parseInt(e.charAt(r),16),t=0;t<i.length;t+=1)i[t]=16*i[t]+n,n=i[t]/10|0,i[t]%=10;for(;n>0;)i.push(n%10),n=n/10|0}return i.reverse().join("")},e.convertHexStringToString=function(e){return ve(we(e))},e.convertNQTStringToNumber=ye,e.convertNumberToNQTString=function(e){if(null==e)throw new Error("Invalid argument");return parseFloat(e.toString()).toFixed(8).replace(".","")},e.convertNumericIdToAddress=function(e){if(null!=e&&0!==e.trim().length){for(var r=[],t=o.slice(),n=0,i=e.length,u=0;u<i;u++)r[u]=e.charCodeAt(u)-"0".charCodeAt(0);var a=0,f=0;do{a=0,f=0;for(var h=0;h<i;h++)(a=10*a+r[h])>=32?(r[f]=a>>5,a&=31,f++):f>0&&(r[f]=0,f++);i=f,t[n]=a,n++}while(i>0);for(var g=[0,0,0,0],p=12;p>=0;p--){var d=t[p]^g[3];g[3]=g[2]^s(30,d),g[2]=g[1]^s(6,d),g[1]=g[0]^s(9,d),g[0]=s(17,d)}t[13]=g[0],t[14]=g[1],t[15]=g[2],t[16]=g[3];for(var v="BURST-",m=0;m<17;m++)v+=l[t[c[m]]],3==(3&m)&&m<13&&(v+="-");return v}},e.convertStringToBase64String=be,e.convertStringToByteArray=Ae,e.convertStringToHexString=Se,e.createDeeplink=function(r){var t=r.encoderFormat,n=void 0===t?e.EncoderFormat.Base64:t,i=r.domain,o=r.action,u=r.payload,a="burst.".concat(i,"://v1");return o&&(a+="?action=".concat(o)),u&&(a+="&payload=".concat(function(r,t){var n=r;switch("string"!=typeof r&&(n=JSON.stringify(r)),t){case e.EncoderFormat.Hexadecimal:return Se(n);case e.EncoderFormat.Base64:return be(n);case e.EncoderFormat.Text:default:return n}}(u,n))),a},e.isBurstAddress=function(e){if(!new RegExp("".concat("BURST","-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{5}(-w+)?"),"i").test(e))return!1;var r=e.lastIndexOf("-"),t=e.substr(r+1);return e=t.length>5?e.substr(0,r):e,U(e)},e.isValid=U,e.parseDeeplink=function(e){var r=function(){throw new Error("Invalid deeplink: "+e)},t=function(e,t){return e.startsWith(t+"=")||r(),e.split("=")[1]},n=e.match(Te);n&&3===n.length||r();var i={domain:n[1],version:n[2],action:void 0,payload:void 0,decodedPayload:void 0};try{var o=e.indexOf("?");if(-1!==o){var u=e.substring(o+1).split("&");u.length>=1&&(u.length>2&&r(),i.action=t(u[0],"action"),2===u.length&&(i.payload=t(u[1],"payload")))}}catch(e){r()}return i},e.sumNQTStringToNumber=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.reduce(function(e,r){return e+ye(r)},0)},e}({});
//# sourceMappingURL=burstjs.util.min.js.map

@@ -9,2 +9,3 @@ import BigNumber from 'bignumber.js';

private constructor();
static Zero(): BurstValue;
static fromPlanck(planck: string): BurstValue;

@@ -11,0 +12,0 @@ static fromBurst(burst: number | string): BurstValue;

@@ -0,2 +1,7 @@

export * from './burstTime';
export * from './burstValue';
export * from './constants';
export * from './convertAddressToNumericId';
export * from './convertBase36StringToHexString';
export * from './convertBase64StringToString';
export * from './convertBurstTimeToDate';

@@ -7,6 +12,7 @@ export * from './convertBurstTimeToEpochTime';

export * from './convertDateToBurstTime';
export * from './convertDecStringToHexString';
export * from './convertHexEndianess';
export * from './convertHexStringToBase36String';
export * from './convertHexStringToByteArray';
export * from './convertHexStringToDecString';
export * from './convertDecStringToHexString';
export * from './convertHexStringToString';

@@ -16,2 +22,3 @@ export * from './convertNQTStringToNumber';

export * from './convertNumericIdToAddress';
export * from './convertStringToBase64String';
export * from './convertStringToByteArray';

@@ -24,4 +31,1 @@ export * from './convertStringToHexString';

export * from './typings';
export * from './constants';
export * from './burstTime';
export * from './burstValue';

@@ -0,1 +1,2 @@

export declare const AddressPrefix = "BURST";
export declare const GenesisBlockTime: number;

@@ -2,0 +3,0 @@ export declare const initialCodeword: number[];

@@ -9,2 +9,3 @@ import BigNumber from 'bignumber.js';

private constructor();
static Zero(): BurstValue;
static fromPlanck(planck: string): BurstValue;

@@ -11,0 +12,0 @@ static fromBurst(burst: number | string): BurstValue;

@@ -23,2 +23,5 @@ "use strict";

}
static Zero() {
return new BurstValue('0');
}
static fromPlanck(planck) {

@@ -25,0 +28,0 @@ return new BurstValue(planck);

@@ -11,3 +11,3 @@ "use strict";

}
if (address.indexOf('BURST-') === 0) {
if (address.indexOf(`${internal_1.AddressPrefix}-`) === 0) {
address = address.substr(6);

@@ -14,0 +14,0 @@ }

@@ -5,11 +5,3 @@ "use strict";

const bignumber_js_1 = require("bignumber.js");
const twosComplementBinary = (bn) => {
let bin = bn.multipliedBy(-1).toString(2);
while (bin.length % 8) {
bin = '0' + bin;
}
const prefix = ('1' === bin[0] && -1 !== bin.slice(1).indexOf('1')) ? '11111111' : '';
bin = bin.split('').map(i => '0' === i ? '1' : '0').join('');
return new bignumber_js_1.default(prefix + bin, 2).plus(1);
};
const twosComplementBinary_1 = require("./internal/twosComplementBinary");
exports.convertDecStringToHexString = (decimal, padding = 2) => {

@@ -25,3 +17,3 @@ let bn = typeof decimal === 'string' ? new bignumber_js_1.default(decimal) : decimal;

if (isNegative) {
bn = twosComplementBinary(bn);
bn = twosComplementBinary_1.twosComplementBinary(bn);
}

@@ -28,0 +20,0 @@ const hex = bn.toString(16);

@@ -48,3 +48,3 @@ "use strict";

codeword[16] = p[3];
let out = 'BURST-';
let out = internal_1.AddressPrefix + '-';
for (let i = 0; i < 17; i++) {

@@ -51,0 +51,0 @@ out += internal_1.alphabet[codeword[internal_1.cwmap[i]]];

@@ -0,2 +1,7 @@

export * from './burstTime';
export * from './burstValue';
export * from './constants';
export * from './convertAddressToNumericId';
export * from './convertBase36StringToHexString';
export * from './convertBase64StringToString';
export * from './convertBurstTimeToDate';

@@ -7,6 +12,7 @@ export * from './convertBurstTimeToEpochTime';

export * from './convertDateToBurstTime';
export * from './convertDecStringToHexString';
export * from './convertHexEndianess';
export * from './convertHexStringToBase36String';
export * from './convertHexStringToByteArray';
export * from './convertHexStringToDecString';
export * from './convertDecStringToHexString';
export * from './convertHexStringToString';

@@ -16,2 +22,3 @@ export * from './convertNQTStringToNumber';

export * from './convertNumericIdToAddress';
export * from './convertStringToBase64String';
export * from './convertStringToByteArray';

@@ -24,4 +31,1 @@ export * from './convertStringToHexString';

export * from './typings';
export * from './constants';
export * from './burstTime';
export * from './burstValue';

@@ -6,3 +6,8 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./burstTime"));
__export(require("./burstValue"));
__export(require("./constants"));
__export(require("./convertAddressToNumericId"));
__export(require("./convertBase36StringToHexString"));
__export(require("./convertBase64StringToString"));
__export(require("./convertBurstTimeToDate"));

@@ -13,6 +18,7 @@ __export(require("./convertBurstTimeToEpochTime"));

__export(require("./convertDateToBurstTime"));
__export(require("./convertDecStringToHexString"));
__export(require("./convertHexEndianess"));
__export(require("./convertHexStringToBase36String"));
__export(require("./convertHexStringToByteArray"));
__export(require("./convertHexStringToDecString"));
__export(require("./convertDecStringToHexString"));
__export(require("./convertHexStringToString"));

@@ -22,2 +28,3 @@ __export(require("./convertNQTStringToNumber"));

__export(require("./convertNumericIdToAddress"));
__export(require("./convertStringToBase64String"));
__export(require("./convertStringToByteArray"));

@@ -30,5 +37,2 @@ __export(require("./convertStringToHexString"));

__export(require("./typings"));
__export(require("./constants"));
__export(require("./burstTime"));
__export(require("./burstValue"));
//# sourceMappingURL=index.js.map

@@ -0,1 +1,2 @@

export declare const AddressPrefix = "BURST";
export declare const GenesisBlockTime: number;

@@ -2,0 +3,0 @@ export declare const initialCodeword: number[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddressPrefix = 'BURST';
exports.GenesisBlockTime = Date.UTC(2014, 7, 11, 2, 0, 0, 0) / 1000;

@@ -4,0 +5,0 @@ exports.initialCodeword = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];

@@ -5,3 +5,3 @@ "use strict";

exports.isValid = (address) => {
if (address.indexOf('BURST-') === 0) {
if (address.indexOf(`${internal_1.AddressPrefix}-`) === 0) {
address = address.substr(6);

@@ -44,5 +44,12 @@ }

exports.isBurstAddress = (address) => {
return /^BURST\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{5}/i
.test(address) && exports.isValid(address);
const addressRegExp = new RegExp(`${internal_1.AddressPrefix}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{5}(-\w+)?`, 'i');
if (!addressRegExp.test(address)) {
return false;
}
const index = address.lastIndexOf('-');
const extension = address.substr(index + 1);
const hasExtension = extension.length > 5;
address = hasExtension ? address.substr(0, index) : address;
return exports.isValid(address);
};
//# sourceMappingURL=isBurstAddress.js.map
{
"name": "@burstjs/util",
"version": "0.6.0-alpha.9",
"version": "0.6.0-beta.1",
"description": "Useful utilities and tools for building Burstcoin applications",

@@ -59,7 +59,7 @@ "keywords": [

},
"gitHead": "7e6cc334ef794e7046b009eeed55f96b6a351d8e",
"gitHead": "8a6a48a9bd4ce272ca59b9b7a3c572bfeafc8d63",
"dependencies": {
"bignumber.js": "^9.0.0",
"js-base64": "^2.5.1"
"js-base64": "^3.6.0"
}
}

@@ -52,2 +52,3 @@ import {convertAddressToNumericId} from '../convertAddressToNumericId';

expect(isBurstAddress('BURST-K37B-9V85-FB95-793HN')).toBeTruthy();
expect(isBurstAddress('BURST-K37B-9V85-FB95-793HN-2UCGWTUEEY66TN7RNC189PM19C4ATCEUGQV929IY1N24H0Y82Z')).toBeTruthy();
});

@@ -62,4 +63,4 @@

});
});
});
});

@@ -7,2 +7,5 @@ import {convertHexStringToByteArray} from '../convertHexStringToByteArray';

import {convertDecStringToHexString} from '../convertDecStringToHexString';
import {convertHexStringToBase36String} from '../convertHexStringToBase36String';
import {convertBase36StringToHexString} from '../convertBase36StringToHexString';
import BigNumber from 'bignumber.js';

@@ -108,7 +111,7 @@

expect(convertDecStringToHexString('1000', 6)).toEqual('0003e8');
expect(convertDecStringToHexString(new BigNumber('327803124352370' ), 16)).toEqual('00012a229cc88572');
expect(convertDecStringToHexString(new BigNumber('327803124352370'), 16)).toEqual('00012a229cc88572');
expect(convertDecStringToHexString('-1', 4)).toEqual('ffff');
expect(convertDecStringToHexString('-1000', 6)).toEqual('fffc18');
expect(convertDecStringToHexString(new BigNumber('-327803124352370' ), 16)).toEqual('fffed5dd63377a8e');
expect(convertDecStringToHexString(new BigNumber('-327803124352370'), 16)).toEqual('fffed5dd63377a8e');
});

@@ -125,3 +128,3 @@

expect(() => {
convertDecStringToHexString('1000', -3 );
convertDecStringToHexString('1000', -3);
}).toThrow('Invalid padding argument: [-3] - Expected a positive value');

@@ -131,2 +134,16 @@ });

});
describe('convertBase36StringToHexString', () => {
it('should return the correct hex string', () => {
expect(convertBase36StringToHexString('52M12IVV2RO5B03A568CVA5AO59D0Z1IF8ILFD11CS8M7N3AQE').toUpperCase()).toBe('CB85806964BB888E9AE1C2F27A3DB85D448B84FE9CB2BCCEAFBC49729A03AC16');
expect(convertBase36StringToHexString('1UQDBIWHL54TH1HBIK1ZEQWQ3DR4MW6E5B3SNDK1HM9TMLL1T2').toUpperCase()).toBe('4A5FA0EE4E40BA8D322EF75963D6B8E71BD206897326CC9683960C9D2FF25966');
});
});
describe('convertHexStringToBase36String', () => {
it('should return the correct base36 string', () => {
expect(convertHexStringToBase36String('CB85806964BB888E9AE1C2F27A3DB85D448B84FE9CB2BCCEAFBC49729A03AC16').toUpperCase()).toBe('52M12IVV2RO5B03A568CVA5AO59D0Z1IF8ILFD11CS8M7N3AQE');
expect(convertHexStringToBase36String('4A5FA0EE4E40BA8D322EF75963D6B8E71BD206897326CC9683960C9D2FF25966').toUpperCase()).toBe('1UQDBIWHL54TH1HBIK1ZEQWQ3DR4MW6E5B3SNDK1HM9TMLL1T2');
});
});
});

@@ -45,4 +45,8 @@ import {convertStringToByteArray} from '../convertStringToByteArray';

describe('convertBase36ToString', () => {
});
});

@@ -43,2 +43,6 @@ /**

public static Zero(): BurstValue {
return new BurstValue('0');
}
/**

@@ -45,0 +49,0 @@ * Creates a Burst Value object from Planck

@@ -6,3 +6,3 @@ /**

import { base32Length, cwmap, alphabet, initialCodeword } from './internal';
import {base32Length, cwmap, alphabet, initialCodeword, AddressPrefix} from './internal';
import { isValid } from './isBurstAddress';

@@ -25,3 +25,3 @@

if (address.indexOf('BURST-') === 0) {
if (address.indexOf(`${AddressPrefix}-`) === 0) {
address = address.substr(6);

@@ -28,0 +28,0 @@ } else {

@@ -12,3 +12,3 @@ /**

* @param b64 The string to be decoded (either URI encoded or not)
* @return {string} The orginal string
* @return {string} The original string
* @module util

@@ -15,0 +15,0 @@ */

@@ -6,18 +6,5 @@ /**

import BigNumber from 'bignumber.js';
import {twosComplementBinary} from './internal/twosComplementBinary';
/**
* @internal
* @param bn
*/
const twosComplementBinary = (bn: BigNumber) => {
// we manually implement our own two's complement (flip bits, add one)
let bin = bn.multipliedBy(-1).toString(2);
while (bin.length % 8) {
bin = '0' + bin;
}
const prefix = ('1' === bin[0] && -1 !== bin.slice(1).indexOf('1')) ? '11111111' : '';
bin = bin.split('').map(i => '0' === i ? '1' : '0').join('');
return new BigNumber(prefix + bin, 2).plus(1);
};

@@ -24,0 +11,0 @@ /**

@@ -19,2 +19,3 @@ /**

digits[j] = digits[j] * 16 + carry;
// tslint:disable-next-line:no-bitwise
carry = digits[j] / 10 | 0;

@@ -25,2 +26,3 @@ digits[j] %= 10;

digits.push(carry % 10);
// tslint:disable-next-line:no-bitwise
carry = carry / 10 | 0;

@@ -27,0 +29,0 @@ }

@@ -8,3 +8,3 @@ // tslint:disable:no-bitwise

import { initialCodeword, base32Length, gmult, alphabet, cwmap } from './internal';
import {initialCodeword, base32Length, gmult, alphabet, cwmap, AddressPrefix} from './internal';

@@ -74,3 +74,3 @@ /**

let out = 'BURST-';
let out = AddressPrefix + '-';

@@ -77,0 +77,0 @@ for (let i = 0; i < 17; i++) {

@@ -6,3 +6,8 @@ /**

* */
export * from './burstTime';
export * from './burstValue';
export * from './constants';
export * from './convertAddressToNumericId';
export * from './convertBase36StringToHexString';
export * from './convertBase64StringToString';
export * from './convertBurstTimeToDate';

@@ -13,6 +18,7 @@ export * from './convertBurstTimeToEpochTime';

export * from './convertDateToBurstTime';
export * from './convertDecStringToHexString';
export * from './convertHexEndianess';
export * from './convertHexStringToBase36String';
export * from './convertHexStringToByteArray';
export * from './convertHexStringToDecString';
export * from './convertDecStringToHexString';
export * from './convertHexStringToString';

@@ -22,2 +28,3 @@ export * from './convertNQTStringToNumber';

export * from './convertNumericIdToAddress';
export * from './convertStringToBase64String';
export * from './convertStringToByteArray';

@@ -30,4 +37,1 @@ export * from './convertStringToHexString';

export * from './typings';
export * from './constants';
export * from './burstTime';
export * from './burstValue';

@@ -13,2 +13,5 @@ /** @ignore */

// Internal helper functions and structures
import BigNumber from 'bignumber.js';
export const AddressPrefix = 'BURST';
export const GenesisBlockTime = Date.UTC(2014, 7, 11, 2, 0, 0, 0) / 1000;

@@ -35,2 +38,1 @@ export const initialCodeword = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];

};
/** @ignore */
/** @internal */
/** @module contracts */
/** @module util */

@@ -5,0 +5,0 @@ // https://github.com/uxitten/polyfill/blob/master/string.polyfill.js

@@ -7,3 +7,3 @@ // tslint:disable:no-bitwise

import { initialCodeword, alphabet, cwmap, gexp, gmult } from './internal';
import {initialCodeword, alphabet, cwmap, gexp, gmult, AddressPrefix} from './internal';

@@ -14,3 +14,3 @@

* @internal
* Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)
* Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX)
* @param {string} address The address

@@ -21,3 +21,3 @@ * @return {boolean} true, if is a valid address, else false

export const isValid = (address: string): boolean => {
if (address.indexOf('BURST-') === 0) {
if (address.indexOf(`${AddressPrefix}-`) === 0) {
address = address.substr(6);

@@ -73,5 +73,5 @@ }

// TODO: make this deprectated in favor of Address in core package
/**
* Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)
* Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX)
* @param {string} address The address

@@ -82,6 +82,18 @@ * @return {boolean} true, if is a valid address, else false

export const isBurstAddress = (address: string): boolean => {
return /^BURST\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{5}/i
.test(address) && isValid(address);
const addressRegExp = new RegExp(`${AddressPrefix}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{4}\-[A-Z0-9]{5}(-\w+)?`, 'i');
if (!addressRegExp.test(address)) {
return false;
}
const index = address.lastIndexOf('-');
const extension = address.substr(index + 1);
const hasExtension = extension.length > 5;
address = hasExtension ? address.substr(0, index ) : address;
// ignoring public key validation as this is involved crypto package.
return isValid(address);
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc