UNPKG

crypto-address-validators

Version:

Wallet address validator for BTC, TRX, ETH, USDT (ERC20, TRC20), HOGE, SFM, SMARS

1 lines 53.9 kB
!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 i(u,s,a){function f(r,t){if(!s[r]){if(!u[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(h)return h(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var o=s[r]={exports:{}};u[r][0].call(o.exports,function(t){return f(u[r][1][t]||t)},o,o.exports,i,u,s,a)}return s[r].exports}for(var h="function"==typeof require&&require,t=0;t<a.length;t++)f(a[t]);return f}({1:[function(t,r,e){"use strict";e.byteLength=function(t){var r=p(t),e=r[0],n=r[1];return 3*(e+n)/4-n},e.toByteArray=function(t){for(var r,e=p(t),n=e[0],o=e[1],i=new l((f=n,h=o,3*(f+h)/4-h)),u=0,s=0<o?n-4:n,a=0;a<s;a+=4)r=c[t.charCodeAt(a)]<<18|c[t.charCodeAt(a+1)]<<12|c[t.charCodeAt(a+2)]<<6|c[t.charCodeAt(a+3)],i[u++]=r>>16&255,i[u++]=r>>8&255,i[u++]=255&r;var f,h;2===o&&(r=c[t.charCodeAt(a)]<<2|c[t.charCodeAt(a+1)]>>4,i[u++]=255&r);1===o&&(r=c[t.charCodeAt(a)]<<10|c[t.charCodeAt(a+1)]<<4|c[t.charCodeAt(a+2)]>>2,i[u++]=r>>8&255,i[u++]=255&r);return i},e.fromByteArray=function(t){for(var r,e=t.length,n=e%3,o=[],i=0,u=e-n;i<u;i+=16383)o.push(a(t,i,u<i+16383?u:i+16383));1===n?(r=t[e-1],o.push(s[r>>2]+s[r<<4&63]+"==")):2===n&&(r=(t[e-2]<<8)+t[e-1],o.push(s[r>>10]+s[r>>4&63]+s[r<<2&63]+"="));return o.join("")};for(var s=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,i=n.length;o<i;++o)s[o]=n[o],c[n.charCodeAt(o)]=o;function p(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function a(t,r,e){for(var n,o,i=[],u=r;u<e;u+=3)n=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(s[(o=n)>>18&63]+s[o>>12&63]+s[o>>6&63]+s[63&o]);return i.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],2:[function(t,r,e){"use strict";var n=t("base64-js"),i=t("ieee754");e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;var o=2147483647;function u(t){if(o<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 s(t,r,e)}function s(t,r,e){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return F(t)||t&&F(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=u(e),o=n.write(t,r);o!==e&&(n=n.slice(0,o));return n}(t,r):function(t){if(c.isBuffer(t)){var r=0|l(t.length),e=u(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||M(t.length)?u(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 a(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 a(t),u(t<0?0:0|l(t))}function h(t){for(var r=t.length<0?0:0|l(t.length),e=u(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(t){if(o<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,r){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(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 R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return H(t).length;default:if(n)return R(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,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),M(e=+e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)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,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):y(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function y(t,r,e,n,o){var i,u=1,s=t.length,a=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;s/=u=2,a/=2,e/=2}function f(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var h=-1;for(i=e;i<s;i++)if(f(t,i)===f(r,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===a)return h*u}else-1!==h&&(i-=i-h),h=-1}else for(s<e+a&&(e=s-a),i=e;0<=i;i--){for(var c=!0,l=0;l<a;l++)if(f(t,i+l)!==f(r,l)){c=!1;break}if(c)return i}return-1}function w(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?o<(n=Number(n))&&(n=o):n=o;var i=r.length;i/2<n&&(n=i/2);for(var u=0;u<n;++u){var s=parseInt(r.substr(2*u,2),16);if(M(s))return u;t[e+u]=s}return u}function v(t,r,e,n){return O(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 A(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,s,a,f=t[o],h=null,c=239<f?4:223<f?3:191<f?2:1;if(o+c<=e)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(i=t[o+1]))&&127<(a=(31&f)<<6|63&i)&&(h=a);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&2047<(a=(15&f)<<12|(63&i)<<6|63&u)&&(a<55296||57343<a)&&(h=a);break;case 4:i=t[o+1],u=t[o+2],s=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&s)&&65535<(a=(15&f)<<18|(63&i)<<12|(63&u)<<6|63&s)&&a<1114112&&(h=a)}null===h?(h=65533,c=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var r=t.length;if(r<=m)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=m));return e}(n)}e.kMaxLength=o,(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 s(t,r,e)},c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(t,r,e){return o=r,i=e,a(n=t),n<=0?u(n):void 0!==o?"string"==typeof i?u(n).fill(o,i):u(n).fill(o):u(n);var n,o,i},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,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];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),o=0;for(e=0;e<t.length;++e){var i=t[e];if(ArrayBuffer.isView(i)&&(i=c.from(i)),!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.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?A(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 _(this,r,e);case"utf8":case"utf-8":return A(this,r,e);case"ascii":return E(this,r,e);case"latin1":case"binary":return B(this,r,e);case"base64":return b(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(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,o){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===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&e<=r)return 0;if(o<=n)return-1;if(e<=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(i,u),a=this.slice(n,o),f=t.slice(r,e),h=0;h<s;++h)if(a[h]!==f[h]){i=a[h],u=f[h];break}return i<u?-1:u<i?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 o=this.length-r;if((void 0===e||o<e)&&(e=o),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i,u,s,a,f,h,c,l,p,d=!1;;)switch(n){case"hex":return w(this,t,r,e);case"utf8":case"utf-8":return l=r,p=e,O(R(t,(c=this).length-l),c,l,p);case"ascii":return v(this,t,r,e);case"latin1":case"binary":return v(this,t,r,e);case"base64":return a=this,f=r,h=e,O(H(t),a,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=r,s=e,O(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}(t,(i=this).length-u),i,u,s);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 m=4096;function E(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function B(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function _(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||n<e)&&(e=n);for(var o="",i=r;i<e;++i)o+=L(t[i]);return o}function k(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function U(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 C(t,r,e,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<r||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function S(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function x(t,r,e,n,o){return r=+r,e>>>=0,o||S(t,0,e,4),i.write(t,r,e,n,23,4),e+4}function T(t,r,e,n,o){return r=+r,e>>>=0,o||S(t,0,e,8),i.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||U(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||U(t,r,this.length);for(var n=this[t+--r],o=1;0<r&&(o*=256);)n+=this[t+--r]*o;return n},c.prototype.readUInt8=function(t,r){return t>>>=0,r||U(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,r){return t>>>=0,r||U(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,r){return t>>>=0,r||U(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,r){return t>>>=0,r||U(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||U(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||U(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*r)),n},c.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||U(t,r,this.length);for(var n=r,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*r)),i},c.prototype.readInt8=function(t,r){return t>>>=0,r||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,r){t>>>=0,r||U(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||U(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||U(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||U(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||U(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t>>>=0,r||U(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t>>>=0,r||U(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t>>>=0,r||U(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||C(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},c.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||C(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;0<=--o&&(i*=256);)this[r+o]=t/i&255;return r+e},c.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||C(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||C(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||C(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||C(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||C(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 o=Math.pow(2,8*e-1);C(this,t,r,e,o-1,-o)}var i=0,u=1,s=0;for(this[r]=255&t;++i<e&&(u*=256);)t<0&&0===s&&0!==this[r+i-1]&&(s=1),this[r+i]=(t/u>>0)-s&255;return r+e},c.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var o=Math.pow(2,8*e-1);C(this,t,r,e,o-1,-o)}var i=e-1,u=1,s=0;for(this[r+i]=255&t;0<=--i&&(u*=256);)t<0&&0===s&&0!==this[r+i+1]&&(s=1),this[r+i]=(t/u>>0)-s&255;return r+e},c.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||C(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||C(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||C(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||C(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||C(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 x(this,t,r,!0,e)},c.prototype.writeFloatBE=function(t,r,e){return x(this,t,r,!1,e)},c.prototype.writeDoubleLE=function(t,r,e){return T(this,t,r,!0,e)},c.prototype.writeDoubleBE=function(t,r,e){return T(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 o=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 i=o-1;0<=i;--i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,n),r);return o},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 o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}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 i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var u=c.isBuffer(t)?t:new c(t,n),s=u.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<e-r;++i)this[i+r]=u[i%s]}return this};var I=/[^+/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function R(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if(55295<(e=t.charCodeAt(u))&&e<57344){if(!o){if(56319<e){-1<(r-=3)&&i.push(239,191,189);continue}if(u+1===n){-1<(r-=3)&&i.push(239,191,189);continue}o=e;continue}if(e<56320){-1<(r-=3)&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&-1<(r-=3)&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.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;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function H(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 O(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function F(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function M(t){return t!=t}},{"base64-js":1,ieee754:3}],3:[function(t,r,e){e.read=function(t,r,e,n,o){var i,u,s=8*o-n-1,a=(1<<s)-1,f=a>>1,h=-7,c=e?o-1:0,l=e?-1:1,p=t[r+c];for(c+=l,i=p&(1<<-h)-1,p>>=-h,h+=s;0<h;i=256*i+t[r+c],c+=l,h-=8);for(u=i&(1<<-h)-1,i>>=-h,h+=n;0<h;u=256*u+t[r+c],c+=l,h-=8);if(0===i)i=1-f;else{if(i===a)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=f}return(p?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,r,e,n,o,i){var u,s,a,f=8*i-o-1,h=(1<<f)-1,c=h>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-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?(s=isNaN(r)?1:0,u=h):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),2<=(r+=1<=u+c?l/a:l*Math.pow(2,1-c))*a&&(u++,a/=2),h<=u+c?(s=0,u=h):1<=u+c?(s=(r*a-1)*Math.pow(2,o),u+=c):(s=r*Math.pow(2,c-1)*Math.pow(2,o),u=0));8<=o;t[e+p]=255&s,p+=d,s/=256,o-=8);for(u=u<<o|s,f+=o;0<f;t[e+p]=255&u,p+=d,u/=256,f-=8);t[e+p-d]|=128*g}},{}],4:[function(t,o,i){"use strict";!function(t){function r(u,t,r){var o,s,a,f,h,c,l,p,d,g=0,y=[],w=0,v=!1,i=[],b=[],A=!1;if(o=(r=r||{}).encoding||"UTF8",(d=r.numRounds||1)!==parseInt(d,10)||d<1)throw Error("numRounds must a integer >= 1");if(0!==u.lastIndexOf("SHA-",0))throw Error("Chosen SHA variant is not supported");if(c=function(t,r){return M(t,r,u)},l=function(t,r,e,n){var o,i;if("SHA-224"!==u&&"SHA-256"!==u)throw Error("Unexpected error in SHA-2 implementation");for(o=15+(r+65>>>9<<4),i=16;t.length<=o;)t.push(0);for(t[r>>>5]|=128<<24-r%32,r+=e,t[o]=4294967295&r,t[o-1]=r/4294967296|0,e=t.length,r=0;r<e;r+=i)n=M(t.slice(r,r+i),n,u);if("SHA-224"===u)t=[n[0],n[1],n[2],n[3],n[4],n[5],n[6]];else{if("SHA-256"!==u)throw Error("Unexpected error in SHA-2 implementation");t=n}return t},p=function(t){return t.slice()},"SHA-224"===u)h=512,f=224;else{if("SHA-256"!==u)throw Error("Chosen SHA variant is not supported");h=512,f=256}a=U(t,o),s=F(u),this.setHMACKey=function(t,r,e){var n;if(!0===v)throw Error("HMAC key already set");if(!0===A)throw Error("Cannot set HMAC key after calling update");if(t=(r=U(r,o=(e||{}).encoding||"UTF8")(t)).binLen,r=r.value,e=(n=h>>>3)/4-1,n<t/8){for(r=l(r,t,0,F(u));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)i[t]=909522486^r[t],b[t]=1549556828^r[t];s=c(i,s),g=h,v=!0},this.update=function(t){var r,e,n,o=0,i=h>>>5;for(t=(r=a(t,y,w)).binLen,e=r.value,r=t>>>5,n=0;n<r;n+=i)o+h<=t&&(s=c(e.slice(n,n+i),s),o+=h);g+=o,y=e.slice(o>>>5),w=t%h,A=!0},this.getHash=function(t,r){var e,n,o,i;if(!0===v)throw Error("Cannot call getHash after setting HMAC key");switch(o=k(r),t){case"HEX":e=function(t){return m(t,f,o)};break;case"B64":e=function(t){return E(t,f,o)};break;case"BYTES":e=function(t){return B(t,f)};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}e=function(t){return _(t,f)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(i=l(y.slice(),w,g,p(s)),n=1;n<d;n+=1)i=l(i,f,0,F(u));return e(i)},this.getHMAC=function(t,r){var e,n,o,i;if(!1===v)throw Error("Cannot call getHMAC without first setting HMAC key");switch(o=k(r),t){case"HEX":e=function(t){return m(t,f,o)};break;case"B64":e=function(t){return E(t,f,o)};break;case"BYTES":e=function(t){return B(t,f)};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}e=function(t){return _(t,f)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return n=l(y.slice(),w,g,p(s)),i=c(b,F(u)),e(i=l(n,f,h,i))}}function n(){}function m(t,r,e){var n,o,i="";for(r/=8,n=0;n<r;n+=1)o=t[n>>>2]>>>8*(3+n%4*-1),i+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return e.outputUpper?i.toUpperCase():i}function E(t,r,e){var n,o,i,u="",s=r/8;for(n=0;n<s;n+=3)for(o=n+1<s?t[n+1>>>2]:0,i=n+2<s?t[n+2>>>2]:0,i=(t[n>>>2]>>>8*(3+n%4*-1)&255)<<16|(o>>>8*(3+(n+1)%4*-1)&255)<<8|i>>>8*(3+(n+2)%4*-1)&255,o=0;o<4;o+=1)u+=8*n+6*o<=r?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63):e.b64Pad;return u}function B(t,r){var e,n,o="",i=r/8;for(e=0;e<i;e+=1)n=t[e>>>2]>>>8*(3+e%4*-1)&255,o+=String.fromCharCode(n);return o}function _(t,r){var e,n,o=r/8,i=new ArrayBuffer(o);for(n=new Uint8Array(i),e=0;e<o;e+=1)n[e]=t[e>>>2]>>>8*(3+e%4*-1)&255;return i}function k(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 U(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,o,i,u,s,a=t.length;if(0!=a%2)throw Error("String of HEX type must be in byte increments");for(r=r||[0],s=(e=e||0)>>>3,n=0;n<a;n+=2){if(o=parseInt(t.substr(n,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(i=(u=(n>>>1)+s)>>>2;r.length<=i;)r.push(0);r[i]|=o<<8*(3+u%4*-1)}return{value:r,binLen:4*a+e}};break;case"TEXT":r=function(t,r,e){var n,o,i,u,s,a,f,h,c=0;if(r=r||[0],s=(e=e||0)>>>3,"UTF8"===l)for(h=3,i=0;i<t.length;i+=1)for(o=[],(n=t.charCodeAt(i))<128?o.push(n):n<2048?(o.push(192|n>>>6),o.push(128|63&n)):n<55296||57344<=n?o.push(224|n>>>12,128|n>>>6&63,128|63&n):(i+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),o.push(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n)),u=0;u<o.length;u+=1){for(a=(f=c+s)>>>2;r.length<=a;)r.push(0);r[a]|=o[u]<<8*(h+f%4*-1),c+=1}else if("UTF16BE"===l||"UTF16LE"===l)for(h=2,o="UTF16LE"===l||"UTF16LE"!==l&&!1,i=0;i<t.length;i+=1){for(n=t.charCodeAt(i),!0===o&&(n=(u=255&n)<<8|n>>>8),a=(f=c+s)>>>2;r.length<=a;)r.push(0);r[a]|=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,o,i,u,s,a,f,h=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=t.indexOf("="),t=t.replace(/\=/g,""),-1!==o&&o<t.length)throw Error("Invalid '=' found in base-64 string");for(r=r||[0],a=(e=e||0)>>>3,o=0;o<t.length;o+=4){for(s=t.substr(o,4),i=u=0;i<s.length;i+=1)u|=(n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(s[i]))<<18-6*i;for(i=0;i<s.length-1;i+=1){for(n=(f=h+a)>>>2;r.length<=n;)r.push(0);r[n]|=(u>>>16-8*i&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,o,i,u,s;for(r=r||[0],i=(e=e||0)>>>3,o=0;o<t.length;o+=1)n=t.charCodeAt(o),u=(s=o+i)>>>2,r.length<=u&&r.push(0),r[u]|=n<<8*(3+s%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,o,i,u,s;for(r=r||[0],o=(e=e||0)>>>3,s=new Uint8Array(t),n=0;n<t.byteLength;n+=1)i=(u=n+o)>>>2,r.length<=i&&r.push(0),r[i]|=s[n]<<8*(3+u%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 C(t,r,e){return t&r^~t&e}function S(t,r,e){return t&r^t&e^r&e}function x(t){return e(t,2)^e(t,13)^e(t,22)}function T(t){return e(t,6)^e(t,11)^e(t,25)}function I(t){return e(t,7)^e(t,18)^t>>>3}function L(t){return e(t,17)^e(t,19)^t>>>10}function R(t,r){var e=(65535&t)+(65535&r);return((t>>>16)+(r>>>16)+(e>>>16)&65535)<<16|65535&e}function H(t,r,e,n){var o=(65535&t)+(65535&r)+(65535&e)+(65535&n);return((t>>>16)+(r>>>16)+(e>>>16)+(n>>>16)+(o>>>16)&65535)<<16|65535&o}function O(t,r,e,n,o){var i=(65535&t)+(65535&r)+(65535&e)+(65535&n)+(65535&o);return((t>>>16)+(r>>>16)+(e>>>16)+(n>>>16)+(o>>>16)+(i>>>16)&65535)<<16|65535&i}function F(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 M(t,r,e){var n,o,i,u,s,a,f,h,c,l,p,d,g,y,w,v,b,A,m,E,B,_,k,U=[];if("SHA-224"!==e&&"SHA-256"!==e)throw Error("Unexpected error in SHA-2 implementation");for(l=64,d=1,_=Number,g=R,y=H,w=O,v=I,b=L,A=x,m=T,B=S,E=C,k=N,e=r[0],n=r[1],o=r[2],i=r[3],u=r[4],s=r[5],a=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],U[p]=new _(h,c)):U[p]=y(b(U[p-2]),U[p-7],v(U[p-15]),U[p-16]),h=w(f,m(u),E(u,s,a),k[p],U[p]),c=g(A(e),B(e,n,o)),f=a,a=s,s=u,u=g(i,h),i=o,o=n,n=e,e=g(h,c);return r[0]=g(e,r[0]),r[1]=g(n,r[1]),r[2]=g(o,r[2]),r[3]=g(i,r[3]),r[4]=g(u,r[4]),r[5]=g(s,r[5]),r[6]=g(a,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!==i?(void 0!==o&&o.exports&&(o.exports=r),i=r):t.jsSHA=r}(this)},{}],5:[function(t,r,e){var n,o,i=r.exports={};function u(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(r){if(n===setTimeout)return setTimeout(r,0);if((n===u||!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:u}catch(t){n=u}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();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=a(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(o===clearTimeout)return clearTimeout(r);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(r);try{o(r)}catch(t){try{return o.call(null,r)}catch(t){return o.call(this,r)}}}(t)}}function g(t,r){this.fun=t,this.array=r}function y(){}i.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||a(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],6:[function(t,r,e){var u=t("./crypto/base58"),n=t("./crypto/segwit_addr"),s=t("./crypto/utils");function o(t,r){var e=(r=r||{}).expectedLength||25,n=r.hashFunction||"sha256",o=function(t){try{return u.decode(t)}catch(t){return null}}(t);if(o){var i=o.length;return i!==e?null:s.toHex(o.slice(i-4,i))===function(t,r){switch(t){case"blake256":return s.blake256Checksum(r);case"sha256":default:return s.sha256Checksum(r)}}(n,s.toHex(o.slice(0,i-4)))?s.toHex(o.slice(0,e-24)):null}return null}r.exports={isValidAddress:function(t,r,e){return function(t,r,e){e=e||"prod";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":7,"./crypto/segwit_addr":11,"./crypto/utils":13}],7:[function(t,r,e){for(var n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",u={},o=0;o<n.length;++o)u[n.charAt(o)]=o;var s=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 o=t[r];if(!(o in u))throw new Error("Non-base58 character");for(e=0;e<n.length;++e)n[e]*=s;n[0]+=u[o];var i=0;for(e=0;e<n.length;++e)n[e]+=i,i=n[e]>>8,n[e]&=255;for(;i;)n.push(255&i),i>>=8}for(r=0;"1"===t[r]&&r<t.length-1;++r)n.push(0);return n.reverse()}}},{}],8:[function(t,r,e){var h="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i=[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 o=0;o<5;++o)n>>o&1&&(r^=i[o])}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 o=(t=t.toLowerCase()).lastIndexOf("1");if(o<1||o+7>t.length||90<t.length)return null;var i=t.substring(0,o),u=[];for(r=o+1;r<t.length;++r){var s=h.indexOf(t.charAt(r));if(-1===s)return null;u.push(s)}if(a=i,f=u,1!==c(l(a).concat(f)))return null;var a,f;return{hrp:i,data:u.slice(0,u.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=[],o=0;o<6;++o)n.push(e>>5*(5-o)&31);return n}(t,r)),n=t+"1",o=0;o<e.length;++o)n+=h.charAt(e[o]);return n}}},{}],9:[function(t,e,r){(function(i){"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 i([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 i(t,r);for(var e=this._block,n=0;this._blockOffset+t.length-n>=e.length;){for(var o=this._blockOffset;o<e.length;)e[o++]=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 i([1]),r=new i([129]);function h(t,r){return(t<<32-r|t>>>r)>>>0}function o(t,r,e,n,o,i,u,s){var a=c.sigma,f=c.u256;t[n]=t[n]+((r[a[e][s]]^f[a[e][s+1]])>>>0)+t[o]>>>0,t[u]=h(t[u]^t[n],16),t[i]=t[i]+t[u]>>>0,t[o]=h(t[o]^t[i],12),t[n]=t[n]+((r[a[e][s+1]]^f[a[e][s]])>>>0)+t[o]>>>0,t[u]=h(t[u]^t[n],8),t[i]=t[i]+t[u]>>>0,t[o]=h(t[o]^t[i],7)}function c(){this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=new i(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])>>>0,e[15]=(e[15]^this._length[1])>>>0),t=0;t<14;++t)o(e,n,t,0,4,8,12,0),o(e,n,t,1,5,9,13,2),o(e,n,t,2,6,10,14,4),o(e,n,t,3,7,11,15,6),o(e,n,t,0,5,10,15,8),o(e,n,t,1,6,11,12,10),o(e,n,t,2,7,8,13,12),o(e,n,t,3,4,9,14,14);for(t=0;t<16;++t)this._h[t%8]=(this._h[t%8]^e[t])>>>0;for(t=0;t<8;++t)this._h[t]=(this._h[t]^this._s[t%4])>>>0},c.prototype._padding=function(){var t=this._length[0]+8*this._blockOffset,r=this._length[1];4294967296<=t&&(t-=4294967296,r+=1);var e=new i(8);e.writeUInt32BE(r,0),e.writeUInt32BE(t,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(c.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(c.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(c.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(e)},c.prototype.digest=function(t){this._padding();for(var r=new i(32),e=0;e<8;++e)r.writeUInt32BE(this._h[e],4*e);return r.toString(t)},e.exports=c}).call(this,t("buffer").Buffer)},{buffer:2}],10:[function(t,r,e){"use strict";function l(t,r,e){var n=t[r]+t[e],o=t[r+1]+t[e+1];4294967296<=n&&o++,t[r]=n,t[r+1]=o}function p(t,r,e,n){var o=t[r]+e;e<0&&(o+=4294967296);var i=t[r+1]+n;4294967296<=o&&i++,t[r]=o,t[r+1]=i}function i(t,r){return t[r]^t[r+1]<<8^t[r+2]<<16^t[r+3]<<24}function n(t,r,e,n,o,i){var u=g[o],s=g[o+1],a=g[i],f=g[i+1];l(d,t,r),p(d,t,u,s);var h=d[n]^d[t],c=d[n+1]^d[t+1];d[n]=c,d[n+1]=h,l(d,e,n),h=d[r]^d[e],c=d[r+1]^d[e+1],d[r]=h>>>24^c<<8,d[r+1]=c>>>24^h<<8,l(d,t,r),p(d,t,a,f),h=d[n]^d[t],c=d[n+1]^d[t+1],d[n]=h>>>16^c<<16,d[n+1]=c>>>16^h<<16,l(d,e,n),h=d[r]^d[e],c=d[r+1]^d[e+1],d[r]=c>>>31^h<<1,d[r+1]=h>>>31^c<<1}var u=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),o=new Uint8Array([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].map(function(t){return 2*t})),d=new Uint32Array(32),g=new Uint32Array(32);function s(t,r){var e=0;for(e=0;e<16;e++)d[e]=t.h[e],d[e+16]=u[e];for(d[24]=d[24]^t.t,d[25]=d[25]^t.t/4294967296,r&&(d[28]=~d[28],d[29]=~d[29]),e=0;e<32;e++)g[e]=i(t.b,4*e);for(e=0;e<12;e++)n(0,8,16,24,o[16*e+0],o[16*e+1]),n(2,10,18,26,o[16*e+2],o[16*e+3]),n(4,12,20,28,o[16*e+4],o[16*e+5]),n(6,14,22,30,o[16*e+6],o[16*e+7]),n(0,10,20,30,o[16*e+8],o[16*e+9]),n(2,12,22,24,o[16*e+10],o[16*e+11]),n(4,14,16,26,o[16*e+12],o[16*e+13]),n(6,8,18,28,o[16*e+14],o[16*e+15]);for(e=0;e<16;e++)t.h[e]=t.h[e]^d[e]^d[e+16]}var a=new Uint8Array([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]);function f(t,r,e,n){a.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=t,a[0]=t,r&&(a[1]=r.length),a[2]=1,a[3]=1,e&&a.set(e,32),n&&a.set(n,48);for(var o=0;o<16;o++)this.h[o]=u[o]^i(a,4*o);r&&(h(this,r),this.c=128)}function h(t,r){for(var e=0;e<r.length;e++)128===t.c&&(t.t+=t.c,s(t,!1),t.c=0),t.b[t.c++]=r[e]}function c(t){return t<16?"0"+t.toString(16):t.toString(16)}f.prototype.update=function(t){return h(this,t),this},f.prototype.final=f.prototype.digest=function(t){var r=t&&"binary"!==t&&"hex"!==t?t:new Uint8Array(this.outlen);return function(t,r){t.t+=t.c;for(;t.c<128;)t.b[t.c++]=0;s(t,!0);for(var e=0;e<t.outlen;e++)r[e]=t.h[e>>2]>>8*(3&e)}(this,r),"hex"===t?function(t){for(var r="",e=0;e<t.length;e++)r+=c(t[e]);return r}(r):r},r.exports=f},{}],11:[function(t,r,e){var o=t("./bech32");function i(t,r,e,n){for(var o=0,i=0,u=[],s=(1<<e)-1,a=0;a<t.length;++a){var f=t[a];if(f<0||f>>r!=0)return null;for(o=o<<r|f,i+=r;e<=i;)i-=e,u.push(o>>i&s)}if(n)0<i&&u.push(o<<e-i&s);else if(r<=i||o<<e-i&s)return null;return u}function u(t,r){var e=o.decode(r);if(null===e||e.hrp!==t||e.data.length<1||16<e.data[0])return null;var n=i(e.data.slice(1),5,8,!1);return null===n||n.length<2||40<n.length?null:0===e.data[0]&&20!==n.length&&32!==n.length?null:{version:e.data[0],program:n}}function n(t,r,e){var n=o.encode(t,[r].concat(i(e,8,5,!0)));return null===u(t,n)?null:n}r.exports={encode:n,decode:u,isValidAddress:function(t,r){var e=u(r=r||"bc",t);return null===e&&(e=u(r="tb",t)),null!==e&&n(r,e.version,e.program)===t.toLowerCase()}}},{"./bech32":8}],12:[function(t,L,r){(function(t,r){"use strict";var c="input is invalid type",e="object"==typeof window,n=e?window:{};n.JS_SHA3_NO_WINDOW&&(e=!1);var o=!e&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node?n=r:o&&(n=self);var l=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),i=[4,1024,262144,67108864],p=[0,8,16,24],ht=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],s=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var d=function(r,e,n){return function(t){return new x(r,e,r).update(t)[n]()}},g=function(e,n,o){return function(t,r){return new x(e,n,r).update(t)[o]()}},y=function(o,t,i){return function(t,r,e,n){return m["cshake"+o].update(t,r,e,n)[i]()}},w=function(o,t,i){return function(t,r,e,n){return m["kmac"+o].update(t,r,e,n)[i]()}},v=function(t,r,e,n){for(var o=0;o<f.length;++o){var i=f[o];t[i]=r(e,n,i)}return t},b=function(t,r){var e=d(t,r,"hex");return e.create=function(){return new x(t,r,t)},e.update=function(t){return e.create().update(t)},v(e,d,t,r)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:s,createMethod:function(r,e){var n=g(r,e,"hex");return n.create=function(t){return new x(r,e,t)},n.update=function(t,r){return n.create(r).update(t)},v(n,g,r,e)}},{name:"cshake",padding:i,bits:s,createMethod:function(n,o){var i=h[n],u=y(n,0,"hex");return u.create=function(t,r,e){return r||e?new x(n,o,t).bytepad([r,e],i):m["shake"+n].create(t)},u.update=function(t,r,e,n){return u.create(r,e,n).update(t)},v(u,y,n,o)}},{name:"kmac",padding:i,bits:s,createMethod:function(n,o){var i=h[n],u=w(n,0,"hex");return u.create=function(t,r,e){return new T(n,o,r).bytepad(["KMAC",e],i).bytepad([t],i)},u.update=function(t,r,e,n){return u.create(t,e,n).update(r)},v(u,w,n,o)}}],m={},E=[],B=0;B<A.length;++B)for(var _=A[B],k=_.bits,U=0;U<k.length;++U){var C=_.name+"_"+k[U];if(E.push(C),m[C]=_.createMethod(k[U],_.padding),"sha3"!==_.name){var S=_.name+k[U];E.push(S),m[S]=m[C]}}function x(t,r,e){this.blocks=[],this.s=[],this.padding=r,this.outputBits=e,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=e>>5,this.extraBytes=(31&e)>>3;for(var n=0;n<50;++n)this.s[n]=0}function T(t,r,e){x.call(this,t,r,e)}x.prototype.update=function(t){if(!this.finalized){var r,e=typeof t;if("string"!==e){if("object"!==e)throw c;if(null===t)throw c;if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw c;r=!0}for(var n,o,i=this.blocks,u=this.byteCount,s=t.length,a=this.blockCount,f=0,h=this.s;f<s;){if(this.reset)for(this.reset=!1,i[0]=this.block,n=1;n<a+1;++n)i[n]=0;if(r)for(n=this.start;f<s&&n<u;++f)i[n>>2]|=t[f]<<p[3&n++];else for(n=this.start;f<s&&n<u;++f)(o=t.charCodeAt(f))<128?i[n>>2]|=o<<p[3&n++]:(o<2048?i[n>>2]|=(192|o>>6)<<p[3&n++]:(o<55296||57344<=o?i[n>>2]|=(224|o>>12)<<p[3&n++]:(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),i[n>>2]|=(240|o>>18)<<p[3&n++],i[n>>2]|=(128|o>>12&63)<<p[3&n++]),i[n>>2]|=(128|o>>6&63)<<p[3&n++]),i[n>>2]|=(128|63&o)<<p[3&n++]);if(u<=(this.lastByteIndex=n)){for(this.start=n-u,this.block=i[a],n=0;n<a;++n)h[n]^=i[n];I(h),this.reset=!0}else this.start=n}return this}},x.prototype.encode=function(t,r){var e=255&t,n=1,o=[e];for(e=255&(t>>=8);0<e;)o.unshift(e),e=255&(t>>=8),++n;return r?o.push(n):o.unshift(n),this.update(o),o.length},x.prototype.encodeString=function(t){var r,e=typeof t;if("string"!==e){if("object"!==e)throw c;if(null===t)throw c;if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw c;r=!0}var n=0,o=t.length;if(r)n=o;else for(var i=0;i<t.length;++i){var u=t.charCodeAt(i);u<128?n+=1:u<2048?n+=2:u<55296||57344<=u?n+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++i)),n+=4)}return n+=this.encode(8*n),this.update(t),n},x.prototype.bytepad=function(t,r){for(var e=this.encode(r),n=0;n<t.length;++n)e+=this.encodeString(t[n]);var o=r-e%r,i=[];return i.length=o,this.update(i),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex,e=this.blockCount,n=this.s;if(t[r>>2]|=this.padding[3&r],this.lastByteIndex===this.byteCount)for(t[0]=t[e],r=1;r<e+1;++r)t[r]=0;for(t[e-1]|=2147483648,r=0;r<e;++r)n[r]^=t[r];I(n)}},x.prototype.toString=x.prototype.hex=function(){this.finalize();for(var t,r=this.blockCount,e=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,u=0,s="";u<n;){for(i=0;i<r&&u<n;++i,++u)t=e[i],s+=a[t>>4&15]+a[15&t]+a[t>>12&15]+a[t>>8&15]+a[t>>20&15]+a[t>>16&15]+a[t>>28&15]+a[t>>24&15];u%r==0&&(I(e),i=0)}return o&&(t=e[i],s+=a[t>>4&15]+a[15&t],1<o&&(s+=a[t>>12&15]+a[t>>8&15]),2<o&&(s+=a[t>>20&15]+a[t>>16&15])),s},x.prototype.buffer=x.prototype.arrayBuffer=function(){this.finalize();var t,r=this.blockCount,e=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,u=0,s=this.outputBits>>3;t=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var a=new Uint32Array(t);u<n;){for(i=0;i<r&&u<n;++i,++u)a[u]=e[i];u%r==0&&I(e)}return o&&(a[i]=e[i],t=t.slice(0,s)),t},x.prototype.digest=x.prototype.array=function(){this.finalize();for(var t,r,e=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,u=0,s=0,a=[];s<o;){for(u=0;u<e&&s<o;++u,++s)t=s<<2,r=n[u],a[t]=255&r,a[t+1]=r>>8&255,a[t+2]=r>>16&255,a[t+3]=r>>24&255;s%e==0&&I(n)}return i&&(t=s<<2,r=n[u],a[t]=255&r,1<i&&(a[t+1]=r>>8&255),2<i&&(a[t+2]=r>>16&255)),a},(T.prototype=new x).finalize=function(){return this.encode(this.outputBits,!0),x.prototype.finalize.call(this)};var I=function(t){var r,e,n,o,i,u,s,a,f,h,c,l,p,d,g,y,w,v,b,A,m,E,B,_,k,U,C,S,x,T,I,L,R,H,O,F,M,N,j,z,Y,P,V,X,D,q,J,W,K,Z,G,Q,$,tt,rt,et,nt,ot,it,ut,st,at,ft;for(n=0;n<48;n+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],r=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|s>>>31),e=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|u>>>31),t[0]^=r,t[1]^=e,t[10]^=r,t[11]^=e,t[20]^=r,t[21]^=e,t[30]^=r,t[31]^=e,t[40]^=r,t[41]^=e,r=o^(a<<1|f>>>31),e=i^(f<<1|a>>>31),t[2]^=r,t[3]^=e,t[12]^=r,t[13]^=e,t[22]^=r,t[23]^=e,t[32]^=r,t[33]^=e,t[42]^=r,t[43]^=e,r=u^(h<<1|c>>>31),e=s^(c<<1|h>>>31),t[4]^=r,t[5]^=e,t[14]^=r,t[15]^=e,t[24]^=r,t[25]^=e,t[34]^=r,t[35]^=e,t[44]^=r,t[45]^=e,r=a^(l<<1|p>>>31),e=f^(p<<1|l>>>31),t[6]^=r,t[7]^=e,t[16]^=r,t[17]^=e,t[26]^=r,t[27]^=e,t[36]^=r,t[37]^=e,t[46]^=r,t[47]^=e,r=h^(o<<1|i>>>31),e=c^(i<<1|o>>>31),t[8]^=r,t[9]^=e,t[18]^=r,t[19]^=e,t[28]^=r,t[29]^=e,t[38]^=r,t[39]^=e,t[48]^=r,t[49]^=e,d=t[0],g=t[1],q=t[11]<<4|t[10]>>>28,J=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,P=t[40]<<18|t[41]>>>14