-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3345.595d311b00a1ec25aed1.js
1 lines (1 loc) · 25.8 KB
/
3345.595d311b00a1ec25aed1.js
1
"use strict";(self.webpackChunktimeless_frontend=self.webpackChunktimeless_frontend||[]).push([[3345],{5514:function(R,e,l){var T=this&&this.__read||function(u,r){var s="function"==typeof Symbol&&u[Symbol.iterator];if(!s)return u;var E,O,S=s.call(u),L=[];try{for(;(void 0===r||r-- >0)&&!(E=S.next()).done;)L.push(E.value)}catch(_){O={error:_}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(O)throw O.error}}return L},A=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;var g=A(l(33114)),y=l(48472),h=l(10019),m=l(63125),n=l(76602),c=l(40951),i=l(56915),a=l(51950),f=l(4442),P=function(){function u(r,s,S,E){void 0===r&&(r=new y.BN(0)),void 0===s&&(s=new y.BN(0)),void 0===S&&(S=n.KECCAK256_RLP),void 0===E&&(E=n.KECCAK256_NULL),this.nonce=r,this.balance=s,this.stateRoot=S,this.codeHash=E,this._validate()}return u.fromAccountData=function(r){var s=r.nonce,S=r.balance,E=r.stateRoot,L=r.codeHash;return new u(s?new y.BN((0,c.toBuffer)(s)):void 0,S?new y.BN((0,c.toBuffer)(S)):void 0,E?(0,c.toBuffer)(E):void 0,L?(0,c.toBuffer)(L):void 0)},u.fromRlpSerializedAccount=function(r){var s=y.rlp.decode(r);if(!Array.isArray(s))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(s)},u.fromValuesArray=function(r){var s=T(r,4),E=s[1],L=s[2],O=s[3];return new u(new y.BN(s[0]),new y.BN(E),L,O)},u.prototype._validate=function(){if(this.nonce.lt(new y.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new y.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},u.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},u.prototype.serialize=function(){return y.rlp.encode(this.raw())},u.prototype.isContract=function(){return!this.codeHash.equals(n.KECCAK256_NULL)},u.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(n.KECCAK256_NULL)},u}();e.Account=P,e.isValidAddress=function(u){try{(0,a.assertIsString)(u)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(u)},e.toChecksumAddress=function(u,r){(0,a.assertIsHexString)(u);var s=(0,m.stripHexPrefix)(u).toLowerCase(),S="";r&&(S=(0,f.toType)(r,f.TypeOutput.BN).toString()+"0x");for(var L=(0,i.keccakFromString)(S+s).toString("hex"),O="0x",_=0;_<s.length;_++)parseInt(L[_],16)>=8?O+=s[_].toUpperCase():O+=s[_];return O},e.isValidChecksumAddress=function(u,r){return(0,e.isValidAddress)(u)&&(0,e.toChecksumAddress)(u,r)===u},e.generateAddress=function(u,r){(0,a.assertIsBuffer)(u),(0,a.assertIsBuffer)(r);var s=new y.BN(r);return s.isZero()?(0,i.rlphash)([u,null]).slice(-20):(0,i.rlphash)([u,Buffer.from(s.toArray())]).slice(-20)},e.generateAddress2=function(u,r,s){return(0,a.assertIsBuffer)(u),(0,a.assertIsBuffer)(r),(0,a.assertIsBuffer)(s),(0,g.default)(20===u.length),(0,g.default)(32===r.length),(0,i.keccak256)(Buffer.concat([Buffer.from("ff","hex"),u,r,(0,i.keccak256)(s)])).slice(-20)},e.isValidPrivate=function(u){return(0,h.privateKeyVerify)(u)},e.isValidPublic=function(u,r){return void 0===r&&(r=!1),(0,a.assertIsBuffer)(u),64===u.length?(0,h.publicKeyVerify)(Buffer.concat([Buffer.from([4]),u])):!!r&&(0,h.publicKeyVerify)(u)},e.pubToAddress=function(u,r){return void 0===r&&(r=!1),(0,a.assertIsBuffer)(u),r&&64!==u.length&&(u=Buffer.from((0,h.publicKeyConvert)(u,!1).slice(1))),(0,g.default)(64===u.length),(0,i.keccak)(u).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToPublic=function(u){return(0,a.assertIsBuffer)(u),Buffer.from((0,h.publicKeyCreate)(u,!1)).slice(1)},e.privateToAddress=function(u){return(0,e.publicToAddress)((0,e.privateToPublic)(u))},e.importPublic=function(u){return(0,a.assertIsBuffer)(u),64!==u.length&&(u=Buffer.from((0,h.publicKeyConvert)(u,!1).slice(1))),u},e.zeroAddress=function(){var r=(0,c.zeros)(20);return(0,c.bufferToHex)(r)},e.isZeroAddress=function(u){try{(0,a.assertIsString)(u)}catch{return!1}return(0,e.zeroAddress)()===u}},21892:function(R,e,l){var T=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.Address=void 0;var A=T(l(33114)),g=l(48472),y=l(40951),h=l(5514),m=function(){function n(c){(0,A.default)(20===c.length,"Invalid address length"),this.buf=c}return n.zero=function(){return new n((0,y.zeros)(20))},n.fromString=function(c){return(0,A.default)((0,h.isValidAddress)(c),"Invalid address"),new n((0,y.toBuffer)(c))},n.fromPublicKey=function(c){return(0,A.default)(Buffer.isBuffer(c),"Public key should be Buffer"),new n((0,h.pubToAddress)(c))},n.fromPrivateKey=function(c){return(0,A.default)(Buffer.isBuffer(c),"Private key should be Buffer"),new n((0,h.privateToAddress)(c))},n.generate=function(c,i){return(0,A.default)(g.BN.isBN(i)),new n((0,h.generateAddress)(c.buf,i.toArrayLike(Buffer)))},n.generate2=function(c,i,a){return(0,A.default)(Buffer.isBuffer(i)),(0,A.default)(Buffer.isBuffer(a)),new n((0,h.generateAddress2)(c.buf,i,a))},n.prototype.equals=function(c){return this.buf.equals(c.buf)},n.prototype.isZero=function(){return this.equals(n.zero())},n.prototype.isPrecompileOrSystemAddress=function(){var c=new g.BN(this.buf),i=new g.BN(0),a=new g.BN("ffff","hex");return c.gte(i)&&c.lte(a)},n.prototype.toString=function(){return"0x"+this.buf.toString("hex")},n.prototype.toBuffer=function(){return Buffer.from(this.buf)},n}();e.Address=m},40951:function(R,e,l){var T=this&&this.__values||function(r){var s="function"==typeof Symbol&&Symbol.iterator,S=s&&r[s],E=0;if(S)return S.call(r);if(r&&"number"==typeof r.length)return{next:function(){return r&&E>=r.length&&(r=void 0),{value:r&&r[E++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},A=this&&this.__read||function(r,s){var S="function"==typeof Symbol&&r[Symbol.iterator];if(!S)return r;var L,_,E=S.call(r),O=[];try{for(;(void 0===s||s-- >0)&&!(L=E.next()).done;)O.push(L.value)}catch(k){_={error:k}}finally{try{L&&!L.done&&(S=E.return)&&S.call(E)}finally{if(_)throw _.error}}return O};Object.defineProperty(e,"__esModule",{value:!0}),e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;var g=l(48472),y=l(63125),h=l(51950);e.intToHex=function(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("Received an invalid integer type: ".concat(r));return"0x".concat(r.toString(16))},e.intToBuffer=function(r){var s=(0,e.intToHex)(r);return Buffer.from((0,y.padToEven)(s.slice(2)),"hex")},e.zeros=function(r){return Buffer.allocUnsafe(r).fill(0)};var i=function(r,s,S){var E=(0,e.zeros)(s);return S?r.length<s?(r.copy(E),E):r.slice(0,s):r.length<s?(r.copy(E,s-r.length),E):r.slice(-s)};e.setLengthLeft=function(r,s){return(0,h.assertIsBuffer)(r),i(r,s,!1)},e.setLengthRight=function(r,s){return(0,h.assertIsBuffer)(r),i(r,s,!0)};var P=function(r){for(var s=r[0];r.length>0&&"0"===s.toString();)s=(r=r.slice(1))[0];return r};e.unpadBuffer=function(r){return(0,h.assertIsBuffer)(r),P(r)},e.unpadArray=function(r){return(0,h.assertIsArray)(r),P(r)},e.unpadHexString=function(r){return(0,h.assertIsHexString)(r),r=(0,y.stripHexPrefix)(r),P(r)},e.toBuffer=function(r){if(null==r)return Buffer.allocUnsafe(0);if(Buffer.isBuffer(r)||Array.isArray(r)||r instanceof Uint8Array)return Buffer.from(r);if("string"==typeof r){if(!(0,y.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return Buffer.from((0,y.padToEven)((0,y.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,e.intToBuffer)(r);if(g.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(Buffer)}if(r.toArray)return Buffer.from(r.toArray());if(r.toBuffer)return Buffer.from(r.toBuffer());throw new Error("invalid type")},e.bufferToInt=function(r){return new g.BN((0,e.toBuffer)(r)).toNumber()},e.bufferToHex=function(r){return"0x"+(r=(0,e.toBuffer)(r)).toString("hex")},e.fromSigned=function(r){return new g.BN(r).fromTwos(256)},e.toUnsigned=function(r){return Buffer.from(r.toTwos(256).toArray())},e.addHexPrefix=function(r){return"string"!=typeof r||(0,y.isHexPrefixed)(r)?r:"0x"+r},e.toUtf8=function(r){if((r=(0,y.stripHexPrefix)(r)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return Buffer.from(r.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},e.baToJSON=function(r){if(Buffer.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var s=[],S=0;S<r.length;S++)s.push((0,e.baToJSON)(r[S]));return s}},e.validateNoLeadingZeroes=function(r){var s,S;try{for(var E=T(Object.entries(r)),L=E.next();!L.done;L=E.next()){var O=A(L.value,2),k=O[1];if(void 0!==k&&k.length>0&&0===k[0])throw new Error("".concat(O[0]," cannot have leading zeroes, received: ").concat(k.toString("hex")))}}catch(M){s={error:M}}finally{try{L&&!L.done&&(S=E.return)&&S.call(E)}finally{if(s)throw s.error}}},e.arrToBufArr=function j(r){return Array.isArray(r)?r.map(function(s){return j(s)}):Buffer.from(r)},e.bufArrToArr=function u(r){return Array.isArray(r)?r.map(function(s){return u(s)}):Uint8Array.from(r??[])}},76602:(R,e,l)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.MAX_INTEGER=e.MAX_UINT64=void 0;var T=l(69337),A=l(48472);e.MAX_UINT64=new A.BN("ffffffffffffffff",16),e.MAX_INTEGER=new A.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new A.BN("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=T.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=T.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=T.Buffer.from(e.KECCAK256_RLP_S,"hex")},48472:function(R,e,l){var T=this&&this.__createBinding||(Object.create?function(n,c,i,a){void 0===a&&(a=i);var f=Object.getOwnPropertyDescriptor(c,i);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[i]}}),Object.defineProperty(n,a,f)}:function(n,c,i,a){void 0===a&&(a=i),n[a]=c[i]}),A=this&&this.__setModuleDefault||(Object.create?function(n,c){Object.defineProperty(n,"default",{enumerable:!0,value:c})}:function(n,c){n.default=c}),g=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var c={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&T(c,n,i);return A(c,n),c},y=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.rlp=e.BN=void 0;var h=y(l(62630));e.BN=h.default;var m=g(l(83111));e.rlp=m},56915:(R,e,l)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rlphash=e.ripemd160FromArray=e.ripemd160FromString=e.ripemd160=e.sha256FromArray=e.sha256FromString=e.sha256=e.keccakFromArray=e.keccakFromHexString=e.keccakFromString=e.keccak256=e.keccak=void 0;var T=l(55075),A=l(12506),g=l(48472),y=l(40951),h=l(51950);e.keccak=function(o,b){switch(void 0===b&&(b=256),(0,h.assertIsBuffer)(o),b){case 224:return(0,T.keccak224)(o);case 256:return(0,T.keccak256)(o);case 384:return(0,T.keccak384)(o);case 512:return(0,T.keccak512)(o);default:throw new Error("Invald algorithm: keccak".concat(b))}},e.keccak256=function(o){return(0,e.keccak)(o)},e.keccakFromString=function(o,b){void 0===b&&(b=256),(0,h.assertIsString)(o);var N=Buffer.from(o,"utf8");return(0,e.keccak)(N,b)},e.keccakFromHexString=function(o,b){return void 0===b&&(b=256),(0,h.assertIsHexString)(o),(0,e.keccak)((0,y.toBuffer)(o),b)},e.keccakFromArray=function(o,b){return void 0===b&&(b=256),(0,h.assertIsArray)(o),(0,e.keccak)((0,y.toBuffer)(o),b)};var f=function(o){return o=(0,y.toBuffer)(o),A("sha256").update(o).digest()};e.sha256=function(o){return(0,h.assertIsBuffer)(o),f(o)},e.sha256FromString=function(o){return(0,h.assertIsString)(o),f(o)},e.sha256FromArray=function(o){return(0,h.assertIsArray)(o),f(o)};var t=function(o,b){o=(0,y.toBuffer)(o);var N=A("rmd160").update(o).digest();return!0===b?(0,y.setLengthLeft)(N,32):N};e.ripemd160=function(o,b){return(0,h.assertIsBuffer)(o),t(o,b)},e.ripemd160FromString=function(o,b){return(0,h.assertIsString)(o),t(o,b)},e.ripemd160FromArray=function(o,b){return(0,h.assertIsArray)(o),t(o,b)},e.rlphash=function(o){return(0,e.keccak)(g.rlp.encode(o))}},51950:(R,e,l)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assertIsString=e.assertIsArray=e.assertIsBuffer=e.assertIsHexString=void 0;var T=l(63125);e.assertIsHexString=function(m){if(!(0,T.isHexString)(m)){var n="This method only supports 0x-prefixed hex strings but input was: ".concat(m);throw new Error(n)}},e.assertIsBuffer=function(m){if(!Buffer.isBuffer(m)){var n="This method only supports Buffer but input was: ".concat(m);throw new Error(n)}},e.assertIsArray=function(m){if(!Array.isArray(m)){var n="This method only supports number arrays but input was: ".concat(m);throw new Error(n)}},e.assertIsString=function(m){if("string"!=typeof m){var n="This method only supports strings but input was: ".concat(m);throw new Error(n)}}},93345:function(R,e,l){var T=this&&this.__createBinding||(Object.create?function(y,h,m,n){void 0===n&&(n=m);var c=Object.getOwnPropertyDescriptor(h,m);(!c||("get"in c?!h.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(y,n,c)}:function(y,h,m,n){void 0===n&&(n=m),y[n]=h[m]}),A=this&&this.__exportStar||function(y,h){for(var m in y)"default"!==m&&!Object.prototype.hasOwnProperty.call(h,m)&&T(h,y,m)};Object.defineProperty(e,"__esModule",{value:!0}),e.isHexString=e.getKeys=e.fromAscii=e.fromUtf8=e.toAscii=e.arrayContainsArray=e.getBinarySize=e.padToEven=e.stripHexPrefix=e.isHexPrefixed=void 0,A(l(76602),e),A(l(5514),e),A(l(21892),e),A(l(56915),e),A(l(53528),e),A(l(40951),e),A(l(49327),e),A(l(48472),e),A(l(4442),e);var g=l(63125);Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return g.isHexPrefixed}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return g.stripHexPrefix}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return g.padToEven}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return g.getBinarySize}}),Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return g.arrayContainsArray}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return g.toAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return g.fromUtf8}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return g.fromAscii}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return g.getKeys}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return g.isHexString}})},63125:(R,e)=>{function l(a){if("string"!=typeof a)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof a));return"0"===a[0]&&"x"===a[1]}function A(a){var f=a;if("string"!=typeof f)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof f));return f.length%2&&(f="0".concat(f)),f}Object.defineProperty(e,"__esModule",{value:!0}),e.isHexString=e.getKeys=e.fromAscii=e.fromUtf8=e.toAscii=e.arrayContainsArray=e.getBinarySize=e.padToEven=e.stripHexPrefix=e.isHexPrefixed=void 0,e.isHexPrefixed=l,e.stripHexPrefix=function(a){if("string"!=typeof a)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof a));return l(a)?a.slice(2):a},e.padToEven=A,e.getBinarySize=function(a){if("string"!=typeof a)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof a));return Buffer.byteLength(a,"utf8")},e.arrayContainsArray=function(a,f,P){if(!0!==Array.isArray(a))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof a,"'"));if(!0!==Array.isArray(f))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof f,"'"));return f[P?"some":"every"](function(H){return a.indexOf(H)>=0})},e.toAscii=function(a){var f="",P=0,H=a.length;for("0x"===a.substring(0,2)&&(P=2);P<H;P+=2){var C=parseInt(a.substr(P,2),16);f+=String.fromCharCode(C)}return f},e.fromUtf8=function(a){var f=Buffer.from(a,"utf8");return"0x".concat(A(f.toString("hex")).replace(/^0+|0+$/g,""))},e.fromAscii=function(a){for(var f="",P=0;P<a.length;P++){var C=a.charCodeAt(P).toString(16);f+=C.length<2?"0".concat(C):C}return"0x".concat(f)},e.getKeys=function(a,f,P){if(!Array.isArray(a))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof a));if("string"!=typeof f)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof a));for(var H=[],C=0;C<a.length;C++){var t=a[C][f];if(P&&!t)t="";else if("string"!=typeof t)throw new Error("invalid abi - expected type 'string', received ".concat(typeof t));H.push(t)}return H},e.isHexString=function(a,f){return!("string"!=typeof a||!a.match(/^0x[0-9A-Fa-f]*$/)||f&&a.length!==2+2*f)}},49327:function(R,e,l){var T=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.defineProperties=void 0;var A=T(l(33114)),g=l(63125),y=l(48472),h=l(40951);e.defineProperties=function(n,c,i){if(n.raw=[],n._fields=[],n.toJSON=function(f){if(void 0===f&&(f=!1),f){var P={};return n._fields.forEach(function(H){P[H]="0x".concat(n[H].toString("hex"))}),P}return(0,h.baToJSON)(n.raw)},n.serialize=function(){return y.rlp.encode(n.raw)},c.forEach(function(f,P){function H(){return n.raw[P]}function C(t){"00"===(t=(0,h.toBuffer)(t)).toString("hex")&&!f.allowZero&&(t=Buffer.allocUnsafe(0)),f.allowLess&&f.length?(t=(0,h.unpadBuffer)(t),(0,A.default)(f.length>=t.length,"The field ".concat(f.name," must not have more ").concat(f.length," bytes"))):!(f.allowZero&&0===t.length)&&f.length&&(0,A.default)(f.length===t.length,"The field ".concat(f.name," must have byte length of ").concat(f.length)),n.raw[P]=t}n._fields.push(f.name),Object.defineProperty(n,f.name,{enumerable:!0,configurable:!0,get:H,set:C}),f.default&&(n[f.name]=f.default),f.alias&&Object.defineProperty(n,f.alias,{enumerable:!1,configurable:!0,set:C,get:H})}),i)if("string"==typeof i&&(i=Buffer.from((0,g.stripHexPrefix)(i),"hex")),Buffer.isBuffer(i)&&(i=y.rlp.decode(i)),Array.isArray(i)){if(i.length>n._fields.length)throw new Error("wrong number of fields in data");i.forEach(function(f,P){n[n._fields[P]]=(0,h.toBuffer)(f)})}else{if("object"!=typeof i)throw new Error("invalid data");var a=Object.keys(i);c.forEach(function(f){-1!==a.indexOf(f.name)&&(n[f.name]=i[f.name]),-1!==a.indexOf(f.alias)&&(n[f.alias]=i[f.alias])})}}},53528:(R,e,l)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toCompactSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var T=l(10019),A=l(48472),g=l(40951),y=l(56915),h=l(51950),m=l(4442);function c(d,v){var B=(0,m.toType)(d,m.TypeOutput.BN);if(B.eqn(0)||B.eqn(1))return(0,m.toType)(d,m.TypeOutput.BN);if(!v)return B.subn(27);var w=(0,m.toType)(v,m.TypeOutput.BN);return B.sub(w.muln(2).addn(35))}function i(d){var v=new A.BN(d);return v.eqn(0)||v.eqn(1)}e.ecsign=function(d,v,B){var w=(0,T.ecdsaSign)(d,v),o=w.signature,b=w.recid,N=Buffer.from(o.slice(0,32)),I=Buffer.from(o.slice(32,64));if(!B||"number"==typeof B){if(B&&!Number.isSafeInteger(B))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:N,s:I,v:B?b+(2*B+35):b+27}}return{r:N,s:I,v:(0,m.toType)(B,m.TypeOutput.BN).muln(2).addn(35).addn(b).toArrayLike(Buffer)}},e.ecrecover=function(d,v,B,w,o){var b=Buffer.concat([(0,g.setLengthLeft)(B,32),(0,g.setLengthLeft)(w,32)],64),N=c(v,o);if(!i(N))throw new Error("Invalid signature v value");var I=(0,T.ecdsaRecover)(b,N.toNumber(),d);return Buffer.from((0,T.publicKeyConvert)(I,!1).slice(1))},e.toRpcSig=function(d,v,B,w){if(!i(c(d,w)))throw new Error("Invalid signature v value");return(0,g.bufferToHex)(Buffer.concat([(0,g.setLengthLeft)(v,32),(0,g.setLengthLeft)(B,32),(0,g.toBuffer)(d)]))},e.toCompactSig=function(d,v,B,w){if(!i(c(d,w)))throw new Error("Invalid signature v value");var b=(0,m.toType)(d,m.TypeOutput.Number),N=B;return(b>28&&b%2==1||1===b||28===b)&&((N=Buffer.from(B))[0]|=128),(0,g.bufferToHex)(Buffer.concat([(0,g.setLengthLeft)(v,32),(0,g.setLengthLeft)(N,32)]))},e.fromRpcSig=function(d){var B,w,o,v=(0,g.toBuffer)(d);if(v.length>=65)B=v.slice(0,32),w=v.slice(32,64),o=(0,g.bufferToInt)(v.slice(64));else{if(64!==v.length)throw new Error("Invalid signature length");B=v.slice(0,32),w=v.slice(32,64),o=(0,g.bufferToInt)(v.slice(32,33))>>7,w[0]&=127}return o<27&&(o+=27),{v:o,r:B,s:w}},e.isValidSignature=function(d,v,B,w,o){void 0===w&&(w=!0);var b=new A.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),N=new A.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==v.length||32!==B.length||!i(c(d,o)))return!1;var I=new A.BN(v),K=new A.BN(B);return!(I.isZero()||I.gt(N)||K.isZero()||K.gt(N)||w&&1===K.cmp(b))},e.hashPersonalMessage=function(d){(0,h.assertIsBuffer)(d);var v=Buffer.from("\x19Ethereum Signed Message:\n".concat(d.length),"utf-8");return(0,y.keccak)(Buffer.concat([v,d]))}},4442:(R,e,l)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=e.bnToRlp=e.bnToUnpaddedBuffer=e.bnToHex=void 0;var n,i,T=l(48472),A=l(63125),g=l(40951);function h(i){return(0,g.unpadBuffer)(i.toArrayLike(Buffer))}e.bnToHex=function(i){return"0x".concat(i.toString(16))},e.bnToUnpaddedBuffer=h,e.bnToRlp=function(i){return h(i)},(i=n=e.TypeOutput||(e.TypeOutput={}))[i.Number=0]="Number",i[i.BN=1]="BN",i[i.Buffer=2]="Buffer",i[i.PrefixedHexString=3]="PrefixedHexString",e.toType=function(i,a){if(null===i)return null;if(void 0!==i){if("string"==typeof i&&!(0,A.isHexString)(i))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(i));if("number"==typeof i&&!Number.isSafeInteger(i))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var f=(0,g.toBuffer)(i);if(a===n.Buffer)return f;if(a===n.BN)return new T.BN(f);if(a===n.Number){var P=new T.BN(f),H=new T.BN(Number.MAX_SAFE_INTEGER.toString());if(P.gt(H))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return P.toNumber()}return"0x".concat(f.toString("hex"))}}},83111:function(R,e,l){var T=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLength=e.decode=e.encode=void 0;var A=T(l(62630));function y(t,d){if("0"===t[0]&&"0"===t[1])throw new Error("invalid RLP: extra zeros");return parseInt(t,d)}function h(t,d){if(t<56)return Buffer.from([t+d]);var v=f(t),w=f(d+55+v.length/2);return Buffer.from(w+v,"hex")}function c(t){var d,v,B,w,o,b=[],N=t[0];if(N<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(N<=183){if(d=N-127,B=128===N?Buffer.from([]):t.slice(1,d),2===d&&B[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:B,remainder:t.slice(d)}}if(N<=191){if(t.length-1<(v=N-182))throw new Error("invalid RLP: not enough bytes for string length");if((d=y(t.slice(1,v).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((B=t.slice(v,d+v)).length<d)throw new Error("invalid RLP: not enough bytes for string");return{data:B,remainder:t.slice(d+v)}}if(N<=247){for(w=t.slice(1,d=N-191);w.length;)o=c(w),b.push(o.data),w=o.remainder;return{data:b,remainder:t.slice(d)}}var I=(v=N-246)+(d=y(t.slice(1,v).toString("hex"),16));if(I>t.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(w=t.slice(v,I)).length)throw new Error("invalid rlp, List has a invalid length");for(;w.length;)o=c(w),b.push(o.data),w=o.remainder;return{data:b,remainder:t.slice(I)}}function i(t){return"0x"===t.slice(0,2)}function f(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var d=t.toString(16);return d.length%2?"0"+d:d}function C(t){if(!Buffer.isBuffer(t)){if("string"==typeof t)return i(t)?Buffer.from(function(t){return t.length%2?"0"+t:t}(function(t){return"string"!=typeof t?t:i(t)?t.slice(2):t}(t)),"hex"):Buffer.from(t);if("number"==typeof t||"bigint"==typeof t)return t?function(t){var d=f(t);return Buffer.from(d,"hex")}(t):Buffer.from([]);if(null==t)return Buffer.from([]);if(t instanceof Uint8Array)return Buffer.from(t);if(A.default.isBN(t))return Buffer.from(t.toArray());throw new Error("invalid type")}return t}e.encode=function g(t){if(Array.isArray(t)){for(var d=[],v=0;v<t.length;v++)d.push(g(t[v]));var B=Buffer.concat(d);return Buffer.concat([h(B.length,192),B])}var w=C(t);return 1===w.length&&w[0]<128?w:Buffer.concat([h(w.length,128),w])},e.decode=function(t,d){if(void 0===d&&(d=!1),!t||0===t.length)return Buffer.from([]);var B=c(C(t));if(d)return B;if(0!==B.remainder.length)throw new Error("invalid remainder");return B.data},e.getLength=function(t){if(!t||0===t.length)return Buffer.from([]);var d=C(t),v=d[0];if(v<=127)return d.length;if(v<=183)return v-127;if(v<=191)return v-182;if(v<=247)return v-191;var B=v-246;return B+y(d.slice(1,B).toString("hex"),16)}}}]);