UNPKG

dpos-offline

Version:

Offline Signing Transactions for DPOS Blockchains

14 lines 165 kB
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ var n=r(29),i=r(30),o=r(31);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"!=typeof t)return u(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=c(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=f(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}(t,e,r):function(t,e){if(a.isBuffer(e)){var r=0|g(e.length);return 0===(t=f(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?f(t,0):c(t,e);if("Buffer"===e.type&&o(e.data))return c(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(h(e),t=f(t,e<0?0:0|g(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function c(t,e){var r=e.length<0?0:0|g(e.length);t=f(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function g(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,s=1,f=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;f/=s=2,a/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<f;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===a)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(f<r+a&&(r=f-a),o=r;0<=o;o--){for(var l=!0,c=0;c<a;c++)if(u(t,o+c)!==u(e,c)){l=!1;break}if(l)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?i<(n=Number(n))&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");o/2<n&&(n=o/2);for(var s=0;s<n;++s){var f=parseInt(e.substr(2*s,2),16);if(isNaN(f))return s;t[r+s]=f}return s}function b(t,e,r,n){return k(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function m(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,f,a,u=t[i],h=null,l=239<u?4:223<u?3:191<u?2:1;if(i+l<=r)switch(l){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[i+1]))&&127<(a=(31&u)<<6|63&o)&&(h=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(a=(15&u)<<12|(63&o)<<6|63&s)&&(a<55296||57343<a)&&(h=a);break;case 4:o=t[i+1],s=t[i+2],f=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&f)&&65535<(a=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&f)&&a<1114112&&(h=a)}null===h?(h=65533,l=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=l}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=E));return r}(n)}e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return u(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return n=null,o=e,s=r,h(i=t),i<=0?f(n,i):void 0!==o?"string"==typeof s?f(n,i).fill(o,s):f(n,i).fill(o):f(n,i);var n,i,o,s},a.allocUnsafe=function(t){return l(null,t)},a.allocUnsafeSlow=function(t){return l(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.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}},a.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.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 e=0;e<t;e+=2)y(this,e,e+1);return this},a.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 e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},a.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 e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?_(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return m(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.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+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),f=Math.min(o,s),u=this.slice(n,i),h=t.slice(e,r),l=0;l<f;++l)if(u[l]!==h[l]){o=u[l],s=h[l];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return d(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return d(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,f,a,u,h,l=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return u=e,h=r,k(N(t,this.length-u),this,u,h);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return this,f=e,a=r,k(F(t),this,f,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=e,s=r,k(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,this.length-o),this,o,s);default:if(l)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),l=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=M(t[o]);return i}function B(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function S(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function R(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function O(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,o){return o||O(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function x(t,e,r,n,o){return o||O(t,0,r,8),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;r=new a(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},a.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},a.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},a.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||S(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);S(this,t,e,r,i-1,-i)}var o=0,s=1,f=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===f&&0!==this[e+o-1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);S(this,t,e,r,i-1,-i)}var o=r-1,s=1,f=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)t<0&&0===f&&0!==this[e+o+1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||S(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return x(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return x(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),0<n&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;0<=i;--i)t[i+e]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=a.isBuffer(t)?t:N(new a(t,n).toString()),f=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%f]}return this};var C=/[^+\/0-9A-Za-z-_]/g;function M(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(t){return n.toByteArray(function(t){var e;if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function k(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(28))},function(t,e){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(t){if(null==t)return!0;if("boolean"==typeof t)return!1;if("number"==typeof t)return 0===t;if("string"==typeof t)return 0===t.length;if("function"==typeof t)return 0===t.length;if(Array.isArray(t))return 0===t.length;if(t instanceof Error)return""===t.message;if(t.toString==n)switch(t.toString()){case"[object File]":case"[object Map]":case"[object Set]":return 0===t.size;case"[object Object]":for(var e in t)if(r.call(t,e))return!1;return!0}return!1}},function(t,e,r){"use strict";(function(t){var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var s=r(10),f=r(1),a=r(4),u=function(){function e(t,e){this.type=t,this.identifier=e}return e.prototype.calcBytes=function(e){var r=this.assetBytes(e),n=new s(213+r.length,!0);return n.writeByte(e.type),n.writeUint32(e.timestamp),n.append(e.senderPublicKey),f(e.requesterPublicKey)||n.append(e.requesterPublicKey),f(e.recipientId)?n.append(t.alloc(8).fill(0)):n.append(new t(a.fromString(e.recipientId.slice(0,-1)).toBytesBE())),n.writeLong(e.amount),n.append(r),n.flip(),new t(n.toBuffer())},e.prototype.calcFullBytes=function(e){return t.concat(o([this.calcBytes(e)],o([e.signature,e.signSignature],e.signatures||[]).filter(function(t){return!!t})))},e.prototype.fromPostable=function(e){var r=n({},e,{amount:parseInt(""+e.amount,10),fee:parseInt(""+e.fee,10),requesterPublicKey:e.requesterPublicKey?t.from(e.requesterPublicKey,"hex"):null,senderPublicKey:e.senderPublicKey?t.from(e.senderPublicKey,"hex"):null,signSignature:e.signSignature?t.from(e.signSignature,"hex"):null,signature:e.signature?t.from(e.signature,"hex"):null,signatures:e.signatures?e.signatures.map(function(e){return t.from(e,"hex")}):null});return["requesterPublicKey","senderPublicKey","signSignature","signatures","signature"].forEach(function(t){null===r[t]&&delete r[t]}),r},e.prototype.toPostable=function(t){var e=n({},t,{amount:""+t.amount,fee:""+t.fee,requesterPublicKey:t.requesterPublicKey?t.requesterPublicKey.toString("hex"):null,senderPublicKey:t.senderPublicKey.toString("hex"),signSignature:t.signSignature?t.signSignature.toString("hex"):null,signature:t.signature.toString("hex"),signatures:t.signatures?t.signatures.map(function(t){return t.toString("hex")}):null});return["requesterPublicKey","senderPublicKey","signSignature","signatures"].forEach(function(t){null===e[t]&&delete e[t]}),e},e.prototype.transform=function(t){var e={amount:0,asset:null,fee:null,id:null,recipientId:null,requesterPublicKey:null,senderId:null,senderPublicKey:null,timestamp:null,type:this.type};if(f(t.fee)?e.fee=this.calcFees(t):e.fee=parseInt(t.fee,10),f(t.sender.publicKey))throw new Error("Please set sender publicKey");return e.senderPublicKey=t.sender.publicKey,e.senderId=t.sender.address||t.sender.address,f(t.nonce)?e.timestamp=parseInt(this.createNonce(),10):e.timestamp=parseInt(t.nonce,10),t.signature&&(e.signature=t.signature),t.extraSignatures&&(1===t.extraSignatures.length?e.signSignature=t.extraSignatures[0]:e.signatures=t.extraSignatures),e},e.prototype.createNonce=function(){return""+Math.floor((Date.now()-Date.UTC(2016,4,24,17,0,0,0))/1e3)},e.prototype.fromBytes=function(t){throw new Error("Cant derive a lsk transaction from buffer inequivocably")},e}();e.BaseLiskCodec=u}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};Object.defineProperty(e,"__esModule",{value:!0});var f=r(10),a=r(5),u=r(11),h=r(12),l=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r.prototype.calcBytes=function(e){var r=new f(1024,!0);function n(e){return t.concat([a.encode(e.length),e])}return r.writeUint8(e.type),r.writeUint32(e.version),r.writeUint32(e.timestamp),r.append(n(e.senderPubData)),r.append(n(e.recipientId?h.RiseIdsHandler.addressToBytes(e.recipientId):t.alloc(0))),r.writeUint64(parseInt(e.amount,10)),r.writeUint64(parseInt(e.fee,10)),r.append(n(this.assetBytes(e))),r.flip(),new t(r.toBuffer())},r.prototype.fromBytes=function(t){var e,r,n=0;function i(){var e=a.decode(t,n);return n+=a.decode.bytes,l(e)}function f(){var e=t.readUInt32LE(n);return n+=4,e}function u(){var t=s([f(),f()],2),e=t[0];return t[1]*Math.pow(2,32)+e}function l(e){var r=t.slice(n,n+e);return n+=e,r}return o({id:h.RiseIdsHandler.calcTxIdFromBytes(t),type:(r=t.readUInt8(n),n+=1,r),version:f(),timestamp:f()},(e=i(),{senderId:h.RiseIdsHandler.addressFromPubData(e),senderPubData:e}),{recipientId:h.RiseIdsHandler.addressFromBytes(i()),amount:""+u(),fee:""+u(),asset:this.assetFromBytes(i()),signatures:new Array(Math.floor((t.length-n)/64)).fill(null).map(function(){return l(64)})})},r}(u.BaseRiseCodec);e.BaseRiseV2Codec=l}).call(this,r(0).Buffer)},function(t,e){t.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}function n(t,e,r){this.low=0|t,this.high=0|e,this.unsigned=!!r}function i(t){return!0===(t&&t.__isLong__)}Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},s={};function f(t,e){var r,n,i;return e?(i=0<=(t>>>=0)&&t<256)&&(n=s[t])?n:(r=u(t,(0|t)<0?-1:0,!0),i&&(s[t]=r),r):(i=-128<=(t|=0)&&t<128)&&(n=o[t])?n:(r=u(t,t<0?-1:0,!1),i&&(o[t]=r),r)}function a(t,e){if(isNaN(t))return e?w:v;if(e){if(t<0)return w;if(p<=t)return A}else{if(t<=-y)return I;if(y<=t+1)return E}return t<0?a(-t,e).neg():u(t%g|0,t/g|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=f,n.fromNumber=a,n.fromBits=u;var h=Math.pow;function l(t,e,r){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return v;if(e="number"==typeof e?(r=e,!1):!!e,(r=r||10)<2||36<r)throw RangeError("radix");var n;if(0<(n=t.indexOf("-")))throw Error("interior hyphen");if(0===n)return l(t.substring(1),e,r).neg();for(var i=a(h(r,8)),o=v,s=0;s<t.length;s+=8){var f=Math.min(8,t.length-s),u=parseInt(t.substring(s,s+f),r);if(f<8){var c=a(h(r,f));o=o.mul(c).add(a(u))}else o=(o=o.mul(i)).add(a(u))}return o.unsigned=e,o}function c(t,e){return"number"==typeof t?a(t,e):"string"==typeof t?l(t,e):u(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}n.fromString=l,n.fromValue=c;var g=4294967296,p=g*g,y=p/2,d=f(1<<24),v=f(0);n.ZERO=v;var w=f(0,!0);n.UZERO=w;var b=f(1);n.ONE=b;var m=f(1,!0);n.UONE=m;var _=f(-1);n.NEG_ONE=_;var E=u(-1,2147483647,!1);n.MAX_VALUE=E;var A=u(-1,-1,!0);n.MAX_UNSIGNED_VALUE=A;var I=u(0,-2147483648,!1);n.MIN_VALUE=I;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*g+(this.low>>>0):this.high*g+(this.low>>>0)},T.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(I)){var e=a(t),r=this.div(e),n=r.mul(e).sub(this);return r.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=a(h(t,6),this.unsigned),o=this,s="";;){var f=o.div(i),u=(o.sub(f.mul(i)).toInt()>>>0).toString(t);if((o=f).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;0<e&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||0<=this.high},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(t){return i(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},T.eq=T.equals,T.notEquals=function(t){return!this.eq(t)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(t){return this.comp(t)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(t){return this.comp(t)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(t){return 0<this.comp(t)},T.gt=T.greaterThan,T.greaterThanOrEqual=function(t){return 0<=this.comp(t)},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(t){if(i(t)||(t=c(t)),this.eq(t))return 0;var e=this.isNegative(),r=t.isNegative();return e&&!r?-1:!e&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(b)},T.neg=T.negate,T.add=function(t){i(t)||(t=c(t));var e=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=t.high>>>16,f=65535&t.high,a=t.low>>>16,h=0,l=0,g=0,p=0;return g+=(p+=o+(65535&t.low))>>>16,l+=(g+=n+a)>>>16,h+=(l+=r+f)>>>16,h+=e+s,u((g&=65535)<<16|(p&=65535),(h&=65535)<<16|(l&=65535),this.unsigned)},T.subtract=function(t){return i(t)||(t=c(t)),this.add(t.neg())},T.sub=T.subtract,T.multiply=function(t){if(this.isZero())return v;if(i(t)||(t=c(t)),r)return u(r.mul(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned);if(t.isZero())return v;if(this.eq(I))return t.isOdd()?I:v;if(t.eq(I))return this.isOdd()?I:v;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(d)&&t.lt(d))return a(this.toNumber()*t.toNumber(),this.unsigned);var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,f=t.high>>>16,h=65535&t.high,l=t.low>>>16,g=65535&t.low,p=0,y=0,w=0,b=0;return w+=(b+=s*g)>>>16,y+=(w+=o*g)>>>16,w&=65535,y+=(w+=s*l)>>>16,p+=(y+=n*g)>>>16,y&=65535,p+=(y+=o*l)>>>16,y&=65535,p+=(y+=s*h)>>>16,p+=e*g+n*l+o*h+s*f,u((w&=65535)<<16|(b&=65535),(p&=65535)<<16|(y&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(t){if(i(t)||(t=c(t)),t.isZero())throw Error("division by zero");var e,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?r.div_u:r.div_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?w:v;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return w;if(t.gt(this.shru(1)))return m;o=w}else{if(this.eq(I))return t.eq(b)||t.eq(_)?I:t.eq(I)?b:(e=this.shr(1).div(t).shl(1)).eq(v)?t.isNegative()?b:_:(n=this.sub(t.mul(e)),o=e.add(n.div(t)));if(t.eq(I))return this.unsigned?w:v;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=v}for(n=this;n.gte(t);){e=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(e)/Math.LN2),f=s<=48?1:h(2,s-48),l=a(e),g=l.mul(t);g.isNegative()||g.gt(n);)g=(l=a(e-=f,this.unsigned)).mul(t);l.isZero()&&(l=b),o=o.add(l),n=n.sub(g)}return o},T.div=T.divide,T.modulo=function(t){return i(t)||(t=c(t)),r?u((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,t.low,t.high),r.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(t){return i(t)||(t=c(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},T.or=function(t){return i(t)||(t=c(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},T.xor=function(t){return i(t)||(t=c(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},T.shiftLeft=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):u(0,this.low<<t-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(t){return i(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,0<=this.high?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(t){if(i(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},T.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},function(t,e,r){"use strict";var n=r(7).Buffer,i=9007199254740991;function o(t){if(t<0||i<t||t%1!=0)throw new RangeError("value out of range")}function s(t){return o(t),t<253?1:t<=65535?3:t<=4294967295?5:9}t.exports={encode:function t(e,r,i){if(o(e),r||(r=n.allocUnsafe(s(e))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),t.bytes=e<253?(r.writeUInt8(e,i),1):e<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(e,i+1),3):e<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(e,i+1),5):(r.writeUInt8(255,i),r.writeUInt32LE(e>>>0,i+1),r.writeUInt32LE(e/4294967296|0,i+5),9),r},decode:function t(e,r){if(!n.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=e.readUInt8(r);if(i<253)return t.bytes=1,i;if(253===i)return t.bytes=3,e.readUInt16LE(r+1);if(254===i)return t.bytes=5,e.readUInt32LE(r+1);t.bytes=9;var s=e.readUInt32LE(r+1),f=4294967296*e.readUInt32LE(r+5)+s;return o(f),f},encodingLength:s}},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=r(10),s=r(1),f=r(5),a=r(11),u=r(12),h=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i(r,e),r.prototype.calcBytes=function(e){var r=this.assetBytes(e),n=new o(213+r.length,!0),i=!s(e.recipientId)&&!/^[0-9]+R$/.test(e.recipientId);if(n.writeByte(e.type),n.writeUint32((i?Math.pow(2,30):0)+e.timestamp),n.append(e.senderPubData),i){var a=u.RiseIdsHandler.addressToBytes(e.recipientId);n.append(f.encode(a.length)),n.append(a)}else s(e.recipientId)?n.append(t.alloc(8).fill(0)):n.append(u.RiseIdsHandler.addressToBytes(e.recipientId));return n.writeLong(e.amount),n.append(r),n.flip(),new t(n.toBuffer())},r.prototype.fromBytes=function(t){throw new Error("V1 transaction types do not support deserializing from bytes")},r.prototype.assetFromBytes=function(t){throw new Error("V1 transaction types do not support deserializing from bytes")},r}(a.BaseRiseCodec);e.BaseRiseV1Codec=h}).call(this,r(0).Buffer)},function(t,e,r){var n=r(0),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):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)}},function(t,e,r){"use strict";(function(t){var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),o=r(4),s=r(5),f=r(17),a=r(36),u=r(19);e.Lisk={txs:{_codec:null,getAddressBytes:function(e){return new t(o.fromString(e.slice(0,-1)).toBytesBE())},bytes:function(t){return u.liskCodecUtils.findCodecFromType(t.type).calcFullBytes(t)},bytesForSignature:function(t){return u.liskCodecUtils.findCodecFromType(t.type).calcBytes(t)},transform:function(t){return u.liskCodecUtils.findCodecFromIdentifier(t.kind).transform(t)},calcSignature:function(t,e){return this._codec.raw.sign(f.toSha256(this.bytes(t)),"string"==typeof e?this._codec.deriveKeypair(e):e)},createAndSign:function(t,e,r){var n="string"==typeof e?this._codec.deriveKeypair(e):e;i(t.sender)&&(t.sender={address:this._codec.calcAddress(n.publicKey),publicKey:n.publicKey});var o=this.transform(t),s=this.sign(o,n);return r?s:this.toPostable(s)},sign:function(t,e){var r="string"==typeof e?this._codec.deriveKeypair(e):e;return t.senderPublicKey||(t.senderPublicKey=r.publicKey),t.signature=this.calcSignature(t,r,{skipSecondSign:!0,skipSignature:!0}),t.id=this.identifier(t),t},verify:function(t,e,r){var n=f.toSha256(this.bytesForSignature(t));return this._codec.raw.verify(n,e||t.signature,r||t.senderPublicKey)},toPostable:function(t){return n({},u.liskCodecUtils.findCodecFromType(t.type).toPostable(t),{id:this.identifier(t)})},fromPostable:function(t){return u.liskCodecUtils.findCodecFromType(t.type).fromPostable(t)},identifier:function(t){for(var e=f.toSha256(this.bytes(t)),r=[],n=0;n<8;n++)r.push(e[7-n]);return o.fromBytesBE(r,!0).toString()}},msgs:{_codec:null,prefix:new t("Lisk Signed Message:\n","utf8"),signablePayload:function(e){var r=t.isBuffer(e)?e:t.from(e,"utf8"),n=t.concat([s.encode(this.prefix.length),this.prefix,s.encode(r.length),r]);return f.toSha256(f.toSha256(n))},sign:function(t,e){return this._codec.raw.sign(this.signablePayload(t),e)},verify:function(t,e,r){return this._codec.raw.verify(this.signablePayload(t),e,r)}},deriveKeypair:function(e){var r=f.toSha256(t.isBuffer(e)?e:t.from(e,"utf8")),n=a.ed25519.crypto_sign_seed_keypair(r);return{privateKey:n.secretKey,publicKey:n.publicKey}},calcAddress:function(e){for(var r=f.toSha256(t.isBuffer(e)?e:t.from(e,"hex")),n=[],i=0;i<8;i++)n.push(r[7-i]);return o.fromBytesBE(n,!0).toString()+"L"},raw:{sign:function(t,e){return a.ed25519.crypto_sign_detached(t,e.privateKey)},verify:function(t,e,r){return a.ed25519.crypto_sign_verify_detached(e,t,r)}}},e.Lisk.msgs._codec=e.Lisk,e.Lisk.txs._codec=e.Lisk}).call(this,r(0).Buffer)},function(t,e){t.exports=null},function(t,e,r){var n,i,o; /** * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io> * Backing buffer: ArrayBuffer, Accessor: Uint8Array * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/bytebuffer.js for details */i=[r(40)],void 0===(o="function"==typeof(n=function(t){"use strict";var e=function(t,r,i){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===r&&(r=e.DEFAULT_ENDIAN),void 0===i&&(i=e.DEFAULT_NOASSERT),!i){if((t|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===t?n:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=r,this.noAssert=i};e.VERSION="5.0.1",e.LITTLE_ENDIAN=!0,e.BIG_ENDIAN=!1,e.DEFAULT_CAPACITY=16,e.DEFAULT_ENDIAN=e.BIG_ENDIAN,e.DEFAULT_NOASSERT=!1,e.Long=t||null;var r=e.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var n=new ArrayBuffer(0),i=String.fromCharCode;function o(t){var e=0;return function(){return e<t.length?t.charCodeAt(e++):null}}function s(){var t=[],e=[];return function(){if(0===arguments.length)return e.join("")+i.apply(String,t);1024<t.length+arguments.length&&(e.push(i.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function f(t,e,r,n,i){var o,s,f=8*i-n-1,a=(1<<f)-1,u=a>>1,h=-7,l=r?i-1:0,c=r?-1:1,g=t[e+l];for(l+=c,o=g&(1<<-h)-1,g>>=-h,h+=f;0<h;o=256*o+t[e+l],l+=c,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;0<h;s=256*s+t[e+l],l+=c,h-=8);if(0===o)o=1-u;else{if(o===a)return s?NaN:1/0*(g?-1:1);s+=Math.pow(2,n),o-=u}return(g?-1:1)*s*Math.pow(2,o-n)}function a(t,e,r,n,i,o){var s,f,a,u=8*o-i-1,h=(1<<u)-1,l=h>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),2<=(e+=1<=s+l?c/a:c*Math.pow(2,1-l))*a&&(s++,a/=2),h<=s+l?(f=0,s=h):1<=s+l?(f=(e*a-1)*Math.pow(2,i),s+=l):(f=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));8<=i;t[r+g]=255&f,g+=p,f/=256,i-=8);for(s=s<<i|f,u+=i;0<u;t[r+g]=255&s,g+=p,s/=256,u-=8);t[r+g-p]|=128*y}e.accessor=function(){return Uint8Array},e.allocate=function(t,r,n){return new e(t,r,n)},e.concat=function(t,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var o,s=0,f=0,a=t.length;f<a;++f)e.isByteBuffer(t[f])||(t[f]=e.wrap(t[f],r)),0<(o=t[f].limit-t[f].offset)&&(s+=o);if(0===s)return new e(0,n,i);var u,h=new e(s,n,i);for(f=0;f<a;)(o=(u=t[f++]).limit-u.offset)<=0||(h.view.set(u.view.subarray(u.offset,u.limit),h.offset),h.offset+=o);return h.limit=h.offset,h.offset=0,h},e.isByteBuffer=function(t){return!0===(t&&t.__isByteBuffer__)},e.type=function(){return ArrayBuffer},e.wrap=function(t,n,i,o){if("string"!=typeof n&&(o=i,i=n,n=void 0),"string"==typeof t)switch(void 0===n&&(n="utf8"),n){case"base64":return e.fromBase64(t,i);case"hex":return e.fromHex(t,i);case"binary":return e.fromBinary(t,i);case"utf8":return e.fromUTF8(t,i);case"debug":return e.fromDebug(t,i);default:throw Error("Unsupported encoding: "+n)}if(null===t||"object"!=typeof t)throw TypeError("Illegal buffer");var s;if(e.isByteBuffer(t))return(s=r.clone.call(t)).markedOffset=-1,s;if(t instanceof Uint8Array)s=new e(0,i,o),0<t.length&&(s.buffer=t.buffer,s.offset=t.byteOffset,s.limit=t.byteOffset+t.byteLength,s.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)s=new e(0,i,o),0<t.byteLength&&(s.buffer=t,s.offset=0,s.limit=t.byteLength,s.view=0<t.byteLength?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");(s=new e(t.length,i,o)).limit=t.length;for(var f=0;f<t.length;++f)s.view[f]=t[f]}return s},r.writeBitSet=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if(!(t instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n,i=e,o=t.length,s=o>>3,f=0;for(e+=this.writeVarint32(o,e);s--;)n=1&!!t[f++]|(1&!!t[f++])<<1|(1&!!t[f++])<<2|(1&!!t[f++])<<3|(1&!!t[f++])<<4|(1&!!t[f++])<<5|(1&!!t[f++])<<6|(1&!!t[f++])<<7,this.writeByte(n,e++);if(f<o){var a=0;for(n=0;f<o;)n|=(1&!!t[f++])<<a++;this.writeByte(n,e++)}return r?(this.offset=e,this):e-i},r.readBitSet=function(t){var e=void 0===t;e&&(t=this.offset);var r,n=this.readVarint32(t),i=n.value,o=i>>3,s=0,f=[];for(t+=n.length;o--;)r=this.readByte(t++),f[s++]=!!(1&r),f[s++]=!!(2&r),f[s++]=!!(4&r),f[s++]=!!(8&r),f[s++]=!!(16&r),f[s++]=!!(32&r),f[s++]=!!(64&r),f[s++]=!!(128&r);if(s<i){var a=0;for(r=this.readByte(t++);s<i;)f[s++]=!!(r>>a++&1)}return e&&(this.offset=t),f},r.readBytes=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var n=this.slice(e,e+t);return r&&(this.offset+=t),n},r.writeBytes=r.append,r.writeInt8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var n=this.buffer.byteLength;return n<e&&this.resize((n*=2)>e?n:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return 128==(128&r)&&(r=-(255-r+1)),e&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var n=this.buffer.byteLength;return n<e&&this.resize((n*=2)>e?n:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return e&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var n=this.buffer.byteLength;return n<e&&this.resize((n*=2)>e?n:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),32768==(32768&r)&&(r=-(65535