wallet-address-validator
Version:
Wallet address validator for Bitcoin and other Altcoins.
1 lines • 74.3 kB
JavaScript
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).WAValidator=t()}}(function(){return function o(s,a,u){function f(e,t){if(!a[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(h)return h(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=a[e]={exports:{}};s[e][0].call(i.exports,function(t){var r=s[e][1][t];return f(r||t)},i,i.exports,o,s,a,u)}return a[e].exports}for(var h="function"==typeof require&&require,t=0;t<u.length;t++)f(u[t]);return f}({1:[function(t,r,e){var c=t("safe-buffer").Buffer;r.exports=function(u){for(var a={},f=u.length,h=u.charAt(0),t=0;t<u.length;t++){var r=u.charAt(t);if(void 0!==a[r])throw new TypeError(r+" is ambiguous");a[r]=t}function e(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return c.allocUnsafe(0);for(var r=[0],e=0;e<t.length;e++){var n=a[t[e]];if(void 0===n)return;for(var i=0,o=n;i<r.length;++i)o+=r[i]*f,r[i]=255&o,o>>=8;for(;0<o;)r.push(255&o),o>>=8}for(var s=0;t[s]===h&&s<t.length-1;++s)r.push(0);return c.from(r.reverse())}return{encode:function(t){if(0===t.length)return"";for(var r=[0],e=0;e<t.length;++e){for(var n=0,i=t[e];n<r.length;++n)i+=r[n]<<8,r[n]=i%f,i=i/f|0;for(;0<i;)r.push(i%f),i=i/f|0}for(var o="",s=0;0===t[s]&&s<t.length-1;++s)o+=h;for(var a=r.length-1;0<=a;--a)o+=u[r[a]];return o},decodeUnsafe:e,decode:function(t){var r=e(t);if(r)return r;throw new Error("Non-base"+f+" character")}}}},{"safe-buffer":7}],2:[function(t,r,e){"use strict";e.byteLength=function(t){return 3*t.length/4-c(t)},e.toByteArray=function(t){var r,e,n,i,o,s=t.length;i=c(t),o=new h(3*s/4-i),e=0<i?s-4:s;var a=0;for(r=0;r<e;r+=4)n=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],o[a++]=n>>16&255,o[a++]=n>>8&255,o[a++]=255&n;2===i?(n=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,o[a++]=255&n):1===i&&(n=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,o[a++]=n>>8&255,o[a++]=255&n);return o},e.fromByteArray=function(t){for(var r,e=t.length,n=e%3,i="",o=[],s=0,a=e-n;s<a;s+=16383)o.push(l(t,s,a<s+16383?a:s+16383));1===n?(r=t[e-1],i+=u[r>>2],i+=u[r<<4&63],i+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],i+=u[r>>10],i+=u[r>>4&63],i+=u[r<<2&63],i+="=");return o.push(i),o.join("")};for(var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)u[i]=n[i],f[n.charCodeAt(i)]=i;function c(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[r-2]?2:"="===t[r-1]?1:0}function l(t,r,e){for(var n,i,o=[],s=r;s<e;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(u[(i=n)>>18&63]+u[i>>12&63]+u[i>>6&63]+u[63&i]);return o.join("")}f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},{}],3:[function(t,r,e){"use strict";var n=t("base64-js"),o=t("ieee754");e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function s(t){if(i<t)throw new RangeError("Invalid typed array length");var r=new Uint8Array(t);return r.__proto__=c.prototype,r}function c(t,r,e){if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return f(t)}return a(t,r,e)}function a(t,r,e){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return H(t)||t&&H(t.buffer)?function(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e);return n.__proto__=c.prototype,n}(t,r,e):"string"==typeof t?function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=0|p(t,r),n=s(e),i=n.write(t,r);i!==e&&(n=n.slice(0,i));return n}(t,r):function(t){if(c.isBuffer(t)){var r=0|l(t.length),e=s(r);return 0===e.length||t.copy(e,0,0,r),e}if(t){if(ArrayBuffer.isView(t)||"length"in t)return"number"!=typeof t.length||F(t.length)?s(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}(t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t){return u(t),s(t<0?0:0|l(t))}function h(t){for(var r=t.length<0?0:0|l(t.length),e=s(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(t){if(i<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,r){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return O(t).length;default:if(n)return L(t).length;r=(""+r).toLowerCase(),n=!0}}function d(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),F(e=+e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=c.from(r,n)),c.isBuffer(r))return 0===r.length?-1:y(t,r,e,n,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):y(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,r,e,n,i){var o,s=1,a=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;a/=s=2,u/=2,e/=2}function f(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(i){var h=-1;for(o=e;o<a;o++)if(f(t,o)===f(r,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(a<e+u&&(e=a-u),o=e;0<=o;o--){for(var c=!0,l=0;l<u;l++)if(f(t,o+l)!==f(r,l)){c=!1;break}if(c)return o}return-1}function v(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?i<(n=Number(n))&&(n=i):n=i;var o=r.length;o/2<n&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(r.substr(2*s,2),16);if(F(a))return s;t[e+s]=a}return s}function w(t,r,e,n){return M(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function b(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function m(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,s,a,u,f=t[i],h=null,c=239<f?4:223<f?3:191<f?2:1;if(i+c<=e)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&f)<<6|63&o)&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&f)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(h=u)}null===h?(h=65533,c=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var r=t.length;if(r<=_)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=_));return e}(n)}e.kMaxLength=i,(c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{get:function(){if(this instanceof c)return this.buffer}}),Object.defineProperty(c.prototype,"offset",{get:function(){if(this instanceof c)return this.byteOffset}}),"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=function(t,r,e){return a(t,r,e)},c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(t,r,e){return i=r,o=e,u(n=t),n<=0?s(n):void 0!==i?"string"==typeof o?s(n).fill(i,o):s(n).fill(i):s(n);var n,i,o},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer},c.compare=function(t,r){if(!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var e;if(void 0===r)for(e=r=0;e<t.length;++e)r+=t[e].length;var n=c.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(ArrayBuffer.isView(o)&&(o=c.from(o)),!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)d(this,r,r+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)d(this,r,r+3),d(this,r+1,r+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)d(this,r,r+7),d(this,r+1,r+6),d(this,r+2,r+5),d(this,r+3,r+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?m(this,0,t):function(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return m(this,r,e);case"ascii":return A(this,r,e);case"latin1":case"binary":return E(this,r,e);case"base64":return b(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,r,e,n,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&e<=r)return 0;if(i<=n)return-1;if(e<=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(e>>>=0)-(r>>>=0),a=Math.min(o,s),u=this.slice(n,i),f=t.slice(r,e),h=0;h<a;++h)if(u[h]!==f[h]){o=u[h],s=f[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},c.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},c.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},c.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||i<e)&&(e=i),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,a,u,f,h,c,l,p,d=!1;;)switch(n){case"hex":return v(this,t,r,e);case"utf8":case"utf-8":return l=r,p=e,M(L(t,(c=this).length-l),c,l,p);case"ascii":return w(this,t,r,e);case"latin1":case"binary":return w(this,t,r,e);case"base64":return u=this,f=r,h=e,M(O(t),u,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s=r,a=e,M(function(t,r){for(var e,n,i,o=[],s=0;s<t.length&&!((r-=2)<0);++s)e=t.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}(t,(o=this).length-s),o,s,a);default:if(d)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function A(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function E(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||n<e)&&(e=n);for(var i="",o=r;o<e;++o)i+=R(t[o]);return i}function B(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+r)throw new RangeError("Trying to access beyond buffer length")}function U(t,r,e,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<r||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function T(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function S(t,r,e,n,i){return r=+r,e>>>=0,i||T(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function C(t,r,e,n,i){return r=+r,e>>>=0,i||T(t,0,e,8),o.write(t,r,e,n,52,8),e+8}c.prototype.slice=function(t,r){var e=this.length;(t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t);var n=this.subarray(t,r);return n.__proto__=c.prototype,n},c.prototype.readUIntLE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=this[t+--r],i=1;0<r&&(i*=256);)n+=this[t+--r]*i;return n},c.prototype.readUInt8=function(t,r){return t>>>=0,r||k(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,r){return t>>>=0,r||k(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,r){return t>>>=0,r||k(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,r){return t>>>=0,r||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,r){return t>>>=0,r||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*r)),n},c.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=r,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*r)),o},c.prototype.readInt8=function(t,r){return t>>>=0,r||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,r){t>>>=0,r||k(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt16BE=function(t,r){t>>>=0,r||k(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt32LE=function(t,r){return t>>>=0,r||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t>>>=0,r||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,r){return t>>>=0,r||k(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t>>>=0,r||k(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t>>>=0,r||k(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t>>>=0,r||k(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},c.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;0<=--i&&(o*=256);)this[r+i]=t/o&255;return r+e},c.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,1,255,0),this[r]=255&t,r+1},c.prototype.writeUInt16LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},c.prototype.writeUInt16BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},c.prototype.writeUInt32LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},c.prototype.writeUInt32BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},c.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var i=Math.pow(2,8*e-1);U(this,t,r,e,i-1,-i)}var o=0,s=1,a=0;for(this[r]=255&t;++o<e&&(s*=256);)t<0&&0===a&&0!==this[r+o-1]&&(a=1),this[r+o]=(t/s>>0)-a&255;return r+e},c.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var i=Math.pow(2,8*e-1);U(this,t,r,e,i-1,-i)}var o=e-1,s=1,a=0;for(this[r+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[r+o+1]&&(a=1),this[r+o]=(t/s>>0)-a&255;return r+e},c.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},c.prototype.writeInt16LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},c.prototype.writeInt32LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,2147483647,-2147483648),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},c.prototype.writeFloatLE=function(t,r,e){return S(this,t,r,!0,e)},c.prototype.writeFloatBE=function(t,r,e){return S(this,t,r,!1,e)},c.prototype.writeDoubleLE=function(t,r,e){return C(this,t,r,!0,e)},c.prototype.writeDoubleBE=function(t,r,e){return C(this,t,r,!1,e)},c.prototype.copy=function(t,r,e,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),0<n&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i=n-e;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,e,n);else if(this===t&&e<r&&r<n)for(var o=i-1;0<=o;--o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,n),r);return i},c.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var s=c.isBuffer(t)?t:new c(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<e-r;++o)this[o+r]=s[o%a]}return this};var I=/[^+/0-9A-Za-z-_]/g;function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(e=t.charCodeAt(s))&&e<57344){if(!i){if(56319<e){-1<(r-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(r-=3)&&o.push(239,191,189);continue}i=e;continue}if(e<56320){-1<(r-=3)&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&-1<(r-=3)&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function O(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function H(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function F(t){return t!=t}},{"base64-js":2,ieee754:4}],4:[function(t,r,e){e.read=function(t,r,e,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;0<h;o=256*o+t[r+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;0<h;s=256*s+t[r+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,r,e,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),2<=(r+=1<=s+c?l/u:l*Math.pow(2,1-c))*u&&(s++,u/=2),h<=s+c?(a=0,s=h):1<=s+c?(a=(r*u-1)*Math.pow(2,i),s+=c):(a=r*Math.pow(2,c-1)*Math.pow(2,i),s=0));8<=i;t[e+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,f+=i;0<f;t[e+p]=255&s,p+=d,s/=256,f-=8);t[e+p-d]|=128*g}},{}],5:[function(t,i,o){"use strict";!function(t){function r(s,t,r){var i,a,u,f,h,c,l,p,d,g=0,y=[],v=0,w=!1,o=[],b=[],m=!1;if(i=(r=r||{}).encoding||"UTF8",(d=r.numRounds||1)!==parseInt(d,10)||d<1)throw Error("numRounds must a integer >= 1");if(0!==s.lastIndexOf("SHA-",0))throw Error("Chosen SHA variant is not supported");if(c=function(t,r){return F(t,r,s)},l=function(t,r,e,n){var i,o;if("SHA-224"!==s&&"SHA-256"!==s)throw Error("Unexpected error in SHA-2 implementation");for(i=15+(r+65>>>9<<4),o=16;t.length<=i;)t.push(0);for(t[r>>>5]|=128<<24-r%32,r+=e,t[i]=4294967295&r,t[i-1]=r/4294967296|0,e=t.length,r=0;r<e;r+=o)n=F(t.slice(r,r+o),n,s);if("SHA-224"===s)t=[n[0],n[1],n[2],n[3],n[4],n[5],n[6]];else{if("SHA-256"!==s)throw Error("Unexpected error in SHA-2 implementation");t=n}return t},p=function(t){return t.slice()},"SHA-224"===s)h=512,f=224;else{if("SHA-256"!==s)throw Error("Chosen SHA variant is not supported");h=512,f=256}u=k(t,i),a=H(s),this.setHMACKey=function(t,r,e){var n;if(!0===w)throw Error("HMAC key already set");if(!0===m)throw Error("Cannot set HMAC key after calling update");if(t=(r=k(r,i=(e||{}).encoding||"UTF8")(t)).binLen,r=r.value,e=(n=h>>>3)/4-1,n<t/8){for(r=l(r,t,0,H(s));r.length<=e;)r.push(0);r[e]&=4294967040}else if(t/8<n){for(;r.length<=e;)r.push(0);r[e]&=4294967040}for(t=0;t<=e;t+=1)o[t]=909522486^r[t],b[t]=1549556828^r[t];a=c(o,a),g=h,w=!0},this.update=function(t){var r,e,n,i=0,o=h>>>5;for(t=(r=u(t,y,v)).binLen,e=r.value,r=t>>>5,n=0;n<r;n+=o)i+h<=t&&(a=c(e.slice(n,n+o),a),i+=h);g+=i,y=e.slice(i>>>5),v=t%h,m=!0},this.getHash=function(t,r){var e,n,i,o;if(!0===w)throw Error("Cannot call getHash after setting HMAC key");switch(i=B(r),t){case"HEX":e=function(t){return _(t,f,i)};break;case"B64":e=function(t){return A(t,f,i)};break;case"BYTES":e=function(t){return E(t,f)};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}e=function(t){return x(t,f)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(o=l(y.slice(),v,g,p(a)),n=1;n<d;n+=1)o=l(o,f,0,H(s));return e(o)},this.getHMAC=function(t,r){var e,n,i,o;if(!1===w)throw Error("Cannot call getHMAC without first setting HMAC key");switch(i=B(r),t){case"HEX":e=function(t){return _(t,f,i)};break;case"B64":e=function(t){return A(t,f,i)};break;case"BYTES":e=function(t){return E(t,f)};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}e=function(t){return x(t,f)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return n=l(y.slice(),v,g,p(a)),o=c(b,H(s)),e(o=l(n,f,h,o))}}function n(){}function _(t,r,e){var n,i,o="";for(r/=8,n=0;n<r;n+=1)i=t[n>>>2]>>>8*(3+n%4*-1),o+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return e.outputUpper?o.toUpperCase():o}function A(t,r,e){var n,i,o,s="",a=r/8;for(n=0;n<a;n+=3)for(i=n+1<a?t[n+1>>>2]:0,o=n+2<a?t[n+2>>>2]:0,o=(t[n>>>2]>>>8*(3+n%4*-1)&255)<<16|(i>>>8*(3+(n+1)%4*-1)&255)<<8|o>>>8*(3+(n+2)%4*-1)&255,i=0;i<4;i+=1)s+=8*n+6*i<=r?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-i)&63):e.b64Pad;return s}function E(t,r){var e,n,i="",o=r/8;for(e=0;e<o;e+=1)n=t[e>>>2]>>>8*(3+e%4*-1)&255,i+=String.fromCharCode(n);return i}function x(t,r){var e,n,i=r/8,o=new ArrayBuffer(i);for(n=new Uint8Array(o),e=0;e<i;e+=1)n[e]=t[e>>>2]>>>8*(3+e%4*-1)&255;return o}function B(t){var r={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(t=t||{},r.outputUpper=t.outputUpper||!1,!0===t.hasOwnProperty("b64Pad")&&(r.b64Pad=t.b64Pad),"boolean"!=typeof r.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof r.b64Pad)throw Error("Invalid b64Pad formatting option");return r}function k(t,l){var r;switch(l){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":r=function(t,r,e){var n,i,o,s,a,u=t.length;if(0!=u%2)throw Error("String of HEX type must be in byte increments");for(r=r||[0],a=(e=e||0)>>>3,n=0;n<u;n+=2){if(i=parseInt(t.substr(n,2),16),isNaN(i))throw Error("String of HEX type contains invalid characters");for(o=(s=(n>>>1)+a)>>>2;r.length<=o;)r.push(0);r[o]|=i<<8*(3+s%4*-1)}return{value:r,binLen:4*u+e}};break;case"TEXT":r=function(t,r,e){var n,i,o,s,a,u,f,h,c=0;if(r=r||[0],a=(e=e||0)>>>3,"UTF8"===l)for(h=3,o=0;o<t.length;o+=1)for(i=[],(n=t.charCodeAt(o))<128?i.push(n):n<2048?(i.push(192|n>>>6),i.push(128|63&n)):n<55296||57344<=n?i.push(224|n>>>12,128|n>>>6&63,128|63&n):(o+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(o)),i.push(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n)),s=0;s<i.length;s+=1){for(u=(f=c+a)>>>2;r.length<=u;)r.push(0);r[u]|=i[s]<<8*(h+f%4*-1),c+=1}else if("UTF16BE"===l||"UTF16LE"===l)for(h=2,i="UTF16LE"===l||"UTF16LE"!==l&&!1,o=0;o<t.length;o+=1){for(n=t.charCodeAt(o),!0===i&&(n=(s=255&n)<<8|n>>>8),u=(f=c+a)>>>2;r.length<=u;)r.push(0);r[u]|=n<<8*(h+f%4*-1),c+=2}return{value:r,binLen:8*c+e}};break;case"B64":r=function(t,r,e){var n,i,o,s,a,u,f,h=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(i=t.indexOf("="),t=t.replace(/\=/g,""),-1!==i&&i<t.length)throw Error("Invalid '=' found in base-64 string");for(r=r||[0],u=(e=e||0)>>>3,i=0;i<t.length;i+=4){for(a=t.substr(i,4),o=s=0;o<a.length;o+=1)s|=(n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[o]))<<18-6*o;for(o=0;o<a.length-1;o+=1){for(n=(f=h+u)>>>2;r.length<=n;)r.push(0);r[n]|=(s>>>16-8*o&255)<<8*(3+f%4*-1),h+=1}}return{value:r,binLen:8*h+e}};break;case"BYTES":r=function(t,r,e){var n,i,o,s,a;for(r=r||[0],o=(e=e||0)>>>3,i=0;i<t.length;i+=1)n=t.charCodeAt(i),s=(a=i+o)>>>2,r.length<=s&&r.push(0),r[s]|=n<<8*(3+a%4*-1);return{value:r,binLen:8*t.length+e}};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}r=function(t,r,e){var n,i,o,s,a;for(r=r||[0],i=(e=e||0)>>>3,a=new Uint8Array(t),n=0;n<t.byteLength;n+=1)o=(s=n+i)>>>2,r.length<=o&&r.push(0),r[o]|=a[n]<<8*(3+s%4*-1);return{value:r,binLen:8*t.byteLength+e}};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, or ARRAYBUFFER")}return r}function e(t,r){return t>>>r|t<<32-r}function U(t,r,e){return t&r^~t&e}function T(t,r,e){return t&r^t&e^r&e}function S(t){return e(t,2)^e(t,13)^e(t,22)}function C(t){return e(t,6)^e(t,11)^e(t,25)}function I(t){return e(t,7)^e(t,18)^t>>>3}function R(t){return e(t,17)^e(t,19)^t>>>10}function L(t,r){var e=(65535&t)+(65535&r);return((t>>>16)+(r>>>16)+(e>>>16)&65535)<<16|65535&e}function O(t,r,e,n){var i=(65535&t)+(65535&r)+(65535&e)+(65535&n);return((t>>>16)+(r>>>16)+(e>>>16)+(n>>>16)+(i>>>16)&65535)<<16|65535&i}function M(t,r,e,n,i){var o=(65535&t)+(65535&r)+(65535&e)+(65535&n)+(65535&i);return((t>>>16)+(r>>>16)+(e>>>16)+(n>>>16)+(i>>>16)+(o>>>16)&65535)<<16|65535&o}function H(t){var r,e=[];if(0!==t.lastIndexOf("SHA-",0))throw Error("No SHA variants supported");switch(e=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t){case"SHA-224":break;case"SHA-256":e=r;break;case"SHA-384":case"SHA-512":e=[new n,new n,new n,new n,new n,new n,new n,new n];break;default:throw Error("Unknown SHA variant")}return e}function F(t,r,e){var n,i,o,s,a,u,f,h,c,l,p,d,g,y,v,w,b,m,_,A,E,x,B,k=[];if("SHA-224"!==e&&"SHA-256"!==e)throw Error("Unexpected error in SHA-2 implementation");for(l=64,d=1,x=Number,g=L,y=O,v=M,w=I,b=R,m=S,_=C,E=T,A=U,B=N,e=r[0],n=r[1],i=r[2],o=r[3],s=r[4],a=r[5],u=r[6],f=r[7],p=0;p<l;p+=1)p<16?(c=p*d,h=t.length<=c?0:t[c],c=t.length<=c+1?0:t[c+1],k[p]=new x(h,c)):k[p]=y(b(k[p-2]),k[p-7],w(k[p-15]),k[p-16]),h=v(f,_(s),A(s,a,u),B[p],k[p]),c=g(m(e),E(e,n,i)),f=u,u=a,a=s,s=g(o,h),o=i,i=n,n=e,e=g(h,c);return r[0]=g(e,r[0]),r[1]=g(n,r[1]),r[2]=g(i,r[2]),r[3]=g(o,r[3]),r[4]=g(s,r[4]),r[5]=g(a,r[5]),r[6]=g(u,r[6]),r[7]=g(f,r[7]),r}var N;N=[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],void 0!==o?(void 0!==i&&i.exports&&(i.exports=r),o=r):t.jsSHA=r}(this)},{}],6:[function(t,r,e){var n,i,o=r.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(r){if(n===setTimeout)return setTimeout(r,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(r,0);try{return n(r,0)}catch(t){try{return n.call(null,r,0)}catch(t){return n.call(this,r,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var f,h=[],c=!1,l=-1;function p(){c&&f&&(c=!1,f.length?h=f.concat(h):l=-1,h.length&&d())}function d(){if(!c){var t=u(p);c=!0;for(var r=h.length;r;){for(f=h,h=[];++l<r;)f&&f[l].run();l=-1,r=h.length}f=null,c=!1,function(r){if(i===clearTimeout)return clearTimeout(r);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(r);try{i(r)}catch(t){try{return i.call(null,r)}catch(t){return i.call(this,r)}}}(t)}}function g(t,r){this.fun=t,this.array=r}function y(){}o.nextTick=function(t){var r=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];h.push(new g(t,r)),1!==h.length||c||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],7:[function(t,r,e){var n=t("buffer"),i=n.Buffer;function o(t,r){for(var e in t)r[e]=t[e]}function s(t,r,e){return i(t,r,e)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?r.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,r,e){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,r,e)},s.alloc=function(t,r,e){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==r?"string"==typeof e?n.fill(r,e):n.fill(r):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:3}],8:[function(t,r,e){var s=t("./crypto/base58"),n=t("./crypto/segwit_addr"),a=t("./crypto/utils"),i="prod";function o(t,r){var e=(r=r||{}).expectedLength||25,n=r.hashFunction||"sha256",i=function(t){try{return s.decode(t)}catch(t){return null}}(t);if(i){var o=i.length;return o!==e?null:a.toHex(i.slice(o-4,o))===function(t,r){switch(t){case"blake256":return a.blake256Checksum(r);case"sha256":default:return a.sha256Checksum(r)}}(n,a.toHex(i.slice(0,o-4)))?a.toHex(i.slice(0,e-24)):null}return null}r.exports={isValidAddress:function(t,r,e){return function(t,r,e){e=e||i;var n=o(t,r);return!!n&&0<=("prod"===e||"testnet"===e?r.addressTypes[e]:r.addressTypes.prod.concat(r.addressTypes.testnet)).indexOf(n)}(t,r,e)||n.isValidAddress(t,r.segwitHrp)}}},{"./crypto/base58":9,"./crypto/segwit_addr":15,"./crypto/utils":17}],9:[function(t,r,e){for(var n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",s={},i=0;i<n.length;++i)s[n.charAt(i)]=i;var a=n.length;r.exports={decode:function(t){if(0===t.length)return[];var r,e,n=[0];for(r=0;r<t.length;++r){var i=t[r];if(!(i in s))throw new Error("Non-base58 character");for(e=0;e<n.length;++e)n[e]*=a;n[0]+=s[i];var o=0;for(e=0;e<n.length;++e)n[e]+=o,o=n[e]>>8,n[e]&=255;for(;o;)n.push(255&o),o>>=8}for(r=0;"1"===t[r]&&r<t.length-1;++r)n.push(0);return n.reverse()}}},{}],10:[function(t,r,e){var h="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o=[996825010,642813549,513874426,1027748829,705979059];function c(t){for(var r=1,e=0;e<t.length;++e){var n=r>>25;r=(33554431&r)<<5^t[e];for(var i=0;i<5;++i)n>>i&1&&(r^=o[i])}return r}function l(t){var r,e=[];for(r=0;r<t.length;++r)e.push(t.charCodeAt(r)>>5);for(e.push(0),r=0;r<t.length;++r)e.push(31&t.charCodeAt(r));return e}r.exports={decode:function(t){var r,e=!1,n=!1;for(r=0;r<t.length;++r){if(t.charCodeAt(r)<33||126<t.charCodeAt(r))return null;97<=t.charCodeAt(r)&&t.charCodeAt(r)<=122&&(e=!0),65<=t.charCodeAt(r)&&t.charCodeAt(r)<=90&&(n=!0)}if(e&&n)return null;var i=(t=t.toLowerCase()).lastIndexOf("1");if(i<1||i+7>t.length||90<t.length)return null;var o=t.substring(0,i),s=[];for(r=i+1;r<t.length;++r){var a=h.indexOf(t.charAt(r));if(-1===a)return null;s.push(a)}if(u=o,f=s,1!==c(l(u).concat(f)))return null;var u,f;return{hrp:o,data:s.slice(0,s.length-6)}},encode:function(t,r){for(var e=r.concat(function(t,r){for(var e=1^c(l(t).concat(r).concat([0,0,0,0,0,0])),n=[],i=0;i<6;++i)n.push(e>>5*(5-i)&31);return n}(t,r)),n=t+"1",i=0;i<e.length;++i)n+=h.charAt(e[i]);return n}}},{}],11:[function(t,r,e){!function(t){"use strict";var d={};function g(t,r,e){if(e!==d)return t instanceof g?t:void 0===t?v:g.parse(t);for(t=t||[];t.length&&!t[t.length-1];)--t.length;this._d=t,this._s=t.length?r||1:0}g._construct=function(t,r){return new g(t,r,d)};var y=1e7;g.base=y,g.base_log10=7;var v=new g([],0,d);g.ZERO=v;var w=new g([1],1,d);g.ONE=w;var b=new g(w._d,-1,d);g.M_ONE=b,g._0=v,g._1=w,g.small=[v,w,new g([2],1,d),new g([3],1,d),new g([4],1,d),new g([5],1,d),new g([6],1,d),new g([7],1,d),new g([8],1,d),new g([9],1,d),new g([10],1,d),new g([11],1,d),new g([12],1,d),new g([13],1,d),new g([14],1,d),new g([15],1,d),new g([16],1,d),new g([17],1,d),new g([18],1,d),new g([19],1,d),new g([20],1,d),new g([21],1,d),new g([22],1,d),new g([23],1,d),new g([24],1,d),new g([25],1,d),new g([26],1,d),new g([27],1,d),new g([28],1,d),new g([29],1,d),new g([30],1,d),new g([31],1,d),new g([32],1,d),new g([33],1,d),new g([34],1,d),new g([35],1,d),new g([36],1,d)],g.digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),g.prototype.toString=function(t){if((t=+t||10)<2||36<t)throw new Error("illegal radix "+t+".");if(0===this._s)return"0";if(10===t){var r=this._s<0?"-":"";r+=this._d[this._d.length-1].toString();for(var e=this._d.length-2;0<=e;e--){for(var n=this._d[e].toString();n.length<7;)n="0"+n;r+=n}return r}var i=g.digits;t=g.small[t];for(var o,s=this._s,a=this.abs(),u=[];0!==a._s;){var f=a.divRem(t);a=f[0],o=f[1],u.push(i[o.valueOf()])}return(s<0?"-":"")+u.reverse().join("")},g.radixRegex=[/^$/,/^$/,/^[01]*$/,/^[012]*$/,/^[0-3]*$/,/^[0-4]*$/,/^[0-5]*$/,/^[0-6]*$/,/^[0-7]*$/,/^[0-8]*$/,/^[0-9]*$/,/^[0-9aA]*$/,/^[0-9abAB]*$/,/^[0-9abcABC]*$/,/^[0-9a-dA-D]*$/,/^[0-9a-eA-E]*$/,/^[0-9a-fA-F]*$/,/^[0-9a-gA-G]*$/,/^[0-9a-hA-H]*$/,/^[0-9a-iA-I]*$/,/^[0-9a-jA-J]*$/,/^[0-9a-kA-K]*$/,/^[0-9a-lA-L]*$/,/^[0-9a-mA-M]*$/,/^[0-9a-nA-N]*$/,/^[0-9a-oA-O]*$/,/^[0-9a-pA-P]*$/,/^[0-9a-qA-Q]*$/,/^[0-9a-rA-R]*$/,/^[0-9a-sA-S]*$/,/^[0-9a-tA-T]*$/,/^[0-9a-uA-U]*$/,/^[0-9a-vA-V]*$/,/^[0-9a-wA-W]*$/,/^[0-9a-xA-X]*$/,/^[0-9a-yA-Y]*$/,/^[0-9a-zA-Z]*$/],g.parse=function(t,r){var e;t=t.toString(),void 0!==r&&10!=+r||(t=t.replace(/\s*[*xX]\s*10\s*(\^|\*\*)\s*/,"e").replace(/^([+\-])?(\d+)\.?(\d*)[eE]([+\-]?\d+)$/,function(t,r,e,n,i){var o=(i=+i)<0,s=e.length+i;t=(o?e:n).length,i=(i=Math.abs(i))>=t?i-t+o:0;var a=new Array(i+1).join("0"),u=e+n;return(r||"")+(o?u=a+u:u+=a).substr(0,s+=o?a.length:0)+(s<u.length?"."+u.substr(s):"")})),e=void 0===r?"0[xcb]":16==r?"0x":8==r?"0c":2==r?"0b":"";var n=new RegExp("^([+\\-]?)("+e+")?([0-9a-z]*)(?:\\.\\d*)?$","i").exec(t);if(n){var i=n[1]||"+",o=n[2]||"",s=n[3]||"";if(void 0===r)r="0x"===o||"0X"===o?16:"0c"===o||"0C"===o?8:"0b"===o||"0B"===o?2:10;else if(r<2||36<r)throw new Error("Illegal radix "+r+".");if(!g.radixRegex[r=+r].test(s))throw new Error("Bad digit for radix "+r);if(0===(s=s.replace(/^0+/,"").split("")).length)return v;if(i="-"===i?-1:1,10==r){for(var a=[];7<=s.length;)a.push(parseInt(s.splice(s.length-g.base_log10,g.base_log10).join(""),10));return a.push(parseInt(s.join(""),10)),new g(a,i,d)}a=v;r=g.small[r];for(var u=g.small,f=0;f<s.length;f++)a=a.multiply(r).add(u[parseInt(s[f],36)]);return new g(a._d,i,d)}throw new Error("Invalid BigInteger format: "+t)},g.prototype.add=function(t){if(0===this._s)return g(t);if(0===(t=g(t))._s)return this;if(this._s!==t._s)return t=t.negate(),this.subtract(t);for(var r,e=this._d,n=t._d,i=e.length,o=n.length,s=new Array(Math.max(i,o)+1),a=Math.min(i,o),u=0,f=0;f<a;f++)r=e[f]+n[f]+u,s[f]=r%y,u=r/y|0;for(i<o&&(e=n,i=o),f=a;u&&f<i;f++)r=e[f]+u,s[f]=r%y,u=r/y|0;for(u&&(s[f]=u);f<i;f++)s[f]=e[f];return new g(s,this._s,d)},g.prototype.negate=function(){return new g(this._d,0|-this._s,d)},g.prototype.abs=function(){return this._s<0?this.negate():this},g.prototype.subtract=function(t){if(0===this._s)return g(t).negate();if(0===(t=g(t))._s)return this;if(this._s!==t._s)return t=t.negate(),this.add(t);var r=this;this._s<0&&(r=new g(t._d,1,d),t=new g(this._d,1,d));var e=r.compareAbs(t);if(0===e)return v;if(e<0){var n=t;t=r,r=n}var i,o,s=r._d,a=t._d,u=s.length,f=a.length,h=new Array(u),c=0;for(i=0;i<f;i++)(o=s[i]-c-a[i])<0?(o+=y,c=1):c=0,h[i]=o;for(i=f;i<u;i++){if(!((o=s[i]-c)<0)){h[i++]=o;break}o+=y,h[i]=o}for(;i<u;i++)h[i]=s[i];return new g(h,e,d)},function(){function t(t,r){for(var e=t._d,n=e.slice(),i=0;;){var o=(e[i]||0)+1;if(n[i]=o%y,o<=y-1)break;++i}return new g(n,r,d)}function r(t,r){for(var e=t._d,n=e.slice(),i=0;;){var o=(e[i]||0)-1;if(!(o<0)){n[i]=o;break}n[i]=o+y,++i}return new g(n,r,d)}g.prototype.next=function(){switch(this._s){case 0:return w;case-1:return r(this,-1);default:return t(this,1)}},g.prototype.prev=function(){switch(this._s){case 0:return b;case-1:return t(this,-1);default:return r(this,1)}}}(),g.prototype.compareAbs=function(t){if(this===t)return 0;if(!(t instanceof g)){if(!isFinite(t))return isNaN(t)?t:-1;t=g(t)}if(0===this._s)return 0!==t._s?-1:0;if(0===t._s)return 1;var r=this._d.length,e=t._d.length;if(r<e)return-1;if(e<r)return 1;for(var n=this._d,i=t._d,o=r-1;0<=o;o--)if(n[o]!==i[o])return n[o]<i[o]?-1:1;return 0},g.prototype.compare=function(t){return this===t?0:(t=g(t),0===this._s?-t._s:this._s===t._s?this.compareAbs(t)*this._s:this._s)},g.prototype.isUnit=function(){return this===w||this===b||1===this._d.length&&1===this._d[0]},g.prototype.multiply=function(t){if(0===this._s)return v;if(0===(t=g(t))._s)return v;if(this.isUnit())return this._s<0?t.negate():t;if(t.isUnit())return t._s<0?this.negate():this;if(this===t)return this.square();var r,e=this._d.length>=t._d.length,n=(e?this:t)._d,i=(e?t:this)._d,o=n.length,s=i.length,a=o+s,u=new Array(a);for(r=0;r<a;r++)u[r]=0;for(r=0;r<s;r++){for(var f,h=0,c=i[r],l=o+r,p=r;p<l;p++)h=(f=u[p]+c*n[p-r]+h)/y|0,u[p]=f%y|0;h&&(h=(f=u[p]+h)/y|0,u[p]=f%y)}return new g(u,this._s*t._s,d)},g.prototype.multiplySingleDigit=function(t){if(0===t||0===this._s)return v;if(1===t)return this;var r;if(1===this._d.length)return r=this._d[0]*t,new g(y<=r?[r%y|0,r/y|0]:[r],1,d);if(2===t)return this.add(this);if(this.isUnit())return new g([t],1,d);for(var e=this._d,n=e.length,i=n+1,o=new Array(i),s=0;s<i;s++)o[s]=0;for(var a=0,u=0;u<n;u++)a=(r=t*e[u]+a)/y|0,o[u]=r%y|0;return a&&(o[u]=a),new g(o,1,d)},g.prototype.square=function(){if(0===this._s)return v;if(this.isUnit())return w;var t,r,e,n,i=this._d,o=i.length,s=new Array(o+o+1);for(n=0;n<o;n++)e=2*n,r=(t=i[n]*i[n])/y|0,s[e]=t%y,s[e+1]=r;for(n=0;n<o;n++){r=0,e=2*n+1;for(var a=n+1;a<o;a++,e++)r=(t=i[a]*i[n]*2+s[e]+r)/y|0,s[e]=t%y;var u=r+s[e=o+n];r=u/y|0,s[e]=u%y,s[e+1]+=r}return new g(s,1,d)},g.prototype.divide=g.prototype.quotient=function(t){return this.divRem(t)[0]},g.prototype.remainder=function(t){return this.divRem(t)[1]},g.prototype.divRem=function(t){if(0===(t=g(t))._s)throw new Error("Divide by zero");if(0===this._s)return[v,v];if(1===t._d.length)return this.divRemSmall(t._s*t._d[0]);switch(this.compareAbs(t)){case 0:return[this._s===t._s?w:b,v];case-1:return[v,this]}for(var r,e=this._s*t._s,n=t.abs(),i=this._d,o=i.length,s=(t._d.length,[]),a=new g([],0,d);o;)if(a._d.unshift(i[--o]),(a=new g(a._d,1,d)).compareAbs(t)<0)s.push(0);else{if(0===a._s)r=0;else{var u=a._d.length,f=n._d.length,h=a._d[u-1]*y+a._d[u-2],c=n._d[f-1]*y+n._d[f-2];a._d.length>n._d.length&&(h=(h+1)*y),r=Math.ceil(h/c)}do{var l=n.multiplySingleDigit(r);if(l.compareAbs(a)<=0)break;r--}while(r);if(s.push(r),r){var p=a.subtract(l);a._d=p._d.slice()}}return[new g(s.reverse(),e,d),new g(a._d,this._s,d)]},g.prototype.divRemSmall=function(t){var r;if(0===(t=+t))throw new Error("Divide by zero");var e=t<0?-1:1,n=this._s*e;if((t=Math.abs(t))<1||y<=t)throw new Error("Argument out of range");if(0===this._s)return[v,v];if(1===t||-1===t)return[1===n?this.abs():new g(this._d,n,d),v];if(1===this._d.length){var i=new g([this._d[0]/t|0],1,d);return r=new g([this._d[0]%t|0],1,d),n<0&&(i=i.negate()),this._s<0&&(r=r.negate()),[i,r]}for(var o,s=this._d.slice(),a=new Array(s.length),u=0,f=0,h=0;s.length;){if((u=u*y+s[s.length-1])<t)a[h++]=0,s.pop(),f=y*f+u;else f=u-t*(o=0===u?0:u/t|0),(a[h++]=o)?(s.pop(),u=f):s.pop()}return r=new g([f],1,d),this._s<0&&(r=r.negate()),[new g(a.reverse(),n,d),r]},g.prototype.isEven=function(){var t=this._d;return 0===this._s||0===t.length||t[0]%2==0},g.prototype.isOdd=function(){return!this.isEven()},g.prototype.sign=function(){return this._s},g.prototype.isPositive=function(){return 0<this._s},g.prototype.isNegative=function(){return this._s<0},g.prototype.isZero=function(){return 0===this._s},g.prototype.exp10=function(t){if(0===(t=+t))return this;if(Math.abs(t)>Number(i))throw new Error("exponent too large in BigInteger.exp10");if(0===this._s)return v;if(0<t){for(var r=new g(this._d.slice(),this._s,d);7<=t;t-=7)r._d.unshift(0);return 0==t?r:(r._s=1,r=r.multiplySingleDigit(Math.pow(10,t)),this._s<0?r.negate():r)}if(-t>=7*this._d.length)return v;r=new g(this._d.slice(),this._s,d);for(t=-t;7<=t;t-=7)r._d.shift();return 0==t?r:r.divRemSmall(Math.pow(10,t))[0]},g.prototype.pow=function(t){if(this.isUnit())return 0<this._s?this:g(t).isOdd()?this:this.negate();if(0===(t=g(t))._s)return w;if(t._s<0){if(0===this._s)throw new Error("Divide by zero");return v}if(0===this._s)return v;if(t.isUnit())return this;if(0<t.compareAbs(i))throw new Error("exponent too large in BigInteger.pow");for(var r=this,e=w,n=g.small[2];t.isPositive();){if(t.isOdd()&&(e=e.multiply(r),t.isUnit()))return e;r=r.square(),t=t.quotient(n)}return e},g.prototype.modPow=function(t,r){for(var e=w,n=this;t.isPositive();)t.isOdd()&&(e=e.multiply(n).remainder(r)),(t=t.quotient(g.small[2])).isPositive()&&(n=n.square().remainder(r));return e},g.prototype.log=function(){switch(this._s){case 0:return-1/0;case-1:return NaN}var t=this._d.length;if(7*t<30)return Math.log(this.valueOf());var r=Math.ceil(30/7),e=this._d.slice(t-r);return Math.log(new g(e,1,d).valueOf())+(t-r)*Math.log(y)},g.prototype.valueOf=function(){return parseInt(this.toString(),10)},g.prototype.toJSValue=function(){return parseInt(this.toString(),10)},g.prototype.lowVal=function(){return this._d[0]||0};var i=g(2147483647);g.MAX_EXP=i,function(){function o(r){return function(t){return r.call(g(t))}}function s(e){return function(t,r){return e.call(g(t),g(r))}}function a(n){return function(t,r,e){return n.call(g(t),g(r),g(e))}}!function(){var t,r,e="toJSValue,isEven,isOdd,sign,isZero,isNegative,abs,isUnit,square,negate,isPositive,toString,next,prev,log".split(","),n="compare,remainder,divRem,subtract,add,quotient,divide,multiply,pow,compareAbs".split(","),i=["modPow"];for(t=0;t<e.length;t++)g[r=e[t]]=o(g.prototype[r]);for(t=0;t<n.length;t++)g[r=n[t]]=s(g.prototype[r]);for(t=0;t<i.length;t++)g[r=i[t]]=a(g.prototype[r]);g.exp10=function(t,r){return g(t).exp10(r)}}()}(),t.JSBigInt=g}(void 0!==e?e:this)},{}],12:[function(t,e,r){(function(o){"use strict";c.sigma=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9],[12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11],[13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10],[6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5],[10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]],c.u256=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479],c.padding=new o([128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),c.prototype._length_carry=function(t){for(var r=0;r<t.length&&!(t[r]<4294967296);++r)t[r]-=4294967296,t[r+1]+=1},c.prototype.update=function(t,r){t=new o(t,r);for(var e=this._block,n=0;this._blockOffset+t.length-n>=e.length;){for(var i=this._blockOffset;i<e.length;)e[i++]=t[n++];this._length[0]+=8*e.length,this._length_carry(this._length),this._compress(),this._blockOffset=0}for(;n<t.length;)e[this._blockOffset++]=t[n++];return this};var t=new o([1]),r=new o([129]);function h(t,r){return(t<<32-r|t>>>r)>>>0}function i(t,r,e,n,i,o,s,a){var u=c.sigma,f=c.u256;t[n]=t[n]+((r[u[e][a]]^f[u[e][a+1]])>>>0)+t[i]>>>0,t[s]=h(t[s]^t[n],16),t[o]=t[o]+t[s]>>>0,t[i]=h(t[i]^t[o],12),t[n]=t[n]+((r[u[e][a+1]]^f[u[e][a]])>>>0)+t[i]>>>0,t[s]=h(t[s]^t[n],8),t[o]=t[o]+t[s]>>>0,t[i]=h(t[i]^t[o],7)}function c(){this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=new o(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=t,this._oo=r}c.prototype._compress=function(){var t,r=c.u256,e=new Array(16),n=new Array(16);for(t=0;t<16;++t)n[t]=this._block.readUInt32BE(4*t);for(t=0;t<8;++t)e[t]=this._h[t]>>>0;for(t=8;t<12;++t)e[t]=(this._s[t-8]^r[t-8])>>>0;for(t=12;t<16;++t)e[t]=r[t-8];for(this._nullt||(e[12]=(e[12]^this._length[0])>>>0,e[13]=(e[13]^this._length[0])>>>0,e[14]=(e[14]^this._length[1])>>>