@waves/blockchain-api
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -37,3 +37,6 @@ var __assign = (this && this.__assign) || function () { | ||
method: 'POST', | ||
body: stringify(tx) | ||
body: stringify(tx), | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
@@ -40,0 +43,0 @@ }); |
@@ -11,2 +11,3 @@ import * as addressesModule from './api-node/addresses'; | ||
import parse from './tools/parse'; | ||
import * as toolsUtilsModule from './tools/utils'; | ||
import { TTransactionFromAPIMap, TTransactionWithProofs } from '@waves/ts-types'; | ||
@@ -44,2 +45,3 @@ import { TLong } from './interface'; | ||
}; | ||
utils: typeof toolsUtilsModule; | ||
query: typeof query; | ||
@@ -46,0 +48,0 @@ resolve: typeof resolve; |
@@ -18,2 +18,3 @@ import * as addressesModule from './api-node/addresses'; | ||
import createWatch from './tools/adresses/watch'; | ||
import * as toolsUtilsModule from './tools/utils'; | ||
export function create(base) { | ||
@@ -40,2 +41,3 @@ var addresses = wrapRecord(base, addressesModule); | ||
}, | ||
utils: toolsUtilsModule, | ||
query: query, | ||
@@ -42,0 +44,0 @@ resolve: resolve, |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.nodeApi=e():t.nodeApi=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){!function(t){"use strict";var e=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,r=Math.floor,i="[BigNumber Error] ",o=i+"Number primitive has more than 15 significant digits: ",u=1e14,s=14,c=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],a=1e7,l=1e9;function h(t){var e=0|t;return t>0||t===e?e:e-1}function p(t){for(var e,n,r=1,i=t.length,o=t[0]+"";r<i;){for(e=t[r++]+"",n=s-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function d(t,e){var n,r,i=t.c,o=e.c,u=t.s,s=e.s,c=t.e,f=e.e;if(!u||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:u;if(u!=s)return u;if(n=u<0,r=c==f,!i||!o)return r?0:!i^n?1:-1;if(!r)return c>f^n?1:-1;for(s=(c=i.length)<(f=o.length)?c:f,u=0;u<s;u++)if(i[u]!=o[u])return i[u]>o[u]^n?1:-1;return c==f?0:c>f^n?1:-1}function g(t,e,n,o){if(t<e||t>n||t!==r(t))throw Error(i+(o||"Argument")+("number"==typeof t?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function m(t){var e=t.c.length-1;return h(t.e/s)==e&&t.c[e]%2!=0}function b(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function v(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}var y=function t(y){var w,O,N,_,A,E,B,I,R,U=q.prototype={constructor:q,toString:null,valueOf:null},D=new q(1),F=20,T=4,L=-7,S=21,P=-1e7,j=1e7,x=!1,M=1,C=0,k={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz";function q(t,n){var i,u,f,a,l,h,p,d,m=this;if(!(m instanceof q))return new q(t,n);if(null==n){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>j?m.c=m.e=null:t.e<P?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((h="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(a=0,l=t;l>=10;l/=10,a++);return void(a>j?m.c=m.e=null:(m.e=a,m.c=[t]))}d=String(t)}else{if(!e.test(d=String(t)))return N(m,d,h);m.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(a=d.indexOf("."))>-1&&(d=d.replace(".","")),(l=d.search(/e/i))>0?(a<0&&(a=l),a+=+d.slice(l+1),d=d.substring(0,l)):a<0&&(a=d.length)}else{if(g(n,2,H.length,"Base"),10==n)return $(m=new q(t),F+m.e+1,T);if(d=String(t),h="number"==typeof t){if(0*t!=0)return N(m,d,h,n);if(m.s=1/t<0?(d=d.slice(1),-1):1,q.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(o+t)}else m.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(i=H.slice(0,n),a=l=0,p=d.length;l<p;l++)if(i.indexOf(u=d.charAt(l))<0){if("."==u){if(l>a){a=p;continue}}else if(!f&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){f=!0,l=-1,a=0;continue}return N(m,String(t),h,n)}h=!1,(a=(d=O(d,n,10,m.s)).indexOf("."))>-1?d=d.replace(".",""):a=d.length}for(l=0;48===d.charCodeAt(l);l++);for(p=d.length;48===d.charCodeAt(--p););if(d=d.slice(l,++p)){if(p-=l,h&&q.DEBUG&&p>15&&(t>c||t!==r(t)))throw Error(o+m.s*t);if((a=a-l-1)>j)m.c=m.e=null;else if(a<P)m.c=[m.e=0];else{if(m.e=a,m.c=[],l=(a+1)%s,a<0&&(l+=s),l<p){for(l&&m.c.push(+d.slice(0,l)),p-=s;l<p;)m.c.push(+d.slice(l,l+=s));l=s-(d=d.slice(l)).length}else l-=p;for(;l--;d+="0");m.c.push(+d)}}else m.c=[m.e=0]}function G(t,e,n,r){var i,o,u,s,c;if(null==n?n=T:g(n,0,8),!t.c)return t.toString();if(i=t.c[0],u=t.e,null==e)c=p(t.c),c=1==r||2==r&&(u<=L||u>=S)?b(c,u):v(c,u,"0");else if(o=(t=$(new q(t),e,n)).e,s=(c=p(t.c)).length,1==r||2==r&&(e<=o||o<=L)){for(;s<e;c+="0",s++);c=b(c,o)}else if(e-=u,c=v(c,o,"0"),o+1>s){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=o-s)>0)for(o+1==s&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function J(t,e){for(var n,r=1,i=new q(t[0]);r<t.length;r++){if(!(n=new q(t[r])).s){i=n;break}e.call(i,n)&&(i=n)}return i}function W(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*s-1)>j?t.c=t.e=null:n<P?t.c=[t.e=0]:(t.e=n,t.c=e),t}function $(t,e,i,o){var c,a,l,h,p,d,g,m=t.c,b=f;if(m){t:{for(c=1,h=m[0];h>=10;h/=10,c++);if((a=e-c)<0)a+=s,l=e,g=(p=m[d=0])/b[c-l-1]%10|0;else if((d=n((a+1)/s))>=m.length){if(!o)break t;for(;m.length<=d;m.push(0));p=g=0,c=1,l=(a%=s)-s+1}else{for(p=h=m[d],c=1;h>=10;h/=10,c++);g=(l=(a%=s)-s+c)<0?0:p/b[c-l-1]%10|0}if(o=o||e<0||null!=m[d+1]||(l<0?p:p%b[c-l-1]),o=i<4?(g||o)&&(0==i||i==(t.s<0?3:2)):g>5||5==g&&(4==i||o||6==i&&(a>0?l>0?p/b[c-l]:0:m[d-1])%10&1||i==(t.s<0?8:7)),e<1||!m[0])return m.length=0,o?(e-=t.e+1,m[0]=b[(s-e%s)%s],t.e=-e||0):m[0]=t.e=0,t;if(0==a?(m.length=d,h=1,d--):(m.length=d+1,h=b[s-a],m[d]=l>0?r(p/b[c-l]%b[l])*h:0),o)for(;;){if(0==d){for(a=1,l=m[0];l>=10;l/=10,a++);for(l=m[0]+=h,h=1;l>=10;l/=10,h++);a!=h&&(t.e++,m[0]==u&&(m[0]=1));break}if(m[d]+=h,m[d]!=u)break;m[d--]=0,h=1}for(a=m.length;0===m[--a];m.pop());}t.e>j?t.c=t.e=null:t.e<P&&(t.c=[t.e=0])}return t}function V(t){var e,n=t.e;return null===n?t.toString():(e=p(t.c),e=n<=L||n>=S?b(e,n):v(e,n,"0"),t.s<0?"-"+e:e)}return q.clone=t,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.EUCLID=9,q.config=q.set=function(t){var e,n;if(null!=t){if("object"!=typeof t)throw Error(i+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(g(n=t[e],0,l,e),F=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(g(n=t[e],0,8,e),T=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(g(n[0],-l,0,e),g(n[1],0,l,e),L=n[0],S=n[1]):(g(n,-l,l,e),L=-(S=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)g(n[0],-l,-1,e),g(n[1],1,l,e),P=n[0],j=n[1];else{if(g(n,-l,l,e),!n)throw Error(i+e+" cannot be zero: "+n);P=-(j=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(i+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw x=!n,Error(i+"crypto unavailable");x=n}else x=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(g(n=t[e],0,9,e),M=n),t.hasOwnProperty(e="POW_PRECISION")&&(g(n=t[e],0,l,e),C=n),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(n=t[e]))throw Error(i+e+" not an object: "+n);k=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(i+e+" invalid: "+n);H=n}}return{DECIMAL_PLACES:F,ROUNDING_MODE:T,EXPONENTIAL_AT:[L,S],RANGE:[P,j],CRYPTO:x,MODULO_MODE:M,POW_PRECISION:C,FORMAT:k,ALPHABET:H}},q.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!q.DEBUG)return!0;var e,n,o=t.c,c=t.e,f=t.s;t:if("[object Array]"=={}.toString.call(o)){if((1===f||-1===f)&&c>=-l&&c<=l&&c===r(c)){if(0===o[0]){if(0===c&&1===o.length)return!0;break t}if((e=(c+1)%s)<1&&(e+=s),String(o[0]).length==e){for(e=0;e<o.length;e++)if((n=o[e])<0||n>=u||n!==r(n))break t;if(0!==n)return!0}}}else if(null===o&&null===c&&(null===f||1===f||-1===f))return!0;throw Error(i+"Invalid BigNumber: "+t)},q.maximum=q.max=function(){return J(arguments,U.lt)},q.minimum=q.min=function(){return J(arguments,U.gt)},q.random=(_=9007199254740992*Math.random()&2097151?function(){return r(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,o,u,c,a,h=0,p=[],d=new q(D);if(null==t?t=F:g(t,0,l),c=n(t/s),x)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(c*=2));h<c;)(a=131072*e[h]+(e[h+1]>>>11))>=9e15?(o=crypto.getRandomValues(new Uint32Array(2)),e[h]=o[0],e[h+1]=o[1]):(p.push(a%1e14),h+=2);h=c/2}else{if(!crypto.randomBytes)throw x=!1,Error(i+"crypto unavailable");for(e=crypto.randomBytes(c*=7);h<c;)(a=281474976710656*(31&e[h])+1099511627776*e[h+1]+4294967296*e[h+2]+16777216*e[h+3]+(e[h+4]<<16)+(e[h+5]<<8)+e[h+6])>=9e15?crypto.randomBytes(7).copy(e,h):(p.push(a%1e14),h+=7);h=c/7}if(!x)for(;h<c;)(a=_())<9e15&&(p[h++]=a%1e14);for(c=p[--h],t%=s,c&&t&&(a=f[s-t],p[h]=r(c/a)*a);0===p[h];p.pop(),h--);if(h<0)p=[u=0];else{for(u=-1;0===p[0];p.splice(0,1),u-=s);for(h=1,a=p[0];a>=10;a/=10,h++);h<s&&(u-=s-h)}return d.e=u,d.c=p,d}),q.sum=function(){for(var t=1,e=arguments,n=new q(e[0]);t<e.length;)n=n.plus(e[t++]);return n},O=function(){function t(t,e,n,r){for(var i,o,u=[0],s=0,c=t.length;s<c;){for(o=u.length;o--;u[o]*=e);for(u[0]+=r.indexOf(t.charAt(s++)),i=0;i<u.length;i++)u[i]>n-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/n|0,u[i]%=n)}return u.reverse()}return function(e,n,r,i,o){var u,s,c,f,a,l,h,d,g=e.indexOf("."),m=F,b=T;for(g>=0&&(f=C,C=0,e=e.replace(".",""),l=(d=new q(n)).pow(e.length-g),C=f,d.c=t(v(p(l.c),l.e,"0"),10,r,"0123456789"),d.e=d.c.length),c=f=(h=t(e,n,r,o?(u=H,"0123456789"):(u="0123456789",H))).length;0==h[--f];h.pop());if(!h[0])return u.charAt(0);if(g<0?--c:(l.c=h,l.e=c,l.s=i,h=(l=w(l,d,m,b,r)).c,a=l.r,c=l.e),g=h[s=c+m+1],f=r/2,a=a||s<0||null!=h[s+1],a=b<4?(null!=g||a)&&(0==b||b==(l.s<0?3:2)):g>f||g==f&&(4==b||a||6==b&&1&h[s-1]||b==(l.s<0?8:7)),s<1||!h[0])e=a?v(u.charAt(1),-m,u.charAt(0)):u.charAt(0);else{if(h.length=s,a)for(--r;++h[--s]>r;)h[s]=0,s||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,e="";g<=f;e+=u.charAt(h[g++]));e=v(e,c,u.charAt(0))}return e}}(),w=function(){function t(t,e,n){var r,i,o,u,s=0,c=t.length,f=e%a,l=e/a|0;for(t=t.slice();c--;)s=((i=f*(o=t[c]%a)+(r=l*o+(u=t[c]/a|0)*f)%a*a+s)/n|0)+(r/a|0)+l*u,t[c]=i%n;return s&&(t=[s].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,o,c,f,a){var l,p,d,g,m,b,v,y,w,O,N,_,A,E,B,I,R,U=i.s==o.s?1:-1,D=i.c,F=o.c;if(!(D&&D[0]&&F&&F[0]))return new q(i.s&&o.s&&(D?!F||D[0]!=F[0]:F)?D&&0==D[0]||!F?0*U:U/0:NaN);for(w=(y=new q(U)).c=[],U=c+(p=i.e-o.e)+1,a||(a=u,p=h(i.e/s)-h(o.e/s),U=U/s|0),d=0;F[d]==(D[d]||0);d++);if(F[d]>(D[d]||0)&&p--,U<0)w.push(1),g=!0;else{for(E=D.length,I=F.length,d=0,U+=2,(m=r(a/(F[0]+1)))>1&&(F=t(F,m,a),D=t(D,m,a),I=F.length,E=D.length),A=I,N=(O=D.slice(0,I)).length;N<I;O[N++]=0);R=F.slice(),R=[0].concat(R),B=F[0],F[1]>=a/2&&B++;do{if(m=0,(l=e(F,O,I,N))<0){if(_=O[0],I!=N&&(_=_*a+(O[1]||0)),(m=r(_/B))>1)for(m>=a&&(m=a-1),v=(b=t(F,m,a)).length,N=O.length;1==e(b,O,v,N);)m--,n(b,I<v?R:F,v,a),v=b.length,l=1;else 0==m&&(l=m=1),v=(b=F.slice()).length;if(v<N&&(b=[0].concat(b)),n(O,b,N,a),N=O.length,-1==l)for(;e(F,O,I,N)<1;)m++,n(O,I<N?R:F,N,a),N=O.length}else 0===l&&(m++,O=[0]);w[d++]=m,O[0]?O[N++]=D[A]||0:(O=[D[A]],N=1)}while((A++<E||null!=O[0])&&U--);g=null!=O[0],w[0]||w.splice(0,1)}if(a==u){for(d=1,U=w[0];U>=10;U/=10,d++);$(y,c+(y.e=d+p*s-1)+1,f,g)}else y.e=p,y.r=+g;return y}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,B=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,N=function(t,e,n,r){var o,u=n?e:e.replace(R,"");if(I.test(u))t.s=isNaN(u)?null:u<0?-1:1;else{if(!n&&(u=u.replace(A,(function(t,e,n){return o="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=o?t:e})),r&&(o=r,u=u.replace(E,"$1").replace(B,"0.$1")),e!=u))return new q(u,o);if(q.DEBUG)throw Error(i+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},U.absoluteValue=U.abs=function(){var t=new q(this);return t.s<0&&(t.s=1),t},U.comparedTo=function(t,e){return d(this,new q(t,e))},U.decimalPlaces=U.dp=function(t,e){var n,r,i,o=this;if(null!=t)return g(t,0,l),null==e?e=T:g(e,0,8),$(new q(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-h(this.e/s))*s,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},U.dividedBy=U.div=function(t,e){return w(this,new q(t,e),F,T)},U.dividedToIntegerBy=U.idiv=function(t,e){return w(this,new q(t,e),0,1)},U.exponentiatedBy=U.pow=function(t,e){var o,u,c,f,a,l,h,p,d=this;if((t=new q(t)).c&&!t.isInteger())throw Error(i+"Exponent not an integer: "+V(t));if(null!=e&&(e=new q(e)),a=t.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!t.c||!t.c[0])return p=new q(Math.pow(+V(d),a?2-m(t):+V(t))),e?p.mod(e):p;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new q(NaN);(u=!l&&d.isInteger()&&e.isInteger())&&(d=d.mod(e))}else{if(t.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||a&&d.c[1]>=24e7:d.c[0]<8e13||a&&d.c[0]<=9999975e7)))return f=d.s<0&&m(t)?-0:0,d.e>-1&&(f=1/f),new q(l?1/f:f);C&&(f=n(C/s+2))}for(a?(o=new q(.5),l&&(t.s=1),h=m(t)):h=(c=Math.abs(+V(t)))%2,p=new q(D);;){if(h){if(!(p=p.times(d)).c)break;f?p.c.length>f&&(p.c.length=f):u&&(p=p.mod(e))}if(c){if(0===(c=r(c/2)))break;h=c%2}else if($(t=t.times(o),t.e+1,1),t.e>14)h=m(t);else{if(0==(c=+V(t)))break;h=c%2}d=d.times(d),f?d.c&&d.c.length>f&&(d.c.length=f):u&&(d=d.mod(e))}return u?p:(l&&(p=D.div(p)),e?p.mod(e):f?$(p,C,T,void 0):p)},U.integerValue=function(t){var e=new q(this);return null==t?t=T:g(t,0,8),$(e,e.e+1,t)},U.isEqualTo=U.eq=function(t,e){return 0===d(this,new q(t,e))},U.isFinite=function(){return!!this.c},U.isGreaterThan=U.gt=function(t,e){return d(this,new q(t,e))>0},U.isGreaterThanOrEqualTo=U.gte=function(t,e){return 1===(e=d(this,new q(t,e)))||0===e},U.isInteger=function(){return!!this.c&&h(this.e/s)>this.c.length-2},U.isLessThan=U.lt=function(t,e){return d(this,new q(t,e))<0},U.isLessThanOrEqualTo=U.lte=function(t,e){return-1===(e=d(this,new q(t,e)))||0===e},U.isNaN=function(){return!this.s},U.isNegative=function(){return this.s<0},U.isPositive=function(){return this.s>0},U.isZero=function(){return!!this.c&&0==this.c[0]},U.minus=function(t,e){var n,r,i,o,c=this,f=c.s;if(e=(t=new q(t,e)).s,!f||!e)return new q(NaN);if(f!=e)return t.s=-e,c.plus(t);var a=c.e/s,l=t.e/s,p=c.c,d=t.c;if(!a||!l){if(!p||!d)return p?(t.s=-e,t):new q(d?c:NaN);if(!p[0]||!d[0])return d[0]?(t.s=-e,t):new q(p[0]?c:3==T?-0:0)}if(a=h(a),l=h(l),p=p.slice(),f=a-l){for((o=f<0)?(f=-f,i=p):(l=a,i=d),i.reverse(),e=f;e--;i.push(0));i.reverse()}else for(r=(o=(f=p.length)<(e=d.length))?f:e,f=e=0;e<r;e++)if(p[e]!=d[e]){o=p[e]<d[e];break}if(o&&(i=p,p=d,d=i,t.s=-t.s),(e=(r=d.length)-(n=p.length))>0)for(;e--;p[n++]=0);for(e=u-1;r>f;){if(p[--r]<d[r]){for(n=r;n&&!p[--n];p[n]=e);--p[n],p[r]+=u}p[r]-=d[r]}for(;0==p[0];p.splice(0,1),--l);return p[0]?W(t,p,l):(t.s=3==T?-1:1,t.c=[t.e=0],t)},U.modulo=U.mod=function(t,e){var n,r,i=this;return t=new q(t,e),!i.c||!t.s||t.c&&!t.c[0]?new q(NaN):!t.c||i.c&&!i.c[0]?new q(i):(9==M?(r=t.s,t.s=1,n=w(i,t,0,3),t.s=r,n.s*=r):n=w(i,t,0,M),(t=i.minus(n.times(t))).c[0]||1!=M||(t.s=i.s),t)},U.multipliedBy=U.times=function(t,e){var n,r,i,o,c,f,l,p,d,g,m,b,v,y,w,O=this,N=O.c,_=(t=new q(t,e)).c;if(!(N&&_&&N[0]&&_[0]))return!O.s||!t.s||N&&!N[0]&&!_||_&&!_[0]&&!N?t.c=t.e=t.s=null:(t.s*=O.s,N&&_?(t.c=[0],t.e=0):t.c=t.e=null),t;for(r=h(O.e/s)+h(t.e/s),t.s*=O.s,(l=N.length)<(g=_.length)&&(v=N,N=_,_=v,i=l,l=g,g=i),i=l+g,v=[];i--;v.push(0));for(y=u,w=a,i=g;--i>=0;){for(n=0,m=_[i]%w,b=_[i]/w|0,o=i+(c=l);o>i;)n=((p=m*(p=N[--c]%w)+(f=b*p+(d=N[c]/w|0)*m)%w*w+v[o]+n)/y|0)+(f/w|0)+b*d,v[o--]=p%y;v[o]=n}return n?++r:v.splice(0,1),W(t,v,r)},U.negated=function(){var t=new q(this);return t.s=-t.s||null,t},U.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new q(t,e)).s,!i||!e)return new q(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/s,c=t.e/s,f=r.c,a=t.c;if(!o||!c){if(!f||!a)return new q(i/0);if(!f[0]||!a[0])return a[0]?t:new q(f[0]?r:0*i)}if(o=h(o),c=h(c),f=f.slice(),i=o-c){for(i>0?(c=o,n=a):(i=-i,n=f),n.reverse();i--;n.push(0));n.reverse()}for((i=f.length)-(e=a.length)<0&&(n=a,a=f,f=n,e=i),i=0;e;)i=(f[--e]=f[e]+a[e]+i)/u|0,f[e]=u===f[e]?0:f[e]%u;return i&&(f=[i].concat(f),++c),W(t,f,c)},U.precision=U.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return g(t,1,l),null==e?e=T:g(e,0,8),$(new q(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*s+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},U.shiftedBy=function(t){return g(t,-c,c),this.times("1e"+t)},U.squareRoot=U.sqrt=function(){var t,e,n,r,i,o=this,u=o.c,s=o.s,c=o.e,f=F+4,a=new q("0.5");if(1!==s||!u||!u[0])return new q(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(s=Math.sqrt(+V(o)))||s==1/0?(((e=p(u)).length+c)%2==0&&(e+="0"),s=Math.sqrt(+e),c=h((c+1)/2)-(c<0||c%2),n=new q(e=s==1/0?"1e"+c:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new q(s+""),n.c[0])for((s=(c=n.e)+f)<3&&(s=0);;)if(i=n,n=a.times(i.plus(w(o,i,f,1))),p(i.c).slice(0,s)===(e=p(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(e=e.slice(s-3,s+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||($(n,n.e+F+2,1),t=!n.times(n).eq(o));break}if(!r&&($(i,i.e+F+2,0),i.times(i).eq(o))){n=i;break}f+=4,s+=4,r=1}return $(n,n.e+F+1,T,t)},U.toExponential=function(t,e){return null!=t&&(g(t,0,l),t++),G(this,t,e,1)},U.toFixed=function(t,e){return null!=t&&(g(t,0,l),t=t+this.e+1),G(this,t,e)},U.toFormat=function(t,e,n){var r,o=this;if(null==n)null!=t&&e&&"object"==typeof e?(n=e,e=null):t&&"object"==typeof t?(n=t,t=e=null):n=k;else if("object"!=typeof n)throw Error(i+"Argument not an object: "+n);if(r=o.toFixed(t,e),o.c){var u,s=r.split("."),c=+n.groupSize,f=+n.secondaryGroupSize,a=n.groupSeparator||"",l=s[0],h=s[1],p=o.s<0,d=p?l.slice(1):l,g=d.length;if(f&&(u=c,c=f,f=u,g-=u),c>0&&g>0){for(u=g%c||c,l=d.substr(0,u);u<g;u+=c)l+=a+d.substr(u,c);f>0&&(l+=a+d.slice(u)),p&&(l="-"+l)}r=h?l+(n.decimalSeparator||"")+((f=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):l}return(n.prefix||"")+r+(n.suffix||"")},U.toFraction=function(t){var e,n,r,o,u,c,a,l,h,d,g,m,b=this,v=b.c;if(null!=t&&(!(a=new q(t)).isInteger()&&(a.c||1!==a.s)||a.lt(D)))throw Error(i+"Argument "+(a.isInteger()?"out of range: ":"not an integer: ")+V(a));if(!v)return new q(b);for(e=new q(D),h=n=new q(D),r=l=new q(D),m=p(v),u=e.e=m.length-b.e-1,e.c[0]=f[(c=u%s)<0?s+c:c],t=!t||a.comparedTo(e)>0?u>0?e:h:a,c=j,j=1/0,a=new q(m),l.c[0]=0;d=w(a,e,0,1),1!=(o=n.plus(d.times(r))).comparedTo(t);)n=r,r=o,h=l.plus(d.times(o=h)),l=o,e=a.minus(d.times(o=e)),a=o;return o=w(t.minus(n),r,0,1),l=l.plus(o.times(h)),n=n.plus(o.times(r)),l.s=h.s=b.s,g=w(h,r,u*=2,T).minus(b).abs().comparedTo(w(l,n,u,T).minus(b).abs())<1?[h,r]:[l,n],j=c,g},U.toNumber=function(){return+V(this)},U.toPrecision=function(t,e){return null!=t&&g(t,1,l),G(this,t,e,2)},U.toString=function(t){var e,n=this,r=n.s,i=n.e;return null===i?r?(e="Infinity",r<0&&(e="-"+e)):e="NaN":(null==t?e=i<=L||i>=S?b(p(n.c),i):v(p(n.c),i,"0"):10===t?e=v(p((n=$(new q(n),F+i+1,T)).c),n.e,"0"):(g(t,2,H.length,"Base"),e=O(v(p(n.c),i,"0"),10,t,r,!0)),r<0&&n.c[0]&&(e="-"+e)),e},U.valueOf=U.toJSON=function(){return V(this)},U._isBigNumber=!0,U[Symbol.toStringTag]="BigNumber",U[Symbol.for("nodejs.util.inspect.custom")]=U.valueOf,null!=y&&q.set(y),q}(),w=function(){return(w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},O=function(){function t(){this.format=t.DEFAULT_FORMAT,y.config({FORMAT:this.format})}return t.prototype.set=function(t){"FORMAT"in t&&(this.format=w({},this.format,t.FORMAT),t.FORMAT=this.format),y.config(t)},t.DEFAULT_FORMAT={prefix:"",decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0,suffix:""},t}();t.BigNumber=function(){function t(e){"object"==typeof e&&t.isBigNumber(e)?this.bn=e.bn.plus(0):this.bn=t.toBigNumberJs(e)}return t.prototype.clone=function(){return new t(this)},t.prototype.add=function(e){return new t(this.bn.plus(t.toBigNumberJs(e)))},t.prototype.sub=function(e){return new t(this.bn.minus(t.toBigNumberJs(e)))},t.prototype.mul=function(e){return new t(this.bn.times(t.toBigNumberJs(e)))},t.prototype.div=function(e){return new t(this.bn.div(t.toBigNumberJs(e)))},t.prototype.pow=function(e){return new t(this.bn.pow(t.toBigNumberJs(e)))},t.prototype.abs=function(){return new t(this.bn.abs())},t.prototype.mod=function(e){return new t(this.bn.mod(t.toBigNumberJs(e)))},t.prototype.roundTo=function(e,n){return void 0===e&&(e=0),void 0===n&&(n=4),new t(this.bn.dp(e||0,n))},t.prototype.eq=function(e){return this.bn.eq(t.toBigNumberJs(e))},t.prototype.lt=function(e){return this.bn.lt(t.toBigNumberJs(e))},t.prototype.gt=function(e){return this.bn.gt(t.toBigNumberJs(e))},t.prototype.lte=function(e){return this.bn.lte(t.toBigNumberJs(e))},t.prototype.gte=function(e){return this.bn.gte(t.toBigNumberJs(e))},t.prototype.isNaN=function(){return this.bn.isNaN()},t.prototype.isFinite=function(){return this.bn.isFinite()},t.prototype.isZero=function(){return this.eq(0)},t.prototype.isPositive=function(){return this.gt(0)},t.prototype.isNegative=function(){return this.lt(0)},t.prototype.isInt=function(){return this.bn.isInteger()},t.prototype.getDecimalsCount=function(){return this.bn.dp()},t.prototype.isEven=function(){return this.mod(2).eq(0)},t.prototype.isOdd=function(){return!this.isEven()},t.prototype.toBytes=function(){if(!this.isInt())throw new Error("Cant create bytes from number with decimals!");var e=this.isNegative(),n=e?"1":"0",r=t._toLength(64,this.bn.plus(n).abs().toString(2).replace("-","")).split(""),i=[];do{i.push(parseInt(r.splice(0,8).join(""),2))}while(r.length);return e?Uint8Array.from(i.map((function(t){return 255-t}))):Uint8Array.from(i)},t.prototype.toFormat=function(t,e,n){return this.bn.toFormat(t,e,n)},t.prototype.toFixed=function(t,e){return null==t?this.bn.toFixed():this.bn.toFixed(t,e)},t.prototype.toString=function(){return this.toFixed()},t.prototype.toNumber=function(){return this.bn.toNumber()},t.prototype.toJSON=function(){return this.bn.toFixed()},t.prototype.valueOf=function(){return this.bn.valueOf()},t.fromBytes=function(e){if(8!==e.length)throw new Error("Wrong bytes length! Need 8 bytes!");var n=e[0]>127,r=Array.from(e).map((function(t){return n?255-t:t})).map((function(e){return t._toLength(8,e.toString(2))})).join(""),i=new t(new y(r,2));return n?i.mul(-1).sub(1):i},t.max=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.toBigNumber(e).reduce((function(t,e){return t.gte(e)?t:e}))},t.min=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.toBigNumber(e).reduce((function(t,e){return t.lte(e)?t:e}))},t.sum=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.toBigNumber(e).reduce((function(t,e){return t.add(e)}))},t.isBigNumber=function(e){return e&&"object"==typeof e&&(e instanceof t||Object.entries(t.prototype).filter((function(t){return"_"!==t[0].charAt(0)})).every((function(t){var n=t[0],r=t[1];return n in e&&typeof r==typeof e[n]})))},t.toBigNumber=function(e){return Array.isArray(e)?e.map((function(e){return new t(e)})):new t(e)},t.toBigNumberJs=function(e){return y.isBigNumber(e)?e:e instanceof t?e.bn:new y(e)},t._toLength=function(t,e){return new Array(t).fill("0",0,t).concat(e.split("")).slice(-t).join("")},t.MAX_VALUE=new t("9223372036854775807"),t.MIN_VALUE=new t("-9223372036854775808"),t.MAX_UNSIGNED_VALUE=new t("18446744073709551615"),t.config=new O,t}(),function(t){!function(t){t[t.ROUND_UP=0]="ROUND_UP",t[t.ROUND_DOWN=1]="ROUND_DOWN",t[t.ROUND_CEIL=2]="ROUND_CEIL",t[t.ROUND_FLOOR=3]="ROUND_FLOOR",t[t.ROUND_HALF_UP=4]="ROUND_HALF_UP",t[t.ROUND_HALF_DOWN=5]="ROUND_HALF_DOWN",t[t.ROUND_HALF_EVEN=6]="ROUND_HALF_EVEN",t[t.ROUND_HALF_CEIL=7]="ROUND_HALF_CEIL",t[t.ROUND_HALF_FLOOR=8]="ROUND_HALF_FLOOR"}(t.ROUND_MODE||(t.ROUND_MODE={}))}(t.BigNumber||(t.BigNumber={}));var N=t.BigNumber;t.default=N,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";e.__esModule=!0,function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(3))},function(t,e,n){"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,e.default=r.fetch.bind(r),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(){this._events=Object.create(null)}return t.prototype.hasListeners=function(t){return!(!this._events[t]||!this._events[t].length)},t.prototype.getActiveEvents=function(){var t=this;return Object.keys(this._events).filter((function(e){return t.hasListeners(e)}))},t.prototype.trigger=function(t,e){this._events[t]&&(this._events[t]=this._events[t].filter((function(t){try{t.handler.call(t.context,e)}catch(t){}return!t.once})),this._events[t].length||delete this._events[t])},t.prototype.on=function(t,e,n){this._on(t,e,n,!1)},t.prototype.once=function(t,e,n){this._on(t,e,n,!0)},t.prototype.off=function(t,e){var n=this,r="string"==typeof t?t:null,i="function"==typeof e?e:"function"==typeof t?t:null;r?i?r in this._events&&(this._events[r]=this._events[r].filter((function(t){return t.handler!==i}))):delete this._events[r]:Object.keys(this._events).forEach((function(t){n.off(t,i)}))},t.prototype._on=function(t,e,n,r){this._events[t]||(this._events[t]=[]),this._events[t].push({handler:e,context:n,once:r})},t}();e.EventEmitter=r},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"dataKey",(function(){return d})),n.d(r,"scriptInfoMeta",(function(){return g})),n.d(r,"balanceDetails",(function(){return m})),n.d(r,"balanceConfirmations",(function(){return b})),n.d(r,"scriptInfo",(function(){return v})),n.d(r,"data",(function(){return y})),n.d(r,"validate",(function(){return w})),n.d(r,"balance",(function(){return O})),n.d(r,"buildAddress",(function(){return N}));var i={};n.r(i),n.d(i,"headersLast",(function(){return _})),n.d(i,"headersAt",(function(){return A})),n.d(i,"blockAt",(function(){return E})),n.d(i,"height",(function(){return B}));var o={};n.r(o),n.d(o,"calculateFee",(function(){return C})),n.d(o,"transactions",(function(){return k})),n.d(o,"unconfirmedInfo",(function(){return H})),n.d(o,"info",(function(){return q})),n.d(o,"status",(function(){return G})),n.d(o,"broadcast",(function(){return J}));var u={};n.r(u),n.d(u,"active",(function(){return W}));var s=function(t,e){return new URL(t,e).toString()},c=new RegExp('((?!\\\\)"\\w+"):\\s*(-?[\\d|\\.]{14,})',"g"),f=function(t){return JSON.parse(t.replace(c,'$1:"$2"'))},a="function"==typeof fetch?fetch:n(2),l=function(t){return a(s(t.url,t.base),function(t){void 0===t&&(t=Object.create(null));return t.credentials="include",t}(t.options)).then(h)};function h(t){return t.text().then((function(e){return t.ok?f(e):Promise.reject(function(t){try{return JSON.parse(t)}catch(e){return t}}(e))}))}var p=function(t,e){void 0===e&&(e=Object.create(null));var n=Object.keys(t).map((function(e){return[e,t[e]]})).map((function(t){var n=t[0],r=t[1];return[n,Object.prototype.hasOwnProperty.call(e,n)?e[n](r):r]})).filter((function(t){t[0];return null!=t[1]})).map((function(t){return t[0]+"="+t[1]})).join("&");return n.length?"?"+n:""};function d(t,e,n,r){return l({base:t,url:"/addresses/data/"+e+"/"+encodeURIComponent(n)})}function g(t,e,n){return l({base:t,url:"/addresses/scriptInfo/"+e+"/meta"})}function m(t,e,n){return l({base:t,url:"/addresses/balance/details/"+e})}function b(t,e,n,r){return l({base:t,url:"/addresses/balance/"+e+"/"+n})}function v(t,e,n){return l({base:t,url:"/addresses/scriptInfo/"+e})}function y(t,e,n,r){return void 0===n&&(n=Object.create(null)),l({base:t,url:"/addresses/data/"+e+p(n)})}function w(t,e,n){return l({base:t,url:"/addresses/validate/"+e})}function O(t,e,n){return l({base:t,url:"/addresses/balance/"+e})}function N(t,e,n){return l({base:t,url:"/addresses/publicKey/"+e})}function _(t,e){return l({base:t,url:"/blocks/headers/last"})}function A(t,e,n){return l({base:t,url:"/blocks/headers/at/"+e})}function E(t,e){return l({base:t,url:"/blocks/at/"+e})}function B(t){return l({base:t,url:"/blocks/height"})}var I=4,R=5,U=6,D=7,F=11,T=14,L=15,S=16,P={IN_BLOCKCHAIN:"in_blockchain",UNCONFIRMED:"unconfirmed",NOT_FOUND:"not_found"},j=new RegExp('(?!\\\\)"('+["value","amount","matcherFee","price","fee","minSponsoredAssetFee","quantity","sellMatcherFee","buyMatcherFee"].join("|")+')":\\s*"(-?\\d+)"',"g"),x=function(t){return JSON.stringify(t).replace(j,"$1:$2")},M=function(){return(M=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function C(t,e){return l({base:t,url:"/transactions/calculateFee",options:{method:"POST",body:x(e)}})}function k(t,e,n,r,i){return l({base:t,url:"/transactions/address/"+e+"/limit/"+n+p({after:r})}).then((function(t){return t[0]}))}function H(t,e){return l({base:t,url:"/transactions/unconfirmed/info/"+e})}function q(t,e){return l({base:t,url:"/transactions/info/"+e})}function G(t,e){var n={id:"",confirmations:-1,height:-1,inUTX:!1,status:P.NOT_FOUND},r=e.map((function(e){return H(t,e).then((function(){return M(M({},n),{id:e,status:P.UNCONFIRMED,inUTX:!0})})).catch((function(){return q(t,e).then((function(t){return M(M({},n),{id:e,status:P.IN_BLOCKCHAIN,height:t.height})}))})).catch((function(){return M(M({},n),{id:e})}))}));return Promise.all([B(t),Promise.all(r)]).then((function(t){var e=t[0].height,n=t[1];return{height:e,statuses:n.map((function(t){return M(M({},t),{confirmations:t.status===P.IN_BLOCKCHAIN?e-t.height:t.confirmations})}))}}))}function J(t,e){return l({base:t,url:"/transactions/broadcast",options:{method:"POST",body:x(e),headers:{"Content-Type":"application/json"}}})}function W(t,e){return l({base:t,url:"/leasing/active/"+e})}function $(t){return Array.isArray(t)?t:[t]}function V(t){return t[0]}function z(t){return function(e){return e[t]}}var X=function(t){return Object.keys(t)};function K(t){return function(e){return e.filter(t)}}function Y(t,e){return e.reduce((function(e,n){return e[t(n)]=n,e}),{})}var Z=function(t){return X(t.reduce((function(t,e){return t[e]=e,t}),Object.create(null)))};var Q,tt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return t(e)}),e)}},et=function(t,e,n){var r=!Array.isArray(e),i=Date.now(),o=[],u=n&&n.confirmations||0,s=n&&n.maxWaitTime||0,c=n&&n.requestInterval||250,f=function(e){return G(t,e.map(z("id"))).then((function(t){var n=Y(z("id"),t.statuses);if(e.some((function(t){return n[t.id].status===P.NOT_FOUND})))throw new Error("One transaction is not in blockchain!");var r,a=e.filter((function(t){return!(n[t.id].confirmations>=u)||(o.push(t),!1)}));if(a.length)return s&&Date.now()-i>s?Promise.reject("Timeout error!"):(r=c,new Promise((function(t){setTimeout(t,r)}))).then((function(){return f(a)}))}))};return f($(e)).then((function(){return r?V(o):o}))},nt=function(){return(nt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},rt={chain:!1,confirmations:-1,maxWaitTime:0,requestInterval:0},it=function(t,e,n){var r=nt(nt({},rt),n||{}),i=!Array.isArray(e),o=r.confirmations>0?1:0;return(r.chain?function(t,e,n){return new Promise((function(r,i){var o=e.slice().reverse(),u=[],s=function(){if(!o.length)return r(u),null;var e=o.pop();J(t,e).then((function(e){return et(t,e,n)})).then((function(t){u.push(t),s()}),i)};s()}))}(t,$(e),nt(nt({},r),{confirmations:o})):function(t,e){return Promise.all(e.map((function(e){return J(t,e)})))}(t,$(e))).then((function(e){return r.confirmations<=0?e:et(t,e,r)})).then((function(t){return i?V(t):t}))};var ot,ut=((Q={})[I]=function(t){return[t.assetId,t.feeAssetId]},Q[U]=function(t){return[t.assetId]},Q[R]=function(t){return[t.assetId]},Q[D]=function(t){return[t.buyOrder.assetPair.amountAsset,t.buyOrder.assetPair.priceAsset,t.buyOrder.matcherFeeAssetId,t.sellOrder.matcherFeeAssetId]},Q[F]=function(t){return[t.assetId]},Q[L]=function(t){return[t.assetId]},Q[T]=function(t){return[t.assetId]},Q[S]=function(t){return(t.payment||[]).map(z("assetId"))},ot=Q,function(t){return ot[t.type]&&"function"==typeof ot[t.type]?ot[t.type](t):void 0}),st=function(t){var e=$(t).reduce((function(t,e){return t.concat(ut(e)||[])}),[]);return tt(K(Boolean),Z)(e)},ct=function(t,e){return function(t,e){var n=!Array.isArray(e);return Promise.all($(e).map((function(e){return l({base:t,url:"/assets/details/"+e})}))).then((function(t){return n?t[0]:t}))}(t,st(e)).then((function(t){return Y(z("assetId"),t)}))},ft=function(t,e,n,r){return k(t,e,n,r).then((function(e){return ct(t,e).then((function(t){return{transactions:e,assets:t}}))}))},at=n(0),lt=function(t,e,n){return function(t,e){return l({base:t,url:"/assets/balance/"+e})}(t,e).then(tt(z("balances"),K(function(t){return function(e){return e.minSponsoredAssetFee&&at.BigNumber.toBigNumber(e.sponsorBalance||0).gte(t)&&at.BigNumber.toBigNumber(t).div(.001*Math.pow(10,8)).mul(e.minSponsoredAssetFee).gte(e.balance)||!1}}(n)),(r=function(t){var e=at.BigNumber.toBigNumber(t).div(.001*Math.pow(10,8));return function(n){return{assetId:n.assetId,wavesFee:t,assetFee:at.BigNumber.toBigNumber(n.minSponsoredAssetFee).mul(e).toFixed()}}}(n),function(t){return t.map(r)})));var r};for(var ht=function(t){return _(t).then((function(t){return function(t){var e,n,r,i,o;if(0===t.length)return new Uint8Array(0);o=void 0,i=void 0,e=[0],o=0;for(;o<t.length;){if(!((n=t[o])in dt))throw"Base58.decode received unacceptable input. Character '"+n+"' is not in the Base58 alphabet.";for(i=0;i<e.length;)e[i]*=58,i++;for(e[0]+=dt[n],r=0,i=0;i<e.length;)e[i]+=r,r=e[i]>>8,e[i]&=255,++i;for(;r;)e.push(255&r),r>>=8;o++}o=0;for(;"1"===t[o]&&o<t.length-1;)e.push(0),o++;return new Uint8Array(e.reverse())}(t.generator)[1]}))},pt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",dt={},gt=0;gt<pt.length;gt++)dt[pt.charAt(gt)]=gt;var mt=function(t){return ht(t).then((function(t){return String.fromCharCode(t)}))},bt=n(1),vt=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],u=0,s=o.length;u<s;u++,i++)r[i]=o[u];return r},yt=function(){function t(t,e,n,r){var i,o;this._emitter=new bt.EventEmitter,this._timer=null,this.address=e,this._interval=r||1e3,this._base=t,this._lastBlock={lastId:(null===(i=n)||void 0===i?void 0:i.id)||"",height:(null===(o=n)||void 0===o?void 0:o.height)||0,transactions:n?[n]:[]},this._addTimeout()}return t.prototype.on=function(t,e){this._emitter.on(t,e)},t.prototype.once=function(t,e){this._emitter.once(t,e)},t.prototype.off=function(t,e){this._emitter.off(t,e)},t.prototype._run=function(){var e=this;this._timer&&clearTimeout(this._timer);var n=function(){return e._addTimeout()};k(this._base,this.address,1).then((function(r){var i=r[0];if(!i)return e._addTimeout(),null;e.getTransactionsInHeight(i,310).then((function(n){var r,i=t._groupByHeight(n),o=X(i).map(Number).sort((function(t,e){return e-t})),u=o[0],s=o[1];if(e._lastBlock.height){var c=Y(z("id"),e._lastBlock.transactions),f=t._getTransactionsToDispatch(vt(i[u],i[s]||[]),c,e._lastBlock.lastId);e._lastBlock.height!==u?e._lastBlock={height:u,lastId:i[s]&&i[s].length?i[s][0].id:"",transactions:i[u]}:(r=e._lastBlock.transactions).push.apply(r,f),f.length&&e._emitter.trigger("change-state",f)}else e._lastBlock={height:u,lastId:i[s]&&i[s].length?i[s][0].id:"",transactions:i[u]},e._emitter.trigger("change-state",n);e._addTimeout()}),n)})).catch(n)},t.prototype.getTransactionsInHeight=function(e,n){var r=this,i=e.height,o=function(e){return e.length>=n?Promise.resolve(e):k(r._base,r.address,e.length+100).then((function(n){if(e.length===n.length)return e;var r=t._groupByHeight(n),u=X(r).map(Number).sort((function(t,e){return e-t})),s=u[0],c=u[1];return s===i&&c?vt(r[s],[r[c][0]]):o(n)}))};return o([e])},t.prototype._addTimeout=function(){var t=this;this._timer=setTimeout((function(){t._run()}),this._interval)},t._groupByHeight=function(t){return t.reduce((function(t,e){return t[e.height]?t[e.height].push(e):t[e.height]=[e],t}),Object.create(null))},t._getTransactionsToDispatch=function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];if(o.id===n)break;e[o.id]||r.push(o)}return r},t}(),wt=function(t,e,n){return k(t,e,1).then((function(r){var i=r[0];return new yt(t,e,i,n)}))};function Ot(t){return{addresses:Nt(t,r),blocks:Nt(t,i),transactions:Nt(t,o),leasing:Nt(t,u),tools:{transactions:{broadcast:_t(t,it),wait:_t(t,et)},blocks:{getNetworkByte:_t(t,ht),getNetworkCode:_t(t,mt)},addresses:{createWatch:_t(t,wt),getAssetsByTransaction:_t(t,ct),getAssetIdListByTx:st,getTransactionsWithAssets:_t(t,ft),availableSponsoredBalances:_t(t,lt)},query:p,resolve:s,request:l,parse:f}}}n.d(e,"create",(function(){return Ot}));e.default=Ot;function Nt(t,e){return Object.keys(e).reduce((function(n,r){return n[r]=_t(t,e[r]),n}),{})}function _t(t,e){return e.bind(null,t)}}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.nodeApi=e():t.nodeApi=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){!function(t){"use strict";var e=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,r=Math.floor,i="[BigNumber Error] ",o=i+"Number primitive has more than 15 significant digits: ",u=1e14,s=14,c=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],a=1e7,l=1e9;function h(t){var e=0|t;return t>0||t===e?e:e-1}function p(t){for(var e,n,r=1,i=t.length,o=t[0]+"";r<i;){for(e=t[r++]+"",n=s-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function d(t,e){var n,r,i=t.c,o=e.c,u=t.s,s=e.s,c=t.e,f=e.e;if(!u||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:u;if(u!=s)return u;if(n=u<0,r=c==f,!i||!o)return r?0:!i^n?1:-1;if(!r)return c>f^n?1:-1;for(s=(c=i.length)<(f=o.length)?c:f,u=0;u<s;u++)if(i[u]!=o[u])return i[u]>o[u]^n?1:-1;return c==f?0:c>f^n?1:-1}function g(t,e,n,o){if(t<e||t>n||t!==r(t))throw Error(i+(o||"Argument")+("number"==typeof t?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function m(t){var e=t.c.length-1;return h(t.e/s)==e&&t.c[e]%2!=0}function b(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function v(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}var y=function t(y){var w,O,N,_,A,B,E,I,R,U=q.prototype={constructor:q,toString:null,valueOf:null},D=new q(1),T=20,F=4,L=-7,S=21,P=-1e7,j=1e7,x=!1,M=1,C=0,k={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz";function q(t,n){var i,u,f,a,l,h,p,d,m=this;if(!(m instanceof q))return new q(t,n);if(null==n){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>j?m.c=m.e=null:t.e<P?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((h="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(a=0,l=t;l>=10;l/=10,a++);return void(a>j?m.c=m.e=null:(m.e=a,m.c=[t]))}d=String(t)}else{if(!e.test(d=String(t)))return N(m,d,h);m.s=45==d.charCodeAt(0)?(d=d.slice(1),-1):1}(a=d.indexOf("."))>-1&&(d=d.replace(".","")),(l=d.search(/e/i))>0?(a<0&&(a=l),a+=+d.slice(l+1),d=d.substring(0,l)):a<0&&(a=d.length)}else{if(g(n,2,H.length,"Base"),10==n)return $(m=new q(t),T+m.e+1,F);if(d=String(t),h="number"==typeof t){if(0*t!=0)return N(m,d,h,n);if(m.s=1/t<0?(d=d.slice(1),-1):1,q.DEBUG&&d.replace(/^0\.0*|\./,"").length>15)throw Error(o+t)}else m.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1;for(i=H.slice(0,n),a=l=0,p=d.length;l<p;l++)if(i.indexOf(u=d.charAt(l))<0){if("."==u){if(l>a){a=p;continue}}else if(!f&&(d==d.toUpperCase()&&(d=d.toLowerCase())||d==d.toLowerCase()&&(d=d.toUpperCase()))){f=!0,l=-1,a=0;continue}return N(m,String(t),h,n)}h=!1,(a=(d=O(d,n,10,m.s)).indexOf("."))>-1?d=d.replace(".",""):a=d.length}for(l=0;48===d.charCodeAt(l);l++);for(p=d.length;48===d.charCodeAt(--p););if(d=d.slice(l,++p)){if(p-=l,h&&q.DEBUG&&p>15&&(t>c||t!==r(t)))throw Error(o+m.s*t);if((a=a-l-1)>j)m.c=m.e=null;else if(a<P)m.c=[m.e=0];else{if(m.e=a,m.c=[],l=(a+1)%s,a<0&&(l+=s),l<p){for(l&&m.c.push(+d.slice(0,l)),p-=s;l<p;)m.c.push(+d.slice(l,l+=s));l=s-(d=d.slice(l)).length}else l-=p;for(;l--;d+="0");m.c.push(+d)}}else m.c=[m.e=0]}function G(t,e,n,r){var i,o,u,s,c;if(null==n?n=F:g(n,0,8),!t.c)return t.toString();if(i=t.c[0],u=t.e,null==e)c=p(t.c),c=1==r||2==r&&(u<=L||u>=S)?b(c,u):v(c,u,"0");else if(o=(t=$(new q(t),e,n)).e,s=(c=p(t.c)).length,1==r||2==r&&(e<=o||o<=L)){for(;s<e;c+="0",s++);c=b(c,o)}else if(e-=u,c=v(c,o,"0"),o+1>s){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=o-s)>0)for(o+1==s&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function J(t,e){for(var n,r=1,i=new q(t[0]);r<t.length;r++){if(!(n=new q(t[r])).s){i=n;break}e.call(i,n)&&(i=n)}return i}function W(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*s-1)>j?t.c=t.e=null:n<P?t.c=[t.e=0]:(t.e=n,t.c=e),t}function $(t,e,i,o){var c,a,l,h,p,d,g,m=t.c,b=f;if(m){t:{for(c=1,h=m[0];h>=10;h/=10,c++);if((a=e-c)<0)a+=s,l=e,g=(p=m[d=0])/b[c-l-1]%10|0;else if((d=n((a+1)/s))>=m.length){if(!o)break t;for(;m.length<=d;m.push(0));p=g=0,c=1,l=(a%=s)-s+1}else{for(p=h=m[d],c=1;h>=10;h/=10,c++);g=(l=(a%=s)-s+c)<0?0:p/b[c-l-1]%10|0}if(o=o||e<0||null!=m[d+1]||(l<0?p:p%b[c-l-1]),o=i<4?(g||o)&&(0==i||i==(t.s<0?3:2)):g>5||5==g&&(4==i||o||6==i&&(a>0?l>0?p/b[c-l]:0:m[d-1])%10&1||i==(t.s<0?8:7)),e<1||!m[0])return m.length=0,o?(e-=t.e+1,m[0]=b[(s-e%s)%s],t.e=-e||0):m[0]=t.e=0,t;if(0==a?(m.length=d,h=1,d--):(m.length=d+1,h=b[s-a],m[d]=l>0?r(p/b[c-l]%b[l])*h:0),o)for(;;){if(0==d){for(a=1,l=m[0];l>=10;l/=10,a++);for(l=m[0]+=h,h=1;l>=10;l/=10,h++);a!=h&&(t.e++,m[0]==u&&(m[0]=1));break}if(m[d]+=h,m[d]!=u)break;m[d--]=0,h=1}for(a=m.length;0===m[--a];m.pop());}t.e>j?t.c=t.e=null:t.e<P&&(t.c=[t.e=0])}return t}function V(t){var e,n=t.e;return null===n?t.toString():(e=p(t.c),e=n<=L||n>=S?b(e,n):v(e,n,"0"),t.s<0?"-"+e:e)}return q.clone=t,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.EUCLID=9,q.config=q.set=function(t){var e,n;if(null!=t){if("object"!=typeof t)throw Error(i+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(g(n=t[e],0,l,e),T=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(g(n=t[e],0,8,e),F=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(g(n[0],-l,0,e),g(n[1],0,l,e),L=n[0],S=n[1]):(g(n,-l,l,e),L=-(S=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)g(n[0],-l,-1,e),g(n[1],1,l,e),P=n[0],j=n[1];else{if(g(n,-l,l,e),!n)throw Error(i+e+" cannot be zero: "+n);P=-(j=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(i+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw x=!n,Error(i+"crypto unavailable");x=n}else x=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(g(n=t[e],0,9,e),M=n),t.hasOwnProperty(e="POW_PRECISION")&&(g(n=t[e],0,l,e),C=n),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(n=t[e]))throw Error(i+e+" not an object: "+n);k=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(i+e+" invalid: "+n);H=n}}return{DECIMAL_PLACES:T,ROUNDING_MODE:F,EXPONENTIAL_AT:[L,S],RANGE:[P,j],CRYPTO:x,MODULO_MODE:M,POW_PRECISION:C,FORMAT:k,ALPHABET:H}},q.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!q.DEBUG)return!0;var e,n,o=t.c,c=t.e,f=t.s;t:if("[object Array]"=={}.toString.call(o)){if((1===f||-1===f)&&c>=-l&&c<=l&&c===r(c)){if(0===o[0]){if(0===c&&1===o.length)return!0;break t}if((e=(c+1)%s)<1&&(e+=s),String(o[0]).length==e){for(e=0;e<o.length;e++)if((n=o[e])<0||n>=u||n!==r(n))break t;if(0!==n)return!0}}}else if(null===o&&null===c&&(null===f||1===f||-1===f))return!0;throw Error(i+"Invalid BigNumber: "+t)},q.maximum=q.max=function(){return J(arguments,U.lt)},q.minimum=q.min=function(){return J(arguments,U.gt)},q.random=(_=9007199254740992*Math.random()&2097151?function(){return r(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,o,u,c,a,h=0,p=[],d=new q(D);if(null==t?t=T:g(t,0,l),c=n(t/s),x)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(c*=2));h<c;)(a=131072*e[h]+(e[h+1]>>>11))>=9e15?(o=crypto.getRandomValues(new Uint32Array(2)),e[h]=o[0],e[h+1]=o[1]):(p.push(a%1e14),h+=2);h=c/2}else{if(!crypto.randomBytes)throw x=!1,Error(i+"crypto unavailable");for(e=crypto.randomBytes(c*=7);h<c;)(a=281474976710656*(31&e[h])+1099511627776*e[h+1]+4294967296*e[h+2]+16777216*e[h+3]+(e[h+4]<<16)+(e[h+5]<<8)+e[h+6])>=9e15?crypto.randomBytes(7).copy(e,h):(p.push(a%1e14),h+=7);h=c/7}if(!x)for(;h<c;)(a=_())<9e15&&(p[h++]=a%1e14);for(c=p[--h],t%=s,c&&t&&(a=f[s-t],p[h]=r(c/a)*a);0===p[h];p.pop(),h--);if(h<0)p=[u=0];else{for(u=-1;0===p[0];p.splice(0,1),u-=s);for(h=1,a=p[0];a>=10;a/=10,h++);h<s&&(u-=s-h)}return d.e=u,d.c=p,d}),q.sum=function(){for(var t=1,e=arguments,n=new q(e[0]);t<e.length;)n=n.plus(e[t++]);return n},O=function(){function t(t,e,n,r){for(var i,o,u=[0],s=0,c=t.length;s<c;){for(o=u.length;o--;u[o]*=e);for(u[0]+=r.indexOf(t.charAt(s++)),i=0;i<u.length;i++)u[i]>n-1&&(null==u[i+1]&&(u[i+1]=0),u[i+1]+=u[i]/n|0,u[i]%=n)}return u.reverse()}return function(e,n,r,i,o){var u,s,c,f,a,l,h,d,g=e.indexOf("."),m=T,b=F;for(g>=0&&(f=C,C=0,e=e.replace(".",""),l=(d=new q(n)).pow(e.length-g),C=f,d.c=t(v(p(l.c),l.e,"0"),10,r,"0123456789"),d.e=d.c.length),c=f=(h=t(e,n,r,o?(u=H,"0123456789"):(u="0123456789",H))).length;0==h[--f];h.pop());if(!h[0])return u.charAt(0);if(g<0?--c:(l.c=h,l.e=c,l.s=i,h=(l=w(l,d,m,b,r)).c,a=l.r,c=l.e),g=h[s=c+m+1],f=r/2,a=a||s<0||null!=h[s+1],a=b<4?(null!=g||a)&&(0==b||b==(l.s<0?3:2)):g>f||g==f&&(4==b||a||6==b&&1&h[s-1]||b==(l.s<0?8:7)),s<1||!h[0])e=a?v(u.charAt(1),-m,u.charAt(0)):u.charAt(0);else{if(h.length=s,a)for(--r;++h[--s]>r;)h[s]=0,s||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(g=0,e="";g<=f;e+=u.charAt(h[g++]));e=v(e,c,u.charAt(0))}return e}}(),w=function(){function t(t,e,n){var r,i,o,u,s=0,c=t.length,f=e%a,l=e/a|0;for(t=t.slice();c--;)s=((i=f*(o=t[c]%a)+(r=l*o+(u=t[c]/a|0)*f)%a*a+s)/n|0)+(r/a|0)+l*u,t[c]=i%n;return s&&(t=[s].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,o,c,f,a){var l,p,d,g,m,b,v,y,w,O,N,_,A,B,E,I,R,U=i.s==o.s?1:-1,D=i.c,T=o.c;if(!(D&&D[0]&&T&&T[0]))return new q(i.s&&o.s&&(D?!T||D[0]!=T[0]:T)?D&&0==D[0]||!T?0*U:U/0:NaN);for(w=(y=new q(U)).c=[],U=c+(p=i.e-o.e)+1,a||(a=u,p=h(i.e/s)-h(o.e/s),U=U/s|0),d=0;T[d]==(D[d]||0);d++);if(T[d]>(D[d]||0)&&p--,U<0)w.push(1),g=!0;else{for(B=D.length,I=T.length,d=0,U+=2,(m=r(a/(T[0]+1)))>1&&(T=t(T,m,a),D=t(D,m,a),I=T.length,B=D.length),A=I,N=(O=D.slice(0,I)).length;N<I;O[N++]=0);R=T.slice(),R=[0].concat(R),E=T[0],T[1]>=a/2&&E++;do{if(m=0,(l=e(T,O,I,N))<0){if(_=O[0],I!=N&&(_=_*a+(O[1]||0)),(m=r(_/E))>1)for(m>=a&&(m=a-1),v=(b=t(T,m,a)).length,N=O.length;1==e(b,O,v,N);)m--,n(b,I<v?R:T,v,a),v=b.length,l=1;else 0==m&&(l=m=1),v=(b=T.slice()).length;if(v<N&&(b=[0].concat(b)),n(O,b,N,a),N=O.length,-1==l)for(;e(T,O,I,N)<1;)m++,n(O,I<N?R:T,N,a),N=O.length}else 0===l&&(m++,O=[0]);w[d++]=m,O[0]?O[N++]=D[A]||0:(O=[D[A]],N=1)}while((A++<B||null!=O[0])&&U--);g=null!=O[0],w[0]||w.splice(0,1)}if(a==u){for(d=1,U=w[0];U>=10;U/=10,d++);$(y,c+(y.e=d+p*s-1)+1,f,g)}else y.e=p,y.r=+g;return y}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,B=/^([^.]+)\.$/,E=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,N=function(t,e,n,r){var o,u=n?e:e.replace(R,"");if(I.test(u))t.s=isNaN(u)?null:u<0?-1:1;else{if(!n&&(u=u.replace(A,(function(t,e,n){return o="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=o?t:e})),r&&(o=r,u=u.replace(B,"$1").replace(E,"0.$1")),e!=u))return new q(u,o);if(q.DEBUG)throw Error(i+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},U.absoluteValue=U.abs=function(){var t=new q(this);return t.s<0&&(t.s=1),t},U.comparedTo=function(t,e){return d(this,new q(t,e))},U.decimalPlaces=U.dp=function(t,e){var n,r,i,o=this;if(null!=t)return g(t,0,l),null==e?e=F:g(e,0,8),$(new q(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-h(this.e/s))*s,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},U.dividedBy=U.div=function(t,e){return w(this,new q(t,e),T,F)},U.dividedToIntegerBy=U.idiv=function(t,e){return w(this,new q(t,e),0,1)},U.exponentiatedBy=U.pow=function(t,e){var o,u,c,f,a,l,h,p,d=this;if((t=new q(t)).c&&!t.isInteger())throw Error(i+"Exponent not an integer: "+V(t));if(null!=e&&(e=new q(e)),a=t.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!t.c||!t.c[0])return p=new q(Math.pow(+V(d),a?2-m(t):+V(t))),e?p.mod(e):p;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new q(NaN);(u=!l&&d.isInteger()&&e.isInteger())&&(d=d.mod(e))}else{if(t.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||a&&d.c[1]>=24e7:d.c[0]<8e13||a&&d.c[0]<=9999975e7)))return f=d.s<0&&m(t)?-0:0,d.e>-1&&(f=1/f),new q(l?1/f:f);C&&(f=n(C/s+2))}for(a?(o=new q(.5),l&&(t.s=1),h=m(t)):h=(c=Math.abs(+V(t)))%2,p=new q(D);;){if(h){if(!(p=p.times(d)).c)break;f?p.c.length>f&&(p.c.length=f):u&&(p=p.mod(e))}if(c){if(0===(c=r(c/2)))break;h=c%2}else if($(t=t.times(o),t.e+1,1),t.e>14)h=m(t);else{if(0==(c=+V(t)))break;h=c%2}d=d.times(d),f?d.c&&d.c.length>f&&(d.c.length=f):u&&(d=d.mod(e))}return u?p:(l&&(p=D.div(p)),e?p.mod(e):f?$(p,C,F,void 0):p)},U.integerValue=function(t){var e=new q(this);return null==t?t=F:g(t,0,8),$(e,e.e+1,t)},U.isEqualTo=U.eq=function(t,e){return 0===d(this,new q(t,e))},U.isFinite=function(){return!!this.c},U.isGreaterThan=U.gt=function(t,e){return d(this,new q(t,e))>0},U.isGreaterThanOrEqualTo=U.gte=function(t,e){return 1===(e=d(this,new q(t,e)))||0===e},U.isInteger=function(){return!!this.c&&h(this.e/s)>this.c.length-2},U.isLessThan=U.lt=function(t,e){return d(this,new q(t,e))<0},U.isLessThanOrEqualTo=U.lte=function(t,e){return-1===(e=d(this,new q(t,e)))||0===e},U.isNaN=function(){return!this.s},U.isNegative=function(){return this.s<0},U.isPositive=function(){return this.s>0},U.isZero=function(){return!!this.c&&0==this.c[0]},U.minus=function(t,e){var n,r,i,o,c=this,f=c.s;if(e=(t=new q(t,e)).s,!f||!e)return new q(NaN);if(f!=e)return t.s=-e,c.plus(t);var a=c.e/s,l=t.e/s,p=c.c,d=t.c;if(!a||!l){if(!p||!d)return p?(t.s=-e,t):new q(d?c:NaN);if(!p[0]||!d[0])return d[0]?(t.s=-e,t):new q(p[0]?c:3==F?-0:0)}if(a=h(a),l=h(l),p=p.slice(),f=a-l){for((o=f<0)?(f=-f,i=p):(l=a,i=d),i.reverse(),e=f;e--;i.push(0));i.reverse()}else for(r=(o=(f=p.length)<(e=d.length))?f:e,f=e=0;e<r;e++)if(p[e]!=d[e]){o=p[e]<d[e];break}if(o&&(i=p,p=d,d=i,t.s=-t.s),(e=(r=d.length)-(n=p.length))>0)for(;e--;p[n++]=0);for(e=u-1;r>f;){if(p[--r]<d[r]){for(n=r;n&&!p[--n];p[n]=e);--p[n],p[r]+=u}p[r]-=d[r]}for(;0==p[0];p.splice(0,1),--l);return p[0]?W(t,p,l):(t.s=3==F?-1:1,t.c=[t.e=0],t)},U.modulo=U.mod=function(t,e){var n,r,i=this;return t=new q(t,e),!i.c||!t.s||t.c&&!t.c[0]?new q(NaN):!t.c||i.c&&!i.c[0]?new q(i):(9==M?(r=t.s,t.s=1,n=w(i,t,0,3),t.s=r,n.s*=r):n=w(i,t,0,M),(t=i.minus(n.times(t))).c[0]||1!=M||(t.s=i.s),t)},U.multipliedBy=U.times=function(t,e){var n,r,i,o,c,f,l,p,d,g,m,b,v,y,w,O=this,N=O.c,_=(t=new q(t,e)).c;if(!(N&&_&&N[0]&&_[0]))return!O.s||!t.s||N&&!N[0]&&!_||_&&!_[0]&&!N?t.c=t.e=t.s=null:(t.s*=O.s,N&&_?(t.c=[0],t.e=0):t.c=t.e=null),t;for(r=h(O.e/s)+h(t.e/s),t.s*=O.s,(l=N.length)<(g=_.length)&&(v=N,N=_,_=v,i=l,l=g,g=i),i=l+g,v=[];i--;v.push(0));for(y=u,w=a,i=g;--i>=0;){for(n=0,m=_[i]%w,b=_[i]/w|0,o=i+(c=l);o>i;)n=((p=m*(p=N[--c]%w)+(f=b*p+(d=N[c]/w|0)*m)%w*w+v[o]+n)/y|0)+(f/w|0)+b*d,v[o--]=p%y;v[o]=n}return n?++r:v.splice(0,1),W(t,v,r)},U.negated=function(){var t=new q(this);return t.s=-t.s||null,t},U.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new q(t,e)).s,!i||!e)return new q(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/s,c=t.e/s,f=r.c,a=t.c;if(!o||!c){if(!f||!a)return new q(i/0);if(!f[0]||!a[0])return a[0]?t:new q(f[0]?r:0*i)}if(o=h(o),c=h(c),f=f.slice(),i=o-c){for(i>0?(c=o,n=a):(i=-i,n=f),n.reverse();i--;n.push(0));n.reverse()}for((i=f.length)-(e=a.length)<0&&(n=a,a=f,f=n,e=i),i=0;e;)i=(f[--e]=f[e]+a[e]+i)/u|0,f[e]=u===f[e]?0:f[e]%u;return i&&(f=[i].concat(f),++c),W(t,f,c)},U.precision=U.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return g(t,1,l),null==e?e=F:g(e,0,8),$(new q(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*s+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},U.shiftedBy=function(t){return g(t,-c,c),this.times("1e"+t)},U.squareRoot=U.sqrt=function(){var t,e,n,r,i,o=this,u=o.c,s=o.s,c=o.e,f=T+4,a=new q("0.5");if(1!==s||!u||!u[0])return new q(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(s=Math.sqrt(+V(o)))||s==1/0?(((e=p(u)).length+c)%2==0&&(e+="0"),s=Math.sqrt(+e),c=h((c+1)/2)-(c<0||c%2),n=new q(e=s==1/0?"1e"+c:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new q(s+""),n.c[0])for((s=(c=n.e)+f)<3&&(s=0);;)if(i=n,n=a.times(i.plus(w(o,i,f,1))),p(i.c).slice(0,s)===(e=p(n.c)).slice(0,s)){if(n.e<c&&--s,"9999"!=(e=e.slice(s-3,s+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||($(n,n.e+T+2,1),t=!n.times(n).eq(o));break}if(!r&&($(i,i.e+T+2,0),i.times(i).eq(o))){n=i;break}f+=4,s+=4,r=1}return $(n,n.e+T+1,F,t)},U.toExponential=function(t,e){return null!=t&&(g(t,0,l),t++),G(this,t,e,1)},U.toFixed=function(t,e){return null!=t&&(g(t,0,l),t=t+this.e+1),G(this,t,e)},U.toFormat=function(t,e,n){var r,o=this;if(null==n)null!=t&&e&&"object"==typeof e?(n=e,e=null):t&&"object"==typeof t?(n=t,t=e=null):n=k;else if("object"!=typeof n)throw Error(i+"Argument not an object: "+n);if(r=o.toFixed(t,e),o.c){var u,s=r.split("."),c=+n.groupSize,f=+n.secondaryGroupSize,a=n.groupSeparator||"",l=s[0],h=s[1],p=o.s<0,d=p?l.slice(1):l,g=d.length;if(f&&(u=c,c=f,f=u,g-=u),c>0&&g>0){for(u=g%c||c,l=d.substr(0,u);u<g;u+=c)l+=a+d.substr(u,c);f>0&&(l+=a+d.slice(u)),p&&(l="-"+l)}r=h?l+(n.decimalSeparator||"")+((f=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):l}return(n.prefix||"")+r+(n.suffix||"")},U.toFraction=function(t){var e,n,r,o,u,c,a,l,h,d,g,m,b=this,v=b.c;if(null!=t&&(!(a=new q(t)).isInteger()&&(a.c||1!==a.s)||a.lt(D)))throw Error(i+"Argument "+(a.isInteger()?"out of range: ":"not an integer: ")+V(a));if(!v)return new q(b);for(e=new q(D),h=n=new q(D),r=l=new q(D),m=p(v),u=e.e=m.length-b.e-1,e.c[0]=f[(c=u%s)<0?s+c:c],t=!t||a.comparedTo(e)>0?u>0?e:h:a,c=j,j=1/0,a=new q(m),l.c[0]=0;d=w(a,e,0,1),1!=(o=n.plus(d.times(r))).comparedTo(t);)n=r,r=o,h=l.plus(d.times(o=h)),l=o,e=a.minus(d.times(o=e)),a=o;return o=w(t.minus(n),r,0,1),l=l.plus(o.times(h)),n=n.plus(o.times(r)),l.s=h.s=b.s,g=w(h,r,u*=2,F).minus(b).abs().comparedTo(w(l,n,u,F).minus(b).abs())<1?[h,r]:[l,n],j=c,g},U.toNumber=function(){return+V(this)},U.toPrecision=function(t,e){return null!=t&&g(t,1,l),G(this,t,e,2)},U.toString=function(t){var e,n=this,r=n.s,i=n.e;return null===i?r?(e="Infinity",r<0&&(e="-"+e)):e="NaN":(null==t?e=i<=L||i>=S?b(p(n.c),i):v(p(n.c),i,"0"):10===t?e=v(p((n=$(new q(n),T+i+1,F)).c),n.e,"0"):(g(t,2,H.length,"Base"),e=O(v(p(n.c),i,"0"),10,t,r,!0)),r<0&&n.c[0]&&(e="-"+e)),e},U.valueOf=U.toJSON=function(){return V(this)},U._isBigNumber=!0,U[Symbol.toStringTag]="BigNumber",U[Symbol.for("nodejs.util.inspect.custom")]=U.valueOf,null!=y&&q.set(y),q}(),w=function(){return(w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},O=function(){function t(){this.format=t.DEFAULT_FORMAT,y.config({FORMAT:this.format})}return t.prototype.set=function(t){"FORMAT"in t&&(this.format=w({},this.format,t.FORMAT),t.FORMAT=this.format),y.config(t)},t.DEFAULT_FORMAT={prefix:"",decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0,suffix:""},t}();t.BigNumber=function(){function t(e){"object"==typeof e&&t.isBigNumber(e)?this.bn=e.bn.plus(0):this.bn=t.toBigNumberJs(e)}return t.prototype.clone=function(){return new t(this)},t.prototype.add=function(e){return new t(this.bn.plus(t.toBigNumberJs(e)))},t.prototype.sub=function(e){return new t(this.bn.minus(t.toBigNumberJs(e)))},t.prototype.mul=function(e){return new t(this.bn.times(t.toBigNumberJs(e)))},t.prototype.div=function(e){return new t(this.bn.div(t.toBigNumberJs(e)))},t.prototype.pow=function(e){return new t(this.bn.pow(t.toBigNumberJs(e)))},t.prototype.abs=function(){return new t(this.bn.abs())},t.prototype.mod=function(e){return new t(this.bn.mod(t.toBigNumberJs(e)))},t.prototype.roundTo=function(e,n){return void 0===e&&(e=0),void 0===n&&(n=4),new t(this.bn.dp(e||0,n))},t.prototype.eq=function(e){return this.bn.eq(t.toBigNumberJs(e))},t.prototype.lt=function(e){return this.bn.lt(t.toBigNumberJs(e))},t.prototype.gt=function(e){return this.bn.gt(t.toBigNumberJs(e))},t.prototype.lte=function(e){return this.bn.lte(t.toBigNumberJs(e))},t.prototype.gte=function(e){return this.bn.gte(t.toBigNumberJs(e))},t.prototype.isNaN=function(){return this.bn.isNaN()},t.prototype.isFinite=function(){return this.bn.isFinite()},t.prototype.isZero=function(){return this.eq(0)},t.prototype.isPositive=function(){return this.gt(0)},t.prototype.isNegative=function(){return this.lt(0)},t.prototype.isInt=function(){return this.bn.isInteger()},t.prototype.getDecimalsCount=function(){return this.bn.dp()},t.prototype.isEven=function(){return this.mod(2).eq(0)},t.prototype.isOdd=function(){return!this.isEven()},t.prototype.toBytes=function(){if(!this.isInt())throw new Error("Cant create bytes from number with decimals!");var e=this.isNegative(),n=e?"1":"0",r=t._toLength(64,this.bn.plus(n).abs().toString(2).replace("-","")).split(""),i=[];do{i.push(parseInt(r.splice(0,8).join(""),2))}while(r.length);return e?Uint8Array.from(i.map((function(t){return 255-t}))):Uint8Array.from(i)},t.prototype.toFormat=function(t,e,n){return this.bn.toFormat(t,e,n)},t.prototype.toFixed=function(t,e){return null==t?this.bn.toFixed():this.bn.toFixed(t,e)},t.prototype.toString=function(){return this.toFixed()},t.prototype.toNumber=function(){return this.bn.toNumber()},t.prototype.toJSON=function(){return this.bn.toFixed()},t.prototype.valueOf=function(){return this.bn.valueOf()},t.fromBytes=function(e){if(8!==e.length)throw new Error("Wrong bytes length! Need 8 bytes!");var n=e[0]>127,r=Array.from(e).map((function(t){return n?255-t:t})).map((function(e){return t._toLength(8,e.toString(2))})).join(""),i=new t(new y(r,2));return n?i.mul(-1).sub(1):i},t.max=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.toBigNumber(e).reduce((function(t,e){return t.gte(e)?t:e}))},t.min=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.toBigNumber(e).reduce((function(t,e){return t.lte(e)?t:e}))},t.sum=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.toBigNumber(e).reduce((function(t,e){return t.add(e)}))},t.isBigNumber=function(e){return e&&"object"==typeof e&&(e instanceof t||Object.entries(t.prototype).filter((function(t){return"_"!==t[0].charAt(0)})).every((function(t){var n=t[0],r=t[1];return n in e&&typeof r==typeof e[n]})))},t.toBigNumber=function(e){return Array.isArray(e)?e.map((function(e){return new t(e)})):new t(e)},t.toBigNumberJs=function(e){return y.isBigNumber(e)?e:e instanceof t?e.bn:new y(e)},t._toLength=function(t,e){return new Array(t).fill("0",0,t).concat(e.split("")).slice(-t).join("")},t.MAX_VALUE=new t("9223372036854775807"),t.MIN_VALUE=new t("-9223372036854775808"),t.MAX_UNSIGNED_VALUE=new t("18446744073709551615"),t.config=new O,t}(),function(t){!function(t){t[t.ROUND_UP=0]="ROUND_UP",t[t.ROUND_DOWN=1]="ROUND_DOWN",t[t.ROUND_CEIL=2]="ROUND_CEIL",t[t.ROUND_FLOOR=3]="ROUND_FLOOR",t[t.ROUND_HALF_UP=4]="ROUND_HALF_UP",t[t.ROUND_HALF_DOWN=5]="ROUND_HALF_DOWN",t[t.ROUND_HALF_EVEN=6]="ROUND_HALF_EVEN",t[t.ROUND_HALF_CEIL=7]="ROUND_HALF_CEIL",t[t.ROUND_HALF_FLOOR=8]="ROUND_HALF_FLOOR"}(t.ROUND_MODE||(t.ROUND_MODE={}))}(t.BigNumber||(t.BigNumber={}));var N=t.BigNumber;t.default=N,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";e.__esModule=!0,function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(3))},function(t,e,n){"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,e.default=r.fetch.bind(r),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(){this._events=Object.create(null)}return t.prototype.hasListeners=function(t){return!(!this._events[t]||!this._events[t].length)},t.prototype.getActiveEvents=function(){var t=this;return Object.keys(this._events).filter((function(e){return t.hasListeners(e)}))},t.prototype.trigger=function(t,e){this._events[t]&&(this._events[t]=this._events[t].filter((function(t){try{t.handler.call(t.context,e)}catch(t){}return!t.once})),this._events[t].length||delete this._events[t])},t.prototype.on=function(t,e,n){this._on(t,e,n,!1)},t.prototype.once=function(t,e,n){this._on(t,e,n,!0)},t.prototype.off=function(t,e){var n=this,r="string"==typeof t?t:null,i="function"==typeof e?e:"function"==typeof t?t:null;r?i?r in this._events&&(this._events[r]=this._events[r].filter((function(t){return t.handler!==i}))):delete this._events[r]:Object.keys(this._events).forEach((function(t){n.off(t,i)}))},t.prototype._on=function(t,e,n,r){this._events[t]||(this._events[t]=[]),this._events[t].push({handler:e,context:n,once:r})},t}();e.EventEmitter=r},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"dataKey",(function(){return g})),n.d(r,"scriptInfoMeta",(function(){return m})),n.d(r,"balanceDetails",(function(){return b})),n.d(r,"balanceConfirmations",(function(){return v})),n.d(r,"scriptInfo",(function(){return y})),n.d(r,"data",(function(){return w})),n.d(r,"validate",(function(){return O})),n.d(r,"balance",(function(){return N})),n.d(r,"buildAddress",(function(){return _}));var i={};n.r(i),n.d(i,"headersLast",(function(){return A})),n.d(i,"headersAt",(function(){return B})),n.d(i,"blockAt",(function(){return E})),n.d(i,"height",(function(){return I}));var o={};n.r(o),n.d(o,"calculateFee",(function(){return k})),n.d(o,"transactions",(function(){return H})),n.d(o,"unconfirmedInfo",(function(){return q})),n.d(o,"info",(function(){return G})),n.d(o,"status",(function(){return J})),n.d(o,"broadcast",(function(){return W}));var u={};n.r(u),n.d(u,"active",(function(){return $}));var s={};n.r(s),n.d(s,"toArray",(function(){return V})),n.d(s,"head",(function(){return z})),n.d(s,"wait",(function(){return X})),n.d(s,"prop",(function(){return K})),n.d(s,"keys",(function(){return Y})),n.d(s,"entries",(function(){return Z})),n.d(s,"values",(function(){return Q})),n.d(s,"assign",(function(){return tt})),n.d(s,"map",(function(){return et})),n.d(s,"filter",(function(){return nt})),n.d(s,"indexBy",(function(){return rt})),n.d(s,"uniq",(function(){return it})),n.d(s,"switchTransactionByType",(function(){return ot})),n.d(s,"pipe",(function(){return st}));var c=function(t,e){return new URL(t,e).toString()},f=new RegExp('((?!\\\\)"\\w+"):\\s*(-?[\\d|\\.]{14,})',"g"),a=function(t){return JSON.parse(t.replace(f,'$1:"$2"'))},l="function"==typeof fetch?fetch:n(2),h=function(t){return l(c(t.url,t.base),function(t){void 0===t&&(t=Object.create(null));return t.credentials="include",t}(t.options)).then(p)};function p(t){return t.text().then((function(e){return t.ok?a(e):Promise.reject(function(t){try{return JSON.parse(t)}catch(e){return t}}(e))}))}var d=function(t,e){void 0===e&&(e=Object.create(null));var n=Object.keys(t).map((function(e){return[e,t[e]]})).map((function(t){var n=t[0],r=t[1];return[n,Object.prototype.hasOwnProperty.call(e,n)?e[n](r):r]})).filter((function(t){t[0];return null!=t[1]})).map((function(t){return t[0]+"="+t[1]})).join("&");return n.length?"?"+n:""};function g(t,e,n,r){return h({base:t,url:"/addresses/data/"+e+"/"+encodeURIComponent(n)})}function m(t,e,n){return h({base:t,url:"/addresses/scriptInfo/"+e+"/meta"})}function b(t,e,n){return h({base:t,url:"/addresses/balance/details/"+e})}function v(t,e,n,r){return h({base:t,url:"/addresses/balance/"+e+"/"+n})}function y(t,e,n){return h({base:t,url:"/addresses/scriptInfo/"+e})}function w(t,e,n,r){return void 0===n&&(n=Object.create(null)),h({base:t,url:"/addresses/data/"+e+d(n)})}function O(t,e,n){return h({base:t,url:"/addresses/validate/"+e})}function N(t,e,n){return h({base:t,url:"/addresses/balance/"+e})}function _(t,e,n){return h({base:t,url:"/addresses/publicKey/"+e})}function A(t,e){return h({base:t,url:"/blocks/headers/last"})}function B(t,e,n){return h({base:t,url:"/blocks/headers/at/"+e})}function E(t,e){return h({base:t,url:"/blocks/at/"+e})}function I(t){return h({base:t,url:"/blocks/height"})}var R=4,U=5,D=6,T=7,F=11,L=14,S=15,P=16,j={IN_BLOCKCHAIN:"in_blockchain",UNCONFIRMED:"unconfirmed",NOT_FOUND:"not_found"},x=new RegExp('(?!\\\\)"('+["value","amount","matcherFee","price","fee","minSponsoredAssetFee","quantity","sellMatcherFee","buyMatcherFee"].join("|")+')":\\s*"(-?\\d+)"',"g"),M=function(t){return JSON.stringify(t).replace(x,'"$1":$2')},C=function(){return(C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function k(t,e){return h({base:t,url:"/transactions/calculateFee",options:{method:"POST",body:M(e),headers:{"Content-Type":"application/json"}}})}function H(t,e,n,r,i){return h({base:t,url:"/transactions/address/"+e+"/limit/"+n+d({after:r})}).then((function(t){return t[0]}))}function q(t,e){return h({base:t,url:"/transactions/unconfirmed/info/"+e})}function G(t,e){return h({base:t,url:"/transactions/info/"+e})}function J(t,e){var n={id:"",confirmations:-1,height:-1,inUTX:!1,status:j.NOT_FOUND},r=e.map((function(e){return q(t,e).then((function(){return C(C({},n),{id:e,status:j.UNCONFIRMED,inUTX:!0})})).catch((function(){return G(t,e).then((function(t){return C(C({},n),{id:e,status:j.IN_BLOCKCHAIN,height:t.height})}))})).catch((function(){return C(C({},n),{id:e})}))}));return Promise.all([I(t),Promise.all(r)]).then((function(t){var e=t[0].height,n=t[1];return{height:e,statuses:n.map((function(t){return C(C({},t),{confirmations:t.status===j.IN_BLOCKCHAIN?e-t.height:t.confirmations})}))}}))}function W(t,e){return h({base:t,url:"/transactions/broadcast",options:{method:"POST",body:M(e),headers:{"Content-Type":"application/json"}}})}function $(t,e){return h({base:t,url:"/leasing/active/"+e})}function V(t){return Array.isArray(t)?t:[t]}function z(t){return t[0]}function X(t){return new Promise((function(e){setTimeout(e,t)}))}function K(t){return function(e){return e[t]}}var Y=function(t){return Object.keys(t)},Z=function(t){return Y(t).map((function(e){return[e,t[e]]}))},Q=function(t){return Y(t).map((function(e){return t[e]}))},tt=function(t,e){return Z(e).reduce((function(e,n){var r=n[0],i=n[1];return t[r]=i,t}),t)};function et(t){return function(e){return e.map(t)}}function nt(t){return function(e){return e.filter(t)}}function rt(t,e){return e.reduce((function(e,n){return e[t(n)]=n,e}),{})}var it=function(t){return Y(t.reduce((function(t,e){return t[e]=e,t}),Object.create(null)))};function ot(t){return function(e){return t[e.type]&&"function"==typeof t[e.type]?t[e.type](e):void 0}}var ut,st=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return e(t)}),e)}},ct=function(t,e,n){var r=!Array.isArray(e),i=Date.now(),o=[],u=n&&n.confirmations||0,s=n&&n.maxWaitTime||0,c=n&&n.requestInterval||250,f=function(e){return J(t,e.map(K("id"))).then((function(t){var n=rt(K("id"),t.statuses);if(e.some((function(t){return n[t.id].status===j.NOT_FOUND})))throw new Error("One transaction is not in blockchain!");var r=e.filter((function(t){return!(n[t.id].confirmations>=u)||(o.push(t),!1)}));if(r.length)return s&&Date.now()-i>s?Promise.reject("Timeout error!"):X(c).then((function(){return f(r)}))}))};return f(V(e)).then((function(){return r?z(o):o}))},ft=function(){return(ft=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},at={chain:!1,confirmations:-1,maxWaitTime:0,requestInterval:0},lt=function(t,e,n){var r=ft(ft({},at),n||{}),i=!Array.isArray(e),o=r.confirmations>0?1:0;return(r.chain?function(t,e,n){return new Promise((function(r,i){var o=e.slice().reverse(),u=[],s=function(){if(!o.length)return r(u),null;var e=o.pop();W(t,e).then((function(e){return ct(t,e,n)})).then((function(t){u.push(t),s()}),i)};s()}))}(t,V(e),ft(ft({},r),{confirmations:o})):function(t,e){return Promise.all(e.map((function(e){return W(t,e)})))}(t,V(e))).then((function(e){return r.confirmations<=0?e:ct(t,e,r)})).then((function(t){return i?z(t):t}))};var ht=ot(((ut={})[R]=function(t){return[t.assetId,t.feeAssetId]},ut[D]=function(t){return[t.assetId]},ut[U]=function(t){return[t.assetId]},ut[T]=function(t){return[t.buyOrder.assetPair.amountAsset,t.buyOrder.assetPair.priceAsset,t.buyOrder.matcherFeeAssetId,t.sellOrder.matcherFeeAssetId]},ut[F]=function(t){return[t.assetId]},ut[S]=function(t){return[t.assetId]},ut[L]=function(t){return[t.assetId]},ut[P]=function(t){return(t.payment||[]).map(K("assetId"))},ut)),pt=function(t){var e=V(t).reduce((function(t,e){return t.concat(ht(e)||[])}),[]);return st(nt(Boolean),it)(e)},dt=function(t,e){return function(t,e){var n=!Array.isArray(e);return Promise.all(V(e).map((function(e){return h({base:t,url:"/assets/details/"+e})}))).then((function(t){return n?t[0]:t}))}(t,pt(e)).then((function(t){return rt(K("assetId"),t)}))},gt=function(t,e,n,r){return H(t,e,n,r).then((function(e){return dt(t,e).then((function(t){return{transactions:e,assets:t}}))}))},mt=n(0),bt=function(t,e,n){return function(t,e){return h({base:t,url:"/assets/balance/"+e})}(t,e).then(st(K("balances"),nt(function(t){return function(e){return e.minSponsoredAssetFee&&mt.BigNumber.toBigNumber(e.sponsorBalance||0).gte(t)&&mt.BigNumber.toBigNumber(t).div(.001*Math.pow(10,8)).mul(e.minSponsoredAssetFee).lte(e.balance)||!1}}(n)),et(function(t){var e=mt.BigNumber.toBigNumber(t).div(.001*Math.pow(10,8));return function(n){return{assetId:n.assetId,wavesFee:t,assetFee:mt.BigNumber.toBigNumber(n.minSponsoredAssetFee).mul(e).toFixed()}}}(n))))};for(var vt=function(t){return A(t).then((function(t){return function(t){var e,n,r,i,o;if(0===t.length)return new Uint8Array(0);o=void 0,i=void 0,e=[0],o=0;for(;o<t.length;){if(!((n=t[o])in wt))throw"Base58.decode received unacceptable input. Character '"+n+"' is not in the Base58 alphabet.";for(i=0;i<e.length;)e[i]*=58,i++;for(e[0]+=wt[n],r=0,i=0;i<e.length;)e[i]+=r,r=e[i]>>8,e[i]&=255,++i;for(;r;)e.push(255&r),r>>=8;o++}o=0;for(;"1"===t[o]&&o<t.length-1;)e.push(0),o++;return new Uint8Array(e.reverse())}(t.generator)[1]}))},yt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",wt={},Ot=0;Ot<yt.length;Ot++)wt[yt.charAt(Ot)]=Ot;var Nt=function(t){return vt(t).then((function(t){return String.fromCharCode(t)}))},_t=n(1),At=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],u=0,s=o.length;u<s;u++,i++)r[i]=o[u];return r},Bt=function(){function t(t,e,n,r){var i,o;this._emitter=new _t.EventEmitter,this._timer=null,this.address=e,this._interval=r||1e3,this._base=t,this._lastBlock={lastId:(null===(i=n)||void 0===i?void 0:i.id)||"",height:(null===(o=n)||void 0===o?void 0:o.height)||0,transactions:n?[n]:[]},this._addTimeout()}return t.prototype.on=function(t,e){this._emitter.on(t,e)},t.prototype.once=function(t,e){this._emitter.once(t,e)},t.prototype.off=function(t,e){this._emitter.off(t,e)},t.prototype._run=function(){var e=this;this._timer&&clearTimeout(this._timer);var n=function(){return e._addTimeout()};H(this._base,this.address,1).then((function(r){var i=r[0];if(!i)return e._addTimeout(),null;e.getTransactionsInHeight(i,310).then((function(n){var r,i=t._groupByHeight(n),o=Y(i).map(Number).sort((function(t,e){return e-t})),u=o[0],s=o[1];if(e._lastBlock.height){var c=rt(K("id"),e._lastBlock.transactions),f=t._getTransactionsToDispatch(At(i[u],i[s]||[]),c,e._lastBlock.lastId);e._lastBlock.height!==u?e._lastBlock={height:u,lastId:i[s]&&i[s].length?i[s][0].id:"",transactions:i[u]}:(r=e._lastBlock.transactions).push.apply(r,f),f.length&&e._emitter.trigger("change-state",f)}else e._lastBlock={height:u,lastId:i[s]&&i[s].length?i[s][0].id:"",transactions:i[u]},e._emitter.trigger("change-state",n);e._addTimeout()}),n)})).catch(n)},t.prototype.getTransactionsInHeight=function(e,n){var r=this,i=e.height,o=function(e){return e.length>=n?Promise.resolve(e):H(r._base,r.address,e.length+100).then((function(n){if(e.length===n.length)return e;var r=t._groupByHeight(n),u=Y(r).map(Number).sort((function(t,e){return e-t})),s=u[0],c=u[1];return s===i&&c?At(r[s],[r[c][0]]):o(n)}))};return o([e])},t.prototype._addTimeout=function(){var t=this;this._timer=setTimeout((function(){t._run()}),this._interval)},t._groupByHeight=function(t){return t.reduce((function(t,e){return t[e.height]?t[e.height].push(e):t[e.height]=[e],t}),Object.create(null))},t._getTransactionsToDispatch=function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];if(o.id===n)break;e[o.id]||r.push(o)}return r},t}(),Et=function(t,e,n){return H(t,e,1).then((function(r){var i=r[0];return new Bt(t,e,i,n)}))};function It(t){return{addresses:Rt(t,r),blocks:Rt(t,i),transactions:Rt(t,o),leasing:Rt(t,u),tools:{transactions:{broadcast:Ut(t,lt),wait:Ut(t,ct)},blocks:{getNetworkByte:Ut(t,vt),getNetworkCode:Ut(t,Nt)},addresses:{createWatch:Ut(t,Et),getAssetsByTransaction:Ut(t,dt),getAssetIdListByTx:pt,getTransactionsWithAssets:Ut(t,gt),availableSponsoredBalances:Ut(t,bt)},utils:s,query:d,resolve:c,request:h,parse:a}}}n.d(e,"create",(function(){return It}));e.default=It;function Rt(t,e){return Object.keys(e).reduce((function(n,r){return n[r]=Ut(t,e[r]),n}),{})}function Ut(t,e){return e.bind(null,t)}}])})); |
@@ -14,3 +14,3 @@ import { BigNumber } from '@waves/bignumber'; | ||
.mul(balance.minSponsoredAssetFee) | ||
.gte(balance.balance)) || false; }; | ||
.lte(balance.balance)) || false; }; | ||
} | ||
@@ -17,0 +17,0 @@ function currentFee(wavesFee) { |
var FIELDS = ['value', 'amount', 'matcherFee', 'price', 'fee', 'minSponsoredAssetFee', 'quantity', 'sellMatcherFee', 'buyMatcherFee']; | ||
var reg = new RegExp("(?!\\\\)\"(" + FIELDS.join('|') + ")\":\\s*\"(-?\\d+)\"", 'g'); | ||
export default function (data) { | ||
return JSON.stringify(data).replace(reg, '$1:$2'); | ||
return JSON.stringify(data).replace(reg, '"$1":$2'); | ||
} | ||
//# sourceMappingURL=stringify.js.map |
@@ -57,4 +57,4 @@ export function toArray(data) { | ||
} | ||
return function (data) { return args.reduce(function (acc, item) { return acc(item); }, data); }; | ||
return function (data) { return args.reduce(function (acc, item) { return item(acc); }, data); }; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@waves/blockchain-api", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
353946
2956