bitcore-message-zcash/bitcore-message.min.js

1 line
23 KiB
JavaScript

require=function t(r,e,n){function i(a,s){if(!e[a]){if(!r[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var h=e[a]={exports:{}};r[a][0].call(h.exports,function(t){var e=r[a][1][t];return i(e?e:t)},h,h.exports,t,r,e,n)}return e[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(t,r,e){(function(e){"use strict";var n=t("bitcore"),i=n.deps._,o=n.PrivateKey,a=n.PublicKey,s=n.Address,u=n.encoding.BufferWriter,f=n.crypto.ECDSA,h=n.crypto.Signature,c=n.crypto.Hash.sha256sha256,l=n.util.js,p=n.util.preconditions,g=function w(t){return this instanceof w?(p.checkArgument(i.isString(t),"First argument should be a string"),this.message=t,this):new w(t)};g.MAGIC_BYTES=new e("Bitcoin Signed Message:\n"),g.prototype.magicHash=function(){var t=u.varintBufNum(g.MAGIC_BYTES.length),r=new e(this.message),n=u.varintBufNum(r.length),i=e.concat([t,g.MAGIC_BYTES,n,r]),o=c(i);return o},g.prototype._sign=function(t){p.checkArgument(t instanceof o,"First argument should be an instance of PrivateKey");var r=this.magicHash(),e=new f;return e.hashbuf=r,e.privkey=t,e.pubkey=t.toPublicKey(),e.signRandomK(),e.calci(),e.sig},g.prototype.sign=function(t){var r=this._sign(t);return r.toCompact().toString("base64")},g.prototype._verify=function(t,r){p.checkArgument(t instanceof a,"First argument should be an instance of PublicKey"),p.checkArgument(r instanceof h,"Second argument should be an instance of Signature");var e=this.magicHash(),n=f.verify(e,r,t);return n||(this.error="The signature was invalid"),n},g.prototype.verify=function(t,r){p.checkArgument(t),p.checkArgument(r&&i.isString(r)),i.isString(t)&&(t=s.fromString(t));var n=h.fromCompact(new e(r,"base64")),o=new f;o.hashbuf=this.magicHash(),o.sig=n;var a=o.toPublicKey(),u=s.fromPublicKey(a,t.network);return t.toString()!==u.toString()?(this.error="The signature did not match the message digest",!1):this._verify(a,n)},g.fromString=function(t){return new g(t)},g.fromJSON=function(t){return l.isValidJSON(t)&&(t=JSON.parse(t)),new g(t.message)},g.prototype.toObject=function(){return{message:this.message}},g.prototype.toJSON=function(){return JSON.stringify(this.toObject())},g.prototype.toString=function(){return this.message},g.prototype.inspect=function(){return"<Message: "+this.toString()+">"},r.exports=g}).call(this,t("buffer").Buffer)},{bitcore:"bitcore",buffer:2}],2:[function(t,r,e){(function(r){function n(){function t(){}try{var r=new Uint8Array(1);return r.foo=function(){return 42},r.constructor=t,42===r.foo()&&r.constructor===t&&"function"==typeof r.subarray&&0===r.subarray(1,1).byteLength}catch(e){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t){return this instanceof o?(this.length=0,this.parent=void 0,"number"==typeof t?a(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):u(this,t)):arguments.length>1?new o(t,arguments[1]):new o(t)}function a(t,r){if(t=w(t,0>r?0:0|y(r)),!o.TYPED_ARRAY_SUPPORT)for(var e=0;r>e;e++)t[e]=0;return t}function s(t,r,e){("string"!=typeof e||""===e)&&(e="utf8");var n=0|E(r,e);return t=w(t,n),t.write(r,e),t}function u(t,r){if(o.isBuffer(r))return f(t,r);if(W(r))return h(t,r);if(null==r)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(r.buffer instanceof ArrayBuffer)return c(t,r);if(r instanceof ArrayBuffer)return l(t,r)}return r.length?p(t,r):g(t,r)}function f(t,r){var e=0|y(r.length);return t=w(t,e),r.copy(t,0,0,e),t}function h(t,r){var e=0|y(r.length);t=w(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function c(t,r){var e=0|y(r.length);t=w(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function l(t,r){return o.TYPED_ARRAY_SUPPORT?(r.byteLength,t=o._augment(new Uint8Array(r))):t=c(t,new Uint8Array(r)),t}function p(t,r){var e=0|y(r.length);t=w(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function g(t,r){var e,n=0;"Buffer"===r.type&&W(r.data)&&(e=r.data,n=0|y(e.length)),t=w(t,n);for(var i=0;n>i;i+=1)t[i]=255&e[i];return t}function w(t,r){o.TYPED_ARRAY_SUPPORT?(t=o._augment(new Uint8Array(r)),t.__proto__=o.prototype):(t.length=r,t._isBuffer=!0);var e=0!==r&&r<=o.poolSize>>>1;return e&&(t.parent=Z),t}function y(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function d(t,r){if(!(this instanceof d))return new d(t,r);var e=new o(t,r);return delete e.parent,e}function E(t,r){"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"binary":case"raw":case"raws":return e;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return z(t).length;default:if(n)return J(t).length;r=(""+r).toLowerCase(),n=!0}}function v(t,r,e){var n=!1;if(r=0|r,e=void 0===e||e===1/0?this.length:0|e,t||(t="utf8"),0>r&&(r=0),e>this.length&&(e=this.length),r>=e)return"";for(;;)switch(t){case"hex":return L(this,r,e);case"utf8":case"utf-8":return _(this,r,e);case"ascii":return P(this,r,e);case"binary":return T(this,r,e);case"base64":return U(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;n>a;a++){var s=parseInt(r.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[e+a]=s}return a}function b(t,r,e,n){return G(J(r,t.length-e),t,e,n)}function I(t,r,e,n){return G(K(r),t,e,n)}function m(t,r,e,n){return I(t,r,e,n)}function B(t,r,e,n){return G(z(r),t,e,n)}function R(t,r,e,n){return G(H(r,t.length-e),t,e,n)}function U(t,r,e){return 0===r&&e===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(r,e))}function _(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;e>i;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(e>=i+s){var u,f,h,c;switch(s){case 1:128>o&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(c=(31&o)<<6|63&u,c>127&&(a=c));break;case 3:u=t[i+1],f=t[i+2],128===(192&u)&&128===(192&f)&&(c=(15&o)<<12|(63&u)<<6|63&f,c>2047&&(55296>c||c>57343)&&(a=c));break;case 4:u=t[i+1],f=t[i+2],h=t[i+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(c=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&h,c>65535&&1114112>c&&(a=c))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return S(n)}function S(t){var r=t.length;if(Q>=r)return String.fromCharCode.apply(String,t);for(var e="",n=0;r>n;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return e}function P(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;e>i;i++)n+=String.fromCharCode(127&t[i]);return n}function T(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;e>i;i++)n+=String.fromCharCode(t[i]);return n}function L(t,r,e){var n=t.length;(!r||0>r)&&(r=0),(!e||0>e||e>n)&&(e=n);for(var i="",o=r;e>o;o++)i+=q(t[o]);return i}function Y(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 O(t,r,e){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function M(t,r,e,n,i,a){if(!o.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(r>i||a>r)throw new RangeError("value is out of bounds");if(e+n>t.length)throw new RangeError("index out of range")}function D(t,r,e,n){0>r&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);o>i;i++)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(t,r,e,n){0>r&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);o>i;i++)t[e+i]=r>>>8*(n?i:3-i)&255}function x(t,r,e,n,i,o){if(r>i||o>r)throw new RangeError("value is out of bounds");if(e+n>t.length)throw new RangeError("index out of range");if(0>e)throw new RangeError("index out of range")}function N(t,r,e,n,i){return i||x(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),V.write(t,r,e,n,23,4),e+4}function k(t,r,e,n,i){return i||x(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),V.write(t,r,e,n,52,8),e+8}function F(t){if(t=j(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function j(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return 16>t?"0"+t.toString(16):t.toString(16)}function J(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;n>a;a++){if(e=t.charCodeAt(a),e>55295&&57344>e){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(56320>e){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=i-55296<<10|e-56320|65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,128>e){if((r-=1)<0)break;o.push(e)}else if(2048>e){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(65536>e){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(1114112>e))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 K(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);a++)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function z(t){return X.toByteArray(F(t))}function G(t,r,e,n){for(var i=0;n>i&&!(i+e>=r.length||i>=t.length);i++)r[i+e]=t[i];return i}var X=t("base64-js"),V=t("ieee754"),W=t("is-array");e.Buffer=o,e.SlowBuffer=d,e.INSPECT_MAX_BYTES=50,o.poolSize=8192;var Z={};o.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:n(),o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array),o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,r){if(!o.isBuffer(t)||!o.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,a=Math.min(e,n);a>i&&t[i]===r[i];)++i;return i!==a&&(e=t[i],n=r[i]),n>e?-1:e>n?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,r){if(!W(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new o(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;e++)r+=t[e].length;var n=new o(r),i=0;for(e=0;e<t.length;e++){var a=t[e];a.copy(n,i),i+=a.length}return n},o.byteLength=E,o.prototype.length=void 0,o.prototype.parent=void 0,o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?_(this,0,t):v.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===o.compare(this,t)},o.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},o.prototype.compare=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:o.compare(this,t)},o.prototype.indexOf=function(t,r){function e(t,r,e){for(var n=-1,i=0;e+i<t.length;i++)if(t[e+i]===r[-1===n?0:i-n]){if(-1===n&&(n=i),i-n+1===r.length)return e+n}else n=-1;return-1}if(r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r>>=0,0===this.length)return-1;if(r>=this.length)return-1;if(0>r&&(r=Math.max(this.length+r,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,r);if(o.isBuffer(t))return e(this,t,r);if("number"==typeof t)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,r):e(this,[t],r);throw new TypeError("val must be string, number or Buffer")},o.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},o.prototype.set=function(t,r){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,r)},o.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))r=0|r,isFinite(e)?(e=0|e,void 0===n&&(n="utf8")):(n=e,e=void 0);else{var i=n;n=r,r=0|e,e=i}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(0>e||0>r)||r>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return b(this,t,r,e);case"ascii":return I(this,t,r,e);case"binary":return m(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r,e);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,0>t?(t+=e,0>t&&(t=0)):t>e&&(t=e),0>r?(r+=e,0>r&&(r=0)):r>e&&(r=e),t>r&&(r=t);var n;if(o.TYPED_ARRAY_SUPPORT)n=o._augment(this.subarray(t,r));else{var i=r-t;n=new o(i,void 0);for(var a=0;i>a;a++)n[a]=this[a+t]}return n.length&&(n.parent=this.parent||this),n},o.prototype.readUIntLE=function(t,r,e){t=0|t,r=0|r,e||O(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},o.prototype.readUIntBE=function(t,r,e){t=0|t,r=0|r,e||O(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},o.prototype.readUInt8=function(t,r){return r||O(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,r){return r||O(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,r){return r||O(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,r){return r||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,r){return r||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,r,e){t=0|t,r=0|r,e||O(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>=i&&(n-=Math.pow(2,8*r)),n},o.prototype.readIntBE=function(t,r,e){t=0|t,r=0|r,e||O(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o},o.prototype.readInt8=function(t,r){return r||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,r){r||O(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},o.prototype.readInt16BE=function(t,r){r||O(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},o.prototype.readInt32LE=function(t,r){return r||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,r){return r||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,r){return r||O(t,4,this.length),V.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,r){return r||O(t,4,this.length),V.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,r){return r||O(t,8,this.length),V.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,r){return r||O(t,8,this.length),V.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,r,e,n){t=+t,r=0|r,e=0|e,n||M(this,t,r,e,Math.pow(2,8*e),0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},o.prototype.writeUIntBE=function(t,r,e,n){t=+t,r=0|r,e=0|e,n||M(this,t,r,e,Math.pow(2,8*e),0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},o.prototype.writeUInt8=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},o.prototype.writeUInt16LE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},o.prototype.writeUInt16BE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},o.prototype.writeUInt32LE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):C(this,t,r,!0),r+4},o.prototype.writeUInt32BE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):C(this,t,r,!1),r+4},o.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r=0|r,!n){var i=Math.pow(2,8*e-1);M(this,t,r,e,i-1,-i)}var o=0,a=1,s=0>t?1:0;for(this[r]=255&t;++o<e&&(a*=256);)this[r+o]=(t/a>>0)-s&255;return r+e},o.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r=0|r,!n){var i=Math.pow(2,8*e-1);M(this,t,r,e,i-1,-i)}var o=e-1,a=1,s=0>t?1:0;for(this[r+o]=255&t;--o>=0&&(a*=256);)this[r+o]=(t/a>>0)-s&255;return r+e},o.prototype.writeInt8=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=255&t,r+1},o.prototype.writeInt16LE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):D(this,t,r,!0),r+2},o.prototype.writeInt16BE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):D(this,t,r,!1),r+2},o.prototype.writeInt32LE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):C(this,t,r,!0),r+4},o.prototype.writeInt32BE=function(t,r,e){return t=+t,r=0|r,e||M(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):C(this,t,r,!1),r+4},o.prototype.writeFloatLE=function(t,r,e){return N(this,t,r,!0,e)},o.prototype.writeFloatBE=function(t,r,e){return N(this,t,r,!1,e)},o.prototype.writeDoubleLE=function(t,r,e){return k(this,t,r,!0,e)},o.prototype.writeDoubleBE=function(t,r,e){return k(this,t,r,!1,e)},o.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&e>n&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>e||e>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)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,a=n-e;if(this===t&&r>e&&n>r)for(i=a-1;i>=0;i--)t[i+r]=this[i+e];else if(1e3>a||!o.TYPED_ARRAY_SUPPORT)for(i=0;a>i;i++)t[i+r]=this[i+e];else t._set(this.subarray(e,e+a),r);return a},o.prototype.fill=function(t,r,e){if(t||(t=0),r||(r=0),e||(e=this.length),r>e)throw new RangeError("end < start");if(e!==r&&0!==this.length){if(0>r||r>=this.length)throw new RangeError("start out of bounds");if(0>e||e>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof t)for(n=r;e>n;n++)this[n]=t;else{var i=J(t.toString()),o=i.length;for(n=r;e>n;n++)this[n]=i[n%o]}return this}},o.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(o.TYPED_ARRAY_SUPPORT)return new o(this).buffer;for(var t=new Uint8Array(this.length),r=0,e=t.length;e>r;r+=1)t[r]=this[r];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var $=o.prototype;o._augment=function(t){return t.constructor=o,t._isBuffer=!0,t._set=t.set,t.get=$.get,t.set=$.set,t.write=$.write,t.toString=$.toString,t.toLocaleString=$.toString,t.toJSON=$.toJSON,t.equals=$.equals,t.compare=$.compare,t.indexOf=$.indexOf,t.copy=$.copy,t.slice=$.slice,t.readUIntLE=$.readUIntLE,t.readUIntBE=$.readUIntBE,t.readUInt8=$.readUInt8,t.readUInt16LE=$.readUInt16LE,t.readUInt16BE=$.readUInt16BE,t.readUInt32LE=$.readUInt32LE,t.readUInt32BE=$.readUInt32BE,t.readIntLE=$.readIntLE,t.readIntBE=$.readIntBE,t.readInt8=$.readInt8,t.readInt16LE=$.readInt16LE,t.readInt16BE=$.readInt16BE,t.readInt32LE=$.readInt32LE,t.readInt32BE=$.readInt32BE,t.readFloatLE=$.readFloatLE,t.readFloatBE=$.readFloatBE,t.readDoubleLE=$.readDoubleLE,t.readDoubleBE=$.readDoubleBE,t.writeUInt8=$.writeUInt8,t.writeUIntLE=$.writeUIntLE,t.writeUIntBE=$.writeUIntBE,t.writeUInt16LE=$.writeUInt16LE,t.writeUInt16BE=$.writeUInt16BE,t.writeUInt32LE=$.writeUInt32LE,t.writeUInt32BE=$.writeUInt32BE,t.writeIntLE=$.writeIntLE,t.writeIntBE=$.writeIntBE,t.writeInt8=$.writeInt8,t.writeInt16LE=$.writeInt16LE,t.writeInt16BE=$.writeInt16BE,t.writeInt32LE=$.writeInt32LE,t.writeInt32BE=$.writeInt32BE,t.writeFloatLE=$.writeFloatLE,t.writeFloatBE=$.writeFloatBE,t.writeDoubleLE=$.writeDoubleLE,t.writeDoubleBE=$.writeDoubleBE,t.fill=$.fill,t.inspect=$.inspect,t.toArrayBuffer=$.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":3,ieee754:4,"is-array":5}],3:[function(t,r,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function r(t){var r=t.charCodeAt(0);return r===a||r===c?62:r===s||r===l?63:u>r?-1:u+10>r?r-u+26+26:h+26>r?r-h:f+26>r?r-f+26:void 0}function e(t){function e(t){f[c++]=t}var n,i,a,s,u,f;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=t.length;u="="===t.charAt(h-2)?2:"="===t.charAt(h-1)?1:0,f=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var c=0;for(n=0,i=0;a>n;n+=4,i+=3)s=r(t.charAt(n))<<18|r(t.charAt(n+1))<<12|r(t.charAt(n+2))<<6|r(t.charAt(n+3)),e((16711680&s)>>16),e((65280&s)>>8),e(255&s);return 2===u?(s=r(t.charAt(n))<<2|r(t.charAt(n+1))>>4,e(255&s)):1===u&&(s=r(t.charAt(n))<<10|r(t.charAt(n+1))<<4|r(t.charAt(n+2))>>2,e(s>>8&255),e(255&s)),f}function i(t){function r(t){return n.charAt(t)}function e(t){return r(t>>18&63)+r(t>>12&63)+r(t>>6&63)+r(63&t)}var i,o,a,s=t.length%3,u="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=e(o);switch(s){case 1:o=t[t.length-1],u+=r(o>>2),u+=r(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=r(o>>10),u+=r(o>>4&63),u+=r(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),f="a".charCodeAt(0),h="A".charCodeAt(0),c="-".charCodeAt(0),l="_".charCodeAt(0);t.toByteArray=e,t.fromByteArray=i}("undefined"==typeof e?this.base64js={}:e)},{}],4:[function(t,r,e){e.read=function(t,r,e,n,i){var o,a,s=8*i-n-1,u=(1<<s)-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+=s;h>0;o=256*o+t[r+c],c+=l,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[r+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,n),o-=f}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,r,e,n,i,o){var a,s,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,g=n?1:-1,w=0>r||0===r&&0>1/r?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),r+=a+c>=1?l/u:l*Math.pow(2,1-c),r*u>=2&&(a++,u/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(r*u-1)*Math.pow(2,i),a+=c):(s=r*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[e+p]=255&s,p+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[e+p]=255&a,p+=g,a/=256,f-=8);t[e+p-g]|=128*w}},{}],5:[function(t,r,e){var n=Array.isArray,i=Object.prototype.toString;r.exports=n||function(t){return!!t&&"[object Array]"==i.call(t)}},{}],"bitcore-message":[function(t,r,e){var n=t("bitcore");n.Message=t("./lib/message"),r.exports=n.Message},{"./lib/message":1,bitcore:"bitcore"}]},{},[]);