!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Dapp",[],t):"object"==typeof exports?exports.Dapp=t():e.Dapp=t()}(self,(function(){return function(){var e={757:function(e,t,r){e.exports=r(666)},669:function(e,t,r){e.exports=r(609)},448:function(e,t,r){"use strict";var n=r(867),o=r(26),s=r(372),i=r(327),a=r(97),c=r(109),u=r(985),f=r(61),l=r(655),p=r(263);e.exports=function(e){return new Promise((function(t,r){var h,d=e.data,v=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(d)&&delete v["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(w+":"+b)}var x=a(e.baseURL,e.url);function k(){if(m){var n="getAllResponseHeaders"in m?c(m.getAllResponseHeaders()):null,s={data:g&&"text"!==g&&"json"!==g?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m};o((function(e){t(e),y()}),(function(e){r(e),y()}),s),m=null}}if(m.open(e.method.toUpperCase(),i(x,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,"onloadend"in m?m.onloadend=k:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(k)},m.onabort=function(){m&&(r(f("Request aborted",e,"ECONNABORTED",m)),m=null)},m.onerror=function(){r(f("Network Error",e,null,m)),m=null},m.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||l.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(f(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",m)),m=null},n.isStandardBrowserEnv()){var O=(e.withCredentials||u(x))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;O&&(v[e.xsrfHeaderName]=O)}"setRequestHeader"in m&&n.forEach(v,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete v[t]:m.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(m.withCredentials=!!e.withCredentials),g&&"json"!==g&&(m.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&m.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){m&&(r(!e||e&&e.type?new p("canceled"):e),m.abort(),m=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),d||(d=null),m.send(d)}))}},609:function(e,t,r){"use strict";var n=r(867),o=r(849),s=r(321),i=r(185),a=function e(t){var r=new s(t),a=o(s.prototype.request,r);return n.extend(a,s.prototype,r),n.extend(a,r),a.create=function(r){return e(i(t,r))},a}(r(655));a.Axios=s,a.Cancel=r(263),a.CancelToken=r(972),a.isCancel=r(502),a.VERSION=r(288).version,a.all=function(e){return Promise.all(e)},a.spread=r(713),a.isAxiosError=r(268),e.exports=a,e.exports.default=a},263:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:function(e,t,r){"use strict";var n=r(263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(i)})),e.exports=u},288:function(e){e.exports={version:"0.24.0"}},849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}},713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:function(e,t,r){"use strict";var n=r(288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,i){if(!1===e)throw new Error(o(n," has been removed"+(t?" in "+t:"")));return t&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,i)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],i=t[s];if(i){var a=e[s],c=void 0===a||i(a,s,e);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+s)}},validators:o}},867:function(e,t,r){"use strict";var n=r(849),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r0||e===t?t:t-1}function m(e){for(var t,r,n=1,o=e.length,s=e[0]+"";nu^r?1:-1;for(a=(c=o.length)<(u=s.length)?c:u,i=0;is[i]^r?1:-1;return c==u?0:c>u^r?1:-1}function b(e,t,r,n){if(er||e!==c(e))throw Error(u+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function x(e){var t=e.c.length-1;return y(e.e/p)==t&&e.c[t]%2!=0}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function O(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else tB?y.c=y.e=null:e.e=10;l/=10,u++);return void(u>B?y.c=y.e=null:(y.e=u,y.c=[e]))}g=String(e)}else{if(!i.test(g=String(e)))return o(y,g,d);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(u<0&&(u=l),u+=+g.slice(l+1),g=g.substring(0,l)):u<0&&(u=g.length)}else{if(b(t,2,G.length,"Base"),10==t&&W)return $(y=new V(e),R+y.e+1,T);if(g=String(e),d="number"==typeof e){if(0*e!=0)return o(y,g,d,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,V.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=G.slice(0,t),u=l=0,v=g.length;lu){u=v;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,l=-1,u=0;continue}return o(y,String(e),d,t)}d=!1,(u=(g=n(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(l=0;48===g.charCodeAt(l);l++);for(v=g.length;48===g.charCodeAt(--v););if(g=g.slice(l,++v)){if(v-=l,d&&V.DEBUG&&v>15&&(e>h||e!==c(e)))throw Error(f+y.s*e);if((u=u-l-1)>B)y.c=y.e=null;else if(u=I)?k(c,i):O(c,i,"0");else if(s=(e=$(new V(e),t,r)).e,a=(c=m(e.c)).length,1==n||2==n&&(t<=s||s<=L)){for(;aa){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=s-a)>0)for(s+1==a&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function z(e,t){for(var r,n=1,o=new V(e[0]);n=10;o/=10,n++);return(r=n+r*p-1)>B?e.c=e.e=null:r=10;u/=10,o++);if((s=t-o)<0)s+=p,i=t,v=(f=g[h=0])/y[o-i-1]%10|0;else if((h=a((s+1)/p))>=g.length){if(!n)break e;for(;g.length<=h;g.push(0));f=v=0,o=1,i=(s%=p)-p+1}else{for(f=u=g[h],o=1;u>=10;u/=10,o++);v=(i=(s%=p)-p+o)<0?0:f/y[o-i-1]%10|0}if(n=n||t<0||null!=g[h+1]||(i<0?f:f%y[o-i-1]),n=r<4?(v||n)&&(0==r||r==(e.s<0?3:2)):v>5||5==v&&(4==r||n||6==r&&(s>0?i>0?f/y[o-i]:0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(p-t%p)%p],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=h,u=1,h--):(g.length=h+1,u=y[p-s],g[h]=i>0?c(f/y[o-i]%y[i])*u:0),n)for(;;){if(0==h){for(s=1,i=g[0];i>=10;i/=10,s++);for(i=g[0]+=u,u=1;i>=10;i/=10,u++);s!=u&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[h]+=u,g[h]!=l)break;g[h--]=0,u=1}for(s=g.length;0===g[--s];g.pop());}e.e>B?e.c=e.e=null:e.e=I?k(t,r):O(t,r,"0"),e.s<0?"-"+t:t)}return V.clone=e,V.ROUND_UP=0,V.ROUND_DOWN=1,V.ROUND_CEIL=2,V.ROUND_FLOOR=3,V.ROUND_HALF_UP=4,V.ROUND_HALF_DOWN=5,V.ROUND_HALF_EVEN=6,V.ROUND_HALF_CEIL=7,V.ROUND_HALF_FLOOR=8,V.EUCLID=9,V.config=V.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,g,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),T=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-g,0,t),b(r[1],0,g,t),L=r[0],I=r[1]):(b(r,-g,g,t),L=-(I=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-g,-1,t),b(r[1],1,g,t),U=r[0],B=r[1];else{if(b(r,-g,g,t),!r)throw Error(u+t+" cannot be zero: "+r);U=-(B=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!r,Error(u+"crypto unavailable");D=r}else D=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),M=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,g,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);q=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);W="0123456789"==r.slice(0,10),G=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:T,EXPONENTIAL_AT:[L,I],RANGE:[U,B],CRYPTO:D,MODULO_MODE:M,POW_PRECISION:F,FORMAT:q,ALPHABET:G}},V.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!V.DEBUG)return!0;var t,r,n=e.c,o=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&o>=-g&&o<=g&&o===c(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%p)<1&&(t+=p),String(n[0]).length==t){for(t=0;t=l||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+e)},V.maximum=V.max=function(){return z(arguments,j.lt)},V.minimum=V.min=function(){return z(arguments,j.gt)},V.random=(s=9007199254740992,E=Math.random()*s&2097151?function(){return c(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,s,i=0,f=[],l=new V(P);if(null==e?e=R:b(e,0,g),o=a(e/p),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));i>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[i]=r[0],t[i+1]=r[1]):(f.push(s%1e14),i+=2);i=o/2}else{if(!crypto.randomBytes)throw D=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(o*=7);i=9e15?crypto.randomBytes(7).copy(t,i):(f.push(s%1e14),i+=7);i=o/7}if(!D)for(;i=10;s/=10,i++);ir-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,s,i,a){var c,u,f,l,p,h,d,v,g=n.indexOf("."),y=R,w=T;for(g>=0&&(l=F,F=0,n=n.replace(".",""),h=(v=new V(o)).pow(n.length-g),F=l,v.c=t(O(m(h.c),h.e,"0"),10,s,e),v.e=v.c.length),f=l=(d=t(n,o,s,a?(c=G,e):(c=e,G))).length;0==d[--l];d.pop());if(!d[0])return c.charAt(0);if(g<0?--f:(h.c=d,h.e=f,h.s=i,d=(h=r(h,v,y,w,s)).c,p=h.r,f=h.e),g=d[u=f+y+1],l=s/2,p=p||u<0||null!=d[u+1],p=w<4?(null!=g||p)&&(0==w||w==(h.s<0?3:2)):g>l||g==l&&(4==w||p||6==w&&1&d[u-1]||w==(h.s<0?8:7)),u<1||!d[0])n=p?O(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(d.length=u,p)for(--s;++d[--u]>s;)d[u]=0,u||(++f,d=[1].concat(d));for(l=d.length;!d[--l];);for(g=0,n="";g<=l;n+=c.charAt(d[g++]));n=O(n,f,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,s,i,a=0,c=e.length,u=t%v,f=t/v|0;for(e=e.slice();c--;)a=((o=u*(s=e[c]%v)+(n=f*s+(i=e[c]/v|0)*u)%v*v+a)/r|0)+(n/v|0)+f*i,e[c]=o%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var o,s;if(r!=n)s=r>n?1:-1;else for(o=s=0;ot[o]?1:-1;break}return s}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]1;e.splice(0,1));}return function(n,o,s,i,a){var u,f,h,d,v,g,m,w,b,x,k,O,E,A,C,S,N,_=n.s==o.s?1:-1,j=n.c,P=o.c;if(!(j&&j[0]&&P&&P[0]))return new V(n.s&&o.s&&(j?!P||j[0]!=P[0]:P)?j&&0==j[0]||!P?0*_:_/0:NaN);for(b=(w=new V(_)).c=[],_=s+(f=n.e-o.e)+1,a||(a=l,f=y(n.e/p)-y(o.e/p),_=_/p|0),h=0;P[h]==(j[h]||0);h++);if(P[h]>(j[h]||0)&&f--,_<0)b.push(1),d=!0;else{for(A=j.length,S=P.length,h=0,_+=2,(v=c(a/(P[0]+1)))>1&&(P=e(P,v,a),j=e(j,v,a),S=P.length,A=j.length),E=S,k=(x=j.slice(0,S)).length;k=a/2&&C++;do{if(v=0,(u=t(P,x,S,k))<0){if(O=x[0],S!=k&&(O=O*a+(x[1]||0)),(v=c(O/C))>1)for(v>=a&&(v=a-1),m=(g=e(P,v,a)).length,k=x.length;1==t(g,x,m,k);)v--,r(g,S=10;_/=10,h++);$(w,s+(w.e=h+f*p-1)+1,i,d)}else w.e=f,w.r=+d;return w}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,S=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,s=r?t:t.replace(_,"");if(N.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(A,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,s=s.replace(C,"$1").replace(S,"0.$1")),t!=s))return new V(s,o);if(V.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},j.absoluteValue=j.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return w(this,new V(e,t))},j.decimalPlaces=j.dp=function(e,t){var r,n,o,s=this;if(null!=e)return b(e,0,g),null==t?t=T:b(t,0,8),$(new V(s),e+s.e+1,t);if(!(r=s.c))return null;if(n=((o=r.length-1)-y(this.e/p))*p,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},j.dividedBy=j.div=function(e,t){return r(this,new V(e,t),R,T)},j.dividedToIntegerBy=j.idiv=function(e,t){return r(this,new V(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var r,n,o,s,i,f,l,h,d=this;if((e=new V(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+X(e));if(null!=t&&(t=new V(t)),i=e.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return h=new V(Math.pow(+X(d),i?2-x(e):+X(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new V(NaN);(n=!f&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(e.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||i&&d.c[1]>=24e7:d.c[0]<8e13||i&&d.c[0]<=9999975e7)))return s=d.s<0&&x(e)?-0:0,d.e>-1&&(s=1/s),new V(f?1/s:s);F&&(s=a(F/p+2))}for(i?(r=new V(.5),f&&(e.s=1),l=x(e)):l=(o=Math.abs(+X(e)))%2,h=new V(P);;){if(l){if(!(h=h.times(d)).c)break;s?h.c.length>s&&(h.c.length=s):n&&(h=h.mod(t))}if(o){if(0===(o=c(o/2)))break;l=o%2}else if($(e=e.times(r),e.e+1,1),e.e>14)l=x(e);else{if(0==(o=+X(e)))break;l=o%2}d=d.times(d),s?d.c&&d.c.length>s&&(d.c.length=s):n&&(d=d.mod(t))}return n?h:(f&&(h=P.div(h)),t?h.mod(t):s?$(h,F,T,void 0):h)},j.integerValue=function(e){var t=new V(this);return null==e?e=T:b(e,0,8),$(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===w(this,new V(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return w(this,new V(e,t))>0},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=w(this,new V(e,t)))||0===t},j.isInteger=function(){return!!this.c&&y(this.e/p)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return w(this,new V(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=w(this,new V(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var r,n,o,s,i=this,a=i.s;if(t=(e=new V(e,t)).s,!a||!t)return new V(NaN);if(a!=t)return e.s=-t,i.plus(e);var c=i.e/p,u=e.e/p,f=i.c,h=e.c;if(!c||!u){if(!f||!h)return f?(e.s=-t,e):new V(h?i:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new V(f[0]?i:3==T?-0:0)}if(c=y(c),u=y(u),f=f.slice(),a=c-u){for((s=a<0)?(a=-a,o=f):(u=c,o=h),o.reverse(),t=a;t--;o.push(0));o.reverse()}else for(n=(s=(a=f.length)<(t=h.length))?a:t,a=t=0;t0)for(;t--;f[r++]=0);for(t=l-1;n>a;){if(f[--n]=0;){for(r=0,d=O[o]%b,g=O[o]/b|0,s=o+(i=c);s>o;)r=((u=d*(u=k[--i]%b)+(a=g*u+(f=k[i]/b|0)*d)%b*b+m[s]+r)/w|0)+(a/b|0)+g*f,m[s--]=u%w;m[s]=r}return r?++n:m.splice(0,1),J(e,m,n)},j.negated=function(){var e=new V(this);return e.s=-e.s||null,e},j.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new V(e,t)).s,!o||!t)return new V(NaN);if(o!=t)return e.s=-t,n.minus(e);var s=n.e/p,i=e.e/p,a=n.c,c=e.c;if(!s||!i){if(!a||!c)return new V(o/0);if(!a[0]||!c[0])return c[0]?e:new V(a[0]?n:0*o)}if(s=y(s),i=y(i),a=a.slice(),o=s-i){for(o>0?(i=s,r=c):(o=-o,r=a),r.reverse();o--;r.push(0));r.reverse()}for((o=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=o),o=0;t;)o=(a[--t]=a[t]+c[t]+o)/l|0,a[t]=l===a[t]?0:a[t]%l;return o&&(a=[o].concat(a),++i),J(e,a,i)},j.precision=j.sd=function(e,t){var r,n,o,s=this;if(null!=e&&e!==!!e)return b(e,1,g),null==t?t=T:b(t,0,8),$(new V(s),e,t);if(!(r=s.c))return null;if(n=(o=r.length-1)*p+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&s.e+1>n&&(n=s.e+1),n},j.shiftedBy=function(e){return b(e,-9007199254740991,h),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,n,o,s,i=this,a=i.c,c=i.s,u=i.e,f=R+4,l=new V("0.5");if(1!==c||!a||!a[0])return new V(!c||c<0&&(!a||a[0])?NaN:a?i:1/0);if(0==(c=Math.sqrt(+X(i)))||c==1/0?(((t=m(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=y((u+1)/2)-(u<0||u%2),n=new V(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new V(c+""),n.c[0])for((c=(u=n.e)+f)<3&&(c=0);;)if(s=n,n=l.times(s.plus(r(i,s,f,1))),m(s.c).slice(0,c)===(t=m(n.c)).slice(0,c)){if(n.e0&&v>0){for(s=v%a||a,l=d.substr(0,s);s0&&(l+=f+d.slice(s)),h&&(l="-"+l)}n=p?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):l}return(r.prefix||"")+n+(r.suffix||"")},j.toFraction=function(e){var t,n,o,s,i,a,c,f,l,h,v,g,y=this,w=y.c;if(null!=e&&(!(c=new V(e)).isInteger()&&(c.c||1!==c.s)||c.lt(P)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+X(c));if(!w)return new V(y);for(t=new V(P),l=n=new V(P),o=f=new V(P),g=m(w),i=t.e=g.length-y.e-1,t.c[0]=d[(a=i%p)<0?p+a:a],e=!e||c.comparedTo(t)>0?i>0?t:l:c,a=B,B=1/0,c=new V(g),f.c[0]=0;h=r(c,t,0,1),1!=(s=n.plus(h.times(o))).comparedTo(e);)n=o,o=s,l=f.plus(h.times(s=l)),f=s,t=c.minus(h.times(s=t)),c=s;return s=r(e.minus(n),o,0,1),f=f.plus(s.times(l)),n=n.plus(s.times(o)),f.s=l.s=y.s,v=r(l,o,i*=2,T).minus(y).abs().comparedTo(r(f,n,i,T).minus(y).abs())<1?[l,o]:[f,n],B=a,v},j.toNumber=function(){return+X(this)},j.toPrecision=function(e,t){return null!=e&&b(e,1,g),H(this,e,t,2)},j.toString=function(e){var t,r=this,o=r.s,s=r.e;return null===s?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=s<=L||s>=I?k(m(r.c),s):O(m(r.c),s,"0"):10===e&&W?t=O(m((r=$(new V(r),R+s+1,T)).c),r.e,"0"):(b(e,2,G.length,"Base"),t=n(O(m(r.c),s,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return X(this)},j._isBigNumber=!0,null!=t&&V.set(t),V}(),s.default=s.BigNumber=s,void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,s=Object.create(o.prototype),i=new N(n||[]);return s._invoke=function(e,t,r){var n=l;return function(o,s){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw s;return j()}for(r.method=o,r.arg=s;;){var i=r.delegate;if(i){var a=A(i,r);if(a){if(a===v)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var c=f(e,t,r);if("normal"===c.type){if(n=r.done?d:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(e,r,i),s}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",p="suspendedYield",h="executing",d="completed",v={};function g(){}function y(){}function m(){}var w={};c(w,s,(function(){return this}));var b=Object.getPrototypeOf,x=b&&b(b(_([])));x&&x!==r&&n.call(x,s)&&(w=x);var k=m.prototype=g.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,s,i,a){var c=f(e[o],e,s);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,a)}))}a(c.arg)}var o;this._invoke=function(e,n){function s(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(s,s):s()}}function A(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function _(e){if(e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--s){var i=this.tryEntries[s],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var n={};return function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==o[1]?o[1]:[],e.next=3,this.initContract();case 3:return e.next=5,(r=this.instance.methods)[t].apply(r,E(n)).call();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"sendContract",value:(n=i(p().mark((function e(t){var r,n,o,s,i,a=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:[],n=a.length>2&&void 0!==a[2]?a[2]:{},o=a.length>3&&void 0!==a[3]?a[3]:0,e.prev=3,e.next=6,this.initContract();case 6:return e.next=8,(s=this.instance)[t].apply(s,E(r));case 8:return i=e.sent,e.next=11,this.dapp._executeContract(i,n,o);case 11:return e.abrupt("return",e.sent);case 14:if(e.prev=14,e.t0=e.catch(3),!e.t0.message){e.next=18;break}return e.abrupt("return",[e.t0.message,null]);case 18:return e.abrupt("return",[e.t0,null]);case 19:case"end":return e.stop()}}),e,this,[[3,14]])}))),function(e){return n.apply(this,arguments)})},{key:"triggerConstantContract",value:(r=i(p().mark((function e(t){var r,n,o=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:[],n=o.length>2&&void 0!==o[2]?o[2]:{},e.next=4,this.dapp._triggerConstantContract(this.address,t,r,n);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"triggerSmartContract",value:(t=i(p().mark((function e(t){var r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:[],e.next=3,this.dapp._triggerSmartContract(this.address,t,r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();var C=function(e){b(d,e);var t,r,n,o,s,c,l,h=(c=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(c);if(l){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return k(this,e)});function d(e,t){var r;return a(this,d),f(m(r=h.call(this,e,t)),"decimals",18),r}return u(d,[{key:"approve",value:(s=i(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.allowance(this.dapp.currentAddress,t);case 2:if(r=e.sent,console.log("合约地址:",t,"额度:",r.toString()),!(Number(r.toString())>1e9)){e.next=6;break}return e.abrupt("return",[null,null]);case 6:return e.next=8,this.sendContract("approve",[t,this.dapp.MAX_APPROVE]);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"transfer",value:(o=i(p().mark((function e(t,r){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendContract("transfer",[t,this.dapp.toToken(r,this.decimals)]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"balanceOf",value:(n=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.dapp.currentAddress,e.next=3,this.callContract("balanceOf",[t]);case 3:return r=e.sent,e.abrupt("return",this.dapp.fromToken(r.toString(),this.decimals));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"allowance",value:(r=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.callContract("allowance",[t,r]);case 2:return n=e.sent,e.abrupt("return",this.dapp.fromToken(n.toString(),this.decimals));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"burn",value:(t=i(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendContract("burn",[this.dapp.toToken(t,this.decimals)]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),d}(A);var S=function(e){b(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O(t);if(r){var o=O(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return k(this,e)});function o(e,t){var r;return a(this,o),f(m(r=n.call(this,e,t)),"decimals",6),r}return u(o)}(C);var N=function(e){b(o,e);var t,r,n=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=O(t);if(r){var o=O(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return k(this,e)});function o(e,t){var r;return a(this,o),f(m(r=n.call(this,e,t)),"decimals",0),r}return u(o)}(C);var _=function(e){b(f,e);var t,r,n,o,s,c=(o=f,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(o);if(s){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return k(this,e)});function f(e,t){return a(this,f),c.call(this,e,t)}return u(f,[{key:"payCnt",value:(n=i(p().mark((function e(t,r,n){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendContract("payCnt",[this.dapp.toToken(t,18),r,n]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"swapCnt",value:(r=i(p().mark((function e(t){var r,n,o,s,i,a,c,u;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.amount1,n=t.amount2,o=t.fee,s=t.deadline,i=t.nonce,a=t.v,c=t.r,u=t.s,e.next=3,this.sendContract("swapCnt",[r,n,o,s,i,a,c,u]);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"withdrawCnt",value:(t=i(p().mark((function e(t){var r,n,o,s,i,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.amount,n=t.deadline,o=t.nonce,s=t.v,i=t.r,a=t.s,e.next=3,this.sendContract("withdrawCnt",[r,n,o,s,i,a]);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),f}(A),j=r(431),P=r.n(j);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t5&&(clearInterval(o),r("请在tronlink环境下运行"))}),1e3)})));case 1:case"end":return e.stop()}}),e)}))),function(){return w.apply(this,arguments)})},{key:"accountChanged",value:function(e){this.currentAddress!==e&&(this.currentAddress=e,this._onAccountChanged&&this._onAccountChanged({address:e}))}},{key:"onAccountChanged",value:function(e){var t=this;return this._onAccountChanged=e,function(){return t._onAccountChanged=void 0}}},{key:"nodeChanged",value:function(e){this.tronNode.fullNode!==e.fullNode&&(this.tronNode=e,this._onNetworkChanged&&this._onNetworkChanged(e))}},{key:"onNetworkChanged",value:function(e){var t=this;return this._onNetworkChanged=e,function(){return t._onNetworkChanged=void 0}}},{key:"registerEvent",value:function(){var e=this;window.addEventListener("message",(function(t){t.data.message&&"tabReply"==t.data.message.action&&t.data.message.data.data&&t.data.message.data.data.node&&e.nodeChanged(t.data.message.data.data.node),t.data.message&&"setAccount"==t.data.message.action&&e.accountChanged(t.data.message.data.address),t.data.message&&"setNode"==t.data.message.action&&(e.nodeChanged(t.data.message.data.node),t.data.message&&"connect"==t.data.message.action&&console.log("connect event",t.data.message.isTronLink),t.data.message&&"disconnect"==t.data.message.action&&console.log("disconnect event",t.data.message.isTronLink),t.data.message&&"accountsChanged"==t.data.message.action&&(console.log("accountsChanged event",t.data.message),e.accountChanged(t.data.message.data.address)),t.data.message&&"connectWeb"==t.data.message.action&&(console.log("connectWeb event",t.data.message),e.accountChanged(t.data.message.data.address)),t.data.message&&"acceptWeb"==t.data.message.action&&console.log("acceptWeb event",t.data.message),t.data.message&&"disconnectWeb"==t.data.message.action&&console.log("disconnectWeb event",t.data.message),t.data.message&&"rejectWeb"==t.data.message.action&&console.log("rejectWeb event",t.data.message))}))}},{key:"init",value:(m=i(p().mark((function e(){var t,r=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]&&r[0],this.isTestNet=t,this.registerEvent(),e.next=5,this.initConfig();case 5:return e.next=7,this.waitTronwebInit();case 7:window.dapp=this.instance;case 8:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"isInit",value:(g=i(p().mark((function e(){var t=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.currentAddress||null===this.contracts){e.next=2;break}return e.abrupt("return","success");case 2:return e.abrupt("return",new Promise((function(e,r){var n=0,o=setInterval((function(){o&&null!==t.currentAddress&&null!==t.contracts&&(clearInterval(o),e("success")),++n>10&&o&&(clearInterval(o),null===t.currentAddress&&r("error, wallet not connect"))}),1e3)})));case 3:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"usdt",value:(v=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.usdt||(this.contractsInstance.usdt=new S(this,this.contracts.usdt)),e.abrupt("return",this.contractsInstance.usdt);case 4:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"cnt",value:(d=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.cnt||(this.contractsInstance.cnt=new C(this,this.contracts.cnt)),e.abrupt("return",this.contractsInstance.cnt);case 4:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"lot",value:(h=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.lot||(this.contractsInstance.lot=new N(this,this.contracts.lot)),e.abrupt("return",this.contractsInstance.lot);case 4:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"farm",value:(l=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.isInit();case 2:return this.contractsInstance.farm||(this.contractsInstance.farm=new _(this,this.contracts.farm)),e.abrupt("return",this.contractsInstance.farm);case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"_executeContract",value:(c=i(p().mark((function e(t){var r,n,o,s=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:{},n=s.length>2&&void 0!==s[2]?s[2]:0,e.next=4,t.send(T({feeLimit:1e8,callValue:n,shouldPollResponse:!1},r));case 4:return o=e.sent,e.next=7,this._getTransactionReceipt(o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"_triggerConstantContract",value:(s=i(p().mark((function e(t,r){var n,o,s,i=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>2&&void 0!==i[2]?i[2]:[],o=i.length>3&&void 0!==i[3]?i[3]:{},e.next=4,this.instance.transactionBuilder.triggerConstantContract(t,r,o,n);case 4:return s=e.sent,e.abrupt("return",s);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"_triggerSmartContract",value:(o=i(p().mark((function e(t,r){var n,o,s=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>2&&void 0!==s[2]?s[2]:[],e.next=3,this.instance.transactionBuilder.triggerSmartContract(t,r,{feeLimit:1e8},n);case 3:return o=e.sent,e.next=6,this._broadcast(o.transaction);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"_broadcast",value:(n=i(p().mark((function e(t){var r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.instance.trx.sign(t);case 2:if((r=e.sent).signature){e.next=6;break}return console.error("Transaction was not signed properly"),e.abrupt("return",["Transaction was not signed properly",null]);case 6:return e.next=8,this.instance.trx.sendRawTransaction(r);case 8:if(!(n=e.sent).txid){e.next=15;break}return e.next=12,this._getTransactionReceipt(n.txid);case 12:return e.abrupt("return",e.sent);case 15:return console.error("broadcast",n),e.abrupt("return",["send raw transaction error",null]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_getTransactionReceipt",value:(r=i(p().mark((function e(t){var r,n,o=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){setTimeout(i(p().mark((function r(){var n,s,i;return p().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.instance.trx.getUnconfirmedTransactionInfo(t);case 2:"SUCCESS"===(n=r.sent).result||n.receipt&&"SUCCESS"===n.receipt.result?e("success"):"FAILED"===n.result||n.receipt&&"SUCCESS"!==n.receipt.result?(s="操作失败","OUT_OF_ENERGY"===(i=n.receipt||n.receipt.result)?s+="能量不足":"string"==typeof i&&(s=s+","+i),console.log(s),e(s)):e("null");case 4:case"end":return r.stop()}}),r)}))),2e3)}));case 2:if("null"!==(r=e.sent)){e.next=7;break}return e.next=6,this._getTransactionReceipt(t);case 6:return e.abrupt("return",e.sent);case 7:return n=null,"success"!==r&&(n=r),e.abrupt("return",[n,t]);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"toToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new(P())(e).multipliedBy(new(P())(Math.pow(10,t))).toFormat().replaceAll(",","")}},{key:"fromToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return new(P())(e).dividedBy(new(P())(Math.pow(10,t))).toFormat().replaceAll(",","")}},{key:"signMessage",value:(t=i(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.instance.trx.sign(this.instance.toHex(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),I=new L,U=function(e){return y.post("account/becomeVillageChief",e)},B=function(e){return y.get("cnt/swapLog",e)},D=function(e){return y.get("cnt/cntDivideLog",e)},M=function(e){return y.get("cnt/cntWithdrawLog",e)},F=function(e){return y.get("cnt/cntLog",e)};function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t0&&void 0!==r[0]&&r[0])&&(this.baseUrl="https://wp.landownership.live/api/"),y.createService(this.baseUrl),e.next=5,I.init(t);case 5:case"end":return e.stop()}}),e,this)}))),function(){return N.apply(this,arguments)})},{key:"getAddress",value:function(){return I.currentAddress}},{key:"getTronNode",value:function(){return I.tronNode}},{key:"onAccountChanged",value:function(e){return I.onAccountChanged(e)}},{key:"onNetworkChanged",value:function(e){return I.onNetworkChanged(e)}},{key:"_checkUserInfo",value:function(){if(!this._userInfo.id)throw new Error("请先初始化用户信息:userInfo")}},{key:"enabled",value:(S=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.isInit();case 2:case"end":return e.stop()}}),e)}))),function(){return S.apply(this,arguments)})},{key:"userInfo",value:(C=i(p().mark((function e(){var t,r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.enabled();case 2:return e.next=4,o={address:this.getAddress()},y.get("account/info",o);case 4:return t=e.sent,r=t.err,n=t.res,null===r&&(this._userInfo=n),e.abrupt("return",{err:r,res:n});case 9:case"end":return e.stop()}var o}),e,this)}))),function(){return C.apply(this,arguments)})},{key:"userLevel",value:(A=i(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.enabled();case 2:return e.next=4,r={address:t},y.get("account/level",r);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}var r}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"bindParent",value:(E=i(p().mark((function e(t){var r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),r=JSON.stringify({code:t,address:this.getAddress()}),e.next=4,I.signMessage(r);case 4:return n=e.sent,e.next=7,o={signature:n,code:t,address:this.getAddress()},y.post("account/bindParent",o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}var o}),e,this)}))),function(e){return E.apply(this,arguments)})},{key:"getLoginSign",value:(O=i(p().mark((function e(){var t,r,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),t={id:this._userInfo.id,timestamp:parseInt(Date.now()/1e3),address:this.getAddress()},r=JSON.stringify(t),e.next=5,I.signMessage(r);case 5:return n=e.sent,e.abrupt("return",G({signature:n},t));case 7:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"cntBalance",value:(k=i(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.cnt();case 2:return t=e.sent,e.next=5,t.balanceOf();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(){return k.apply(this,arguments)})},{key:"cntTransfer",value:(x=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.cnt();case 2:return n=e.sent,e.next=5,n.transfer(t,r);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return x.apply(this,arguments)})},{key:"lotBalance",value:(b=i(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.lot();case 2:return t=e.sent,e.next=5,t.balanceOf();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)})},{key:"lotTransfer",value:(w=i(p().mark((function e(t,r){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I.lot();case 2:return n=e.sent,e.next=5,n.transfer(t,r);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return w.apply(this,arguments)})},{key:"cntCanWithdrawBalance",value:(m=i(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,t={address:this.getAddress()},y.get("cnt/cntBalance",t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}var t}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"cntWithdraw",value:(g=i(p().mark((function e(t){var r,n,s,i,a,c,u,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,l={address:this.getAddress(),amount:t},y.get("cnt/cntWithdraw",l);case 3:if(r=e.sent,n=r.err,s=r.res,null!==n){e.next=18;break}return e.next=9,I.farm();case 9:return i=e.sent,e.next=12,i.withdrawCnt(s);case 12:return a=e.sent,c=o(a,2),u=c[0],f=c[1],e.abrupt("return",[u,f]);case 18:return e.abrupt("return",[n,null]);case 19:case"end":return e.stop()}var l}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"snbToCnt",value:(v=i(p().mark((function e(t){var r,n,s,i,a,c,u,f;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkUserInfo(),e.next=3,l={address:this.getAddress(),amount:t},y.get("cnt/getSwapSign",l);case 3:if(r=e.sent,n=r.err,s=r.res,!n){e.next=8;break}return e.abrupt("return",[n,null]);case 8:return e.next=10,I.farm();case 10:return i=e.sent,e.next=13,i.swapCnt(s);case 13:return a=e.sent,c=o(a,2),u=c[0],f=c[1],e.abrupt("return",[u,f]);case 18:case"end":return e.stop()}var l}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"swapLog",value:(d=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,B({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"cntDivideLog",value:(h=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,D({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"cntWithdrawLog",value:(l=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,M({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"cntLog",value:(c=i(p().mark((function e(){var t,r,n=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:1,r=n.length>1&&void 0!==n[1]?n[1]:10,this._checkUserInfo(),e.next=5,F({address:this.getAddress(),page:t,limit:r});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"payCnt",value:(s=i(p().mark((function e(t,r,n){var s,i,a,c,u,f,l,h,d,v;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._checkUserInfo(),!(String(n).length>100)){e.next=3;break}return e.abrupt("return",["item type 过长",null]);case 3:return e.next=5,this.cntBalance();case 5:if(s=e.sent,!(Number(s)