diff --git a/lib/browser.js b/lib/browser.js index 2226089cf..86cc81aec 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -4,7 +4,7 @@ * @author Feross Aboukhadijeh * @license MIT */ -var Q=r(95),G=r(96),J=r(49);t.Buffer=a,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return o(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return f(null,e,t,r)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,f=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return A(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,a=0;++a=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),G.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),G.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),G.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),G.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):z(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):z(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=d(n)),n}),d=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;if("number"!=typeof e)throw new Error("num must be numeric");return h(Math.round(e*Math.pow(10,8)),t,!0)},t.fixed82num=function(e){if("string"!=typeof e)throw new Error("fixed8hex must be a string");if(!e.length||e.length%2!=0)throw new Error("fixed8hex must be hex");return parseInt(d(e),16)/Math.pow(10,8)},t.num2VarInt=function(e){return e<253?h(e):e<=65535?"fd"+h(e,4,!0):e<=4294967295?"fe"+h(e,8,!0):"ff"+h(e,16,!0)},t.hexXor=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new Error("hexXor expects hex strings");if(e.length!==t.length)throw new Error("strings are disparate lengths");if(e.length%2!=0)throw new Error("strings must be hex");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t});t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";n(this,e),this.str=t,this.pter=0}return i(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(d(this.read(2)),16):254===e?e=parseInt(d(this.read(4)),16):255===e&&(e=parseInt(d(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e);return(0,o.SHA256)(t).toString()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654"},t.DEFAULT_RPC={MAIN:"http://seed1.neo.org:10332",TEST:"http://seed1.neo.org:20332"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){"use strict";function n(e){return"[object Array]"===A.call(e)}function i(e){return"[object ArrayBuffer]"===A.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function o(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function f(e){return"number"==typeof e}function u(e){return void 0===e}function c(e){return null!==e&&"object"==typeof e}function h(e){return"[object Date]"===A.call(e)}function d(e){return"[object File]"===A.call(e)}function l(e){return"[object Blob]"===A.call(e)}function p(e){return"[object Function]"===A.call(e)}function b(e){return c(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function m(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function y(e,t){if(null!==e&&void 0!==e)if("object"==typeof e||n(e)||(e=[e]),n(e))for(var r=0,i=e.length;r1)for(var r=1;r>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function c(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function h(e,t){return e>>>t|e<<32-t}function d(e,t){return e<>>32-t}function l(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function g(e,t,r,n){return(t+n>>>0>>0}function y(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,u=t;return u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function S(e,t,r,n,i,a,o,s,f,u){var c=0,h=t;return h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}function k(e,t,r,n,i,a,o,s,f,u){return t+n+a+s+u>>>0}function A(e,t,r){return(t<<32-r|e>>>r)>>>0}function M(e,t,r){return(e<<32-r|t>>>r)>>>0}function x(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var I=r(14),T=r(1);t.inherits=T,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=u,t.split32=c,t.rotr32=h,t.rotl32=d,t.sum32=l,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=g,t.sum64_lo=y,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=S,t.sum64_5_lo=k,t.rotr64_hi=A,t.rotr64_lo=M,t.shr64_hi=x,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function u(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;i=0|e.words[p],a=0|t.words[l],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}function c(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(e,t,r){return(new d).mulp(e,t,r)}function d(e,t){this.x=e,this.y=t}function l(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function y(e){g.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(122).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],k=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=S[e],c=k[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var d=h.modn(c).toString(e);h=h.idivn(c),r=h.isZero()?d+r:_[u-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,u=new e(a),c=this.clone();if(f){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],p=8191&l,b=l>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,_=y>>>13,S=0|o[4],k=8191&S,A=S>>>13,M=0|o[5],x=8191&M,E=M>>>13,I=0|o[6],T=8191&I,P=I>>>13,B=0|o[7],R=8191&B,C=B>>>13,O=0|o[8],N=8191&O,j=O>>>13,z=0|o[9],L=8191&z,F=z>>>13,H=0|s[0],q=8191&H,U=H>>>13,D=0|s[1],Y=8191&D,K=D>>>13,V=0|s[2],W=8191&V,X=V>>>13,Z=0|s[3],Q=8191&Z,G=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ue=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(h,q),i=Math.imul(h,U),i=i+Math.imul(d,q)|0,a=Math.imul(d,U);var ve=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,q),i=Math.imul(p,U),i=i+Math.imul(b,q)|0,a=Math.imul(b,U),n=n+Math.imul(h,Y)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(d,Y)|0,a=a+Math.imul(d,K)|0;var me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=Math.imul(m,U),i=i+Math.imul(g,q)|0,a=Math.imul(g,U),n=n+Math.imul(p,Y)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(b,Y)|0,a=a+Math.imul(b,K)|0,n=n+Math.imul(h,W)|0,i=i+Math.imul(h,X)|0,i=i+Math.imul(d,W)|0,a=a+Math.imul(d,X)|0;var ge=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=Math.imul(w,U),i=i+Math.imul(_,q)|0,a=Math.imul(_,U),n=n+Math.imul(m,Y)|0,i=i+Math.imul(m,K)|0,i=i+Math.imul(g,Y)|0,a=a+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(h,Q)|0,i=i+Math.imul(h,G)|0,i=i+Math.imul(d,Q)|0,a=a+Math.imul(d,G)|0;var ye=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,q),i=Math.imul(k,U),i=i+Math.imul(A,q)|0,a=Math.imul(A,U),n=n+Math.imul(w,Y)|0,i=i+Math.imul(w,K)|0,i=i+Math.imul(_,Y)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(m,W)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,G)|0,i=i+Math.imul(b,Q)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(h,$)|0,i=i+Math.imul(h,ee)|0,i=i+Math.imul(d,$)|0,a=a+Math.imul(d,ee)|0;var we=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=Math.imul(x,U),i=i+Math.imul(E,q)|0,a=Math.imul(E,U),n=n+Math.imul(k,Y)|0,i=i+Math.imul(k,K)|0,i=i+Math.imul(A,Y)|0,a=a+Math.imul(A,K)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,Q)|0,i=i+Math.imul(m,G)|0,i=i+Math.imul(g,Q)|0,a=a+Math.imul(g,G)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0,i=i+Math.imul(d,re)|0,a=a+Math.imul(d,ne)|0;var _e=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,q),i=Math.imul(T,U),i=i+Math.imul(P,q)|0,a=Math.imul(P,U),n=n+Math.imul(x,Y)|0,i=i+Math.imul(x,K)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(E,K)|0,n=n+Math.imul(k,W)|0,i=i+Math.imul(k,X)|0,i=i+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,G)|0,i=i+Math.imul(_,Q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(h,ae)|0,i=i+Math.imul(h,oe)|0,i=i+Math.imul(d,ae)|0,a=a+Math.imul(d,oe)|0;var Se=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(R,q),i=Math.imul(R,U),i=i+Math.imul(C,q)|0,a=Math.imul(C,U),n=n+Math.imul(T,Y)|0,i=i+Math.imul(T,K)|0,i=i+Math.imul(P,Y)|0,a=a+Math.imul(P,K)|0,n=n+Math.imul(x,W)|0,i=i+Math.imul(x,X)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,G)|0,i=i+Math.imul(A,Q)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(h,fe)|0,i=i+Math.imul(h,ue)|0,i=i+Math.imul(d,fe)|0,a=a+Math.imul(d,ue)|0;var ke=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,q),i=Math.imul(N,U),i=i+Math.imul(j,q)|0,a=Math.imul(j,U),n=n+Math.imul(R,Y)|0,i=i+Math.imul(R,K)|0,i=i+Math.imul(C,Y)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,i=i+Math.imul(P,W)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(x,Q)|0,i=i+Math.imul(x,G)|0,i=i+Math.imul(E,Q)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,i=i+Math.imul(A,$)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ue)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ue)|0,n=n+Math.imul(h,he)|0,i=i+Math.imul(h,de)|0,i=i+Math.imul(d,he)|0,a=a+Math.imul(d,de)|0;var Ae=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,q),i=Math.imul(L,U),i=i+Math.imul(F,q)|0,a=Math.imul(F,U),n=n+Math.imul(N,Y)|0,i=i+Math.imul(N,K)|0,i=i+Math.imul(j,Y)|0,a=a+Math.imul(j,K)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(R,X)|0,i=i+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=i+Math.imul(T,G)|0,i=i+Math.imul(P,Q)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,i=i+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,i=i+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ue)|0,i=i+Math.imul(g,fe)|0,a=a+Math.imul(g,ue)|0,n=n+Math.imul(p,he)|0,i=i+Math.imul(p,de)|0,i=i+Math.imul(b,he)|0,a=a+Math.imul(b,de)|0,n=n+Math.imul(h,pe)|0,i=i+Math.imul(h,be)|0,i=i+Math.imul(d,pe)|0,a=a+Math.imul(d,be)|0;var Me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,Y),i=Math.imul(L,K),i=i+Math.imul(F,Y)|0,a=Math.imul(F,K),n=n+Math.imul(N,W)|0,i=i+Math.imul(N,X)|0,i=i+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=i+Math.imul(R,G)|0,i=i+Math.imul(C,Q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,i=i+Math.imul(P,$)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,oe)|0,i=i+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ue)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(m,he)|0,i=i+Math.imul(m,de)|0,i=i+Math.imul(g,he)|0,a=a+Math.imul(g,de)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var xe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,W),i=Math.imul(L,X),i=i+Math.imul(F,W)|0,a=Math.imul(F,X),n=n+Math.imul(N,Q)|0,i=i+Math.imul(N,G)|0,i=i+Math.imul(j,Q)|0,a=a+Math.imul(j,G)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,i=i+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(x,ae)|0,i=i+Math.imul(x,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(k,fe)|0,i=i+Math.imul(k,ue)|0,i=i+Math.imul(A,fe)|0,a=a+Math.imul(A,ue)|0,n=n+Math.imul(w,he)|0,i=i+Math.imul(w,de)|0,i=i+Math.imul(_,he)|0,a=a+Math.imul(_,de)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(g,pe)|0,a=a+Math.imul(g,be)|0;var Ee=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,Q),i=Math.imul(L,G),i=i+Math.imul(F,Q)|0,a=Math.imul(F,G),n=n+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,i=i+Math.imul(j,$)|0,a=a+Math.imul(j,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(T,ae)|0,i=i+Math.imul(T,oe)|0,i=i+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(x,fe)|0,i=i+Math.imul(x,ue)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ue)|0,n=n+Math.imul(k,he)|0,i=i+Math.imul(k,de)|0,i=i+Math.imul(A,he)|0,a=a+Math.imul(A,de)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ie=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,$),i=Math.imul(L,ee),i=i+Math.imul(F,$)|0,a=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,i=i+Math.imul(j,re)|0,a=a+Math.imul(j,ne)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,oe)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(T,fe)|0,i=i+Math.imul(T,ue)|0,i=i+Math.imul(P,fe)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(x,he)|0,i=i+Math.imul(x,de)|0,i=i+Math.imul(E,he)|0,a=a+Math.imul(E,de)|0,n=n+Math.imul(k,pe)|0,i=i+Math.imul(k,be)|0,i=i+Math.imul(A,pe)|0,a=a+Math.imul(A,be)|0;var Te=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,re),i=Math.imul(L,ne),i=i+Math.imul(F,re)|0,a=Math.imul(F,ne),n=n+Math.imul(N,ae)|0,i=i+Math.imul(N,oe)|0,i=i+Math.imul(j,ae)|0,a=a+Math.imul(j,oe)|0,n=n+Math.imul(R,fe)|0,i=i+Math.imul(R,ue)|0,i=i+Math.imul(C,fe)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(T,he)|0,i=i+Math.imul(T,de)|0,i=i+Math.imul(P,he)|0,a=a+Math.imul(P,de)|0,n=n+Math.imul(x,pe)|0,i=i+Math.imul(x,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Pe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,ae),i=Math.imul(L,oe),i=i+Math.imul(F,ae)|0,a=Math.imul(F,oe),n=n+Math.imul(N,fe)|0,i=i+Math.imul(N,ue)|0,i=i+Math.imul(j,fe)|0,a=a+Math.imul(j,ue)|0,n=n+Math.imul(R,he)|0,i=i+Math.imul(R,de)|0,i=i+Math.imul(C,he)|0,a=a+Math.imul(C,de)|0,n=n+Math.imul(T,pe)|0,i=i+Math.imul(T,be)|0,i=i+Math.imul(P,pe)|0,a=a+Math.imul(P,be)|0;var Be=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,fe),i=Math.imul(L,ue),i=i+Math.imul(F,fe)|0,a=Math.imul(F,ue),n=n+Math.imul(N,he)|0,i=i+Math.imul(N,de)|0,i=i+Math.imul(j,he)|0,a=a+Math.imul(j,de)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(C,pe)|0,a=a+Math.imul(C,be)|0;var Re=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,he),i=Math.imul(L,de),i=i+Math.imul(F,he)|0,a=Math.imul(F,de),n=n+Math.imul(N,pe)|0,i=i+Math.imul(N,be)|0,i=i+Math.imul(j,pe)|0,a=a+Math.imul(j,be)|0;var Ce=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,pe),i=Math.imul(L,be),i=i+Math.imul(F,pe)|0,a=Math.imul(F,be);var Oe=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ge,f[3]=ye,f[4]=we,f[5]=_e,f[6]=Se,f[7]=ke,f[8]=Ae,f[9]=Me,f[10]=xe,f[11]=Ee,f[12]=Ie,f[13]=Te,f[14]=Pe,f[15]=Be,f[16]=Re,f[17]=Ce,f[18]=Oe,0!==u&&(f[19]=u,r.length++),r};Math.imul||(A=u),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?A(this,e,t):r<63?u(this,e,t):r<1024?c(this,e,t):h(this,e,t)},d.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},d.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var d;return d=0===t.cmpn(1)?i:o,d.cmpn(0)<0&&d.iadd(e),d},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new g(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};l.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},l.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},l.prototype.split=function(e,t){e.iushrn(this.n,0,t)},l.prototype.imulK=function(e){return e.imul(this.k)},i(p,l),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return M[e]=t,t},g.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},g.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},g.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},g.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},g.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},g.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},g.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},g.prototype.isqr=function(e){return this.imul(e,e.clone())},g.prototype.sqr=function(e){return this.mul(e,e)},g.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=o;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},g.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},g.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new y(e)},i(y,g),y.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},y.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},y.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},y.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},y.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(59)(e))},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);u.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||o(a,this)}function a(e){e.end()}var o=r(26),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=n;var f=r(21);f.inherits=r(1);var u=r(52),c=r(34);f.inherits(n,u);for(var h=s(c.prototype),d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=4294967295&r,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e,t,r){for(var n=[],a=0,o=0;o>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,u=o<<16|s<<8|f,c=0;c<4&&a+.75*c>>6*(3-c)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,u=s.Hasher,c=o.algo,h=[];!function(){for(var e=0;e<64;e++)h[e]=4294967296*t.abs(t.sin(e+1))|0}();var d=c.MD5=u.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var u=this._hash.words,c=e[t+0],d=e[t+1],l=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],g=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],S=e[t+11],k=e[t+12],A=e[t+13],M=e[t+14],x=e[t+15],E=u[0],I=u[1],T=u[2],P=u[3];E=r(E,I,T,P,c,7,h[0]),P=r(P,E,I,T,d,12,h[1]),T=r(T,P,E,I,l,17,h[2]),I=r(I,T,P,E,p,22,h[3]),E=r(E,I,T,P,b,7,h[4]),P=r(P,E,I,T,v,12,h[5]),T=r(T,P,E,I,m,17,h[6]),I=r(I,T,P,E,g,22,h[7]),E=r(E,I,T,P,y,7,h[8]),P=r(P,E,I,T,w,12,h[9]),T=r(T,P,E,I,_,17,h[10]),I=r(I,T,P,E,S,22,h[11]),E=r(E,I,T,P,k,7,h[12]),P=r(P,E,I,T,A,12,h[13]),T=r(T,P,E,I,M,17,h[14]),I=r(I,T,P,E,x,22,h[15]),E=n(E,I,T,P,d,5,h[16]),P=n(P,E,I,T,m,9,h[17]),T=n(T,P,E,I,S,14,h[18]),I=n(I,T,P,E,c,20,h[19]),E=n(E,I,T,P,v,5,h[20]),P=n(P,E,I,T,_,9,h[21]),T=n(T,P,E,I,x,14,h[22]),I=n(I,T,P,E,b,20,h[23]),E=n(E,I,T,P,w,5,h[24]),P=n(P,E,I,T,M,9,h[25]),T=n(T,P,E,I,p,14,h[26]),I=n(I,T,P,E,y,20,h[27]),E=n(E,I,T,P,A,5,h[28]),P=n(P,E,I,T,l,9,h[29]),T=n(T,P,E,I,g,14,h[30]),I=n(I,T,P,E,k,20,h[31]),E=i(E,I,T,P,v,4,h[32]),P=i(P,E,I,T,y,11,h[33]),T=i(T,P,E,I,S,16,h[34]),I=i(I,T,P,E,M,23,h[35]),E=i(E,I,T,P,d,4,h[36]),P=i(P,E,I,T,b,11,h[37]),T=i(T,P,E,I,g,16,h[38]),I=i(I,T,P,E,_,23,h[39]),E=i(E,I,T,P,A,4,h[40]),P=i(P,E,I,T,c,11,h[41]),T=i(T,P,E,I,p,16,h[42]),I=i(I,T,P,E,m,23,h[43]),E=i(E,I,T,P,w,4,h[44]),P=i(P,E,I,T,k,11,h[45]),T=i(T,P,E,I,x,16,h[46]),I=i(I,T,P,E,l,23,h[47]),E=a(E,I,T,P,c,6,h[48]),P=a(P,E,I,T,g,10,h[49]),T=a(T,P,E,I,M,15,h[50]),I=a(I,T,P,E,v,21,h[51]),E=a(E,I,T,P,k,6,h[52]),P=a(P,E,I,T,p,10,h[53]),T=a(T,P,E,I,_,15,h[54]),I=a(I,T,P,E,d,21,h[55]),E=a(E,I,T,P,y,6,h[56]),P=a(P,E,I,T,x,10,h[57]),T=a(T,P,E,I,m,15,h[58]),I=a(I,T,P,E,A,21,h[59]),E=a(E,I,T,P,b,6,h[60]),P=a(P,E,I,T,S,10,h[61]),T=a(T,P,E,I,l,15,h[62]),I=a(I,T,P,E,w,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+I|0,u[2]=u[2]+T|0,u[3]=u[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,u=0;u<4;u++){var c=f[u];f[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=u._createHelper(d),o.HmacMD5=u._createHmacHelper(d)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i=r(70);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(29);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(42);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(177),f=function(e){return e&&e.__esModule?e:{default:e}}(s),u=n(i),c=n(a),h=n(o),d={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,u.reverseHex)((0,u.hash160)(t))},t.getAddressFromScriptHash=function(t){t=(0,u.reverseHex)(t);var r=(0,u.hash256)(c.ADDR_VERSION+t).substr(0,8);return f.default.encode(e.from(c.ADDR_VERSION+t+r,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,u.ab2hexstring)(f.default.decode(e));return(0,u.reverseHex)(t.substr(2,40))},t.generateSignature=function(t,r){var n=(0,u.sha256)(t),i=e.from(n,"hex"),a=new o.ec("p256"),s=a.sign(i,r,null);return e.concat([s.r.toArrayLike(e,"be",32),s.s.toArrayLike(e,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,u.ab2hexstring)((0,d.default)(32))},t.generateRandomArray=function(e){return(0,d.default)(e)}}).call(t,r(3).Buffer)},function(e,t,r){"use strict";(function(t){function r(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(a=new Array(s-1),o=0;o65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getClaims=t.getBalance=t.getAPIEndpoint=void 0;var n=r(24),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(10),o=r(19),s=r(23),f=r(6),u=t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}},c=t.getBalance=function(e,t){var r=u(e);return i.default.get(r+"/v2/address/balance/"+t).then(function(t){var r=new a.Balance({net:e,address:t.data.address});return Object.keys(t.data).map(function(e){"net"!==e&&"address"!==e&&r.addAsset(e,t.data[e])}),Object.assign(r,t.data),r})},h=t.getClaims=function(e,t){var r=u(e);return i.default.get(r+"/v2/address/claims/"+t).then(function(e){return e.data})},d=t.getRPCEndpoint=function(e){var t=u(e);return i.default.get(t+"/v2/network/best_node").then(function(e){return e.data.node})};t.getTransactionHistory=function(e,t){var r=u(e);return i.default.get(r+"/v2/address/history/"+t).then(function(e){return e.data.history})},t.getWalletDBHeight=function(e){var t=u(e);return i.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){var n=new a.Account(t),i=d(e),f=h(e,n.address),u=void 0,c=void 0;return Promise.all([i,f]).then(function(e){c=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=o.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return u=e,s.Query.sendRawTransaction(u).execute(c)}).then(function(e){return!0===e.result&&(e.txid=u),e})},t.doMintTokens=function(e,t,r,n,i,u){var h=new a.Account(r),l=[{assetId:f.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t},b=d(e),v=c(e,h.address),m=void 0,g=void 0;return Promise.all([b,v]).then(function(e){g=e[0];var t=e[1],r=o.Transaction.createInvocationTx(t,l,p,i,{version:1});if(u)return u(r,h.publicKey);r.sign(h.privateKey)}).then(function(e){return m=e,s.Query.sendRawTransaction(m).execute(g)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})},t.doSendAsset=function(e,t,r,n,i){var u=new a.Account(r),h=new a.Account(t),l=d(e),p=c(e,u.address),b=Object.keys(n).map(function(e){return{assetId:f.ASSET_ID[e],value:n[e],scriptHash:h.scriptHash}}),v=void 0,m=void 0;return Promise.all([l,p]).then(function(e){m=e[0];var t=e[1],r=o.Transaction.createContractTx(t,b);return i?i(r,u.publicKey):r.sign(u.privateKey)}).then(function(e){return v=e,s.Query.sendRawTransaction(v).execute(m)}).then(function(e){return!0===e.result&&(e.txid=v.hash),e})}},function(e,t,r){"use strict";(function(t){function n(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i=r(7),a=r(80),o={"Content-Type":"application/x-www-form-urlencoded"},s={adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=r(45):void 0!==t&&(e=r(45)),e}(),transformRequest:[function(e,t){return a(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(n(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s}).call(t,r(9))},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,f,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(r=this._events[e],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),i=u.length,f=0;f0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){t=e.exports=r(52),t.Stream=t,t.Readable=t,t.Writable=r(34),t.Duplex=r(13),t.Transform=r(56),t.PassThrough=r(107)},function(e,t,r){"use strict";(function(t,n,i){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){E(t,e)}}function o(e){return O.from(e)}function s(e){return O.isBuffer(e)||e instanceof N}function f(){}function u(e,t){T=T||r(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof T&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){g(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function c(e){if(T=T||r(13),!(z.call(c,this)||this instanceof T))return new c(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),C.call(this)}function h(e,t){var r=new Error("write after end");e.emit("error",r),I(t,r)}function d(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),I(n,a),i=!1),i}function l(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=O.from(t,r)),t}function p(e,t,r,n,i,a){if(!r){var o=l(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1?n:I;c.WritableState=u;var B=r(21);B.inherits=r(1);var R={deprecate:r(106)},C=r(53),O=r(4).Buffer,N=i.Uint8Array||function(){},j=r(54);B.inherits(c,C),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:R.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var z;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!z.call(this,e)||e&&e._writableState instanceof u}})):z=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=s(e)&&!n.objectMode;return a&&!O.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=f),n.ended?h(this,r):(a||d(this,n,e,r))&&(n.pendingcb++,i=p(this,n,a,e,t,r)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||x(this,n,r)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=j.destroy,c.prototype._undestroy=j.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(9),r(55).setImmediate,r(20))},function(e,t,r){"use strict";function n(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=n(e);if("string"!=typeof t&&(g.isEncoding===y||!y(e)))throw new Error("Unknown encoding: "+e);return t||e}function a(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=d,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=p,this.end=b,t=3;break;default:return this.write=v,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function f(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(r+2)}}function u(e){var t=this.lastTotal-this.lastNeed,r=f(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var r=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function d(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function p(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function b(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}var g=r(4).Buffer,y=g.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>>31}var h=(n<<5|n>>>27)+f+o[u];h+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,u=0;u0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return s.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,u.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,u.decrypt)(this.encrypted,e,t),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=s.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=s.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=s.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=s.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=s.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=s.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(5),i=r(29),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},d=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},l=function(e){return Object.assign({script:"",gas:0},{script:e.script,gas:e.gas})};t.serializeExclusive={2:o,128:u,209:d},t.deserializeExclusive={2:a,128:f,209:h},t.getExclusive={2:s,128:c,209:l}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateDeployScript=t.createScript=t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(71),a=n(i),o=r(178),s=n(o),f=r(179),u=n(f),c=r(5),h=function(e){var t=e.script,r=e.name,n=e.version,i=e.author,a=e.email,o=e.description,f=e.needsStorage,u=void 0!==f&&f,h=e.returnType,d=void 0===h?"ff":h,l=e.paramaterList,p=void 0===l?void 0:l,b=new s.default;return b.emitPush((0,c.str2hexstring)(o)).emitPush((0,c.str2hexstring)(a)).emitPush((0,c.str2hexstring)(i)).emitPush((0,c.str2hexstring)(n)).emitPush((0,c.str2hexstring)(r)).emitPush(u).emitPush(d).emitPush(p).emitPush(t).emitSysCall("Neo.Contract.Create"),b};t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===z.prototype||(t=i(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?c(e,o,t,!1):g(e,o)):c(e,o,t,!1))):n||(o.reading=!1)}return d(o)}function c(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&v(e)),g(e,t)}function h(e,t){var r;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function d(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=l(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function b(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(q("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R(m,e):m(e))}function m(e){q("emit readable"),e.emit("readable"),A(e)}function g(e,t){t.readingMore||(t.readingMore=!0,R(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=x(e,t.buffer,t.decoder),r}function x(e,t,r){var n;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}function I(e,t){var r=z.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,R(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return q("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):v(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&T(this),null;var n=t.needReadable;q("need readable",n),(0===t.length||t.length-e0?M(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},f.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},f.prototype.pipe=function(e,t){function r(e,t){q("onunpipe"),e===d&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){q("onend"),e.end()}function a(){q("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",f),e.removeListener("unpipe",r),d.removeListener("end",i),d.removeListener("end",h),d.removeListener("data",s),m=!0,!l.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){q("ondata"),g=!1,!1!==e.write(t)||g||((1===l.pipesCount&&l.pipes===e||l.pipesCount>1&&-1!==B(l.pipes,e))&&!m&&(q("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,g=!0),d.pause())}function f(t){q("onerror",t),h(),e.removeListener("error",f),0===N(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),h()}function c(){q("onfinish"),e.removeListener("close",u),h()}function h(){q("unpipe"),d.unpipe(e)}var d=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1,q("pipe count=%d opts=%j",l.pipesCount,t);var p=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,b=p?i:h;l.endEmitted?R(b):d.once("end",b),e.on("unpipe",r);var v=w(d);e.on("drain",v);var m=!1,g=!1;return d.on("data",s),o(e,"error",f),e.once("close",u),e.once("finish",c),e.emit("pipe",d),l.flowing||(q("pipe resume"),d.resume()),e},f.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(105),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,r){"use strict";function n(e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r),i(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function u(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var c=r(1),h=r(16),d=r(4).Buffer,l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);c(n,h),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,c=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=u(t[m-2])+t[m-7]+f(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var y=v+s(d)+i(d,p,b)+l[g]+t[g]|0,w=o(r)+a(r,n,c)|0;v=b,b=p,p=d,d=h+y|0,h=c,c=n,n=r,r=y+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=c+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var e=d.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=m,p.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function d(e,t){return e>>>0>>0?1:0}var l=r(1),p=r(16),b=r(4).Buffer,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=new Array(160);l(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,l=0|this._ch,p=0|this._dh,b=0|this._eh,m=0|this._fh,g=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,k=0|this._dl,A=0|this._el,M=0|this._fl,x=0|this._gl,E=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var T=t[I-30],P=t[I-30+1],B=f(T,P),R=u(P,T);T=t[I-4],P=t[I-4+1];var C=c(T,P),O=h(P,T),N=t[I-14],j=t[I-14+1],z=t[I-32],L=t[I-32+1],F=R+j|0,H=B+N+d(F,R)|0;F=F+O|0,H=H+C+d(F,O)|0,F=F+L|0,H=H+z+d(F,L)|0,t[I]=H,t[I+1]=F}for(var q=0;q<160;q+=2){H=t[q],F=t[q+1];var U=a(r,n,l),D=a(w,_,S),Y=o(r,w),K=o(w,r),V=s(b,A),W=s(A,b),X=v[q],Z=v[q+1],Q=i(b,m,g),G=i(A,M,x),J=E+W|0,$=y+V+d(J,E)|0;J=J+G|0,$=$+Q+d(J,G)|0,J=J+Z|0,$=$+X+d(J,Z)|0,J=J+F|0,$=$+H+d(J,F)|0;var ee=K+D|0,te=Y+U+d(ee,K)|0;y=g,E=x,g=m,x=M,m=b,M=A,A=k+J|0,b=p+$+d(A,k)|0,p=l,k=S,l=n,S=_,n=r,_=w,w=J+ee|0,r=$+te+d(w,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+A|0,this._fl=this._fl+M|0,this._gl=this._gl+x|0,this._hl=this._hl+E|0,this._ah=this._ah+r+d(this._al,w)|0,this._bh=this._bh+n+d(this._bl,_)|0,this._ch=this._ch+l+d(this._cl,S)|0,this._dh=this._dh+p+d(this._dl,k)|0,this._eh=this._eh+b+d(this._el,A)|0,this._fh=this._fh+m+d(this._fl,M)|0,this._gh=this._gh+g+d(this._gl,x)|0,this._hh=this._hh+y+d(this._hl,E)|0},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=b.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function c(e){return d(e,17)^d(e,19)^e>>>10}var h=r(11),d=h.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=u,t.g1_256=c},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}var i=r(11),a=r(22),o=r(61),s=r(14),f=i.sum32,u=i.sum32_4,c=i.sum32_5,h=o.ch32,d=o.maj32,l=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=u[l-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[l]=b+u[l-7]+m+u[l-16]}var g=s&c^~s&h,y=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=d+_+g+f[l]+u[l],k=w+y;d=h,h=c,c=s,s=o+S|0,o=a,a=i,i=n,n=S+k|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(28))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,u=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=t()}();var h=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],h=r[6],d=r[7],l=n.high,p=n.low,b=i.high,v=i.low,m=a.high,g=a.low,y=o.high,w=o.low,_=s.high,S=s.low,k=f.high,A=f.low,M=h.high,x=h.low,E=d.high,I=d.low,T=l,P=p,B=b,R=v,C=m,O=g,N=y,j=w,z=_,L=S,F=k,H=A,q=M,U=x,D=E,Y=I,K=0;K<80;K++){var V=c[K];if(K<16)var W=V.high=0|e[t+2*K],X=V.low=0|e[t+2*K+1];else{var Z=c[K-15],Q=Z.high,G=Z.low,J=(Q>>>1|G<<31)^(Q>>>8|G<<24)^Q>>>7,$=(G>>>1|Q<<31)^(G>>>8|Q<<24)^(G>>>7|Q<<25),ee=c[K-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=c[K-7],oe=ae.high,se=ae.low,fe=c[K-16],ue=fe.high,ce=fe.low,X=$+se,W=J+oe+(X>>>0<$>>>0?1:0),X=X+ie,W=W+ne+(X>>>0>>0?1:0),X=X+ce,W=W+ue+(X>>>0>>0?1:0);V.high=W,V.low=X}var he=z&F^~z&q,de=L&H^~L&U,le=T&B^T&C^B&C,pe=P&R^P&O^R&O,be=(T>>>28|P<<4)^(T<<30|P>>>2)^(T<<25|P>>>7),ve=(P>>>28|T<<4)^(P<<30|T>>>2)^(P<<25|T>>>7),me=(z>>>14|L<<18)^(z>>>18|L<<14)^(z<<23|L>>>9),ge=(L>>>14|z<<18)^(L>>>18|z<<14)^(L<<23|z>>>9),ye=u[K],we=ye.high,_e=ye.low,Se=Y+ge,ke=D+me+(Se>>>0>>0?1:0),Se=Se+de,ke=ke+he+(Se>>>0>>0?1:0),Se=Se+_e,ke=ke+we+(Se>>>0<_e>>>0?1:0),Se=Se+X,ke=ke+W+(Se>>>0>>0?1:0),Ae=ve+pe,Me=be+le+(Ae>>>0>>0?1:0);D=q,Y=U,q=F,U=H,F=z,H=L,L=j+Se|0,z=N+ke+(L>>>0>>0?1:0)|0,N=C,j=O,C=B,O=R,B=T,R=P,P=Se+Ae|0,T=ke+Me+(P>>>0>>0?1:0)|0}p=n.low=p+P,n.high=l+T+(p>>>0

>>0?1:0),v=i.low=v+R,i.high=b+B+(v>>>0>>0?1:0),g=a.low=g+O,a.high=m+C+(g>>>0>>0?1:0),w=o.low=w+j,o.high=y+N+(w>>>0>>0?1:0),S=s.low=S+L,s.high=_+z+(S>>>0>>0?1:0),A=f.low=A+H,f.high=k+F+(A>>>0>>0?1:0),x=h.low=x+U,h.high=M+q+(x>>>0>>0?1:0),I=d.low=I+Y,d.high=E+D+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(h),r.HmacSHA512=i._createHmacHelper(h)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(36),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(5),o=r(25);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptWIF=t.encryptWIF=t.decrypt=t.encrypt=t.generateEncryptedWif=t.encryptWifAccount=void 0;var i=r(50),a=n(i),o=r(64),s=r(169),f=n(s),u=r(25),c=r(41),h=n(c),d=r(5),l=r(6),p=t.encryptWifAccount=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),m(e,t).then(function(r){var n=new h.default(e);return n.encryptedWif=r,n.passphrase=t,n})},b=(t.generateEncryptedWif=function(e){console.log("To be deprecated in v3. Please use new Account() and encrypt with Account.encrypt");var t=(0,u.generatePrivateKey)();return p(t,e)},t.encrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;n=g(n);var i=new h.default(t),s=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(i.address))).toString().slice(0,8),u=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(s,"hex"),n).toString("hex"),c=u.slice(0,64),p=u.slice(64),b=(0,d.hexXor)(i.privateKey,c),v=o.AES.encrypt(o.enc.Hex.parse(b),o.enc.Hex.parse(p),{mode:o.mode.ECB,padding:o.pad.NoPadding}),m=l.NEP_HEADER+l.NEP_FLAG+s+v.ciphertext.toString();return a.default.encode(e.from(m,"hex"))}),v=t.decrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;n=g(n);var i=(0,d.ab2hexstring)(a.default.decode(t)),s=i.substr(6,8),u=i.substr(-64),c=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(s,"hex"),n).toString("hex"),p=c.slice(0,64),b=c.slice(64),v={ciphertext:o.enc.Hex.parse(u),salt:""},m=o.AES.decrypt(v,o.enc.Hex.parse(b),{mode:o.mode.ECB,padding:o.pad.NoPadding}),y=(0,d.hexXor)(m.toString(),p),w=new h.default(y);if(s!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(w.address))).toString().slice(0,8))throw new Error("Wrong Password!");return w.WIF},m=t.encryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),Promise.resolve(b(e,t))},g=(t.decryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.decrypt"),Promise.resolve(v(e,t))},function(e){return Object.assign({},l.DEFAULT_SCRYPT,e)})}).call(t,r(3).Buffer)},function(e,t,r){(function(t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?t("","utf8"):e instanceof t?e:"string"==typeof e?new t(e,"utf8"):new t(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:u(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function u(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r}).call(t,r(3).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(5),i=r(10),a=r(42),o=r(6),s=r(29),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),u=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var n=t.reduce(function(e,t){var r=Math.round(1e8*t.value);return e[t.assetId]?e[t.assetId]+=r:e[t.assetId]=r,e},{});if(r>0){var a=1e8*r;n[o.ASSET_ID.GAS]?n[o.ASSET_ID.GAS]+=a:n[o.ASSET_ID.GAS]=a}var s=[];return{inputs:Object.keys(n).map(function(t){var r=n[t],a=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(a))throw new Error("This balance does not contain any "+a+"!");var f=e.assets[a];if(1e8*f.balancef.unspent.length)throw new Error("Insufficient "+o.ASSETS[t]+"! Reached end of unspent coins!");c+=Math.round(1e8*f.unspent[u-1].value)}return c>r&&s.push({assetId:t,value:(c-r)/1e8,scriptHash:(0,i.getScriptHashFromAddress)(e.address)}),f.unspent.slice(0,u).map(function(e){return{prevHash:e.txid,prevIndex:e.index}})}).reduce(function(e,t){return e.concat(t)},[]),change:s}},t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var u,c=e.attributes[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;r+=f.serializeTransactionAttribute(h)}}catch(e){o=!0,s=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var d=!0,l=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(d=(b=v.next()).done);d=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){l=!0,p=e}finally{try{!d&&v.return&&v.return()}finally{if(l)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var g=!0,y=!1,w=void 0;try{for(var _,S=e.outputs[Symbol.iterator]();!(g=(_=S.next()).done);g=!0){var k=_.value;r+=f.serializeTransactionOutput(k)}}catch(e){y=!0,w=e}finally{try{!g&&S.return&&S.return()}finally{if(y)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var A=!0,M=!1,x=void 0;try{for(var E,I=e.scripts[Symbol.iterator]();!(A=(E=I.next()).done);A=!0){var T=E.value;r+=f.serializeWitness(T)}}catch(e){M=!0,x=e}finally{try{!A&&I.return&&I.return()}finally{if(M)throw x}}}return r});t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;ar?(r=u.height,n=[u]):u.height===r&&n.push(u)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})},t.getBalance=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_balance/"+t).then(function(t){var r=new a.Balance({address:t.data.address,net:e});return t.data.balance.map(function(e){r.addAsset(e.asset,{balance:e.amount,unspent:s(e.unspent)}),r[e.asset]={balance:e.amount,unspent:s(e.unspent)}}),r})},t.getClaims=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_claimable/"+t).then(function(t){var r=f(t.data.claimable);return{net:e,address:t.data.address,claims:r}})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),f=function(e){return e.map(function(e){return{start:e.start_height,end:e.ed_height,index:e.n,claim:Math.round(1e8*e.unclaimed),txid:e.txid,value:e.value}})}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(75),a=n(i),o=r(23),s=n(o),f=r(6),u=n(f),c=r(43),h=n(c),d=r(19),l=n(d),p=r(10),b=n(p),v=r(5),m=n(v),g=[h.default,l.default,b.default,a.default,s.default],y=g.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:u,u:m});t.default=y,t.api=a,t.rpc=s,t.sc=h,t.tx=l,t.wallet=b,t.u=m,t.CONST=u},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(76);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(30),o=n(a),s=r(184),f=n(s),u=r(185),c=n(u),h=r(73),d=n(h);t.default={get:{price:f.getPrice,balance:o.getBalance,claims:o.getClaims,transactionHistory:o.getTransactionHistory,tokenBalance:c.getTokenBalance,tokenInfo:c.getTokenInfo,token:c.getToken},do:{sendAsset:o.doSendAsset,claimAllGas:o.doClaimAllGas,mintTokens:o.doMintTokens}},t.neonDB=o,t.cmc=f,t.nep5=c,t.neoscan=d},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.doInvoke=t.claimGas=t.sendAsset=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.getClaimsFrom=t.getBalanceFrom=void 0;var i=r(30),a=n(i),o=r(73),s=n(o),f=r(10),u=r(6),c=r(23),h=r(19),d=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,f=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return A(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,a=0;++a=i&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),G.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),G.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),G.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),G.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t|=0,r|=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):z(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):z(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):z(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=d(n)),n}),d=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;if("number"!=typeof e)throw new Error("num must be numeric");return h(Math.round(e*Math.pow(10,8)),t,!0)},t.fixed82num=function(e){if("string"!=typeof e)throw new Error("fixed8hex must be a string");if(e.length%2!=0)throw new Error("fixed8hex must be hex");return""===e?0:parseInt(d(e),16)/Math.pow(10,8)},t.num2VarInt=function(e){return e<253?h(e):e<=65535?"fd"+h(e,4,!0):e<=4294967295?"fe"+h(e,8,!0):"ff"+h(e,16,!0)},t.hexXor=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new Error("hexXor expects hex strings");if(e.length!==t.length)throw new Error("strings are disparate lengths");if(e.length%2!=0)throw new Error("strings must be hex");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t});t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";n(this,e),this.str=t,this.pter=0}return i(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(d(this.read(2)),16):254===e?e=parseInt(d(this.read(4)),16):255===e&&(e=parseInt(d(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e);return(0,o.SHA256)(t).toString()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654"},t.DEFAULT_RPC={MAIN:"http://seed1.neo.org:10332",TEST:"http://seed1.neo.org:20332"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){"use strict";function n(e){return"[object Array]"===A.call(e)}function i(e){return"[object ArrayBuffer]"===A.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function o(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function f(e){return"number"==typeof e}function u(e){return void 0===e}function c(e){return null!==e&&"object"==typeof e}function h(e){return"[object Date]"===A.call(e)}function d(e){return"[object File]"===A.call(e)}function l(e){return"[object Blob]"===A.call(e)}function p(e){return"[object Function]"===A.call(e)}function b(e){return c(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function m(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function g(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function y(e,t){if(null!==e&&void 0!==e)if("object"==typeof e||n(e)||(e=[e]),n(e))for(var r=0,i=e.length;r1)for(var r=1;r>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function c(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function h(e,t){return e>>>t|e<<32-t}function d(e,t){return e<>>32-t}function l(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function g(e,t,r,n){return(t+n>>>0>>0}function y(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,u=t;return u=u+n>>>0,f+=u>>0,f+=u>>0,f+=u>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function S(e,t,r,n,i,a,o,s,f,u){var c=0,h=t;return h=h+n>>>0,c+=h>>0,c+=h>>0,c+=h>>0,c+=h>>0}function k(e,t,r,n,i,a,o,s,f,u){return t+n+a+s+u>>>0}function A(e,t,r){return(t<<32-r|e>>>r)>>>0}function M(e,t,r){return(e<<32-r|t>>>r)>>>0}function x(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var I=r(14),T=r(1);t.inherits=T,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=u,t.split32=c,t.rotr32=h,t.rotl32=d,t.sum32=l,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=g,t.sum64_lo=y,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=S,t.sum64_5_lo=k,t.rotr64_hi=A,t.rotr64_lo=M,t.shr64_hi=x,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function u(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,d=Math.min(u,t.length-1),l=Math.max(0,u-e.length+1);l<=d;l++){var p=u-l|0;i=0|e.words[p],a=0|t.words[l],o=i*a+h,c+=o/67108864|0,h=67108863&o}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}function c(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function h(e,t,r){return(new d).mulp(e,t,r)}function d(e,t){this.x=e,this.y=t}function l(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function y(e){g.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(122).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],k=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=S[e],c=k[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var d=h.modn(c).toString(e);h=h.idivn(c),r=h.isZero()?d+r:_[u-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,u=new e(a),c=this.clone();if(f){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),u[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],p=8191&l,b=l>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,_=y>>>13,S=0|o[4],k=8191&S,A=S>>>13,M=0|o[5],x=8191&M,E=M>>>13,I=0|o[6],T=8191&I,P=I>>>13,B=0|o[7],R=8191&B,C=B>>>13,O=0|o[8],N=8191&O,j=O>>>13,z=0|o[9],L=8191&z,F=z>>>13,H=0|s[0],q=8191&H,U=H>>>13,D=0|s[1],Y=8191&D,K=D>>>13,V=0|s[2],W=8191&V,X=V>>>13,Z=0|s[3],Q=8191&Z,G=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ue=se>>>13,ce=0|s[8],he=8191&ce,de=ce>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(h,q),i=Math.imul(h,U),i=i+Math.imul(d,q)|0,a=Math.imul(d,U);var ve=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,q),i=Math.imul(p,U),i=i+Math.imul(b,q)|0,a=Math.imul(b,U),n=n+Math.imul(h,Y)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(d,Y)|0,a=a+Math.imul(d,K)|0;var me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=Math.imul(m,U),i=i+Math.imul(g,q)|0,a=Math.imul(g,U),n=n+Math.imul(p,Y)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(b,Y)|0,a=a+Math.imul(b,K)|0,n=n+Math.imul(h,W)|0,i=i+Math.imul(h,X)|0,i=i+Math.imul(d,W)|0,a=a+Math.imul(d,X)|0;var ge=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=Math.imul(w,U),i=i+Math.imul(_,q)|0,a=Math.imul(_,U),n=n+Math.imul(m,Y)|0,i=i+Math.imul(m,K)|0,i=i+Math.imul(g,Y)|0,a=a+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(h,Q)|0,i=i+Math.imul(h,G)|0,i=i+Math.imul(d,Q)|0,a=a+Math.imul(d,G)|0;var ye=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,q),i=Math.imul(k,U),i=i+Math.imul(A,q)|0,a=Math.imul(A,U),n=n+Math.imul(w,Y)|0,i=i+Math.imul(w,K)|0,i=i+Math.imul(_,Y)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(m,W)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,G)|0,i=i+Math.imul(b,Q)|0,a=a+Math.imul(b,G)|0,n=n+Math.imul(h,$)|0,i=i+Math.imul(h,ee)|0,i=i+Math.imul(d,$)|0,a=a+Math.imul(d,ee)|0;var we=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,q),i=Math.imul(x,U),i=i+Math.imul(E,q)|0,a=Math.imul(E,U),n=n+Math.imul(k,Y)|0,i=i+Math.imul(k,K)|0,i=i+Math.imul(A,Y)|0,a=a+Math.imul(A,K)|0,n=n+Math.imul(w,W)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,Q)|0,i=i+Math.imul(m,G)|0,i=i+Math.imul(g,Q)|0,a=a+Math.imul(g,G)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(h,re)|0,i=i+Math.imul(h,ne)|0,i=i+Math.imul(d,re)|0,a=a+Math.imul(d,ne)|0;var _e=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,q),i=Math.imul(T,U),i=i+Math.imul(P,q)|0,a=Math.imul(P,U),n=n+Math.imul(x,Y)|0,i=i+Math.imul(x,K)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(E,K)|0,n=n+Math.imul(k,W)|0,i=i+Math.imul(k,X)|0,i=i+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,G)|0,i=i+Math.imul(_,Q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(h,ae)|0,i=i+Math.imul(h,oe)|0,i=i+Math.imul(d,ae)|0,a=a+Math.imul(d,oe)|0;var Se=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(R,q),i=Math.imul(R,U),i=i+Math.imul(C,q)|0,a=Math.imul(C,U),n=n+Math.imul(T,Y)|0,i=i+Math.imul(T,K)|0,i=i+Math.imul(P,Y)|0,a=a+Math.imul(P,K)|0,n=n+Math.imul(x,W)|0,i=i+Math.imul(x,X)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,G)|0,i=i+Math.imul(A,Q)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(h,fe)|0,i=i+Math.imul(h,ue)|0,i=i+Math.imul(d,fe)|0,a=a+Math.imul(d,ue)|0;var ke=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,q),i=Math.imul(N,U),i=i+Math.imul(j,q)|0,a=Math.imul(j,U),n=n+Math.imul(R,Y)|0,i=i+Math.imul(R,K)|0,i=i+Math.imul(C,Y)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,W)|0,i=i+Math.imul(T,X)|0,i=i+Math.imul(P,W)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(x,Q)|0,i=i+Math.imul(x,G)|0,i=i+Math.imul(E,Q)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,i=i+Math.imul(A,$)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ue)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ue)|0,n=n+Math.imul(h,he)|0,i=i+Math.imul(h,de)|0,i=i+Math.imul(d,he)|0,a=a+Math.imul(d,de)|0;var Ae=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,q),i=Math.imul(L,U),i=i+Math.imul(F,q)|0,a=Math.imul(F,U),n=n+Math.imul(N,Y)|0,i=i+Math.imul(N,K)|0,i=i+Math.imul(j,Y)|0,a=a+Math.imul(j,K)|0,n=n+Math.imul(R,W)|0,i=i+Math.imul(R,X)|0,i=i+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=i+Math.imul(T,G)|0,i=i+Math.imul(P,Q)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,i=i+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,i=i+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ue)|0,i=i+Math.imul(g,fe)|0,a=a+Math.imul(g,ue)|0,n=n+Math.imul(p,he)|0,i=i+Math.imul(p,de)|0,i=i+Math.imul(b,he)|0,a=a+Math.imul(b,de)|0,n=n+Math.imul(h,pe)|0,i=i+Math.imul(h,be)|0,i=i+Math.imul(d,pe)|0,a=a+Math.imul(d,be)|0;var Me=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(L,Y),i=Math.imul(L,K),i=i+Math.imul(F,Y)|0,a=Math.imul(F,K),n=n+Math.imul(N,W)|0,i=i+Math.imul(N,X)|0,i=i+Math.imul(j,W)|0,a=a+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=i+Math.imul(R,G)|0,i=i+Math.imul(C,Q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,i=i+Math.imul(P,$)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,oe)|0,i=i+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ue)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(m,he)|0,i=i+Math.imul(m,de)|0,i=i+Math.imul(g,he)|0,a=a+Math.imul(g,de)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var xe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,W),i=Math.imul(L,X),i=i+Math.imul(F,W)|0,a=Math.imul(F,X),n=n+Math.imul(N,Q)|0,i=i+Math.imul(N,G)|0,i=i+Math.imul(j,Q)|0,a=a+Math.imul(j,G)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,i=i+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(x,ae)|0,i=i+Math.imul(x,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(k,fe)|0,i=i+Math.imul(k,ue)|0,i=i+Math.imul(A,fe)|0,a=a+Math.imul(A,ue)|0,n=n+Math.imul(w,he)|0,i=i+Math.imul(w,de)|0,i=i+Math.imul(_,he)|0,a=a+Math.imul(_,de)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(g,pe)|0,a=a+Math.imul(g,be)|0;var Ee=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(L,Q),i=Math.imul(L,G),i=i+Math.imul(F,Q)|0,a=Math.imul(F,G),n=n+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,i=i+Math.imul(j,$)|0,a=a+Math.imul(j,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(T,ae)|0,i=i+Math.imul(T,oe)|0,i=i+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(x,fe)|0,i=i+Math.imul(x,ue)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ue)|0,n=n+Math.imul(k,he)|0,i=i+Math.imul(k,de)|0,i=i+Math.imul(A,he)|0,a=a+Math.imul(A,de)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ie=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,$),i=Math.imul(L,ee),i=i+Math.imul(F,$)|0,a=Math.imul(F,ee),n=n+Math.imul(N,re)|0,i=i+Math.imul(N,ne)|0,i=i+Math.imul(j,re)|0,a=a+Math.imul(j,ne)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,oe)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(T,fe)|0,i=i+Math.imul(T,ue)|0,i=i+Math.imul(P,fe)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(x,he)|0,i=i+Math.imul(x,de)|0,i=i+Math.imul(E,he)|0,a=a+Math.imul(E,de)|0,n=n+Math.imul(k,pe)|0,i=i+Math.imul(k,be)|0,i=i+Math.imul(A,pe)|0,a=a+Math.imul(A,be)|0;var Te=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(L,re),i=Math.imul(L,ne),i=i+Math.imul(F,re)|0,a=Math.imul(F,ne),n=n+Math.imul(N,ae)|0,i=i+Math.imul(N,oe)|0,i=i+Math.imul(j,ae)|0,a=a+Math.imul(j,oe)|0,n=n+Math.imul(R,fe)|0,i=i+Math.imul(R,ue)|0,i=i+Math.imul(C,fe)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(T,he)|0,i=i+Math.imul(T,de)|0,i=i+Math.imul(P,he)|0,a=a+Math.imul(P,de)|0,n=n+Math.imul(x,pe)|0,i=i+Math.imul(x,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Pe=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(L,ae),i=Math.imul(L,oe),i=i+Math.imul(F,ae)|0,a=Math.imul(F,oe),n=n+Math.imul(N,fe)|0,i=i+Math.imul(N,ue)|0,i=i+Math.imul(j,fe)|0,a=a+Math.imul(j,ue)|0,n=n+Math.imul(R,he)|0,i=i+Math.imul(R,de)|0,i=i+Math.imul(C,he)|0,a=a+Math.imul(C,de)|0,n=n+Math.imul(T,pe)|0,i=i+Math.imul(T,be)|0,i=i+Math.imul(P,pe)|0,a=a+Math.imul(P,be)|0;var Be=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(L,fe),i=Math.imul(L,ue),i=i+Math.imul(F,fe)|0,a=Math.imul(F,ue),n=n+Math.imul(N,he)|0,i=i+Math.imul(N,de)|0,i=i+Math.imul(j,he)|0,a=a+Math.imul(j,de)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(C,pe)|0,a=a+Math.imul(C,be)|0;var Re=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,he),i=Math.imul(L,de),i=i+Math.imul(F,he)|0,a=Math.imul(F,de),n=n+Math.imul(N,pe)|0,i=i+Math.imul(N,be)|0,i=i+Math.imul(j,pe)|0,a=a+Math.imul(j,be)|0;var Ce=(u+n|0)+((8191&i)<<13)|0;u=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,pe),i=Math.imul(L,be),i=i+Math.imul(F,pe)|0,a=Math.imul(F,be);var Oe=(u+n|0)+((8191&i)<<13)|0;return u=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ge,f[3]=ye,f[4]=we,f[5]=_e,f[6]=Se,f[7]=ke,f[8]=Ae,f[9]=Me,f[10]=xe,f[11]=Ee,f[12]=Ie,f[13]=Te,f[14]=Pe,f[15]=Be,f[16]=Re,f[17]=Ce,f[18]=Oe,0!==u&&(f[19]=u,r.length++),r};Math.imul||(A=u),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?A(this,e,t):r<63?u(this,e,t):r<1024?c(this,e,t):h(this,e,t)},d.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},d.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-a|h>>>a,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(u)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0==(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var c=0,h=1;0==(r.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(r.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var d;return d=0===t.cmpn(1)?i:o,d.cmpn(0)<0&&d.iadd(e),d},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new g(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};l.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},l.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},l.prototype.split=function(e,t){e.iushrn(this.n,0,t)},l.prototype.imulK=function(e){return e.imul(this.k)},i(p,l),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return M[e]=t,t},g.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},g.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},g.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},g.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},g.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},g.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},g.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},g.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},g.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},g.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},g.prototype.isqr=function(e){return this.imul(e,e.clone())},g.prototype.sqr=function(e){return this.mul(e,e)},g.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=o;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},g.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},g.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new y(e)},i(y,g),y.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},y.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},y.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},y.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},y.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(59)(e))},function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);u.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||o(a,this)}function a(e){e.end()}var o=r(26),s=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=n;var f=r(21);f.inherits=r(1);var u=r(52),c=r(34);f.inherits(n,u);for(var h=s(c.prototype),d=0;d=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=4294967295&r,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){function t(e,t,r){for(var n=[],a=0,o=0;o>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,u=o<<16|s<<8|f,c=0;c<4&&a+.75*c>>6*(3-c)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,u=s.Hasher,c=o.algo,h=[];!function(){for(var e=0;e<64;e++)h[e]=4294967296*t.abs(t.sin(e+1))|0}();var d=c.MD5=u.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var u=this._hash.words,c=e[t+0],d=e[t+1],l=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],g=e[t+7],y=e[t+8],w=e[t+9],_=e[t+10],S=e[t+11],k=e[t+12],A=e[t+13],M=e[t+14],x=e[t+15],E=u[0],I=u[1],T=u[2],P=u[3];E=r(E,I,T,P,c,7,h[0]),P=r(P,E,I,T,d,12,h[1]),T=r(T,P,E,I,l,17,h[2]),I=r(I,T,P,E,p,22,h[3]),E=r(E,I,T,P,b,7,h[4]),P=r(P,E,I,T,v,12,h[5]),T=r(T,P,E,I,m,17,h[6]),I=r(I,T,P,E,g,22,h[7]),E=r(E,I,T,P,y,7,h[8]),P=r(P,E,I,T,w,12,h[9]),T=r(T,P,E,I,_,17,h[10]),I=r(I,T,P,E,S,22,h[11]),E=r(E,I,T,P,k,7,h[12]),P=r(P,E,I,T,A,12,h[13]),T=r(T,P,E,I,M,17,h[14]),I=r(I,T,P,E,x,22,h[15]),E=n(E,I,T,P,d,5,h[16]),P=n(P,E,I,T,m,9,h[17]),T=n(T,P,E,I,S,14,h[18]),I=n(I,T,P,E,c,20,h[19]),E=n(E,I,T,P,v,5,h[20]),P=n(P,E,I,T,_,9,h[21]),T=n(T,P,E,I,x,14,h[22]),I=n(I,T,P,E,b,20,h[23]),E=n(E,I,T,P,w,5,h[24]),P=n(P,E,I,T,M,9,h[25]),T=n(T,P,E,I,p,14,h[26]),I=n(I,T,P,E,y,20,h[27]),E=n(E,I,T,P,A,5,h[28]),P=n(P,E,I,T,l,9,h[29]),T=n(T,P,E,I,g,14,h[30]),I=n(I,T,P,E,k,20,h[31]),E=i(E,I,T,P,v,4,h[32]),P=i(P,E,I,T,y,11,h[33]),T=i(T,P,E,I,S,16,h[34]),I=i(I,T,P,E,M,23,h[35]),E=i(E,I,T,P,d,4,h[36]),P=i(P,E,I,T,b,11,h[37]),T=i(T,P,E,I,g,16,h[38]),I=i(I,T,P,E,_,23,h[39]),E=i(E,I,T,P,A,4,h[40]),P=i(P,E,I,T,c,11,h[41]),T=i(T,P,E,I,p,16,h[42]),I=i(I,T,P,E,m,23,h[43]),E=i(E,I,T,P,w,4,h[44]),P=i(P,E,I,T,k,11,h[45]),T=i(T,P,E,I,x,16,h[46]),I=i(I,T,P,E,l,23,h[47]),E=a(E,I,T,P,c,6,h[48]),P=a(P,E,I,T,g,10,h[49]),T=a(T,P,E,I,M,15,h[50]),I=a(I,T,P,E,v,21,h[51]),E=a(E,I,T,P,k,6,h[52]),P=a(P,E,I,T,p,10,h[53]),T=a(T,P,E,I,_,15,h[54]),I=a(I,T,P,E,d,21,h[55]),E=a(E,I,T,P,y,6,h[56]),P=a(P,E,I,T,x,10,h[57]),T=a(T,P,E,I,m,15,h[58]),I=a(I,T,P,E,A,21,h[59]),E=a(E,I,T,P,b,6,h[60]),P=a(P,E,I,T,S,10,h[61]),T=a(T,P,E,I,l,15,h[62]),I=a(I,T,P,E,w,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+I|0,u[2]=u[2]+T|0,u[3]=u[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,u=0;u<4;u++){var c=f[u];f[u]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=u._createHelper(d),o.HmacMD5=u._createHmacHelper(d)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i=r(70);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(29);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(42);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(177),f=function(e){return e&&e.__esModule?e:{default:e}}(s),u=n(i),c=n(a),h=n(o),d={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,u.reverseHex)((0,u.hash160)(t))},t.getAddressFromScriptHash=function(t){t=(0,u.reverseHex)(t);var r=(0,u.hash256)(c.ADDR_VERSION+t).substr(0,8);return f.default.encode(e.from(c.ADDR_VERSION+t+r,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,u.ab2hexstring)(f.default.decode(e));return(0,u.reverseHex)(t.substr(2,40))},t.generateSignature=function(t,r){var n=(0,u.sha256)(t),i=e.from(n,"hex"),a=new o.ec("p256"),s=a.sign(i,r,null);return e.concat([s.r.toArrayLike(e,"be",32),s.s.toArrayLike(e,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,u.ab2hexstring)((0,d.default)(32))},t.generateRandomArray=function(e){return(0,d.default)(e)}}).call(t,r(3).Buffer)},function(e,t,r){"use strict";(function(t){function r(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(a=new Array(s-1),o=0;o65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getClaims=t.getBalance=t.getAPIEndpoint=void 0;var n=r(24),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(10),o=r(19),s=r(23),f=r(6),u=t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}},c=t.getBalance=function(e,t){var r=u(e);return i.default.get(r+"/v2/address/balance/"+t).then(function(t){var r=new a.Balance({net:e,address:t.data.address});return Object.keys(t.data).map(function(e){"net"!==e&&"address"!==e&&r.addAsset(e,t.data[e])}),Object.assign(r,t.data),r})},h=t.getClaims=function(e,t){var r=u(e);return i.default.get(r+"/v2/address/claims/"+t).then(function(e){return e.data})},d=t.getRPCEndpoint=function(e){var t=u(e);return i.default.get(t+"/v2/network/best_node").then(function(e){return e.data.node})};t.getTransactionHistory=function(e,t){var r=u(e);return i.default.get(r+"/v2/address/history/"+t).then(function(e){return e.data.history})},t.getWalletDBHeight=function(e){var t=u(e);return i.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){var n=new a.Account(t),i=d(e),f=h(e,n.address),u=void 0,c=void 0;return Promise.all([i,f]).then(function(e){c=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=o.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return u=e,s.Query.sendRawTransaction(u).execute(c)}).then(function(e){return!0===e.result&&(e.txid=u),e})},t.doMintTokens=function(e,t,r,n,i,u){var h=new a.Account(r),l=[{assetId:f.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t},b=d(e),v=c(e,h.address),m=void 0,g=void 0;return Promise.all([b,v]).then(function(e){g=e[0];var t=e[1],r=o.Transaction.createInvocationTx(t,l,p,i,{version:1});if(u)return u(r,h.publicKey);r.sign(h.privateKey)}).then(function(e){return m=e,s.Query.sendRawTransaction(m).execute(g)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})},t.doSendAsset=function(e,t,r,n,i){var u=new a.Account(r),h=new a.Account(t),l=d(e),p=c(e,u.address),b=Object.keys(n).map(function(e){return{assetId:f.ASSET_ID[e],value:n[e],scriptHash:h.scriptHash}}),v=void 0,m=void 0;return Promise.all([l,p]).then(function(e){m=e[0];var t=e[1],r=o.Transaction.createContractTx(t,b);return i?i(r,u.publicKey):r.sign(u.privateKey)}).then(function(e){return v=e,s.Query.sendRawTransaction(v).execute(m)}).then(function(e){return!0===e.result&&(e.txid=v.hash),e})}},function(e,t,r){"use strict";(function(t){function n(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i=r(7),a=r(80),o={"Content-Type":"application/x-www-form-urlencoded"},s={adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=r(45):void 0!==t&&(e=r(45)),e}(),transformRequest:[function(e,t){return a(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(n(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s}).call(t,r(9))},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,f,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(r=this._events[e],o(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),u=r.slice(),i=u.length,f=0;f0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],o=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){t=e.exports=r(52),t.Stream=t,t.Readable=t,t.Writable=r(34),t.Duplex=r(13),t.Transform=r(56),t.PassThrough=r(107)},function(e,t,r){"use strict";(function(t,n,i){function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){E(t,e)}}function o(e){return O.from(e)}function s(e){return O.isBuffer(e)||e instanceof N}function f(){}function u(e,t){T=T||r(13),e=e||{},this.objectMode=!!e.objectMode,t instanceof T&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){g(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function c(e){if(T=T||r(13),!(z.call(c,this)||this instanceof T))return new c(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),C.call(this)}function h(e,t){var r=new Error("write after end");e.emit("error",r),I(t,r)}function d(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),I(n,a),i=!1),i}function l(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=O.from(t,r)),t}function p(e,t,r,n,i,a){if(!r){var o=l(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length-1?n:I;c.WritableState=u;var B=r(21);B.inherits=r(1);var R={deprecate:r(106)},C=r(53),O=r(4).Buffer,N=i.Uint8Array||function(){},j=r(54);B.inherits(c,C),u.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(u.prototype,"buffer",{get:R.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}();var z;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!z.call(this,e)||e&&e._writableState instanceof u}})):z=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=s(e)&&!n.objectMode;return a&&!O.isBuffer(e)&&(e=o(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=f),n.ended?h(this,r):(a||d(this,n,e,r))&&(n.pendingcb++,i=p(this,n,a,e,t,r)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},c.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||x(this,n,r)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=j.destroy,c.prototype._undestroy=j.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(9),r(55).setImmediate,r(20))},function(e,t,r){"use strict";function n(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=n(e);if("string"!=typeof t&&(g.isEncoding===y||!y(e)))throw new Error("Unknown encoding: "+e);return t||e}function a(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=d,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=p,this.end=b,t=3;break;default:return this.write=v,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=g.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function s(e,t,r){var n=t.length-1;if(n=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function f(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(r);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(r+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(r+2)}}function u(e){var t=this.lastTotal-this.lastNeed,r=f(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var r=s(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function d(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function p(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function b(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}var g=r(4).Buffer,y=g.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>>31}var h=(n<<5|n>>>27)+f+o[u];h+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=h}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,u=0;u0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return s.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,u.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,u.decrypt)(this.encrypted,e,t),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=s.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=s.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=s.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=s.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=s.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=s.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(5),i=r(29),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},d=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},l=function(e){return Object.assign({script:"",gas:0},{script:e.script,gas:e.gas})};t.serializeExclusive={2:o,128:u,209:d},t.deserializeExclusive={2:a,128:f,209:h},t.getExclusive={2:s,128:c,209:l}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateDeployScript=t.createScript=t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(71),a=n(i),o=r(178),s=n(o),f=r(179),u=n(f),c=r(5),h=function(e){var t=e.script,r=e.name,n=e.version,i=e.author,a=e.email,o=e.description,f=e.needsStorage,u=void 0!==f&&f,h=e.returnType,d=void 0===h?"ff":h,l=e.paramaterList,p=void 0===l?void 0:l,b=new s.default;return b.emitPush((0,c.str2hexstring)(o)).emitPush((0,c.str2hexstring)(a)).emitPush((0,c.str2hexstring)(i)).emitPush((0,c.str2hexstring)(n)).emitPush((0,c.str2hexstring)(r)).emitPush(u).emitPush(d).emitPush(p).emitPush(t).emitSysCall("Neo.Contract.Create"),b};t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===z.prototype||(t=i(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):c(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?c(e,o,t,!1):g(e,o)):c(e,o,t,!1))):n||(o.reading=!1)}return d(o)}function c(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&v(e)),g(e,t)}function h(e,t){var r;return a(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function d(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function p(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=l(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function b(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,v(e)}}function v(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(q("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?R(m,e):m(e))}function m(e){q("emit readable"),e.emit("readable"),A(e)}function g(e,t){t.readingMore||(t.readingMore=!0,R(y,e,t))}function y(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=x(e,t.buffer,t.decoder),r}function x(e,t,r){var n;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}function I(e,t){var r=z.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,R(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return q("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):v(this),null;if(0===(e=p(e,t))&&t.ended)return 0===t.length&&T(this),null;var n=t.needReadable;q("need readable",n),(0===t.length||t.length-e0?M(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&T(this)),null!==i&&this.emit("data",i),i},f.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},f.prototype.pipe=function(e,t){function r(e,t){q("onunpipe"),e===d&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){q("onend"),e.end()}function a(){q("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",f),e.removeListener("unpipe",r),d.removeListener("end",i),d.removeListener("end",h),d.removeListener("data",s),m=!0,!l.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){q("ondata"),g=!1,!1!==e.write(t)||g||((1===l.pipesCount&&l.pipes===e||l.pipesCount>1&&-1!==B(l.pipes,e))&&!m&&(q("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,g=!0),d.pause())}function f(t){q("onerror",t),h(),e.removeListener("error",f),0===N(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),h()}function c(){q("onfinish"),e.removeListener("close",u),h()}function h(){q("unpipe"),d.unpipe(e)}var d=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1,q("pipe count=%d opts=%j",l.pipesCount,t);var p=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,b=p?i:h;l.endEmitted?R(b):d.once("end",b),e.on("unpipe",r);var v=w(d);e.on("drain",v);var m=!1,g=!1;return d.on("data",s),o(e,"error",f),e.once("close",u),e.once("finish",c),e.emit("pipe",d),l.flowing||(q("pipe resume"),d.resume()),e},f.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(105),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,r){"use strict";function n(e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r),i(t);var a=e._readableState;a.reading=!1,(a.needReadable||a.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function s(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function u(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}var c=r(1),h=r(16),d=r(4).Buffer,l=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],p=new Array(64);c(n,h),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,c=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=u(t[m-2])+t[m-7]+f(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var y=v+s(d)+i(d,p,b)+l[g]+t[g]|0,w=o(r)+a(r,n,c)|0;v=b,b=p,p=d,d=h+y|0,h=c,c=n,n=r,r=y+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=c+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},n.prototype._hash=function(){var e=d.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=n},function(e,t,r){function n(){this.init(),this._w=m,p.call(this,128,112)}function i(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function o(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function s(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function u(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function d(e,t){return e>>>0>>0?1:0}var l=r(1),p=r(16),b=r(4).Buffer,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],m=new Array(160);l(n,p),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,l=0|this._ch,p=0|this._dh,b=0|this._eh,m=0|this._fh,g=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,k=0|this._dl,A=0|this._el,M=0|this._fl,x=0|this._gl,E=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var T=t[I-30],P=t[I-30+1],B=f(T,P),R=u(P,T);T=t[I-4],P=t[I-4+1];var C=c(T,P),O=h(P,T),N=t[I-14],j=t[I-14+1],z=t[I-32],L=t[I-32+1],F=R+j|0,H=B+N+d(F,R)|0;F=F+O|0,H=H+C+d(F,O)|0,F=F+L|0,H=H+z+d(F,L)|0,t[I]=H,t[I+1]=F}for(var q=0;q<160;q+=2){H=t[q],F=t[q+1];var U=a(r,n,l),D=a(w,_,S),Y=o(r,w),K=o(w,r),V=s(b,A),W=s(A,b),X=v[q],Z=v[q+1],Q=i(b,m,g),G=i(A,M,x),J=E+W|0,$=y+V+d(J,E)|0;J=J+G|0,$=$+Q+d(J,G)|0,J=J+Z|0,$=$+X+d(J,Z)|0,J=J+F|0,$=$+H+d(J,F)|0;var ee=K+D|0,te=Y+U+d(ee,K)|0;y=g,E=x,g=m,x=M,m=b,M=A,A=k+J|0,b=p+$+d(A,k)|0,p=l,k=S,l=n,S=_,n=r,_=w,w=J+ee|0,r=$+te+d(w,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+A|0,this._fl=this._fl+M|0,this._gl=this._gl+x|0,this._hl=this._hl+E|0,this._ah=this._ah+r+d(this._al,w)|0,this._bh=this._bh+n+d(this._bl,_)|0,this._ch=this._ch+l+d(this._cl,S)|0,this._dh=this._dh+p+d(this._dl,k)|0,this._eh=this._eh+b+d(this._el,A)|0,this._fh=this._fh+m+d(this._fl,M)|0,this._gh=this._gh+g+d(this._gl,x)|0,this._hh=this._hh+y+d(this._hl,E)|0},n.prototype._hash=function(){function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}var t=b.allocUnsafe(64);return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function c(e){return d(e,17)^d(e,19)^e>>>10}var h=r(11),d=h.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=u,t.g1_256=c},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}var i=r(11),a=r(22),o=r(61),s=r(14),f=i.sum32,u=i.sum32_4,c=i.sum32_5,h=o.ch32,d=o.maj32,l=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=u[l-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[l]=b+u[l-7]+m+u[l-16]}var g=s&c^~s&h,y=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),S=d+_+g+f[l]+u[l],k=w+y;d=h,h=c,c=s,s=o+S|0,o=a,a=i,i=n,n=S+k|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(28))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,u=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=t()}();var h=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],h=r[6],d=r[7],l=n.high,p=n.low,b=i.high,v=i.low,m=a.high,g=a.low,y=o.high,w=o.low,_=s.high,S=s.low,k=f.high,A=f.low,M=h.high,x=h.low,E=d.high,I=d.low,T=l,P=p,B=b,R=v,C=m,O=g,N=y,j=w,z=_,L=S,F=k,H=A,q=M,U=x,D=E,Y=I,K=0;K<80;K++){var V=c[K];if(K<16)var W=V.high=0|e[t+2*K],X=V.low=0|e[t+2*K+1];else{var Z=c[K-15],Q=Z.high,G=Z.low,J=(Q>>>1|G<<31)^(Q>>>8|G<<24)^Q>>>7,$=(G>>>1|Q<<31)^(G>>>8|Q<<24)^(G>>>7|Q<<25),ee=c[K-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=c[K-7],oe=ae.high,se=ae.low,fe=c[K-16],ue=fe.high,ce=fe.low,X=$+se,W=J+oe+(X>>>0<$>>>0?1:0),X=X+ie,W=W+ne+(X>>>0>>0?1:0),X=X+ce,W=W+ue+(X>>>0>>0?1:0);V.high=W,V.low=X}var he=z&F^~z&q,de=L&H^~L&U,le=T&B^T&C^B&C,pe=P&R^P&O^R&O,be=(T>>>28|P<<4)^(T<<30|P>>>2)^(T<<25|P>>>7),ve=(P>>>28|T<<4)^(P<<30|T>>>2)^(P<<25|T>>>7),me=(z>>>14|L<<18)^(z>>>18|L<<14)^(z<<23|L>>>9),ge=(L>>>14|z<<18)^(L>>>18|z<<14)^(L<<23|z>>>9),ye=u[K],we=ye.high,_e=ye.low,Se=Y+ge,ke=D+me+(Se>>>0>>0?1:0),Se=Se+de,ke=ke+he+(Se>>>0>>0?1:0),Se=Se+_e,ke=ke+we+(Se>>>0<_e>>>0?1:0),Se=Se+X,ke=ke+W+(Se>>>0>>0?1:0),Ae=ve+pe,Me=be+le+(Ae>>>0>>0?1:0);D=q,Y=U,q=F,U=H,F=z,H=L,L=j+Se|0,z=N+ke+(L>>>0>>0?1:0)|0,N=C,j=O,C=B,O=R,B=T,R=P,P=Se+Ae|0,T=ke+Me+(P>>>0>>0?1:0)|0}p=n.low=p+P,n.high=l+T+(p>>>0

>>0?1:0),v=i.low=v+R,i.high=b+B+(v>>>0>>0?1:0),g=a.low=g+O,a.high=m+C+(g>>>0>>0?1:0),w=o.low=w+j,o.high=y+N+(w>>>0>>0?1:0),S=s.low=S+L,s.high=_+z+(S>>>0>>0?1:0),A=f.low=A+H,f.high=k+F+(A>>>0>>0?1:0),x=h.low=x+U,h.high=M+q+(x>>>0>>0?1:0),I=d.low=I+Y,d.high=E+D+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(h),r.HmacSHA512=i._createHmacHelper(h)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(36),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(5),o=r(25);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptWIF=t.encryptWIF=t.decrypt=t.encrypt=t.generateEncryptedWif=t.encryptWifAccount=void 0;var i=r(50),a=n(i),o=r(64),s=r(169),f=n(s),u=r(25),c=r(41),h=n(c),d=r(5),l=r(6),p=t.encryptWifAccount=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),m(e,t).then(function(r){var n=new h.default(e);return n.encryptedWif=r,n.passphrase=t,n})},b=(t.generateEncryptedWif=function(e){console.log("To be deprecated in v3. Please use new Account() and encrypt with Account.encrypt");var t=(0,u.generatePrivateKey)();return p(t,e)},t.encrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;n=g(n);var i=new h.default(t),s=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(i.address))).toString().slice(0,8),u=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(s,"hex"),n).toString("hex"),c=u.slice(0,64),p=u.slice(64),b=(0,d.hexXor)(i.privateKey,c),v=o.AES.encrypt(o.enc.Hex.parse(b),o.enc.Hex.parse(p),{mode:o.mode.ECB,padding:o.pad.NoPadding}),m=l.NEP_HEADER+l.NEP_FLAG+s+v.ciphertext.toString();return a.default.encode(e.from(m,"hex"))}),v=t.decrypt=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;n=g(n);var i=(0,d.ab2hexstring)(a.default.decode(t)),s=i.substr(6,8),u=i.substr(-64),c=f.default.hashSync(e.from(r.normalize("NFC"),"utf8"),e.from(s,"hex"),n).toString("hex"),p=c.slice(0,64),b=c.slice(64),v={ciphertext:o.enc.Hex.parse(u),salt:""},m=o.AES.decrypt(v,o.enc.Hex.parse(b),{mode:o.mode.ECB,padding:o.pad.NoPadding}),y=(0,d.hexXor)(m.toString(),p),w=new h.default(y);if(s!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(w.address))).toString().slice(0,8))throw new Error("Wrong Password!");return w.WIF},m=t.encryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),Promise.resolve(b(e,t))},g=(t.decryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.decrypt"),Promise.resolve(v(e,t))},function(e){return Object.assign({},l.DEFAULT_SCRYPT,e)})}).call(t,r(3).Buffer)},function(e,t,r){(function(t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?t("","utf8"):e instanceof t?e:"string"==typeof e?new t(e,"utf8"):new t(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:u(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function u(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r}).call(t,r(3).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(5),i=r(10),a=r(42),o=r(6),s=r(29),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),u=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var n=t.reduce(function(e,t){var r=Math.round(1e8*t.value);return e[t.assetId]?e[t.assetId]+=r:e[t.assetId]=r,e},{});if(r>0){var a=1e8*r;n[o.ASSET_ID.GAS]?n[o.ASSET_ID.GAS]+=a:n[o.ASSET_ID.GAS]=a}var s=[];return{inputs:Object.keys(n).map(function(t){var r=n[t],a=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(a))throw new Error("This balance does not contain any "+a+"!");var f=e.assets[a];if(1e8*f.balancef.unspent.length)throw new Error("Insufficient "+o.ASSETS[t]+"! Reached end of unspent coins!");c+=Math.round(1e8*f.unspent[u-1].value)}return c>r&&s.push({assetId:t,value:(c-r)/1e8,scriptHash:(0,i.getScriptHashFromAddress)(e.address)}),f.unspent.slice(0,u).map(function(e){return{prevHash:e.txid,prevIndex:e.index}})}).reduce(function(e,t){return e.concat(t)},[]),change:s}},t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var u,c=e.attributes[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;r+=f.serializeTransactionAttribute(h)}}catch(e){o=!0,s=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var d=!0,l=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(d=(b=v.next()).done);d=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){l=!0,p=e}finally{try{!d&&v.return&&v.return()}finally{if(l)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var g=!0,y=!1,w=void 0;try{for(var _,S=e.outputs[Symbol.iterator]();!(g=(_=S.next()).done);g=!0){var k=_.value;r+=f.serializeTransactionOutput(k)}}catch(e){y=!0,w=e}finally{try{!g&&S.return&&S.return()}finally{if(y)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var A=!0,M=!1,x=void 0;try{for(var E,I=e.scripts[Symbol.iterator]();!(A=(E=I.next()).done);A=!0){var T=E.value;r+=f.serializeWitness(T)}}catch(e){M=!0,x=e}finally{try{!A&&I.return&&I.return()}finally{if(M)throw x}}}return r});t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;ar?(r=u.height,n=[u]):u.height===r&&n.push(u)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})},t.getBalance=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_balance/"+t).then(function(t){var r=new a.Balance({address:t.data.address,net:e});return t.data.balance.map(function(e){r.addAsset(e.asset,{balance:e.amount,unspent:s(e.unspent)}),r[e.asset]={balance:e.amount,unspent:s(e.unspent)}}),r})},t.getClaims=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_claimable/"+t).then(function(t){var r=f(t.data.claimable);return{net:e,address:t.data.address,claims:r}})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),f=function(e){return e.map(function(e){return{start:e.start_height,end:e.ed_height,index:e.n,claim:Math.round(1e8*e.unclaimed),txid:e.txid,value:e.value}})}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(75),a=n(i),o=r(23),s=n(o),f=r(6),u=n(f),c=r(43),h=n(c),d=r(19),l=n(d),p=r(10),b=n(p),v=r(5),m=n(v),g=[h.default,l.default,b.default,a.default,s.default],y=g.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:u,u:m});t.default=y,t.api=a,t.rpc=s,t.sc=h,t.tx=l,t.wallet=b,t.u=m,t.CONST=u},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(76);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(30),o=n(a),s=r(184),f=n(s),u=r(185),c=n(u),h=r(73),d=n(h);t.default={get:{price:f.getPrice,balance:o.getBalance,claims:o.getClaims,transactionHistory:o.getTransactionHistory,tokenBalance:c.getTokenBalance,tokenInfo:c.getTokenInfo,token:c.getToken},do:{sendAsset:o.doSendAsset,claimAllGas:o.doClaimAllGas,mintTokens:o.doMintTokens}},t.neonDB=o,t.cmc=f,t.nep5=c,t.neoscan=d},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.doInvoke=t.claimGas=t.sendAsset=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.getClaimsFrom=t.getBalanceFrom=void 0;var i=r(30),a=n(i),o=r(73),s=n(o),f=r(10),u=r(6),c=r(23),h=r(19),d=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n diff --git a/lib/browser.js.gz b/lib/browser.js.gz index 6a837c958..334554f95 100644 Binary files a/lib/browser.js.gz and b/lib/browser.js.gz differ diff --git a/lib/index.js b/lib/index.js index 3e8c51cd7..996bea16b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,4 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=63)}([function(e,t,r){!function(r,n){e.exports=t=n()}(0,function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),s=n.enc={},f=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,f=i/s;f=t?e.ceil(f):e.max((0|f)-this._minBufferSize,0);var c=f*a,u=e.min(4*c,i);if(c){for(var d=0;d>>2];e.sigBytes-=t}},m=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:v}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=r.format={},g=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:g}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},k=_.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},S=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:k}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=w.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,w.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";function n(e){return"[object Array]"===x.call(e)}function i(e){return"[object ArrayBuffer]"===x.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function o(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function f(e){return"number"==typeof e}function c(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===x.call(e)}function h(e){return"[object File]"===x.call(e)}function l(e){return"[object Blob]"===x.call(e)}function p(e){return"[object Function]"===x.call(e)}function b(e){return u(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function m(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function y(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function g(e,t){if(null!==e&&void 0!==e)if("object"==typeof e||n(e)||(e=[e]),n(e))for(var r=0,i=e.length;r1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=h(n)),n}),h=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;if("number"!=typeof e)throw new Error("num must be numeric");return d(Math.round(e*Math.pow(10,8)),t,!0)},t.fixed82num=function(e){if("string"!=typeof e)throw new Error("fixed8hex must be a string");if(!e.length||e.length%2!=0)throw new Error("fixed8hex must be hex");return parseInt(h(e),16)/Math.pow(10,8)},t.num2VarInt=function(e){return e<253?d(e):e<=65535?"fd"+d(e,4,!0):e<=4294967295?"fe"+d(e,8,!0):"ff"+d(e,16,!0)},t.hexXor=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new Error("hexXor expects hex strings");if(e.length!==t.length)throw new Error("strings are disparate lengths");if(e.length%2!=0)throw new Error("strings must be hex");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t});t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";n(this,e),this.str=t,this.pter=0}return i(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(h(this.read(2)),16):254===e?e=parseInt(h(this.read(4)),16):255===e&&(e=parseInt(h(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e);return(0,o.SHA256)(t).toString()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654"},t.DEFAULT_RPC={MAIN:"http://seed1.neo.org:10332",TEST:"http://seed1.neo.org:20332"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){"use strict";var n=t;n.version=r(98).version,n.utils=r(99),n.rand=r(100),n.curve=r(18),n.curves=r(106),n.ec=r(114),n.eddsa=r(118)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.Balance=t.Account=void 0;var a=r(17);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(56);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(57);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var f=i(a),c=i(o),u=i(s),d=r(31),h=n(d),l=r(153),p=n(l),b=r(160),v=n(b);t.default={create:{account:function(e){return new h.default(e)},privateKey:f.generatePrivateKey,signature:f.generateSignature,wallet:function(e){return new v.default(e)}},is:{address:c.isAddress,publicKey:c.isPublicKey,encryptedKey:c.isNEP2,privateKey:c.isPrivateKey,wif:c.isWIF},encrypt:{privateKey:u.encrypt},decrypt:{privateKey:u.decrypt},get:{privateKeyFromWIF:f.getPrivateKeyFromWIF,WIFFromPrivateKey:f.getWIFFromPrivateKey,publicKeyFromPrivateKey:f.getPublicKeyFromPrivateKey,scriptHashFromPublicKey:f.getScriptHashFromPublicKey,addressFromScriptHash:f.getAddressFromScriptHash,scriptHashFromAddress:f.getScriptHashFromAddress}},t.Account=h.default,t.Balance=p.default,t.Wallet=v.default},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for(e=e.replace(/[^a-z0-9]+/gi,""),e.length%2!=0&&(e="0"+e),n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function u(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){return e<>>32-t}function l(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function y(e,t,r,n){return(t+n>>>0>>0}function g(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,c=t;return c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function k(e,t,r,n,i,a,o,s,f,c){var u=0,d=t;return d=d+n>>>0,u+=d>>0,u+=d>>0,u+=d>>0,u+=d>>0}function S(e,t,r,n,i,a,o,s,f,c){return t+n+a+s+c>>>0}function x(e,t,r){return(t<<32-r|e>>>r)>>>0}function M(e,t,r){return(e<<32-r|t>>>r)>>>0}function A(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var I=r(9),P=r(19);t.inherits=P,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=c,t.split32=u,t.rotr32=d,t.rotl32=h,t.sum32=l,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=y,t.sum64_lo=g,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=k,t.sum64_5_lo=S,t.rotr64_hi=x,t.rotr64_lo=M,t.shr64_hi=A,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function c(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,d=67108863&f,h=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=h;l++){var p=c-l|0;i=0|e.words[p],a=0|t.words[l],o=i*a+d,u+=o/67108864|0,d=67108863&o}r.words[c]=0|d,f=0|u}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}function u(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function d(e,t,r){return(new h).mulp(e,t,r)}function h(e,t){this.x=e,this.y=t}function l(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function g(e){y.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(47).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],k=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=k[e],u=S[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modn(u).toString(e);d=d.idivn(u),r=d.isZero()?h+r:_[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,c=new e(a),u=this.clone();if(f){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],p=8191&l,b=l>>>13,v=0|o[2],m=8191&v,y=v>>>13,g=0|o[3],w=8191&g,_=g>>>13,k=0|o[4],S=8191&k,x=k>>>13,M=0|o[5],A=8191&M,E=M>>>13,I=0|o[6],P=8191&I,T=I>>>13,B=0|o[7],R=8191&B,C=B>>>13,O=0|o[8],z=8191&O,N=O>>>13,j=0|o[9],q=8191&j,H=j>>>13,F=0|s[0],L=8191&F,U=F>>>13,D=0|s[1],K=8191&D,V=D>>>13,W=0|s[2],Y=8191&W,X=W>>>13,Z=0|s[3],G=8191&Z,Q=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,he=ue>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(d,L),i=Math.imul(d,U),i=i+Math.imul(h,L)|0,a=Math.imul(h,U);var ve=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,L),i=Math.imul(p,U),i=i+Math.imul(b,L)|0,a=Math.imul(b,U),n=n+Math.imul(d,K)|0,i=i+Math.imul(d,V)|0,i=i+Math.imul(h,K)|0,a=a+Math.imul(h,V)|0;var me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,L),i=Math.imul(m,U),i=i+Math.imul(y,L)|0,a=Math.imul(y,U),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,V)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,n=n+Math.imul(d,Y)|0,i=i+Math.imul(d,X)|0,i=i+Math.imul(h,Y)|0,a=a+Math.imul(h,X)|0;var ye=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,L),i=Math.imul(w,U),i=i+Math.imul(_,L)|0,a=Math.imul(_,U),n=n+Math.imul(m,K)|0,i=i+Math.imul(m,V)|0,i=i+Math.imul(y,K)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(p,Y)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(d,G)|0,i=i+Math.imul(d,Q)|0,i=i+Math.imul(h,G)|0,a=a+Math.imul(h,Q)|0;var ge=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(S,L),i=Math.imul(S,U),i=i+Math.imul(x,L)|0,a=Math.imul(x,U),n=n+Math.imul(w,K)|0,i=i+Math.imul(w,V)|0,i=i+Math.imul(_,K)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(m,Y)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(y,Y)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Q)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Q)|0,n=n+Math.imul(d,$)|0,i=i+Math.imul(d,ee)|0,i=i+Math.imul(h,$)|0,a=a+Math.imul(h,ee)|0;var we=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,L),i=Math.imul(A,U),i=i+Math.imul(E,L)|0,a=Math.imul(E,U),n=n+Math.imul(S,K)|0,i=i+Math.imul(S,V)|0,i=i+Math.imul(x,K)|0,a=a+Math.imul(x,V)|0,n=n+Math.imul(w,Y)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,Y)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,G)|0,i=i+Math.imul(m,Q)|0,i=i+Math.imul(y,G)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(d,re)|0,i=i+Math.imul(d,ne)|0,i=i+Math.imul(h,re)|0,a=a+Math.imul(h,ne)|0;var _e=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,L),i=Math.imul(P,U),i=i+Math.imul(T,L)|0,a=Math.imul(T,U),n=n+Math.imul(A,K)|0,i=i+Math.imul(A,V)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,V)|0,n=n+Math.imul(S,Y)|0,i=i+Math.imul(S,X)|0,i=i+Math.imul(x,Y)|0,a=a+Math.imul(x,X)|0,n=n+Math.imul(w,G)|0,i=i+Math.imul(w,Q)|0,i=i+Math.imul(_,G)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(y,$)|0,a=a+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(d,ae)|0,i=i+Math.imul(d,oe)|0,i=i+Math.imul(h,ae)|0,a=a+Math.imul(h,oe)|0;var ke=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,L),i=Math.imul(R,U),i=i+Math.imul(C,L)|0,a=Math.imul(C,U),n=n+Math.imul(P,K)|0,i=i+Math.imul(P,V)|0,i=i+Math.imul(T,K)|0,a=a+Math.imul(T,V)|0,n=n+Math.imul(A,Y)|0,i=i+Math.imul(A,X)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(S,G)|0,i=i+Math.imul(S,Q)|0,i=i+Math.imul(x,G)|0,a=a+Math.imul(x,Q)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(d,fe)|0,i=i+Math.imul(d,ce)|0,i=i+Math.imul(h,fe)|0,a=a+Math.imul(h,ce)|0;var Se=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,L),i=Math.imul(z,U),i=i+Math.imul(N,L)|0,a=Math.imul(N,U),n=n+Math.imul(R,K)|0,i=i+Math.imul(R,V)|0,i=i+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(P,Y)|0,i=i+Math.imul(P,X)|0,i=i+Math.imul(T,Y)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(A,G)|0,i=i+Math.imul(A,Q)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Q)|0,n=n+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,i=i+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ce)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ce)|0,n=n+Math.imul(d,de)|0,i=i+Math.imul(d,he)|0,i=i+Math.imul(h,de)|0,a=a+Math.imul(h,he)|0;var xe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(q,L),i=Math.imul(q,U),i=i+Math.imul(H,L)|0,a=Math.imul(H,U),n=n+Math.imul(z,K)|0,i=i+Math.imul(z,V)|0,i=i+Math.imul(N,K)|0,a=a+Math.imul(N,V)|0,n=n+Math.imul(R,Y)|0,i=i+Math.imul(R,X)|0,i=i+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(P,G)|0,i=i+Math.imul(P,Q)|0,i=i+Math.imul(T,G)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,i=i+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,i=i+Math.imul(x,re)|0,a=a+Math.imul(x,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ce)|0,i=i+Math.imul(y,fe)|0,a=a+Math.imul(y,ce)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,he)|0,i=i+Math.imul(b,de)|0,a=a+Math.imul(b,he)|0,n=n+Math.imul(d,pe)|0,i=i+Math.imul(d,be)|0,i=i+Math.imul(h,pe)|0,a=a+Math.imul(h,be)|0;var Me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(q,K),i=Math.imul(q,V),i=i+Math.imul(H,K)|0,a=Math.imul(H,V),n=n+Math.imul(z,Y)|0,i=i+Math.imul(z,X)|0,i=i+Math.imul(N,Y)|0,a=a+Math.imul(N,X)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(R,Q)|0,i=i+Math.imul(C,G)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,i=i+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(S,ae)|0,i=i+Math.imul(S,oe)|0,i=i+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ce)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ce)|0,n=n+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0,i=i+Math.imul(y,de)|0,a=a+Math.imul(y,he)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var Ae=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,Y),i=Math.imul(q,X),i=i+Math.imul(H,Y)|0,a=Math.imul(H,X),n=n+Math.imul(z,G)|0,i=i+Math.imul(z,Q)|0,i=i+Math.imul(N,G)|0,a=a+Math.imul(N,Q)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,i=i+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(A,ae)|0,i=i+Math.imul(A,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(S,fe)|0,i=i+Math.imul(S,ce)|0,i=i+Math.imul(x,fe)|0,a=a+Math.imul(x,ce)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,he)|0,i=i+Math.imul(_,de)|0,a=a+Math.imul(_,he)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(y,pe)|0,a=a+Math.imul(y,be)|0;var Ee=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(q,G),i=Math.imul(q,Q),i=i+Math.imul(H,G)|0,a=Math.imul(H,Q),n=n+Math.imul(z,$)|0,i=i+Math.imul(z,ee)|0,i=i+Math.imul(N,$)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,oe)|0,i=i+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(A,fe)|0,i=i+Math.imul(A,ce)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ce)|0,n=n+Math.imul(S,de)|0,i=i+Math.imul(S,he)|0,i=i+Math.imul(x,de)|0,a=a+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ie=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,$),i=Math.imul(q,ee),i=i+Math.imul(H,$)|0,a=Math.imul(H,ee),n=n+Math.imul(z,re)|0,i=i+Math.imul(z,ne)|0,i=i+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,oe)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(P,fe)|0,i=i+Math.imul(P,ce)|0,i=i+Math.imul(T,fe)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(A,de)|0,i=i+Math.imul(A,he)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(E,he)|0,n=n+Math.imul(S,pe)|0,i=i+Math.imul(S,be)|0,i=i+Math.imul(x,pe)|0,a=a+Math.imul(x,be)|0;var Pe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(q,re),i=Math.imul(q,ne),i=i+Math.imul(H,re)|0,a=Math.imul(H,ne),n=n+Math.imul(z,ae)|0,i=i+Math.imul(z,oe)|0,i=i+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,n=n+Math.imul(R,fe)|0,i=i+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,a=a+Math.imul(C,ce)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,he)|0,i=i+Math.imul(T,de)|0,a=a+Math.imul(T,he)|0,n=n+Math.imul(A,pe)|0,i=i+Math.imul(A,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Te=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,ae),i=Math.imul(q,oe),i=i+Math.imul(H,ae)|0,a=Math.imul(H,oe),n=n+Math.imul(z,fe)|0,i=i+Math.imul(z,ce)|0,i=i+Math.imul(N,fe)|0,a=a+Math.imul(N,ce)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,he)|0,i=i+Math.imul(C,de)|0,a=a+Math.imul(C,he)|0,n=n+Math.imul(P,pe)|0,i=i+Math.imul(P,be)|0,i=i+Math.imul(T,pe)|0,a=a+Math.imul(T,be)|0;var Be=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,fe),i=Math.imul(q,ce),i=i+Math.imul(H,fe)|0,a=Math.imul(H,ce),n=n+Math.imul(z,de)|0,i=i+Math.imul(z,he)|0,i=i+Math.imul(N,de)|0,a=a+Math.imul(N,he)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(C,pe)|0,a=a+Math.imul(C,be)|0;var Re=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(q,de),i=Math.imul(q,he),i=i+Math.imul(H,de)|0,a=Math.imul(H,he),n=n+Math.imul(z,pe)|0,i=i+Math.imul(z,be)|0,i=i+Math.imul(N,pe)|0,a=a+Math.imul(N,be)|0;var Ce=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,pe),i=Math.imul(q,be),i=i+Math.imul(H,pe)|0,a=Math.imul(H,be);var Oe=(c+n|0)+((8191&i)<<13)|0;return c=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ye,f[3]=ge,f[4]=we,f[5]=_e,f[6]=ke,f[7]=Se,f[8]=xe,f[9]=Me,f[10]=Ae,f[11]=Ee,f[12]=Ie,f[13]=Pe,f[14]=Te,f[15]=Be,f[16]=Re,f[17]=Ce,f[18]=Oe,0!==c&&(f[19]=c,r.length++),r};Math.imul||(x=c),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?c(this,e,t):r<1024?u(this,e,t):d(this,e,t)},h.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},h.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&s}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(u),f.isub(d)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,d=1;0==(r.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var h;return h=0===t.cmpn(1)?i:o,h.cmpn(0)<0&&h.iadd(e),h},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new y(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};l.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},l.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},l.prototype.split=function(e,t){e.iushrn(this.n,0,t)},l.prototype.imulK=function(e){return e.imul(this.k)},i(p,l),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return M[e]=t,t},y.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},y.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},y.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},y.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},y.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},y.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},y.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},y.prototype.isqr=function(e){return this.imul(e,e.clone())},y.prototype.sqr=function(e){return this.mul(e,e)},y.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=o;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var c=t.words[n],u=f-1;u>=0;u--){var d=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},y.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},y.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new g(e)},i(g,y),g.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},g.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},g.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},g.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},g.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(48)(e))},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(29),r(30))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),o=a.words,s=r.keySize,f=r.iterations;o.length>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,c=o<<16|s<<8|f,u=0;u<4&&a+.75*u>>6*(3-u)&63));var d=n.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,c=s.Hasher,u=o.algo,d=[];!function(){for(var e=0;e<64;e++)d[e]=4294967296*t.abs(t.sin(e+1))|0}();var h=u.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var c=this._hash.words,u=e[t+0],h=e[t+1],l=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],y=e[t+7],g=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],S=e[t+12],x=e[t+13],M=e[t+14],A=e[t+15],E=c[0],I=c[1],P=c[2],T=c[3];E=r(E,I,P,T,u,7,d[0]),T=r(T,E,I,P,h,12,d[1]),P=r(P,T,E,I,l,17,d[2]),I=r(I,P,T,E,p,22,d[3]),E=r(E,I,P,T,b,7,d[4]),T=r(T,E,I,P,v,12,d[5]),P=r(P,T,E,I,m,17,d[6]),I=r(I,P,T,E,y,22,d[7]),E=r(E,I,P,T,g,7,d[8]),T=r(T,E,I,P,w,12,d[9]),P=r(P,T,E,I,_,17,d[10]),I=r(I,P,T,E,k,22,d[11]),E=r(E,I,P,T,S,7,d[12]),T=r(T,E,I,P,x,12,d[13]),P=r(P,T,E,I,M,17,d[14]),I=r(I,P,T,E,A,22,d[15]),E=n(E,I,P,T,h,5,d[16]),T=n(T,E,I,P,m,9,d[17]),P=n(P,T,E,I,k,14,d[18]),I=n(I,P,T,E,u,20,d[19]),E=n(E,I,P,T,v,5,d[20]),T=n(T,E,I,P,_,9,d[21]),P=n(P,T,E,I,A,14,d[22]),I=n(I,P,T,E,b,20,d[23]),E=n(E,I,P,T,w,5,d[24]),T=n(T,E,I,P,M,9,d[25]),P=n(P,T,E,I,p,14,d[26]),I=n(I,P,T,E,g,20,d[27]),E=n(E,I,P,T,x,5,d[28]),T=n(T,E,I,P,l,9,d[29]),P=n(P,T,E,I,y,14,d[30]),I=n(I,P,T,E,S,20,d[31]),E=i(E,I,P,T,v,4,d[32]),T=i(T,E,I,P,g,11,d[33]),P=i(P,T,E,I,k,16,d[34]),I=i(I,P,T,E,M,23,d[35]),E=i(E,I,P,T,h,4,d[36]),T=i(T,E,I,P,b,11,d[37]),P=i(P,T,E,I,y,16,d[38]),I=i(I,P,T,E,_,23,d[39]),E=i(E,I,P,T,x,4,d[40]),T=i(T,E,I,P,u,11,d[41]),P=i(P,T,E,I,p,16,d[42]),I=i(I,P,T,E,m,23,d[43]),E=i(E,I,P,T,w,4,d[44]),T=i(T,E,I,P,S,11,d[45]),P=i(P,T,E,I,A,16,d[46]),I=i(I,P,T,E,l,23,d[47]),E=a(E,I,P,T,u,6,d[48]),T=a(T,E,I,P,y,10,d[49]),P=a(P,T,E,I,M,15,d[50]),I=a(I,P,T,E,v,21,d[51]),E=a(E,I,P,T,S,6,d[52]),T=a(T,E,I,P,p,10,d[53]),P=a(P,T,E,I,_,15,d[54]),I=a(I,P,T,E,h,21,d[55]),E=a(E,I,P,T,g,6,d[56]),T=a(T,E,I,P,A,10,d[57]),P=a(P,T,E,I,m,15,d[58]),I=a(I,P,T,E,x,21,d[59]),E=a(E,I,P,T,b,6,d[60]),T=a(T,E,I,P,k,10,d[61]),P=a(P,T,E,I,l,15,d[62]),I=a(I,P,T,E,w,21,d[63]),c[0]=c[0]+E|0,c[1]=c[1]+I|0,c[2]=c[2]+P|0,c[3]=c[3]+T|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,c=0;c<4;c++){var u=f[c];f[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=c._createHelper(h),o.HmacMD5=c._createHmacHelper(h)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i=r(59);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(21);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(32);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(154),f=function(e){return e&&e.__esModule?e:{default:e}}(s),c=n(i),u=n(a),d=n(o),h={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,c.reverseHex)((0,c.hash160)(t))},t.getAddressFromScriptHash=function(e){e=(0,c.reverseHex)(e);var t=(0,c.hash256)(u.ADDR_VERSION+e).substr(0,8);return f.default.encode(Buffer.from(u.ADDR_VERSION+e+t,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,c.ab2hexstring)(f.default.decode(e));return(0,c.reverseHex)(t.substr(2,40))},t.generateSignature=function(e,t){var r=(0,c.sha256)(e),n=Buffer.from(r,"hex"),i=new o.ec("p256"),a=i.sign(n,t,null);return Buffer.concat([a.r.toArrayLike(Buffer,"be",32),a.s.toArrayLike(Buffer,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,c.ab2hexstring)((0,h.default)(32))},t.generateRandomArray=function(e){return(0,h.default)(e)}},function(e,t,r){"use strict";var n=t;n.base=r(101),n.short=r(102),n.mont=r(104),n.edwards=r(105)},function(e,t,r){try{var n=r(43);if("function"!=typeof n.inherits)throw"";e.exports=n.inherits}catch(t){e.exports=r(103)}},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=r.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getClaims=t.getBalance=t.getAPIEndpoint=void 0;var n=r(16),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(6),o=r(13),s=r(15),f=r(4),c=t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}},u=t.getBalance=function(e,t){var r=c(e);return i.default.get(r+"/v2/address/balance/"+t).then(function(t){var r=new a.Balance({net:e,address:t.data.address});return Object.keys(t.data).map(function(e){"net"!==e&&"address"!==e&&r.addAsset(e,t.data[e])}),Object.assign(r,t.data),r})},d=t.getClaims=function(e,t){var r=c(e);return i.default.get(r+"/v2/address/claims/"+t).then(function(e){return e.data})},h=t.getRPCEndpoint=function(e){var t=c(e);return i.default.get(t+"/v2/network/best_node").then(function(e){return e.data.node})};t.getTransactionHistory=function(e,t){var r=c(e);return i.default.get(r+"/v2/address/history/"+t).then(function(e){return e.data.history})},t.getWalletDBHeight=function(e){var t=c(e);return i.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){var n=new a.Account(t),i=h(e),f=d(e,n.address),c=void 0,u=void 0;return Promise.all([i,f]).then(function(e){u=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=o.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return c=e,s.Query.sendRawTransaction(c).execute(u)}).then(function(e){return!0===e.result&&(e.txid=c),e})},t.doMintTokens=function(e,t,r,n,i,c){var d=new a.Account(r),l=[{assetId:f.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t},b=h(e),v=u(e,d.address),m=void 0,y=void 0;return Promise.all([b,v]).then(function(e){y=e[0];var t=e[1],r=o.Transaction.createInvocationTx(t,l,p,i,{version:1});if(c)return c(r,d.publicKey);r.sign(d.privateKey)}).then(function(e){return m=e,s.Query.sendRawTransaction(m).execute(y)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})},t.doSendAsset=function(e,t,r,n,i){var c=new a.Account(r),d=new a.Account(t),l=h(e),p=u(e,c.address),b=Object.keys(n).map(function(e){return{assetId:f.ASSET_ID[e],value:n[e],scriptHash:d.scriptHash}}),v=void 0,m=void 0;return Promise.all([l,p]).then(function(e){m=e[0];var t=e[1],r=o.Transaction.createContractTx(t,b);return i?i(r,c.publicKey):r.sign(c.privateKey)}).then(function(e){return v=e,s.Query.sendRawTransaction(v).execute(m)}).then(function(e){return!0===e.result&&(e.txid=v.hash),e})}},function(e,t,r){"use strict";function n(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i=r(2),a=r(69),o={"Content-Type":"application/x-www-form-urlencoded"},s={adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=r(70):"undefined"!=typeof process&&(e=r(75)),e}(),transformRequest:[function(e,t){return a(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(n(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s},function(e,t,r){"use strict";var n=r(36);e.exports=function(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("crypto")},function(e,t,r){var n=r(96);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){var n=t;n.utils=r(7),n.common=r(14),n.sha=r(107),n.ripemd=r(111),n.hmac=r(112),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],f=r[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var u=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+f+o[c];d+=c<20?1518500249+(i&a|~i&s):c<40?1859775393+(i^a^s):c<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,c=0;c0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return s.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,c.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,c.decrypt)(this.encrypted,e,t),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=s.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=s.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=s.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=s.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=s.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=s.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(3),i=r(21),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},h=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},l=function(e){return Object.assign({script:"",gas:0},{script:e.script,gas:e.gas})};t.serializeExclusive={2:o,128:c,209:h},t.deserializeExclusive={2:a,128:f,209:d},t.getExclusive={2:s,128:u,209:l}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateDeployScript=t.createScript=t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(60),a=n(i),o=r(155),s=n(o),f=r(156),c=n(f),u=r(3),d=function(e){var t=e.script,r=e.name,n=e.version,i=e.author,a=e.email,o=e.description,f=e.needsStorage,c=void 0!==f&&f,d=e.returnType,h=void 0===d?"ff":d,l=e.paramaterList,p=void 0===l?void 0:l,b=new s.default;return b.emitPush((0,u.str2hexstring)(o)).emitPush((0,u.str2hexstring)(a)).emitPush((0,u.str2hexstring)(i)).emitPush((0,u.str2hexstring)(n)).emitPush((0,u.str2hexstring)(r)).emitPush(c).emitPush(h).emitPush(p).emitPush(t).emitSysCall("Neo.Contract.Create"),b};t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r=300&&e.statusCode<400){if(++this._redirectCount>this._options.maxRedirects)return this.emit("error",new Error("Max redirects exceeded."));var r,n=this._options.headers;if(307!==e.statusCode&&!(this._options.method in h)){this._options.method="GET",this._bufferedWrites=[];for(r in n)/^content-/i.test(r)&&delete n[r]}if(!this._isRedirect)for(r in n)/^host$/i.test(r)&&delete n[r];var a=i.resolve(this._currentUrl,t);c("redirecting to",a),Object.assign(this._options,i.parse(a)),this._isRedirect=!0,this._performRequest()}else e.responseUrl=this._currentUrl,this.emit("response",e),delete this._options,delete this._bufferedWrites},n.prototype.abort=function(){this._currentRequest.abort()},n.prototype.flushHeaders=function(){this._currentRequest.flushHeaders()},n.prototype.setNoDelay=function(e){this._currentRequest.setNoDelay(e)},n.prototype.setSocketKeepAlive=function(e,t){this._currentRequest.setSocketKeepAlive(e,t)},n.prototype.setTimeout=function(e,t){this._currentRequest.setTimeout(e,t)},n.prototype.write=function(e,t,r){this._currentRequest.write(e,t,r),this._bufferedWrites.push({data:e,encoding:t})},n.prototype.end=function(e,t,r){this._currentRequest.end(e,t,r),e&&this._bufferedWrites.push({data:e,encoding:t})},Object.keys(u).forEach(function(e){var r=d[e]=e.substr(0,e.length-1),o=u[e],s=t[r]=Object.create(o);s.request=function(r,o){return"string"==typeof r?(r=i.parse(r),r.maxRedirects=t.maxRedirects):r=Object.assign({maxRedirects:t.maxRedirects,protocol:e},r),a.equal(r.protocol,e,"protocol mismatch"),c("options",r),new n(r,o)},s.get=function(e,t){var r=s.request(e,t);return r.end(),r}})},function(e,t){e.exports=require("url")},function(e,t,r){function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function i(e){function r(){if(r.enabled){var e=r,n=+new Date,i=n-(c||n);e.diff=i,e.prev=c,e.curr=n,c=n;for(var a=new Array(arguments.length),o=0;o>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function u(e){return h(e,17)^h(e,19)^e>>>10}var d=r(7),h=d.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=c,t.g1_256=u},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}var i=r(7),a=r(14),o=r(50),s=r(9),f=i.sum32,c=i.sum32_4,u=i.sum32_5,d=o.ch32,h=o.maj32,l=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=c[l-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[l]=b+c[l-7]+m+c[l-16]}var y=s&u^~s&d,g=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),k=h+_+y+f[l]+c[l],S=w+g;h=d,d=u,u=s,s=o+k|0,o=a,a=i,i=n,n=k+S|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+u|0,r[6]=r[6]+d|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(u),r.HmacSHA256=a._createHmacHelper(u)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,c=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=t()}();var d=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],d=r[6],h=r[7],l=n.high,p=n.low,b=i.high,v=i.low,m=a.high,y=a.low,g=o.high,w=o.low,_=s.high,k=s.low,S=f.high,x=f.low,M=d.high,A=d.low,E=h.high,I=h.low,P=l,T=p,B=b,R=v,C=m,O=y,z=g,N=w,j=_,q=k,H=S,F=x,L=M,U=A,D=E,K=I,V=0;V<80;V++){var W=u[V];if(V<16)var Y=W.high=0|e[t+2*V],X=W.low=0|e[t+2*V+1];else{var Z=u[V-15],G=Z.high,Q=Z.low,J=(G>>>1|Q<<31)^(G>>>8|Q<<24)^G>>>7,$=(Q>>>1|G<<31)^(Q>>>8|G<<24)^(Q>>>7|G<<25),ee=u[V-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[V-7],oe=ae.high,se=ae.low,fe=u[V-16],ce=fe.high,ue=fe.low,X=$+se,Y=J+oe+(X>>>0<$>>>0?1:0),X=X+ie,Y=Y+ne+(X>>>0>>0?1:0),X=X+ue,Y=Y+ce+(X>>>0>>0?1:0);W.high=Y,W.low=X}var de=j&H^~j&L,he=q&F^~q&U,le=P&B^P&C^B&C,pe=T&R^T&O^R&O,be=(P>>>28|T<<4)^(P<<30|T>>>2)^(P<<25|T>>>7),ve=(T>>>28|P<<4)^(T<<30|P>>>2)^(T<<25|P>>>7),me=(j>>>14|q<<18)^(j>>>18|q<<14)^(j<<23|q>>>9),ye=(q>>>14|j<<18)^(q>>>18|j<<14)^(q<<23|j>>>9),ge=c[V],we=ge.high,_e=ge.low,ke=K+ye,Se=D+me+(ke>>>0>>0?1:0),ke=ke+he,Se=Se+de+(ke>>>0>>0?1:0),ke=ke+_e,Se=Se+we+(ke>>>0<_e>>>0?1:0),ke=ke+X,Se=Se+Y+(ke>>>0>>0?1:0),xe=ve+pe,Me=be+le+(xe>>>0>>0?1:0);D=L,K=U,L=H,U=F,H=j,F=q,q=N+ke|0,j=z+Se+(q>>>0>>0?1:0)|0,z=C,N=O,C=B,O=R,B=P,R=T,T=ke+xe|0,P=Se+Me+(T>>>0>>0?1:0)|0}p=n.low=p+T,n.high=l+P+(p>>>0>>0?1:0),v=i.low=v+R,i.high=b+B+(v>>>0>>0?1:0),y=a.low=y+O,a.high=m+C+(y>>>0>>0?1:0),w=o.low=w+N,o.high=g+z+(w>>>0>>0?1:0),k=s.low=k+q,s.high=_+j+(k>>>0>>0?1:0),x=f.low=x+F,f.high=S+H+(x>>>0>>0?1:0),A=d.low=A+U,d.high=M+L+(A>>>0>>0?1:0),I=h.low=I+K,h.high=E+D+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(d),r.HmacSHA512=i._createHmacHelper(d)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(27),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(3),o=r(17);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptWIF=t.encryptWIF=t.decrypt=t.encrypt=t.generateEncryptedWif=t.encryptWifAccount=void 0;var i=r(46),a=n(i),o=r(53),s=r(145),f=n(s),c=r(17),u=r(31),d=n(u),h=r(3),l=r(4),p=t.encryptWifAccount=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),m(e,t).then(function(r){var n=new d.default(e);return n.encryptedWif=r,n.passphrase=t,n})},b=(t.generateEncryptedWif=function(e){console.log("To be deprecated in v3. Please use new Account() and encrypt with Account.encrypt");var t=(0,c.generatePrivateKey)();return p(t,e)},t.encrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;r=y(r);var n=new d.default(e),i=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(n.address))).toString().slice(0,8),s=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(i,"hex"),r).toString("hex"),c=s.slice(0,64),u=s.slice(64),p=(0,h.hexXor)(n.privateKey,c),b=o.AES.encrypt(o.enc.Hex.parse(p),o.enc.Hex.parse(u),{mode:o.mode.ECB,padding:o.pad.NoPadding}),v=l.NEP_HEADER+l.NEP_FLAG+i+b.ciphertext.toString();return a.default.encode(Buffer.from(v,"hex"))}),v=t.decrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;r=y(r);var n=(0,h.ab2hexstring)(a.default.decode(e)),i=n.substr(6,8),s=n.substr(-64),c=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(i,"hex"),r).toString("hex"),u=c.slice(0,64),p=c.slice(64),b={ciphertext:o.enc.Hex.parse(s),salt:""},v=o.AES.decrypt(b,o.enc.Hex.parse(p),{mode:o.mode.ECB,padding:o.pad.NoPadding}),m=(0,h.hexXor)(v.toString(),u),g=new d.default(m);if(i!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(g.address))).toString().slice(0,8))throw new Error("Wrong Password!");return g.WIF},m=t.encryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),Promise.resolve(b(e,t))},y=(t.decryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.decrypt"),Promise.resolve(v(e,t))},function(e){return Object.assign({},l.DEFAULT_SCRYPT,e)})},function(e,t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?Buffer("","utf8"):e instanceof Buffer?e:"string"==typeof e?new Buffer(e,"utf8"):new Buffer(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:c(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function c(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(3),i=r(6),a=r(32),o=r(4),s=r(21),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),c=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var n=t.reduce(function(e,t){var r=Math.round(1e8*t.value);return e[t.assetId]?e[t.assetId]+=r:e[t.assetId]=r,e},{});if(r>0){var a=1e8*r;n[o.ASSET_ID.GAS]?n[o.ASSET_ID.GAS]+=a:n[o.ASSET_ID.GAS]=a}var s=[];return{inputs:Object.keys(n).map(function(t){var r=n[t],a=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(a))throw new Error("This balance does not contain any "+a+"!");var f=e.assets[a];if(1e8*f.balancef.unspent.length)throw new Error("Insufficient "+o.ASSETS[t]+"! Reached end of unspent coins!");u+=Math.round(1e8*f.unspent[c-1].value)}return u>r&&s.push({assetId:t,value:(u-r)/1e8,scriptHash:(0,i.getScriptHashFromAddress)(e.address)}),f.unspent.slice(0,c).map(function(e){return{prevHash:e.txid,prevIndex:e.index}})}).reduce(function(e,t){return e.concat(t)},[]),change:s}},t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var c,u=e.attributes[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var d=c.value;r+=f.serializeTransactionAttribute(d)}}catch(e){o=!0,s=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var h=!0,l=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(h=(b=v.next()).done);h=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){l=!0,p=e}finally{try{!h&&v.return&&v.return()}finally{if(l)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var y=!0,g=!1,w=void 0;try{for(var _,k=e.outputs[Symbol.iterator]();!(y=(_=k.next()).done);y=!0){var S=_.value;r+=f.serializeTransactionOutput(S)}}catch(e){g=!0,w=e}finally{try{!y&&k.return&&k.return()}finally{if(g)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var x=!0,M=!1,A=void 0;try{for(var E,I=e.scripts[Symbol.iterator]();!(x=(E=I.next()).done);x=!0){var P=E.value;r+=f.serializeWitness(P)}}catch(e){M=!0,A=e}finally{try{!x&&I.return&&I.return()}finally{if(M)throw A}}}return r});t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;ar?(r=c.height,n=[c]):c.height===r&&n.push(c)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})},t.getBalance=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_balance/"+t).then(function(t){var r=new a.Balance({address:t.data.address,net:e});return t.data.balance.map(function(e){r.addAsset(e.asset,{balance:e.amount,unspent:s(e.unspent)}),r[e.asset]={balance:e.amount,unspent:s(e.unspent)}}),r})},t.getClaims=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_claimable/"+t).then(function(t){var r=f(t.data.claimable);return{net:e,address:t.data.address,claims:r}})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),f=function(e){return e.map(function(e){return{start:e.start_height,end:e.ed_height,index:e.n,claim:Math.round(1e8*e.unclaimed),txid:e.txid,value:e.value}})}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(64),a=n(i),o=r(15),s=n(o),f=r(4),c=n(f),u=r(33),d=n(u),h=r(13),l=n(h),p=r(6),b=n(p),v=r(3),m=n(v),y=[d.default,l.default,b.default,a.default,s.default],g=y.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:c,u:m});t.default=g,t.api=a,t.rpc=s,t.sc=d,t.tx=l,t.wallet=b,t.u=m,t.CONST=c},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(65);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(22),o=n(a),s=r(161),f=n(s),c=r(162),u=n(c),d=r(62),h=n(d);t.default={get:{price:f.getPrice,balance:o.getBalance,claims:o.getClaims,transactionHistory:o.getTransactionHistory,tokenBalance:u.getTokenBalance,tokenInfo:u.getTokenInfo,token:u.getToken},do:{sendAsset:o.doSendAsset,claimAllGas:o.doClaimAllGas,mintTokens:o.doMintTokens}},t.neonDB=o,t.cmc=f,t.nep5=u,t.neoscan=h},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.doInvoke=t.claimGas=t.sendAsset=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.getClaimsFrom=t.getBalanceFrom=void 0;var i=r(22),a=n(i),o=r(62),s=n(o),f=r(6),c=r(4),u=r(15),d=r(13),h=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=0;i>16)&n,t=18e3*(65535&t)+(t>>16)&n;var i=(r<<16)+t&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(r||e.random()));r=987654071*a(),n.push(4294967296*a()|0)}return new o.init(n,t)}}),s=n.enc={},f=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,f=i/s;f=t?e.ceil(f):e.max((0|f)-this._minBufferSize,0);var c=f*a,u=e.min(4*c,i);if(c){for(var d=0;d>>2];e.sigBytes-=t}},m=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:v}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=r.format={},g=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},w=n.SerializableCipher=i.extend({cfg:i.extend({format:g}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=r.kdf={},k=_.OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},S=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:k}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=w.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,w.decrypt.call(this,e,t,i.key,n)}})}()})},function(e,t,r){"use strict";function n(e){return"[object Array]"===x.call(e)}function i(e){return"[object ArrayBuffer]"===x.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function o(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function s(e){return"string"==typeof e}function f(e){return"number"==typeof e}function c(e){return void 0===e}function u(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===x.call(e)}function h(e){return"[object File]"===x.call(e)}function l(e){return"[object Blob]"===x.call(e)}function p(e){return"[object Function]"===x.call(e)}function b(e){return u(e)&&p(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function m(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function y(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function g(e,t){if(null!==e&&void 0!==e)if("object"==typeof e||n(e)||(e=[e]),n(e))for(var r=0,i=e.length;r1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new Error("num must be numeric");if(e<0)throw new RangeError("num is unsigned (>= 0)");if(!Number.isSafeInteger(e))throw new RangeError("num ("+e+") must be a safe integer");var n=e.toString(16);return n=n.length%t==0?n:("0".repeat(t)+n).substring(n.length),r&&(n=h(n)),n}),h=(t.num2fixed8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;if("number"!=typeof e)throw new Error("num must be numeric");return d(Math.round(e*Math.pow(10,8)),t,!0)},t.fixed82num=function(e){if("string"!=typeof e)throw new Error("fixed8hex must be a string");if(e.length%2!=0)throw new Error("fixed8hex must be hex");return""===e?0:parseInt(h(e),16)/Math.pow(10,8)},t.num2VarInt=function(e){return e<253?d(e):e<=65535?"fd"+d(e,4,!0):e<=4294967295?"fe"+d(e,8,!0):"ff"+d(e,16,!0)},t.hexXor=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new Error("hexXor expects hex strings");if(e.length!==t.length)throw new Error("strings are disparate lengths");if(e.length%2!=0)throw new Error("strings must be hex");for(var r=[],n=0;n=0;r-=2)t+=e.substr(r,2);return t});t.StringStream=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";n(this,e),this.str=t,this.pter=0}return i(e,[{key:"isEmpty",value:function(){return this.pter>=this.str.length}},{key:"read",value:function(e){if(this.isEmpty())throw new Error;var t=this.str.substr(this.pter,2*e);return this.pter+=2*e,t}},{key:"readVarBytes",value:function(){return this.read(this.readVarInt())}},{key:"readVarInt",value:function(){var e=parseInt(this.read(1),16);return 253===e?e=parseInt(h(this.read(2)),16):254===e?e=parseInt(h(this.read(4)),16):255===e&&(e=parseInt(h(this.read(8)),16)),e}}]),e}(),t.hash160=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.RIPEMD160)(r).toString()},t.hash256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e),r=(0,o.SHA256)(t);return(0,o.SHA256)(r).toString()},t.sha256=function(e){if("string"!=typeof e)throw new Error("reverseHex expects a string");if(e.length%2!=0)throw new Error("Incorrect Length: "+e);var t=o.enc.Hex.parse(e);return(0,o.SHA256)(t).toString()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ADDR_VERSION="17",t.ASSETS={NEO:"NEO",c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b:"NEO",GAS:"GAS","602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7":"GAS"},t.ASSET_ID={NEO:"c56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",GAS:"602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7"},t.CONTRACTS={RPX:"ecc6b20d3ccac1ee9ef109af5a7cdb85706b1df9",TEST_RPX:"5b7074e873973a6ed3708862f219a6fbf4d1c411",TEST_LWTF:"d7678dd97c000be3f33e9362e673101bac4ca654"},t.DEFAULT_RPC={MAIN:"http://seed1.neo.org:10332",TEST:"http://seed1.neo.org:20332"},t.DEFAULT_REQ={jsonrpc:"2.0",method:"getblockcount",params:[],id:1234},t.DEFAULT_SCRYPT={cost:16384,blockSize:8,parallel:8,size:64},t.DEFAULT_WALLET={name:"myWallet",version:"1.0",scrypt:{},accounts:[],extra:null},t.NEO_NETWORK={MAIN:"MainNet",TEST:"TestNet"},t.NEP_HEADER="0142",t.NEP_FLAG="e0",t.RPC_VERSION="2.3.2",t.TX_VERSION={CLAIM:0,CONTRACT:0,INVOCATION:1}},function(e,t,r){"use strict";var n=t;n.version=r(98).version,n.utils=r(99),n.rand=r(100),n.curve=r(18),n.curves=r(106),n.ec=r(114),n.eddsa=r(118)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.Balance=t.Account=void 0;var a=r(17);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(56);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(57);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var f=i(a),c=i(o),u=i(s),d=r(31),h=n(d),l=r(153),p=n(l),b=r(160),v=n(b);t.default={create:{account:function(e){return new h.default(e)},privateKey:f.generatePrivateKey,signature:f.generateSignature,wallet:function(e){return new v.default(e)}},is:{address:c.isAddress,publicKey:c.isPublicKey,encryptedKey:c.isNEP2,privateKey:c.isPrivateKey,wif:c.isWIF},encrypt:{privateKey:u.encrypt},decrypt:{privateKey:u.decrypt},get:{privateKeyFromWIF:f.getPrivateKeyFromWIF,WIFFromPrivateKey:f.getWIFFromPrivateKey,publicKeyFromPrivateKey:f.getPublicKeyFromPrivateKey,scriptHashFromPublicKey:f.getScriptHashFromPublicKey,addressFromScriptHash:f.getAddressFromScriptHash,scriptHashFromAddress:f.getScriptHashFromAddress}},t.Account=h.default,t.Balance=p.default,t.Wallet=v.default},function(e,t,r){"use strict";function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for(e=e.replace(/[^a-z0-9]+/gi,""),e.length%2!=0&&(e="0"+e),n=0;n>8,o=255&i;a?r.push(a,o):r.push(o)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e,t){for(var r="",n=0;n>>0}return a}function u(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r}function d(e,t){return e>>>t|e<<32-t}function h(e,t){return e<>>32-t}function l(e,t){return e+t>>>0}function p(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function m(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o>>0,e[t+1]=o}function y(e,t,r,n){return(t+n>>>0>>0}function g(e,t,r,n){return t+n>>>0}function w(e,t,r,n,i,a,o,s){var f=0,c=t;return c=c+n>>>0,f+=c>>0,f+=c>>0,f+=c>>0}function _(e,t,r,n,i,a,o,s){return t+n+a+s>>>0}function k(e,t,r,n,i,a,o,s,f,c){var u=0,d=t;return d=d+n>>>0,u+=d>>0,u+=d>>0,u+=d>>0,u+=d>>0}function S(e,t,r,n,i,a,o,s,f,c){return t+n+a+s+c>>>0}function x(e,t,r){return(t<<32-r|e>>>r)>>>0}function M(e,t,r){return(e<<32-r|t>>>r)>>>0}function A(e,t,r){return e>>>r}function E(e,t,r){return(e<<32-r|t>>>r)>>>0}var I=r(9),P=r(19);t.inherits=P,t.toArray=n,t.toHex=i,t.htonl=a,t.toHex32=o,t.zero2=s,t.zero8=f,t.join32=c,t.split32=u,t.rotr32=d,t.rotl32=h,t.sum32=l,t.sum32_3=p,t.sum32_4=b,t.sum32_5=v,t.sum64=m,t.sum64_hi=y,t.sum64_lo=g,t.sum64_4_hi=w,t.sum64_4_lo=_,t.sum64_5_hi=k,t.sum64_5_lo=S,t.rotr64_hi=x,t.rotr64_lo=M,t.shr64_hi=A,t.shr64_lo=E},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}function o(e,t,r){for(var n=0,i=Math.min(e.length,r),a=t;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}function f(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}function c(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,f=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,d=67108863&f,h=Math.min(c,t.length-1),l=Math.max(0,c-e.length+1);l<=h;l++){var p=c-l|0;i=0|e.words[p],a=0|t.words[l],o=i*a+d,u+=o/67108864|0,d=67108863&o}r.words[c]=0|d,f=0|u}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}function u(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0,i+=o>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}function d(e,t,r){return(new h).mulp(e,t,r)}function h(e,t){this.x=e,this.y=t}function l(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function g(e){y.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var w;try{w=r(47).Buffer}catch(e){}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var i=0;"-"===e[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=o(e,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==t&&(i=o(e,t,r+6),this.words[n]|=i<>>26-a&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],k=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(e,t){e=e||10,t=0|t||1;var r;if(16===e||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215,r=0!==a||o!==this.length-1?_[6-f.length]+f+r:f+r,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=k[e],u=S[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modn(u).toString(e);d=d.idivn(u),r=d.isZero()?h+r:_[c-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==w),this.toArrayLike(w,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,f="le"===t,c=new e(a),u=this.clone();if(f){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=e):(n=e,i=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,l=0|o[1],p=8191&l,b=l>>>13,v=0|o[2],m=8191&v,y=v>>>13,g=0|o[3],w=8191&g,_=g>>>13,k=0|o[4],S=8191&k,x=k>>>13,M=0|o[5],A=8191&M,E=M>>>13,I=0|o[6],P=8191&I,T=I>>>13,B=0|o[7],R=8191&B,C=B>>>13,O=0|o[8],z=8191&O,N=O>>>13,j=0|o[9],q=8191&j,H=j>>>13,F=0|s[0],L=8191&F,U=F>>>13,D=0|s[1],K=8191&D,V=D>>>13,W=0|s[2],Y=8191&W,X=W>>>13,Z=0|s[3],G=8191&Z,Q=Z>>>13,J=0|s[4],$=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],fe=8191&se,ce=se>>>13,ue=0|s[8],de=8191&ue,he=ue>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19,n=Math.imul(d,L),i=Math.imul(d,U),i=i+Math.imul(h,L)|0,a=Math.imul(h,U);var ve=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,L),i=Math.imul(p,U),i=i+Math.imul(b,L)|0,a=Math.imul(b,U),n=n+Math.imul(d,K)|0,i=i+Math.imul(d,V)|0,i=i+Math.imul(h,K)|0,a=a+Math.imul(h,V)|0;var me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,L),i=Math.imul(m,U),i=i+Math.imul(y,L)|0,a=Math.imul(y,U),n=n+Math.imul(p,K)|0,i=i+Math.imul(p,V)|0,i=i+Math.imul(b,K)|0,a=a+Math.imul(b,V)|0,n=n+Math.imul(d,Y)|0,i=i+Math.imul(d,X)|0,i=i+Math.imul(h,Y)|0,a=a+Math.imul(h,X)|0;var ye=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,L),i=Math.imul(w,U),i=i+Math.imul(_,L)|0,a=Math.imul(_,U),n=n+Math.imul(m,K)|0,i=i+Math.imul(m,V)|0,i=i+Math.imul(y,K)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(p,Y)|0,i=i+Math.imul(p,X)|0,i=i+Math.imul(b,Y)|0,a=a+Math.imul(b,X)|0,n=n+Math.imul(d,G)|0,i=i+Math.imul(d,Q)|0,i=i+Math.imul(h,G)|0,a=a+Math.imul(h,Q)|0;var ge=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(S,L),i=Math.imul(S,U),i=i+Math.imul(x,L)|0,a=Math.imul(x,U),n=n+Math.imul(w,K)|0,i=i+Math.imul(w,V)|0,i=i+Math.imul(_,K)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(m,Y)|0,i=i+Math.imul(m,X)|0,i=i+Math.imul(y,Y)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,Q)|0,i=i+Math.imul(b,G)|0,a=a+Math.imul(b,Q)|0,n=n+Math.imul(d,$)|0,i=i+Math.imul(d,ee)|0,i=i+Math.imul(h,$)|0,a=a+Math.imul(h,ee)|0;var we=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,L),i=Math.imul(A,U),i=i+Math.imul(E,L)|0,a=Math.imul(E,U),n=n+Math.imul(S,K)|0,i=i+Math.imul(S,V)|0,i=i+Math.imul(x,K)|0,a=a+Math.imul(x,V)|0,n=n+Math.imul(w,Y)|0,i=i+Math.imul(w,X)|0,i=i+Math.imul(_,Y)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,G)|0,i=i+Math.imul(m,Q)|0,i=i+Math.imul(y,G)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,i=i+Math.imul(b,$)|0,a=a+Math.imul(b,ee)|0,n=n+Math.imul(d,re)|0,i=i+Math.imul(d,ne)|0,i=i+Math.imul(h,re)|0,a=a+Math.imul(h,ne)|0;var _e=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,L),i=Math.imul(P,U),i=i+Math.imul(T,L)|0,a=Math.imul(T,U),n=n+Math.imul(A,K)|0,i=i+Math.imul(A,V)|0,i=i+Math.imul(E,K)|0,a=a+Math.imul(E,V)|0,n=n+Math.imul(S,Y)|0,i=i+Math.imul(S,X)|0,i=i+Math.imul(x,Y)|0,a=a+Math.imul(x,X)|0,n=n+Math.imul(w,G)|0,i=i+Math.imul(w,Q)|0,i=i+Math.imul(_,G)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0,i=i+Math.imul(y,$)|0,a=a+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0,i=i+Math.imul(b,re)|0,a=a+Math.imul(b,ne)|0,n=n+Math.imul(d,ae)|0,i=i+Math.imul(d,oe)|0,i=i+Math.imul(h,ae)|0,a=a+Math.imul(h,oe)|0;var ke=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,L),i=Math.imul(R,U),i=i+Math.imul(C,L)|0,a=Math.imul(C,U),n=n+Math.imul(P,K)|0,i=i+Math.imul(P,V)|0,i=i+Math.imul(T,K)|0,a=a+Math.imul(T,V)|0,n=n+Math.imul(A,Y)|0,i=i+Math.imul(A,X)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(S,G)|0,i=i+Math.imul(S,Q)|0,i=i+Math.imul(x,G)|0,a=a+Math.imul(x,Q)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,i=i+Math.imul(_,$)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,i=i+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,oe)|0,i=i+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0,n=n+Math.imul(d,fe)|0,i=i+Math.imul(d,ce)|0,i=i+Math.imul(h,fe)|0,a=a+Math.imul(h,ce)|0;var Se=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(z,L),i=Math.imul(z,U),i=i+Math.imul(N,L)|0,a=Math.imul(N,U),n=n+Math.imul(R,K)|0,i=i+Math.imul(R,V)|0,i=i+Math.imul(C,K)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(P,Y)|0,i=i+Math.imul(P,X)|0,i=i+Math.imul(T,Y)|0,a=a+Math.imul(T,X)|0,n=n+Math.imul(A,G)|0,i=i+Math.imul(A,Q)|0,i=i+Math.imul(E,G)|0,a=a+Math.imul(E,Q)|0,n=n+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,i=i+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,i=i+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=i+Math.imul(m,oe)|0,i=i+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(p,fe)|0,i=i+Math.imul(p,ce)|0,i=i+Math.imul(b,fe)|0,a=a+Math.imul(b,ce)|0,n=n+Math.imul(d,de)|0,i=i+Math.imul(d,he)|0,i=i+Math.imul(h,de)|0,a=a+Math.imul(h,he)|0;var xe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(q,L),i=Math.imul(q,U),i=i+Math.imul(H,L)|0,a=Math.imul(H,U),n=n+Math.imul(z,K)|0,i=i+Math.imul(z,V)|0,i=i+Math.imul(N,K)|0,a=a+Math.imul(N,V)|0,n=n+Math.imul(R,Y)|0,i=i+Math.imul(R,X)|0,i=i+Math.imul(C,Y)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(P,G)|0,i=i+Math.imul(P,Q)|0,i=i+Math.imul(T,G)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,i=i+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,i=i+Math.imul(x,re)|0,a=a+Math.imul(x,ne)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,oe)|0,i=i+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,fe)|0,i=i+Math.imul(m,ce)|0,i=i+Math.imul(y,fe)|0,a=a+Math.imul(y,ce)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,he)|0,i=i+Math.imul(b,de)|0,a=a+Math.imul(b,he)|0,n=n+Math.imul(d,pe)|0,i=i+Math.imul(d,be)|0,i=i+Math.imul(h,pe)|0,a=a+Math.imul(h,be)|0;var Me=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(q,K),i=Math.imul(q,V),i=i+Math.imul(H,K)|0,a=Math.imul(H,V),n=n+Math.imul(z,Y)|0,i=i+Math.imul(z,X)|0,i=i+Math.imul(N,Y)|0,a=a+Math.imul(N,X)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(R,Q)|0,i=i+Math.imul(C,G)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,i=i+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,i=i+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(S,ae)|0,i=i+Math.imul(S,oe)|0,i=i+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,n=n+Math.imul(w,fe)|0,i=i+Math.imul(w,ce)|0,i=i+Math.imul(_,fe)|0,a=a+Math.imul(_,ce)|0,n=n+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0,i=i+Math.imul(y,de)|0,a=a+Math.imul(y,he)|0,n=n+Math.imul(p,pe)|0,i=i+Math.imul(p,be)|0,i=i+Math.imul(b,pe)|0,a=a+Math.imul(b,be)|0;var Ae=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,Y),i=Math.imul(q,X),i=i+Math.imul(H,Y)|0,a=Math.imul(H,X),n=n+Math.imul(z,G)|0,i=i+Math.imul(z,Q)|0,i=i+Math.imul(N,G)|0,a=a+Math.imul(N,Q)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,i=i+Math.imul(C,$)|0,a=a+Math.imul(C,ee)|0,n=n+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,i=i+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(A,ae)|0,i=i+Math.imul(A,oe)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(S,fe)|0,i=i+Math.imul(S,ce)|0,i=i+Math.imul(x,fe)|0,a=a+Math.imul(x,ce)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,he)|0,i=i+Math.imul(_,de)|0,a=a+Math.imul(_,he)|0,n=n+Math.imul(m,pe)|0,i=i+Math.imul(m,be)|0,i=i+Math.imul(y,pe)|0,a=a+Math.imul(y,be)|0;var Ee=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(q,G),i=Math.imul(q,Q),i=i+Math.imul(H,G)|0,a=Math.imul(H,Q),n=n+Math.imul(z,$)|0,i=i+Math.imul(z,ee)|0,i=i+Math.imul(N,$)|0,a=a+Math.imul(N,ee)|0,n=n+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,i=i+Math.imul(C,re)|0,a=a+Math.imul(C,ne)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,oe)|0,i=i+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(A,fe)|0,i=i+Math.imul(A,ce)|0,i=i+Math.imul(E,fe)|0,a=a+Math.imul(E,ce)|0,n=n+Math.imul(S,de)|0,i=i+Math.imul(S,he)|0,i=i+Math.imul(x,de)|0,a=a+Math.imul(x,he)|0,n=n+Math.imul(w,pe)|0,i=i+Math.imul(w,be)|0,i=i+Math.imul(_,pe)|0,a=a+Math.imul(_,be)|0;var Ie=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,$),i=Math.imul(q,ee),i=i+Math.imul(H,$)|0,a=Math.imul(H,ee),n=n+Math.imul(z,re)|0,i=i+Math.imul(z,ne)|0,i=i+Math.imul(N,re)|0,a=a+Math.imul(N,ne)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,oe)|0,i=i+Math.imul(C,ae)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(P,fe)|0,i=i+Math.imul(P,ce)|0,i=i+Math.imul(T,fe)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(A,de)|0,i=i+Math.imul(A,he)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(E,he)|0,n=n+Math.imul(S,pe)|0,i=i+Math.imul(S,be)|0,i=i+Math.imul(x,pe)|0,a=a+Math.imul(x,be)|0;var Pe=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(q,re),i=Math.imul(q,ne),i=i+Math.imul(H,re)|0,a=Math.imul(H,ne),n=n+Math.imul(z,ae)|0,i=i+Math.imul(z,oe)|0,i=i+Math.imul(N,ae)|0,a=a+Math.imul(N,oe)|0,n=n+Math.imul(R,fe)|0,i=i+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,a=a+Math.imul(C,ce)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,he)|0,i=i+Math.imul(T,de)|0,a=a+Math.imul(T,he)|0,n=n+Math.imul(A,pe)|0,i=i+Math.imul(A,be)|0,i=i+Math.imul(E,pe)|0,a=a+Math.imul(E,be)|0;var Te=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,ae),i=Math.imul(q,oe),i=i+Math.imul(H,ae)|0,a=Math.imul(H,oe),n=n+Math.imul(z,fe)|0,i=i+Math.imul(z,ce)|0,i=i+Math.imul(N,fe)|0,a=a+Math.imul(N,ce)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,he)|0,i=i+Math.imul(C,de)|0,a=a+Math.imul(C,he)|0,n=n+Math.imul(P,pe)|0,i=i+Math.imul(P,be)|0,i=i+Math.imul(T,pe)|0,a=a+Math.imul(T,be)|0;var Be=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,fe),i=Math.imul(q,ce),i=i+Math.imul(H,fe)|0,a=Math.imul(H,ce),n=n+Math.imul(z,de)|0,i=i+Math.imul(z,he)|0,i=i+Math.imul(N,de)|0,a=a+Math.imul(N,he)|0,n=n+Math.imul(R,pe)|0,i=i+Math.imul(R,be)|0,i=i+Math.imul(C,pe)|0,a=a+Math.imul(C,be)|0;var Re=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(q,de),i=Math.imul(q,he),i=i+Math.imul(H,de)|0,a=Math.imul(H,he),n=n+Math.imul(z,pe)|0,i=i+Math.imul(z,be)|0,i=i+Math.imul(N,pe)|0,a=a+Math.imul(N,be)|0;var Ce=(c+n|0)+((8191&i)<<13)|0;c=(a+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,pe),i=Math.imul(q,be),i=i+Math.imul(H,pe)|0,a=Math.imul(H,be);var Oe=(c+n|0)+((8191&i)<<13)|0;return c=(a+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,f[0]=ve,f[1]=me,f[2]=ye,f[3]=ge,f[4]=we,f[5]=_e,f[6]=ke,f[7]=Se,f[8]=xe,f[9]=Me,f[10]=Ae,f[11]=Ee,f[12]=Ie,f[13]=Pe,f[14]=Te,f[15]=Be,f[16]=Re,f[17]=Ce,f[18]=Oe,0!==c&&(f[19]=c,r.length++),r};Math.imul||(x=c),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?c(this,e,t):r<1024?u(this,e,t):d(this,e,t)},h.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},h.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=f(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0);var i;i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var d=0|this.words[c];this.words[c]=u<<26-a|d>>>a,u=d&s}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=this.length-e.length,n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==t){s=new a(null),s.length=f+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){if(n(!e.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),f=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(u),f.isub(d)),s.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(f)):(r.isub(t),s.isub(i),f.isub(o))}return{a:s,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,d=1;0==(r.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(o)):(r.isub(t),o.isub(i))}var h;return h=0===t.cmpn(1)?i:o,h.cmpn(0)<0&&h.iadd(e),h},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t=e<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;this.strip();var r;if(this.length>1)r=1;else{t&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];r=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new y(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};l.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},l.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},l.prototype.split=function(e,t){e.iushrn(this.n,0,t)},l.prototype.imulK=function(e){return e.imul(this.k)},i(p,l),p.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},p.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new p;else if("p224"===e)t=new b;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new m}return M[e]=t,t},y.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},y.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},y.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},y.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},y.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},y.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},y.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},y.prototype.isqr=function(e){return this.imul(e,e.clone())},y.prototype.sqr=function(e){return this.mul(e,e)},y.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),f=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=o;0!==l.cmp(s);){for(var b=l,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var c=t.words[n],u=f-1;u>=0;u--){var d=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},y.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},y.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new g(e)},i(g,y),g.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},g.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},g.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},g.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},g.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(t,r(48)(e))},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(29),r(30))}(0,function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),o=a.words,s=r.keySize,f=r.iterations;o.length>>6-o%4*2;n[a>>>2]|=(s|f)<<24-a%4*8,a++}return i.create(n,a)}var r=e,n=r.lib,i=n.WordArray,a=r.enc;a.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,f=t[a+2>>>2]>>>24-(a+2)%4*8&255,c=o<<16|s<<8|f,u=0;u<4&&a+.75*u>>6*(3-u)&63));var d=n.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(e){var r=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>32-a)+t}function n(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<>>32-a)+t}function i(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<>>32-a)+t}function a(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<>>32-a)+t}var o=e,s=o.lib,f=s.WordArray,c=s.Hasher,u=o.algo,d=[];!function(){for(var e=0;e<64;e++)d[e]=4294967296*t.abs(t.sin(e+1))|0}();var h=u.MD5=c.extend({_doReset:function(){this._hash=new f.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var o=0;o<16;o++){var s=t+o,f=e[s];e[s]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var c=this._hash.words,u=e[t+0],h=e[t+1],l=e[t+2],p=e[t+3],b=e[t+4],v=e[t+5],m=e[t+6],y=e[t+7],g=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],S=e[t+12],x=e[t+13],M=e[t+14],A=e[t+15],E=c[0],I=c[1],P=c[2],T=c[3];E=r(E,I,P,T,u,7,d[0]),T=r(T,E,I,P,h,12,d[1]),P=r(P,T,E,I,l,17,d[2]),I=r(I,P,T,E,p,22,d[3]),E=r(E,I,P,T,b,7,d[4]),T=r(T,E,I,P,v,12,d[5]),P=r(P,T,E,I,m,17,d[6]),I=r(I,P,T,E,y,22,d[7]),E=r(E,I,P,T,g,7,d[8]),T=r(T,E,I,P,w,12,d[9]),P=r(P,T,E,I,_,17,d[10]),I=r(I,P,T,E,k,22,d[11]),E=r(E,I,P,T,S,7,d[12]),T=r(T,E,I,P,x,12,d[13]),P=r(P,T,E,I,M,17,d[14]),I=r(I,P,T,E,A,22,d[15]),E=n(E,I,P,T,h,5,d[16]),T=n(T,E,I,P,m,9,d[17]),P=n(P,T,E,I,k,14,d[18]),I=n(I,P,T,E,u,20,d[19]),E=n(E,I,P,T,v,5,d[20]),T=n(T,E,I,P,_,9,d[21]),P=n(P,T,E,I,A,14,d[22]),I=n(I,P,T,E,b,20,d[23]),E=n(E,I,P,T,w,5,d[24]),T=n(T,E,I,P,M,9,d[25]),P=n(P,T,E,I,p,14,d[26]),I=n(I,P,T,E,g,20,d[27]),E=n(E,I,P,T,x,5,d[28]),T=n(T,E,I,P,l,9,d[29]),P=n(P,T,E,I,y,14,d[30]),I=n(I,P,T,E,S,20,d[31]),E=i(E,I,P,T,v,4,d[32]),T=i(T,E,I,P,g,11,d[33]),P=i(P,T,E,I,k,16,d[34]),I=i(I,P,T,E,M,23,d[35]),E=i(E,I,P,T,h,4,d[36]),T=i(T,E,I,P,b,11,d[37]),P=i(P,T,E,I,y,16,d[38]),I=i(I,P,T,E,_,23,d[39]),E=i(E,I,P,T,x,4,d[40]),T=i(T,E,I,P,u,11,d[41]),P=i(P,T,E,I,p,16,d[42]),I=i(I,P,T,E,m,23,d[43]),E=i(E,I,P,T,w,4,d[44]),T=i(T,E,I,P,S,11,d[45]),P=i(P,T,E,I,A,16,d[46]),I=i(I,P,T,E,l,23,d[47]),E=a(E,I,P,T,u,6,d[48]),T=a(T,E,I,P,y,10,d[49]),P=a(P,T,E,I,M,15,d[50]),I=a(I,P,T,E,v,21,d[51]),E=a(E,I,P,T,S,6,d[52]),T=a(T,E,I,P,p,10,d[53]),P=a(P,T,E,I,_,15,d[54]),I=a(I,P,T,E,h,21,d[55]),E=a(E,I,P,T,g,6,d[56]),T=a(T,E,I,P,A,10,d[57]),P=a(P,T,E,I,m,15,d[58]),I=a(I,P,T,E,x,21,d[59]),E=a(E,I,P,T,b,6,d[60]),T=a(T,E,I,P,k,10,d[61]),P=a(P,T,E,I,l,15,d[62]),I=a(I,P,T,E,w,21,d[63]),c[0]=c[0]+E|0,c[1]=c[1]+I|0,c[2]=c[2]+P|0,c[3]=c[3]+T|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,f=s.words,c=0;c<4;c++){var u=f[c];f[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}});o.MD5=c._createHelper(h),o.HmacMD5=c._createHmacHelper(h)}(Math),e.MD5})},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;var i=r(59);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(21);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var o=r(32);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=r(154),f=function(e){return e&&e.__esModule?e:{default:e}}(s),c=n(i),u=n(a),d=n(o),h={tx:function(){for(var e=arguments.length,t=Array(e),r=0;r=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a1&&void 0!==arguments[1])||arguments[1],r=new o.ec("p256"),n=r.keyFromPrivate(e,"hex"),i=n.getPublic().encode("hex");if(t){return parseInt(i.substr(128,2),16)%2==1?"03"+i.substr(2,64):"02"+i.substr(2,64)}return i},t.getVerificationScriptFromPublicKey=function(e){return"21"+e+"ac"});t.getScriptHashFromPublicKey=function(e){"04"===e.substring(0,2)&&(e=p(e));var t=b(e);return(0,c.reverseHex)((0,c.hash160)(t))},t.getAddressFromScriptHash=function(e){e=(0,c.reverseHex)(e);var t=(0,c.hash256)(u.ADDR_VERSION+e).substr(0,8);return f.default.encode(Buffer.from(u.ADDR_VERSION+e+t,"hex"))},t.getScriptHashFromAddress=function(e){var t=(0,c.ab2hexstring)(f.default.decode(e));return(0,c.reverseHex)(t.substr(2,40))},t.generateSignature=function(e,t){var r=(0,c.sha256)(e),n=Buffer.from(r,"hex"),i=new o.ec("p256"),a=i.sign(n,t,null);return Buffer.concat([a.r.toArrayLike(Buffer,"be",32),a.s.toArrayLike(Buffer,"be",32)]).toString("hex")},t.generatePrivateKey=function(){return(0,c.ab2hexstring)((0,h.default)(32))},t.generateRandomArray=function(e){return(0,h.default)(e)}},function(e,t,r){"use strict";var n=t;n.base=r(101),n.short=r(102),n.mont=r(104),n.edwards=r(105)},function(e,t,r){try{var n=r(43);if("function"!=typeof n.inherits)throw"";e.exports=n.inherits}catch(t){e.exports=r(103)}},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=r.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n65535)throw new Error;var t=(0,n.num2hexstring)(e.usage);return 129===e.usage?t+=(0,n.num2hexstring)(e.data.length/2):(144===e.usage||e.usage>=240)&&(t+=(0,n.num2VarInt)(e.data.length/2)),2===e.usage||3===e.usage?t+=e.data.substr(2,64):t+=e.data,t},t.deserializeTransactionAttribute=function(e){var t={usage:parseInt(e.read(1),16)};if(0===t.usage||48===t.usage||t.usage>=161&&t.usage<=175)t.data=e.read(32);else if(2===t.usage||3===t.usage)t.data=(0,n.num2hexstring)(t.usage)+e.read(32);else if(32===t.usage)t.data=e.read(20);else if(129===t.usage)t.data=e.read(parseInt(e.read(1),16));else{if(!(144===t.usage||t.usage>=240))throw new Error;t.data=e.readVarBytes()}return t},t.serializeWitness=function(e){var t=(0,n.num2VarInt)(e.invocationScript.length/2),r=(0,n.num2VarInt)(e.verificationScript.length/2);return t+e.invocationScript+r+e.verificationScript},t.deserializeWitness=function(e){return{invocationScript:e.readVarBytes(),verificationScript:e.readVarBytes()}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doSendAsset=t.doMintTokens=t.doClaimAllGas=t.getWalletDBHeight=t.getTransactionHistory=t.getRPCEndpoint=t.getClaims=t.getBalance=t.getAPIEndpoint=void 0;var n=r(16),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(6),o=r(13),s=r(15),f=r(4),c=t.getAPIEndpoint=function(e){switch(e){case"MainNet":return"http://api.wallet.cityofzion.io";case"TestNet":return"http://testnet-api.wallet.cityofzion.io";default:return e}},u=t.getBalance=function(e,t){var r=c(e);return i.default.get(r+"/v2/address/balance/"+t).then(function(t){var r=new a.Balance({net:e,address:t.data.address});return Object.keys(t.data).map(function(e){"net"!==e&&"address"!==e&&r.addAsset(e,t.data[e])}),Object.assign(r,t.data),r})},d=t.getClaims=function(e,t){var r=c(e);return i.default.get(r+"/v2/address/claims/"+t).then(function(e){return e.data})},h=t.getRPCEndpoint=function(e){var t=c(e);return i.default.get(t+"/v2/network/best_node").then(function(e){return e.data.node})};t.getTransactionHistory=function(e,t){var r=c(e);return i.default.get(r+"/v2/address/history/"+t).then(function(e){return e.data.history})},t.getWalletDBHeight=function(e){var t=c(e);return i.default.get(t+"/v2/block/height").then(function(e){return parseInt(e.data.block_height)})},t.doClaimAllGas=function(e,t,r){var n=new a.Account(t),i=h(e),f=d(e,n.address),c=void 0,u=void 0;return Promise.all([i,f]).then(function(e){u=e[0];var t=e[1];if(0===t.length)throw new Error("No claimable gas!");var i=o.Transaction.createClaimTx(n.publicKey,t);return r?r(i,n.publicKey):i.sign(n.privateKey)}).then(function(e){return c=e,s.Query.sendRawTransaction(c).execute(u)}).then(function(e){return!0===e.result&&(e.txid=c),e})},t.doMintTokens=function(e,t,r,n,i,c){var d=new a.Account(r),l=[{assetId:f.ASSET_ID.NEO,value:n,scriptHash:t}],p={operation:"mintTokens",scriptHash:t},b=h(e),v=u(e,d.address),m=void 0,y=void 0;return Promise.all([b,v]).then(function(e){y=e[0];var t=e[1],r=o.Transaction.createInvocationTx(t,l,p,i,{version:1});if(c)return c(r,d.publicKey);r.sign(d.privateKey)}).then(function(e){return m=e,s.Query.sendRawTransaction(m).execute(y)}).then(function(e){return!0===e.result&&(e.txid=m.hash),e})},t.doSendAsset=function(e,t,r,n,i){var c=new a.Account(r),d=new a.Account(t),l=h(e),p=u(e,c.address),b=Object.keys(n).map(function(e){return{assetId:f.ASSET_ID[e],value:n[e],scriptHash:d.scriptHash}}),v=void 0,m=void 0;return Promise.all([l,p]).then(function(e){m=e[0];var t=e[1],r=o.Transaction.createContractTx(t,b);return i?i(r,c.publicKey):r.sign(c.privateKey)}).then(function(e){return v=e,s.Query.sendRawTransaction(v).execute(m)}).then(function(e){return!0===e.result&&(e.txid=v.hash),e})}},function(e,t,r){"use strict";function n(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var i=r(2),a=r(69),o={"Content-Type":"application/x-www-form-urlencoded"},s={adapter:function(){var e;return"undefined"!=typeof XMLHttpRequest?e=r(70):"undefined"!=typeof process&&(e=r(75)),e}(),transformRequest:[function(e,t){return a(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(n(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(n(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){s.headers[e]={}}),i.forEach(["post","put","patch"],function(e){s.headers[e]=i.merge(o)}),e.exports=s},function(e,t,r){"use strict";var n=r(36);e.exports=function(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("crypto")},function(e,t,r){var n=r(96);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){var n=t;n.utils=r(7),n.common=r(14),n.sha=r(107),n.ripemd=r(111),n.hmac=r(112),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],f=r[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var u=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=u<<1|u>>>31}var d=(n<<5|n>>>27)+f+o[c];d+=c<20?1518500249+(i&a|~i&s):c<40?1859775393+(i^a^s):c<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,f=s,s=a,a=i<<30|i>>>2,i=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1})},function(e,t,r){!function(n,i){e.exports=t=i(r(0))}(0,function(e){!function(){var t=e,r=t.lib,n=r.Base,i=t.enc,a=i.Utf8,o=t.algo;o.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,f=o.words,c=0;c0&&void 0!==arguments[0])||arguments[0])return this.publicKey;var e=this.publicKey;return s.getPublicKeyUnencoded(e)}},{key:"encrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._encrypted=(0,c.encrypt)(this.privateKey,e,t),this}},{key:"decrypt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this._WIF=(0,c.decrypt)(this.encrypted,e,t),this}},{key:"export",value:function(){var e=null;if(this._privateKey&&!this._encrypted)throw new Error("Encrypt private key first!");return this._encrypted&&(e=this._encrypted),{address:this.address,label:this.label,isDefault:this.isDefault,lock:this.lock,key:e,contract:this.contract,extra:this.extra}}},{key:"encrypted",get:function(){if(this._encrypted)return this._encrypted;throw new Error("No encrypted key found")}},{key:"WIF",get:function(){return this._WIF?this._WIF:(this._WIF=s.getWIFFromPrivateKey(this._privateKey),this._WIF)}},{key:"privateKey",get:function(){if(this._privateKey)return this._privateKey;if(this._WIF)return this._privateKey=s.getPrivateKeyFromWIF(this._WIF),this._privateKey;throw this._encrypted?new ReferenceError("Private Key encrypted!"):new ReferenceError("No Private Key provided!")}},{key:"publicKey",get:function(){return this._publicKey?this._publicKey:(this._publicKey=s.getPublicKeyFromPrivateKey(this.privateKey),this._publicKey)}},{key:"scriptHash",get:function(){return this._scriptHash?this._scriptHash:this._address?(this._scriptHash=s.getScriptHashFromAddress(this.address),this._scriptHash):(this._scriptHash=s.getScriptHashFromPublicKey(this.publicKey),this._scriptHash)}},{key:"address",get:function(){return this._address?this._address:(this._address=s.getAddressFromScriptHash(this.scriptHash),this._address)}}]),e}();t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExclusive=t.deserializeExclusive=t.serializeExclusive=void 0;var n=r(3),i=r(21),a=function(e){for(var t={claims:[]},r=e.readVarInt(),n=0;n=1?(0,n.fixed82num)(e.read(8)):0}},h=function(e){if(209!==e.type)throw new Error;var t=(0,n.num2VarInt)(e.script.length/2);return t+=e.script,e.version>=1&&(t+=(0,n.num2fixed8)(e.gas)),t},l=function(e){return Object.assign({script:"",gas:0},{script:e.script,gas:e.gas})};t.serializeExclusive={2:o,128:c,209:h},t.deserializeExclusive={2:a,128:f,209:d},t.getExclusive={2:s,128:u,209:l}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.generateDeployScript=t.createScript=t.ScriptBuilder=t.OpCode=t.ContractParam=void 0;var i=r(60),a=n(i),o=r(155),s=n(o),f=r(156),c=n(f),u=r(3),d=function(e){var t=e.script,r=e.name,n=e.version,i=e.author,a=e.email,o=e.description,f=e.needsStorage,c=void 0!==f&&f,d=e.returnType,h=void 0===d?"ff":d,l=e.paramaterList,p=void 0===l?void 0:l,b=new s.default;return b.emitPush((0,u.str2hexstring)(o)).emitPush((0,u.str2hexstring)(a)).emitPush((0,u.str2hexstring)(i)).emitPush((0,u.str2hexstring)(n)).emitPush((0,u.str2hexstring)(r)).emitPush(c).emitPush(h).emitPush(p).emitPush(t).emitSysCall("Neo.Contract.Create"),b};t.default={create:{contractParam:function(){for(var e=arguments.length,t=Array(e),r=0;r=300&&e.statusCode<400){if(++this._redirectCount>this._options.maxRedirects)return this.emit("error",new Error("Max redirects exceeded."));var r,n=this._options.headers;if(307!==e.statusCode&&!(this._options.method in h)){this._options.method="GET",this._bufferedWrites=[];for(r in n)/^content-/i.test(r)&&delete n[r]}if(!this._isRedirect)for(r in n)/^host$/i.test(r)&&delete n[r];var a=i.resolve(this._currentUrl,t);c("redirecting to",a),Object.assign(this._options,i.parse(a)),this._isRedirect=!0,this._performRequest()}else e.responseUrl=this._currentUrl,this.emit("response",e),delete this._options,delete this._bufferedWrites},n.prototype.abort=function(){this._currentRequest.abort()},n.prototype.flushHeaders=function(){this._currentRequest.flushHeaders()},n.prototype.setNoDelay=function(e){this._currentRequest.setNoDelay(e)},n.prototype.setSocketKeepAlive=function(e,t){this._currentRequest.setSocketKeepAlive(e,t)},n.prototype.setTimeout=function(e,t){this._currentRequest.setTimeout(e,t)},n.prototype.write=function(e,t,r){this._currentRequest.write(e,t,r),this._bufferedWrites.push({data:e,encoding:t})},n.prototype.end=function(e,t,r){this._currentRequest.end(e,t,r),e&&this._bufferedWrites.push({data:e,encoding:t})},Object.keys(u).forEach(function(e){var r=d[e]=e.substr(0,e.length-1),o=u[e],s=t[r]=Object.create(o);s.request=function(r,o){return"string"==typeof r?(r=i.parse(r),r.maxRedirects=t.maxRedirects):r=Object.assign({maxRedirects:t.maxRedirects,protocol:e},r),a.equal(r.protocol,e,"protocol mismatch"),c("options",r),new n(r,o)},s.get=function(e,t){var r=s.request(e,t);return r.end(),r}})},function(e,t){e.exports=require("url")},function(e,t,r){function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function i(e){function r(){if(r.enabled){var e=r,n=+new Date,i=n-(c||n);e.diff=i,e.prev=c,e.curr=n,c=n;for(var a=new Array(arguments.length),o=0;o>8,o=255&i;a?r.push(a,o):r.push(o)}return r}function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>>3}function u(e){return h(e,17)^h(e,19)^e>>>10}var d=r(7),h=d.rotr32;t.ft_1=n,t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=s,t.s1_256=f,t.g0_256=c,t.g1_256=u},function(e,t,r){"use strict";function n(){if(!(this instanceof n))return new n;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}var i=r(7),a=r(14),o=r(50),s=r(9),f=i.sum32,c=i.sum32_4,u=i.sum32_5,d=o.ch32,h=o.maj32,l=o.s0_256,p=o.s1_256,b=o.g0_256,v=o.g1_256,m=a.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];i.inherits(n,m),e.exports=n,n.blockSize=512,n.outSize=256,n.hmacStrength=192,n.padLength=64,n.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>>7)^(p<<14|p>>>18)^p>>>3,v=c[l-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[l]=b+c[l-7]+m+c[l-16]}var y=s&u^~s&d,g=n&i^n&a^i&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),k=h+_+y+f[l]+c[l],S=w+g;h=d,d=u,u=s,s=o+k|0,o=a,a=i,i=n,n=k+S|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+u|0,r[6]=r[6]+d|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(u),r.HmacSHA256=a._createHmacHelper(u)}(Math),e.SHA256})},function(e,t,r){!function(n,i,a){e.exports=t=i(r(0),r(20))}(0,function(e){return function(){function t(){return o.create.apply(o,arguments)}var r=e,n=r.lib,i=n.Hasher,a=r.x64,o=a.Word,s=a.WordArray,f=r.algo,c=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=t()}();var d=f.SHA512=i.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],f=r[5],d=r[6],h=r[7],l=n.high,p=n.low,b=i.high,v=i.low,m=a.high,y=a.low,g=o.high,w=o.low,_=s.high,k=s.low,S=f.high,x=f.low,M=d.high,A=d.low,E=h.high,I=h.low,P=l,T=p,B=b,R=v,C=m,O=y,z=g,N=w,j=_,q=k,H=S,F=x,L=M,U=A,D=E,K=I,V=0;V<80;V++){var W=u[V];if(V<16)var Y=W.high=0|e[t+2*V],X=W.low=0|e[t+2*V+1];else{var Z=u[V-15],G=Z.high,Q=Z.low,J=(G>>>1|Q<<31)^(G>>>8|Q<<24)^G>>>7,$=(Q>>>1|G<<31)^(Q>>>8|G<<24)^(Q>>>7|G<<25),ee=u[V-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=u[V-7],oe=ae.high,se=ae.low,fe=u[V-16],ce=fe.high,ue=fe.low,X=$+se,Y=J+oe+(X>>>0<$>>>0?1:0),X=X+ie,Y=Y+ne+(X>>>0>>0?1:0),X=X+ue,Y=Y+ce+(X>>>0>>0?1:0);W.high=Y,W.low=X}var de=j&H^~j&L,he=q&F^~q&U,le=P&B^P&C^B&C,pe=T&R^T&O^R&O,be=(P>>>28|T<<4)^(P<<30|T>>>2)^(P<<25|T>>>7),ve=(T>>>28|P<<4)^(T<<30|P>>>2)^(T<<25|P>>>7),me=(j>>>14|q<<18)^(j>>>18|q<<14)^(j<<23|q>>>9),ye=(q>>>14|j<<18)^(q>>>18|j<<14)^(q<<23|j>>>9),ge=c[V],we=ge.high,_e=ge.low,ke=K+ye,Se=D+me+(ke>>>0>>0?1:0),ke=ke+he,Se=Se+de+(ke>>>0>>0?1:0),ke=ke+_e,Se=Se+we+(ke>>>0<_e>>>0?1:0),ke=ke+X,Se=Se+Y+(ke>>>0>>0?1:0),xe=ve+pe,Me=be+le+(xe>>>0>>0?1:0);D=L,K=U,L=H,U=F,H=j,F=q,q=N+ke|0,j=z+Se+(q>>>0>>0?1:0)|0,z=C,N=O,C=B,O=R,B=P,R=T,T=ke+xe|0,P=Se+Me+(T>>>0>>0?1:0)|0}p=n.low=p+T,n.high=l+P+(p>>>0>>0?1:0),v=i.low=v+R,i.high=b+B+(v>>>0>>0?1:0),y=a.low=y+O,a.high=m+C+(y>>>0>>0?1:0),w=o.low=w+N,o.high=g+z+(w>>>0>>0?1:0),k=s.low=k+q,s.high=_+j+(k>>>0>>0?1:0),x=f.low=x+F,f.high=S+H+(x>>>0>>0?1:0),A=d.low=A+U,d.high=M+L+(A>>>0>>0?1:0),I=h.low=I+K,h.high=E+D+(I>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=i._createHelper(d),r.HmacSHA512=i._createHmacHelper(d)}(),e.SHA512})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.isPublicKey=t.isPrivateKey=t.isWIF=t.isNEP2=void 0;var n=r(27),i=function(e){return e&&e.__esModule?e:{default:e}}(n),a=r(3),o=r(17);t.isNEP2=function(e){try{if(58!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return!!t&&(86===t.length&&("01"===t.substr(0,2)&&("42"===t.substr(2,2)&&"e0"===t.substr(4,2))))}catch(e){return!1}},t.isWIF=function(e){try{if(52!==e.length)return!1;var t=(0,a.ab2hexstring)(i.default.decode(e));return(0,a.hash256)(t.substr(0,t.length-8)).substr(0,8)===t.substr(t.length-8,8)}catch(e){return!1}},t.isPrivateKey=function(e){return/^[0-9A-Fa-f]{64}$/.test(e)},t.isPublicKey=function(e,t){try{var r=void 0;switch(e.substr(0,2)){case"04":if(!0===t)return!1;r=(0,o.getPublicKeyEncoded)(e);break;case"02":case"03":if(!1===t)return!1;r=e;break;default:return!1}var n=(0,o.getPublicKeyUnencoded)(r),i=parseInt(n.substr(n.length-2,2),16);if("02"===r.substr(0,2)&&i%2==0)return!0;if("03"===r.substr(0,2)&&i%2==1)return!0}catch(e){}return!1},t.isAddress=function(e){try{var t=(0,a.ab2hexstring)(i.default.decode(e));if((0,a.hash256)(t.slice(0,42)).substr(0,8)!==t.substr(42,8))return!1;var r=(0,a.reverseHex)(t.slice(2,42));return(0,o.getAddressFromScriptHash)(r)===e}catch(e){return!1}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.decryptWIF=t.encryptWIF=t.decrypt=t.encrypt=t.generateEncryptedWif=t.encryptWifAccount=void 0;var i=r(46),a=n(i),o=r(53),s=r(145),f=n(s),c=r(17),u=r(31),d=n(u),h=r(3),l=r(4),p=t.encryptWifAccount=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),m(e,t).then(function(r){var n=new d.default(e);return n.encryptedWif=r,n.passphrase=t,n})},b=(t.generateEncryptedWif=function(e){console.log("To be deprecated in v3. Please use new Account() and encrypt with Account.encrypt");var t=(0,c.generatePrivateKey)();return p(t,e)},t.encrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;r=y(r);var n=new d.default(e),i=(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(n.address))).toString().slice(0,8),s=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(i,"hex"),r).toString("hex"),c=s.slice(0,64),u=s.slice(64),p=(0,h.hexXor)(n.privateKey,c),b=o.AES.encrypt(o.enc.Hex.parse(p),o.enc.Hex.parse(u),{mode:o.mode.ECB,padding:o.pad.NoPadding}),v=l.NEP_HEADER+l.NEP_FLAG+i+b.ciphertext.toString();return a.default.encode(Buffer.from(v,"hex"))}),v=t.decrypt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.DEFAULT_SCRYPT;r=y(r);var n=(0,h.ab2hexstring)(a.default.decode(e)),i=n.substr(6,8),s=n.substr(-64),c=f.default.hashSync(Buffer.from(t.normalize("NFC"),"utf8"),Buffer.from(i,"hex"),r).toString("hex"),u=c.slice(0,64),p=c.slice(64),b={ciphertext:o.enc.Hex.parse(s),salt:""},v=o.AES.decrypt(b,o.enc.Hex.parse(p),{mode:o.mode.ECB,padding:o.pad.NoPadding}),m=(0,h.hexXor)(v.toString(),u),g=new d.default(m);if(i!==(0,o.SHA256)((0,o.SHA256)(o.enc.Latin1.parse(g.address))).toString().slice(0,8))throw new Error("Wrong Password!");return g.WIF},m=t.encryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.encrypt"),Promise.resolve(b(e,t))},y=(t.decryptWIF=function(e,t){return console.log("To be deprecated in v3. Please use Account.decrypt"),Promise.resolve(v(e,t))},function(e){return Object.assign({},l.DEFAULT_SCRYPT,e)})},function(e,t){function r(e,t,r,o){return{password:n(e),salt:n(t),options:i(r),callback:a(arguments[arguments.length-1])}}function n(e){return"function"==typeof e?Buffer("","utf8"):e instanceof Buffer?e:"string"==typeof e?new Buffer(e,"utf8"):new Buffer(String(e||""),"utf8")}function i(e){return e=null!==e&&"object"==typeof e?e:{},{maxmem:o(e.maxmem)||33554432,cost:s(e.cost)||Math.pow(2,14),blockSize:f(e.blockSize)||8,parallel:f(e.parallel)||1,size:c(e.size)||64}}function a(e){return"function"==typeof e?e:null}function o(e){if("number"!=typeof e)return null;for(var t=4;t<=2048;t*=2){var r=1048576*t;if(r>e)return null;if(r==e)return r}return null}function s(e){if("number"!=typeof e)return null;for(var t=8;t<=64;t++){var r=Math.pow(2,t);if(r>e)return null;if(r==e)return r}return null}function f(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>256?null:e)}function c(e){return"number"!=typeof e?null:(e=Math.round(e),e<1?null:e>2048?null:e)}e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionHash=t.signTransaction=t.deserializeTransaction=t.serializeTransaction=t.calculateInputs=void 0;var n=r(3),i=r(6),a=r(32),o=r(4),s=r(21),f=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(s),c=(t.calculateInputs=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;null===t&&(t=[]);var n=t.reduce(function(e,t){var r=Math.round(1e8*t.value);return e[t.assetId]?e[t.assetId]+=r:e[t.assetId]=r,e},{});if(r>0){var a=1e8*r;n[o.ASSET_ID.GAS]?n[o.ASSET_ID.GAS]+=a:n[o.ASSET_ID.GAS]=a}var s=[];return{inputs:Object.keys(n).map(function(t){var r=n[t],a=o.ASSETS[t];if(-1===e.assetSymbols.indexOf(a))throw new Error("This balance does not contain any "+a+"!");var f=e.assets[a];if(1e8*f.balancef.unspent.length)throw new Error("Insufficient "+o.ASSETS[t]+"! Reached end of unspent coins!");u+=Math.round(1e8*f.unspent[c-1].value)}return u>r&&s.push({assetId:t,value:(u-r)/1e8,scriptHash:(0,i.getScriptHashFromAddress)(e.address)}),f.unspent.slice(0,c).map(function(e){return{prevHash:e.txid,prevIndex:e.index}})}).reduce(function(e,t){return e.concat(t)},[]),change:s}},t.serializeTransaction=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";r+=(0,n.num2hexstring)(e.type),r+=(0,n.num2hexstring)(e.version),r+=a.serializeExclusive[e.type](e),r+=(0,n.num2VarInt)(e.attributes.length);var i=!0,o=!1,s=void 0;try{for(var c,u=e.attributes[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var d=c.value;r+=f.serializeTransactionAttribute(d)}}catch(e){o=!0,s=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}r+=(0,n.num2VarInt)(e.inputs.length);var h=!0,l=!1,p=void 0;try{for(var b,v=e.inputs[Symbol.iterator]();!(h=(b=v.next()).done);h=!0){var m=b.value;r+=f.serializeTransactionInput(m)}}catch(e){l=!0,p=e}finally{try{!h&&v.return&&v.return()}finally{if(l)throw p}}r+=(0,n.num2VarInt)(e.outputs.length);var y=!0,g=!1,w=void 0;try{for(var _,k=e.outputs[Symbol.iterator]();!(y=(_=k.next()).done);y=!0){var S=_.value;r+=f.serializeTransactionOutput(S)}}catch(e){g=!0,w=e}finally{try{!y&&k.return&&k.return()}finally{if(g)throw w}}if(t&&e.scripts&&e.scripts.length>0){r+=(0,n.num2VarInt)(e.scripts.length);var x=!0,M=!1,A=void 0;try{for(var E,I=e.scripts[Symbol.iterator]();!(x=(E=I.next()).done);x=!0){var P=E.value;r+=f.serializeWitness(P)}}catch(e){M=!0,A=e}finally{try{!x&&I.return&&I.return()}finally{if(M)throw A}}}return r});t.deserializeTransaction=function(e){var t=new n.StringStream(e),r={};r.type=parseInt(t.read(1),16),r.version=parseInt(t.read(1),16);var i=a.deserializeExclusive[r.type](t);r.attributes=[],r.inputs=[],r.outputs=[],r.scripts=[];for(var o=t.readVarInt(),s=0;s1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getBestBlockHash",value:function(){return new e({method:"getbestblockhash"})}},{key:"getBlockCount",value:function(){return new e({method:"getblockcount"})}},{key:"getBlockSysFee",value:function(t){return new e({method:"getblocksysfee",params:[t]})}},{key:"getConnectionCount",value:function(){return new e({method:"getconnectioncount"})}},{key:"getContractState",value:function(t){return new e({method:"getcontractstate",params:[t]})}},{key:"getPeers",value:function(){return new e({method:"getpeers"})}},{key:"getRawMemPool",value:function(){return new e({method:"getrawmempool"})}},{key:"getRawTransaction",value:function(t){return new e({method:"getrawtransaction",params:[t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1]})}},{key:"getStorage",value:function(t,r){return new e({method:"getstorage",params:[t,r]})}},{key:"getTxOut",value:function(t,r){return new e({method:"gettxout",params:[t,r]})}},{key:"getVersion",value:function(){return new e({method:"getversion"})}},{key:"invoke",value:function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2?n-2:0),a=2;ar?(r=c.height,n=[c]):c.height===r&&n.push(c)}}catch(e){a=!0,o=e}finally{try{!i&&f.return&&f.return()}finally{if(a)throw o}}return n[Math.floor(Math.random()*n.length)].url})},t.getBalance=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_balance/"+t).then(function(t){var r=new a.Balance({address:t.data.address,net:e});return t.data.balance.map(function(e){r.addAsset(e.asset,{balance:e.amount,unspent:s(e.unspent)}),r[e.asset]={balance:e.amount,unspent:s(e.unspent)}}),r})},t.getClaims=function(e,t){var r=o(e);return i.default.get(r+"/v1/get_claimable/"+t).then(function(t){var r=f(t.data.claimable);return{net:e,address:t.data.address,claims:r}})},function(e){return e.map(function(e){return{index:e.n,txid:e.txid,value:e.value}})}),f=function(e){return e.map(function(e){return{start:e.start_height,end:e.ed_height,index:e.n,claim:Math.round(1e8*e.unclaimed),txid:e.txid,value:e.value}})}},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.CONST=t.u=t.wallet=t.tx=t.sc=t.rpc=t.api=void 0;var i=r(64),a=n(i),o=r(15),s=n(o),f=r(4),c=n(f),u=r(33),d=n(u),h=r(13),l=n(h),p=r(6),b=n(p),v=r(3),m=n(v),y=[d.default,l.default,b.default,a.default,s.default],g=y.reduce(function(e,t){return Object.keys(t).map(function(r){e[r]?Object.assign(e[r],t[r]):e[r]=t[r]}),e},{CONST:c,u:m});t.default=g,t.api=a,t.rpc=s,t.sc=d,t.tx=l,t.wallet=b,t.u=m,t.CONST=c},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.neoscan=t.nep5=t.cmc=t.neonDB=void 0;var i=r(65);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=r(22),o=n(a),s=r(161),f=n(s),c=r(162),u=n(c),d=r(62),h=n(d);t.default={get:{price:f.getPrice,balance:o.getBalance,claims:o.getClaims,transactionHistory:o.getTransactionHistory,tokenBalance:u.getTokenBalance,tokenInfo:u.getTokenInfo,token:u.getToken},do:{sendAsset:o.doSendAsset,claimAllGas:o.doClaimAllGas,mintTokens:o.doMintTokens}},t.neonDB=o,t.cmc=f,t.nep5=u,t.neoscan=h},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.doInvoke=t.claimGas=t.sendAsset=t.makeIntent=t.sendTx=t.signTx=t.createTx=t.getClaimsFrom=t.getBalanceFrom=void 0;var i=r(22),a=n(i),o=r(62),s=n(o),f=r(6),c=r(4),u=r(15),d=r(13),h=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n diff --git a/lib/index.js.gz b/lib/index.js.gz index 4a4eb4b59..737f84708 100644 Binary files a/lib/index.js.gz and b/lib/index.js.gz differ diff --git a/package.json b/package.json index 4cd18df33..d1463a5c4 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "name": "@cityofzion/neon-js", "description": "Javascript libraries for neo wallet using https://github.com/neochainio/neowallet/blob/master/js/wallet.js as the original source.", - "version": "2.2.0", + "version": "2.2.1", "main": "lib/index.js", "browser": "lib/browser.js", "types": "src/index.d.ts", diff --git a/source/conf.py b/source/conf.py index 9bd9c338b..e7f99eb1c 100644 --- a/source/conf.py +++ b/source/conf.py @@ -66,9 +66,9 @@ # built documents. # # The short X.Y version. -version = u'2.2.0' +version = u'2.2.1' # The full version, including alpha/beta/rc tags. -release = u'2.2.0' +release = u'2.2.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.