@blocto/dappauth
Version:
A util to prove actionable control ('ownership') over a public Ethereum address using eth_sign
37 lines (32 loc) • 2.09 MB
JavaScript
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function getAugmentedNamespace(n) {
if (n.__esModule) return n;
var f = n.default;
if (typeof f == "function") {
var a = function a () {
if (this instanceof a) {
return Reflect.construct(f, arguments, this.constructor);
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
} else a = {};
Object.defineProperty(a, '__esModule', {value: true});
Object.keys(n).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a, k, d.get ? d : {
enumerable: true,
get: function () {
return n[k];
}
});
});
return a;
}
var web3_min = {exports: {}};
/*! For license information please see web3.min.js.LICENSE.txt */
(function (module, exports) {
!function(e,t){module.exports=t();}(self,(()=>(()=>{var e={81645:(e,t,r)=>{var n=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return {next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.chains=t._getInitializedChains=void 0;var o=i(r(87295)),a=i(r(31227)),s=i(r(40439)),u=i(r(37098)),f=i(r(17687));function c(e){var t,r,i={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli"},c={mainnet:o.default,ropsten:a.default,rinkeby:s.default,kovan:u.default,goerli:f.default};if(e)try{for(var d=n(e),l=d.next();!l.done;l=d.next()){var h=l.value,p=h.name;i[h.chainId.toString()]=p,c[p]=h;}}catch(e){t={error:e};}finally{try{l&&!l.done&&(r=d.return)&&r.call(d);}finally{if(t)throw t.error}}return c.names=i,c}t._getInitializedChains=c,t.chains=c();},425:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1559:r(77523),2315:r(83339),2537:r(26769),2565:r(17897),2718:r(62170),2929:r(88436),2930:r(96213),3198:r(25491),3529:r(20070),3541:r(21871),3554:r(47225),3675:r(98571)};},7002:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",r(60114)],["homestead",r(62800)],["dao",r(7197)],["tangerineWhistle",r(22302)],["spuriousDragon",r(90716)],["byzantium",r(26985)],["constantinople",r(35993)],["petersburg",r(4064)],["istanbul",r(83166)],["muirGlacier",r(42946)],["berlin",r(20015)],["london",r(61250)],["shanghai",r(5553)],["merge",r(88648)]];},3863:(e,t,r)=>{var n,i=r(29033).Buffer,o=r(28847)(r(3355)),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e;}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r);}),s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)},u=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return {next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=t.CustomChain=void 0;var f,c,d,l,h,p=r(38291),b=r(64628),y=r(33062),v=r(81645),m=r(7002),g=r(425);!function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.xDaiChain="x-dai-chain";}(f=t.CustomChain||(t.CustomChain={})),(h=t.Chain||(t.Chain={}))[h.Mainnet=1]="Mainnet",h[h.Ropsten=3]="Ropsten",h[h.Rinkeby=4]="Rinkeby",h[h.Kovan=42]="Kovan",h[h.Goerli=5]="Goerli",function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.Shanghai="shanghai",e.Merge="merge";}(c=t.Hardfork||(t.Hardfork={})),(l=t.ConsensusType||(t.ConsensusType={})).ProofOfStake="pos",l.ProofOfWork="pow",l.ProofOfAuthority="poa",(d=t.ConsensusAlgorithm||(t.ConsensusAlgorithm={})).Ethash="ethash",d.Clique="clique",d.Casper="casper";var w=function(e){function t(t){var r,n,i,o,a=e.call(this)||this;a._supportedHardforks=[],a._eips=[],a._customChains=null!==(i=t.customChains)&&void 0!==i?i:[],a._chainParams=a.setChain(t.chain),a.DEFAULT_HARDFORK=null!==(o=a._chainParams.defaultHardfork)&&void 0!==o?o:c.Istanbul;try{for(var s=u(a._chainParams.hardforks),f=s.next();!f.done;f=s.next()){var d=f.value;d.forkHash||(d.forkHash=a._calcForkHash(d.name));}}catch(e){r={error:e};}finally{try{f&&!f.done&&(n=s.return)&&n.call(s);}finally{if(r)throw r.error}}return a._hardfork=a.DEFAULT_HARDFORK,t.supportedHardforks&&(a._supportedHardforks=t.supportedHardforks),t.hardfork&&a.setHardfork(t.hardfork),t.eips&&a.setEIPs(t.eips),a}return a(t,e),t.custom=function(e,r){var n;void 0===r&&(r={});var i=null!==(n=r.baseChain)&&void 0!==n?n:"mainnet",o=s({},t._getChainParams(i));if(o.name="custom-chain","string"!=typeof e)return new t(s({chain:s(s({},o),e)},r));if(e===f.PolygonMainnet)return t.custom({name:f.PolygonMainnet,chainId:137,networkId:137});if(e===f.PolygonMumbai)return t.custom({name:f.PolygonMumbai,chainId:80001,networkId:80001});if(e===f.ArbitrumRinkebyTestnet)return t.custom({name:f.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611});if(e===f.xDaiChain)return t.custom({name:f.xDaiChain,chainId:100,networkId:100});throw new Error("Custom chain "+e+" not supported")},t.forCustomChain=function(e,r,n,i){var o=t._getChainParams(e);return new t({chain:s(s({},o),r),hardfork:n,supportedHardforks:i})},t.isSupportedChainId=function(e){var t=(0, v._getInitializedChains)();return Boolean(t.names[e.toString()])},t._getChainParams=function(e,t){var r=(0, v._getInitializedChains)(t);if("number"==typeof e||y.BN.isBN(e)){if(e=e.toString(),r.names[e])return r[r.names[e]];throw new Error("Chain with ID "+e+" not supported")}if(r[e])return r[e];throw new Error("Chain with name "+e+" not supported")},t.prototype.setChain=function(e){var r,n;if("number"==typeof e||"string"==typeof e||y.BN.isBN(e)){var i;i=this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0])?this._customChains.map((function(e){return e[0]})):this._customChains,this._chainParams=t._getChainParams(e,i);}else {if("object"!==(0, o.default)(e))throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");try{for(var a=u(["networkId","genesis","hardforks","bootstrapNodes"]),s=a.next();!s.done;s=a.next()){var f=s.value;if(void 0===e[f])throw new Error("Missing required chain parameter: "+f)}}catch(e){r={error:e};}finally{try{s&&!s.done&&(n=a.return)&&n.call(a);}finally{if(r)throw r.error}}this._chainParams=e;}return this._chainParams},t.prototype.setHardfork=function(e){var t,r;if(!this._isSupportedHardfork(e))throw new Error("Hardfork "+e+" not set as supported in supportedHardforks");var n=!1;try{for(var i=u(m.hardforks),o=i.next();!o.done;o=i.next())o.value[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),n=!0);}catch(e){t={error:e};}finally{try{o&&!o.done&&(r=i.return)&&r.call(i);}finally{if(t)throw t.error}}if(!n)throw new Error("Hardfork with name "+e+" not supported")},t.prototype.getHardforkByBlockNumber=function(e,t){var r,n;e=(0, y.toType)(e,y.TypeOutput.BN),t=t?(0, y.toType)(t,y.TypeOutput.BN):void 0;var i,o,a,s=c.Chainstart;try{for(var f=u(this.hardforks()),d=f.next();!d.done;d=f.next()){var l=d.value;if(null!==l.block)e.gte(new y.BN(l.block))&&(s=l.name),t&&l.td&&(t.gten(l.td)?i=l.name:o=a),a=l.name;else if(t&&l.td&&t.gten(l.td))return l.name}}catch(e){r={error:e};}finally{try{d&&!d.done&&(n=f.return)&&n.call(f);}finally{if(r)throw r.error}}if(t){var h="block number: "+e+" (-> "+s+"), ";if(i&&!this.hardforkGteHardfork(s,i)){var p="HF determined by block number is lower than the minimum total difficulty HF";throw h+="total difficulty: "+t+" (-> "+i+")",new Error(p+": "+h)}if(o&&!this.hardforkGteHardfork(o,s))throw p="Maximum HF determined by total difficulty is lower than the block number HF",h+="total difficulty: "+t+" (-> "+o+")",new Error(p+": "+h)}return s},t.prototype.setHardforkByBlockNumber=function(e,t){var r=this.getHardforkByBlockNumber(e,t);return this.setHardfork(r),r},t.prototype._chooseHardfork=function(e,t){if(void 0===t&&(t=!0),e){if(t&&!this._isSupportedHardfork(e))throw new Error("Hardfork "+e+" not set as supported in supportedHardforks")}else e=this._hardfork;return e},t.prototype._getHardfork=function(e){var t,r,n=this.hardforks();try{for(var i=u(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(a.name===e)return a}}catch(e){t={error:e};}finally{try{o&&!o.done&&(r=i.return)&&r.call(i);}finally{if(t)throw t.error}}throw new Error("Hardfork "+e+" not defined for chain "+this.chainName())},t.prototype._isSupportedHardfork=function(e){var t,r;if(!(this._supportedHardforks.length>0))return !0;try{for(var n=u(this._supportedHardforks),i=n.next();!i.done;i=n.next())if(e===i.value)return !0}catch(e){t={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(t)throw t.error}}return !1},t.prototype.setEIPs=function(e){var t,r,n=this;void 0===e&&(e=[]);var i=function(t){if(!(t in g.EIPs))throw new Error(t+" not supported");var r=o.gteHardfork(g.EIPs[t].minimumHardfork);if(!r)throw new Error(t+" cannot be activated on hardfork "+o.hardfork()+", minimumHardfork: "+r);g.EIPs[t].requiredEIPs&&g.EIPs[t].requiredEIPs.forEach((function(r){if(!e.includes(r)&&!n.isActivatedEIP(r))throw new Error(t+" requires EIP "+r+", but is not included in the EIP list")}));},o=this;try{for(var a=u(e),s=a.next();!s.done;s=a.next())i(s.value);}catch(e){t={error:e};}finally{try{s&&!s.done&&(r=a.return)&&r.call(a);}finally{if(t)throw t.error}}this._eips=e;},t.prototype.param=function(e,t){var r,n,i=null;try{for(var o=u(this._eips),a=o.next();!a.done;a=o.next()){var s=a.value;if(null!==(i=this.paramByEIP(e,t,s)))return i}}catch(e){r={error:e};}finally{try{a&&!a.done&&(n=o.return)&&n.call(o);}finally{if(r)throw r.error}}return this.paramByHardfork(e,t,this._hardfork)},t.prototype.paramByHardfork=function(e,t,r){var n,i,o,a;r=this._chooseHardfork(r);var s=null;try{for(var f=u(m.hardforks),c=f.next();!c.done;c=f.next()){var d=c.value;if("eips"in d[1]){var l=d[1].eips;try{for(var h=(o=void 0,u(l)),p=h.next();!p.done;p=h.next()){var b=p.value,y=this.paramByEIP(e,t,b);s=null!==y?y:s;}}catch(e){o={error:e};}finally{try{p&&!p.done&&(a=h.return)&&a.call(h);}finally{if(o)throw o.error}}}else {if(!d[1][e])throw new Error("Topic "+e+" not defined");void 0!==d[1][e][t]&&(s=d[1][e][t].v);}if(d[0]===r)break}}catch(e){n={error:e};}finally{try{c&&!c.done&&(i=f.return)&&i.call(f);}finally{if(n)throw n.error}}return s},t.prototype.paramByEIP=function(e,t,r){if(!(r in g.EIPs))throw new Error(r+" not supported");var n=g.EIPs[r];if(!(e in n))throw new Error("Topic "+e+" not defined");return void 0===n[e][t]?null:n[e][t].v},t.prototype.paramByBlock=function(e,t,r){var n=this.activeHardforks(r),i=n[n.length-1].name;return this.paramByHardfork(e,t,i)},t.prototype.isActivatedEIP=function(e){var t,r;if(this.eips().includes(e))return !0;try{for(var n=u(m.hardforks),i=n.next();!i.done;i=n.next()){var o=i.value[1];if(this.gteHardfork(o.name)&&"eips"in o&&o.eips.includes(e))return !0}}catch(e){t={error:e};}finally{try{i&&!i.done&&(r=n.return)&&r.call(n);}finally{if(t)throw t.error}}return !1},t.prototype.hardforkIsActiveOnBlock=function(e,t,r){var n;void 0===r&&(r={}),t=(0, y.toType)(t,y.TypeOutput.BN);var i=null!==(n=r.onlySupported)&&void 0!==n&&n;e=this._chooseHardfork(e,i);var o=this.hardforkBlockBN(e);return !(!o||!t.gte(o))},t.prototype.activeOnBlock=function(e,t){return this.hardforkIsActiveOnBlock(null,e,t)},t.prototype.hardforkGteHardfork=function(e,t,r){var n,i;void 0===r&&(r={});var o,a=void 0!==r.onlyActive&&r.onlyActive;e=this._chooseHardfork(e,r.onlySupported),o=a?this.activeHardforks(null,r):this.hardforks();var s=-1,f=-1,c=0;try{for(var d=u(o),l=d.next();!l.done;l=d.next()){var h=l.value;h.name===e&&(s=c),h.name===t&&(f=c),c+=1;}}catch(e){n={error:e};}finally{try{l&&!l.done&&(i=d.return)&&i.call(d);}finally{if(n)throw n.error}}return s>=f&&-1!==f},t.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},t.prototype.hardforkIsActiveOnChain=function(e,t){var r,n,i;void 0===t&&(t={});var o=null!==(i=t.onlySupported)&&void 0!==i&&i;e=this._chooseHardfork(e,o);try{for(var a=u(this.hardforks()),s=a.next();!s.done;s=a.next()){var f=s.value;if(f.name===e&&null!==f.block)return !0}}catch(e){r={error:e};}finally{try{s&&!s.done&&(n=a.return)&&n.call(a);}finally{if(r)throw r.error}}return !1},t.prototype.activeHardforks=function(e,t){var r,n;void 0===t&&(t={});var i=[],o=this.hardforks();try{for(var a=u(o),s=a.next();!s.done;s=a.next()){var f=s.value;if(null!==f.block){if(null!=e&&e<f.block)break;t.onlySupported&&!this._isSupportedHardfork(f.name)||i.push(f);}}}catch(e){r={error:e};}finally{try{s&&!s.done&&(n=a.return)&&n.call(a);}finally{if(r)throw r.error}}return i},t.prototype.activeHardfork=function(e,t){void 0===t&&(t={});var r=this.activeHardforks(e,t);if(r.length>0)return r[r.length-1].name;throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return t?(0, y.toType)(t,y.TypeOutput.Number):null},t.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).block;return null==t?null:new y.BN(t)},t.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).td;return null==t?null:new y.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0, y.toType)(e,y.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.hardforkBlockBN(t);return !!r&&r.eq(e)},t.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return null===t?null:(0, y.toType)(t,y.TypeOutput.Number)},t.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);return null===t?null:this.hardforks().reduce((function(e,r){var n=new y.BN(r.block);return n.gt(t)&&null===e?n:e}),null)},t.prototype.isNextHardforkBlock=function(e,t){e=(0, y.toType)(e,y.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.nextHardforkBlockBN(t);return null!==r&&r.eq(e)},t.prototype._calcForkHash=function(e){var t,r,n=i.from(this.genesis().hash.substr(2),"hex"),o=i.alloc(0),a=0;try{for(var s=u(this.hardforks()),f=s.next();!f.done;f=s.next()){var c=f.value,d=c.block;if(0!==d&&null!==d&&d!==a){var l=i.from(d.toString(16).padStart(16,"0"),"hex");o=i.concat([o,l]);}if(c.name===e)break;null!==d&&(a=d);}}catch(e){t={error:e};}finally{try{f&&!f.done&&(r=s.return)&&r.call(s);}finally{if(t)throw t.error}}var h=i.concat([n,o]);return "0x"+(0, y.intToBuffer)((0, b.buf)(h)>>>0).toString("hex")},t.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t.block)throw new Error("No fork hash calculation possible for non-applied or future hardfork");return void 0!==t.forkHash?t.forkHash:this._calcForkHash(e)},t.prototype.hardforkForForkHash=function(e){var t=this.hardforks().filter((function(t){return t.forkHash===e}));return t.length>=1?t[t.length-1]:null},t.prototype.genesis=function(){return this._chainParams.genesis},t.prototype.genesisState=function(){var e,t;switch(this.chainName()){case"mainnet":return r(Object(function(){var e=new Error("Cannot find module './genesisStates/mainnet.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"ropsten":return r(Object(function(){var e=new Error("Cannot find module './genesisStates/ropsten.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"rinkeby":return r(Object(function(){var e=new Error("Cannot find module './genesisStates/rinkeby.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"kovan":return r(Object(function(){var e=new Error("Cannot find module './genesisStates/kovan.json'");throw e.code="MODULE_NOT_FOUND",e}()));case"goerli":return r(Object(function(){var e=new Error("Cannot find module './genesisStates/goerli.json'");throw e.code="MODULE_NOT_FOUND",e}()))}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var n=u(this._customChains),i=n.next();!i.done;i=n.next()){var o=i.value;if(o[0].name===this.chainName())return o[1]}}catch(t){e={error:t};}finally{try{i&&!i.done&&(t=n.return)&&t.call(n);}finally{if(e)throw e.error}}return {}},t.prototype.hardforks=function(){return this._chainParams.hardforks},t.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},t.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},t.prototype.hardfork=function(){return this._hardfork},t.prototype.chainId=function(){return (0, y.toType)(this.chainIdBN(),y.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new y.BN(this._chainParams.chainId)},t.prototype.chainName=function(){return this._chainParams.name},t.prototype.networkId=function(){return (0, y.toType)(this.networkIdBN(),y.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new y.BN(this._chainParams.networkId)},t.prototype.eips=function(){return this._eips},t.prototype.consensusType=function(){var e,t,r,n=this.hardfork();try{for(var i=u(m.hardforks),o=i.next();!o.done;o=i.next()){var a=o.value;if("consensus"in a[1]&&(r=a[1].consensus.type),a[0]===n)break}}catch(t){e={error:t};}finally{try{o&&!o.done&&(t=i.return)&&t.call(i);}finally{if(e)throw e.error}}return r||this._chainParams.consensus.type},t.prototype.consensusAlgorithm=function(){var e,t,r,n=this.hardfork();try{for(var i=u(m.hardforks),o=i.next();!o.done;o=i.next()){var a=o.value;if("consensus"in a[1]&&(r=a[1].consensus.algorithm),a[0]===n)break}}catch(t){e={error:t};}finally{try{o&&!o.done&&(t=i.return)&&t.call(i);}finally{if(e)throw e.error}}return r||this._chainParams.consensus.algorithm},t.prototype.consensusConfig=function(){var e,t,r,n=this.hardfork();try{for(var i=u(m.hardforks),o=i.next();!o.done;o=i.next()){var a=o.value;if("consensus"in a[1]&&(r=a[1].consensus[a[1].consensus.algorithm]),a[0]===n)break}}catch(t){e={error:t};}finally{try{o&&!o.done&&(t=i.return)&&t.call(i);}finally{if(e)throw e.error}}if(r)return r;var s=this.consensusAlgorithm();return this._chainParams.consensus[s]},t.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},t}(p.EventEmitter);t.default=w;},89658:(e,t,r)=>{var n=r(28847)(r(3355));function i(e){if(Array.isArray(e)){for(var t=[],r=0,n=0;n<e.length;n++){var o=i(e[n]);t.push(o),r+=o.length;}return p.apply(void 0,[s(r,192)].concat(t))}var a=m(e);return 1===a.length&&a[0]<128?a:p(s(a.length,128),a)}function o(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function a(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return l(d(e))}function s(e,t){if(e<56)return Uint8Array.from([e+t]);var r=y(e),n=y(t+55+r.length/2);return Uint8Array.from(h(n+r))}function u(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==e||0===e.length)return Uint8Array.from([]);var r=f(m(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function f(e){var t,r,n,i,s,u=[],c=e[0];if(c<=127)return {data:e.slice(0,1),remainder:e.slice(1)};if(c<=183){if(t=c-127,n=128===c?Uint8Array.from([]):o(e,1,t),2===t&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return {data:n,remainder:e.slice(t)}}if(c<=191){if(r=c-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if((t=a(o(e,1,r)))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return {data:n=o(e,r,t+r),remainder:e.slice(t+r)}}if(c<=247){for(i=o(e,1,t=c-191);i.length;)s=f(i),u.push(s.data),i=s.remainder;return {data:u,remainder:e.slice(t)}}if((t=a(o(e,1,r=c-246)))<56)throw new Error("invalid RLP: encoded list too short");var d=r+t;if(d>e.length)throw new Error("invalid RLP: total length is larger than the data");for(i=o(e,r,d);i.length;)s=f(i),u.push(s.data),i=s.remainder;return {data:u,remainder:e.slice(d)}}Object.defineProperty(t,"__esModule",{value:!0}),t.RLP=t.utils=t.decode=t.encode=void 0,t.encode=i,t.decode=u;var c=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function d(e){for(var t="",r=0;r<e.length;r++)t+=c[e[r]];return t}function l(e){var t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function h(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+(0, n.default)(e));if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var i=2*r;t[r]=l(e.slice(i,i+2));}return t}function p(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),i=new Uint8Array(n),o=0,a=0;o<t.length;o++){var s=t[o];i.set(s,a),a+=s.length;}return i}function b(e){return (new TextEncoder).encode(e)}function y(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0".concat(t):t}function v(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function m(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return v(e)?h((t="string"!=typeof(r=e)?r:v(r)?r.slice(2):r).length%2?"0".concat(t):t):b(e);var t,r;if("number"==typeof e||"bigint"==typeof e)return e?h(y(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+(0, n.default)(e))}t.utils={bytesToHex:d,concatBytes:p,hexToBytes:h,utf8ToBytes:b},t.RLP={encode:i,decode:u};},75058:(e,t,r)=>{var n=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t});}:function(e,t){e.default=t;},o=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value);}catch(e){i={error:e};}finally{try{n&&!n.done&&(r=o.return)&&r.call(o);}finally{if(i)throw i.error}}return a};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t}(r(3863)),s=r(33062),u=r(87325),f=function(){function e(e){this.cache={hash:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=a.Chain.Mainnet,this.DEFAULT_HARDFORK=a.Hardfork.Istanbul;var t=e.nonce,r=e.gasLimit,n=e.to,i=e.value,o=e.data,u=e.v,f=e.r,c=e.s,d=e.type;this._type=new s.BN((0, s.toBuffer)(d)).toNumber();var l=(0, s.toBuffer)(""===n?"0x":n),h=(0, s.toBuffer)(""===u?"0x":u),p=(0, s.toBuffer)(""===f?"0x":f),b=(0, s.toBuffer)(""===c?"0x":c);this.nonce=new s.BN((0, s.toBuffer)(""===t?"0x":t)),this.gasLimit=new s.BN((0, s.toBuffer)(""===r?"0x":r)),this.to=l.length>0?new s.Address(l):void 0,this.value=new s.BN((0, s.toBuffer)(""===i?"0x":i)),this.data=(0, s.toBuffer)(""===o?"0x":o),this.v=h.length>0?new s.BN(h):void 0,this.r=p.length>0?new s.BN(p):void 0,this.s=b.length>0?new s.BN(b):void 0,this._validateCannotExceedMaxInteger({nonce:this.nonce,gasLimit:this.gasLimit,value:this.value,r:this.r,s:this.s});}return Object.defineProperty(e.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),e.prototype.supports=function(e){return this.activeCapabilities.includes(e)},e.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given "+this.gasLimit+", need at least "+this.getBaseFee()),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},e.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},e.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),r=0,n=0;n<this.data.length;n++)0===this.data[n]?r+=e:r+=t;return new s.BN(r)},e.prototype.toCreationAddress=function(){return void 0===this.to||0===this.to.buf.length},e.prototype.isSigned=function(){var e=this,t=e.v,r=e.r,n=e.s;return 0===this.type?!!(t&&r&&n):!(void 0===t||!r||!n)},e.prototype.verifySignature=function(){try{var e=this.getSenderPublicKey();return 0!==(0,s.unpadBuffer)(e).length}catch(e){return !1}},e.prototype.getSenderAddress=function(){return new s.Address((0, s.publicToAddress)(this.getSenderPublicKey()))},e.prototype.sign=function(e){if(32!==e.length)throw new Error("Private key must be 32 bytes in length.");var t=!1;0===this.type&&this.common.gteHardfork("spuriousDragon")&&!this.supports(u.Capability.EIP155ReplayProtection)&&(this.activeCapabilities.push(u.Capability.EIP155ReplayProtection),t=!0);var r=this.getMessageToSign(!0),n=(0, s.ecsign)(r,e),i=n.v,o=n.r,a=n.s,f=this._processSignature(i,o,a);if(t){var c=this.activeCapabilities.indexOf(u.Capability.EIP155ReplayProtection);c>-1&&this.activeCapabilities.splice(c,1);}return f},e.prototype._getCommon=function(e,t){var r;if(t){var n=new s.BN((0, s.toBuffer)(t));if(e){if(!e.chainIdBN().eq(n))throw new Error("The chain ID does not match the chain ID of Common");return e.copy()}return a.default.isSupportedChainId(n)?new a.default({chain:n,hardfork:this.DEFAULT_HARDFORK}):a.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:n,chainId:n},this.DEFAULT_HARDFORK)}return null!==(r=null==e?void 0:e.copy())&&void 0!==r?r:new a.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(e,t){var r,n;void 0===t&&(t=53);try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return {next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.entries(e)),a=i.next();!a.done;a=i.next()){var u=o(a.value,2),f=u[0],c=u[1];if(53===t){if(null==c?void 0:c.gt(s.MAX_INTEGER))throw new Error(f+" cannot exceed MAX_INTEGER, given "+c)}else {if(256!==t)throw new Error("unimplemented bits value");if(null==c?void 0:c.gte(s.TWO_POW256))throw new Error(f+" must be less than 2^256, given "+c)}}}catch(e){r={error:e};}finally{try{a&&!a.done&&(n=i.return)&&n.call(i);}finally{if(r)throw r.error}}},e}();t.BaseTransaction=f;},660:(e,t,r)=>{var n,i=r(29033).Buffer,o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e;}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r);}),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=r(33062),u=r(75058),f=r(87325),c=r(53789),d=i.from(2..toString(16).padStart(2,"0"),"hex"),l=function(e){function t(t,r){var n,i;void 0===r&&(r={});var o=e.call(this,a(a({},t),{type:2}))||this;o.DEFAULT_HARDFORK="london";var u=t.chainId,d=t.accessList,l=t.maxFeePerGas,h=t.maxPriorityFeePerGas;if(o.common=o._getCommon(r.common,u),o.chainId=o.common.chainIdBN(),!o.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");o.activeCapabilities=o.activeCapabilities.concat([1559,2718,2930]);var p=c.AccessLists.getAccessListData(null!=d?d:[]);if(o.accessList=p.accessList,o.AccessListJSON=p.AccessListJSON,c.AccessLists.verifyAccessList(o.accessList),o.maxFeePerGas=new s.BN((0, s.toBuffer)(""===l?"0x":l)),o.maxPriorityFeePerGas=new s.BN((0, s.toBuffer)(""===h?"0x":h)),o._validateCannotExceedMaxInteger({maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas},256),o.maxFeePerGas.lt(o.maxPriorityFeePerGas))throw new Error("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");if(o.v&&!o.v.eqn(0)&&!o.v.eqn(1))throw new Error("The y-parity of the transaction should either be 0 or 1");if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(f.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");return (null===(i=null==r?void 0:r.freeze)||void 0===i||i)&&Object.freeze(o),o}return o(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(d))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: 2, received: "+e.slice(0,1).toString("hex"));var n=s.rlp.decode(e.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(n,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),9!==e.length&&12!==e.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");var n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value);}catch(e){i={error:e};}finally{try{n&&!n.done&&(r=o.return)&&r.call(o);}finally{if(i)throw i.error}}return a}(e,12),i=n[0],o=n[1],a=n[2],u=n[3],f=n[4],c=n[5],d=n[6],l=n[7],h=n[8],p=n[9],b=n[10],y=n[11];return new t({chainId:new s.BN(i),nonce:o,maxPriorityFeePerGas:a,maxFeePerGas:u,gasLimit:f,to:c,value:d,data:l,accessList:null!=h?h:[],v:void 0!==p?new s.BN(p):void 0,r:b,s:y},r)},t.prototype.getDataFee=function(){var t=e.prototype.getDataFee.call(this);return t.iaddn(c.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),t},t.prototype.getUpfrontCost=function(e){void 0===e&&(e=new s.BN(0));var t=s.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(e)).add(e);return this.gasLimit.mul(t).add(this.value)},t.prototype.raw=function(){return [(0, s.bnToUnpaddedBuffer)(this.chainId),(0, s.bnToUnpaddedBuffer)(this.nonce),(0, s.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0, s.bnToUnpaddedBuffer)(this.maxFeePerGas),(0, s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0, s.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0, s.bnToUnpaddedBuffer)(this.v):i.from([]),void 0!==this.r?(0, s.bnToUnpaddedBuffer)(this.r):i.from([]),void 0!==this.s?(0, s.bnToUnpaddedBuffer)(this.s):i.from([])]},t.prototype.serialize=function(){var e=this.raw();return i.concat([d,s.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),r=i.concat([d,s.rlp.encode(t)]);return e?(0, s.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned())throw new Error("Cannot call hash method if transaction is not signed");return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0, s.keccak256)(this.serialize())),this.cache.hash):(0, s.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned())throw new Error("Cannot call this method if transaction is not signed");var t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(f.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var r=this,n=r.v,i=r.r,o=r.s;try{return (0,s.ecrecover)(t,n.addn(27),(0,s.bnToUnpaddedBuffer)(i),(0,s.bnToUnpaddedBuffer)(o))}catch(e){throw new Error("Invalid Signature")}},t.prototype._processSignature=function(e,r,n){var i={common:this.common};return t.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new s.BN(e-27),r:new s.BN(r),s:new s.BN(n)},i)},t.prototype.toJSON=function(){var e=c.AccessLists.getAccessListJSON(this.accessList);return {chainId:(0, s.bnToHex)(this.chainId),nonce:(0, s.bnToHex)(this.nonce),maxPriorityFeePerGas:(0, s.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0, s.bnToHex)(this.maxFeePerGas),gasLimit:(0, s.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0, s.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0, s.bnToHex)(this.v):void 0,r:void 0!==this.r?(0, s.bnToHex)(this.r):void 0,s:void 0!==this.s?(0, s.bnToHex)(this.s):void 0}},t}(u.BaseTransaction);t.default=l;},97613:(e,t,r)=>{var n,i=r(29033).Buffer,o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e;}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r);}),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=r(33062),u=r(75058),f=r(87325),c=r(53789),d=i.from(1..toString(16).padStart(2,"0"),"hex"),l=function(e){function t(t,r){var n,i;void 0===r&&(r={});var o=e.call(this,a(a({},t),{type:1}))||this;o.DEFAULT_HARDFORK="berlin";var u=t.chainId,d=t.accessList,l=t.gasPrice;if(o.common=o._getCommon(r.common,u),o.chainId=o.common.chainIdBN(),!o.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");o.activeCapabilities=o.activeCapabilities.concat([2718,2930]);var h=c.AccessLists.getAccessListData(null!=d?d:[]);if(o.accessList=h.accessList,o.AccessListJSON=h.AccessListJSON,c.AccessLists.verifyAccessList(o.accessList),o.gasPrice=new s.BN((0, s.toBuffer)(""===l?"0x":l)),o._validateCannotExceedMaxInteger({gasPrice:o.gasPrice}),o.v&&!o.v.eqn(0)&&!o.v.eqn(1))throw new Error("The y-parity of the transaction should either be 0 or 1");if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(f.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");return (null===(i=null==r?void 0:r.freeze)||void 0===i||i)&&Object.freeze(o),o}return o(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(d))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: 1, received: "+e.slice(0,1).toString("hex"));var n=s.rlp.decode(e.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(n,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),8!==e.length&&11!==e.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");var n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value);}catch(e){i={error:e};}finally{try{n&&!n.done&&(r=o.return)&&r.call(o);}finally{if(i)throw i.error}}return a}(e,11),i=n[0],o=n[1],a=n[2],u=n[3],f=n[4],c=n[5],d=n[6],l=n[7],h=n[8],p=n[9],b=n[10];return new t({chainId:new s.BN(i),nonce:o,gasPrice:a,gasLimit:u,to:f,value:c,data:d,accessList:null!=l?l:[],v:void 0!==h?new s.BN(h):void 0,r:p,s:b},r)},t.prototype.getDataFee=function(){var t=e.prototype.getDataFee.call(this);return t.iaddn(c.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.raw=function(){return [(0, s.bnToUnpaddedBuffer)(this.chainId),(0, s.bnToUnpaddedBuffer)(this.nonce),(0, s.bnToUnpaddedBuffer)(this.gasPrice),(0, s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0, s.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0, s.bnToUnpaddedBuffer)(this.v):i.from([]),void 0!==this.r?(0, s.bnToUnpaddedBuffer)(this.r):i.from([]),void 0!==this.s?(0, s.bnToUnpaddedBuffer)(this.s):i.from([])]},t.prototype.serialize=function(){var e=this.raw();return i.concat([d,s.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),r=i.concat([d,s.rlp.encode(t)]);return e?(0, s.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned())throw new Error("Cannot call hash method if transaction is not signed");return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0, s.keccak256)(this.serialize())),this.cache.hash):(0, s.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned())throw new Error("Cannot call this method if transaction is not signed");var t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(f.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var r=this,n=r.yParity,i=r.r,o=r.s;try{return (0,s.ecrecover)(t,n.addn(27),(0,s.bnToUnpaddedBuffer)(i),(0,s.bnToUnpaddedBuffer)(o))}catch(e){throw new Error("Invalid Signature")}},t.prototype._processSignature=function(e,r,n){var i={common:this.common};return t.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new s.BN(e-27),r:new s.BN(r),s:new s.BN(n)},i)},t.prototype.toJSON=function(){var e=c.AccessLists.getAccessListJSON(this.accessList);return {chainId:(0, s.bnToHex)(this.chainId),nonce:(0, s.bnToHex)(this.nonce),gasPrice:(0, s.bnToHex)(this.gasPrice),gasLimit:(0, s.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0, s.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0, s.bnToHex)(this.v):void 0,r:void 0!==this.r?(0, s.bnToHex)(this.r):void 0,s:void 0!==this.s?(0, s.bnToHex)(this.s):void 0}},t}(u.BaseTransaction);t.default=l;},42339:(e,t,r)=>{var n=Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}});}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r];},i=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeeMarketEIP1559Transaction=t.TransactionFactory=t.AccessListEIP2930Transaction=t.Transaction=void 0;var o=r(53088);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return i(o).default}});var a=r(97613);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return i(a).default}});var s=r(89562);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return i(s).default}});var u=r(660);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return i(u).default}}),function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r);}(r(87325),t);},53088:(e,t,r)=>{var n,i=r(29033).Buffer,o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e;}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r);}),a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=r(33062),u=r(87325),f=function(e){function t(t,r){var n;void 0===r&&(r={});var i=e.call(this,a(a({},t),{type:0}))||this;if(i.common=i._validateTxV(i.v,r.common),i.gasPrice=new s.BN((0, s.toBuffer)(""===t.gasPrice?"0x":t.gasPrice)),i._validateCannotExceedMaxInteger({gasPrice:i.gasPrice}),i.common.gteHardfork("spuriousDragon"))if(i.isSigned()){var o=i.v,f=i.common.chainIdBN().muln(2);(o.eq(f.addn(35))||o.eq(f.addn(36)))&&i.activeCapabilities.push(u.Capability.EIP155ReplayProtection);}else i.activeCapabilities.push(u.Capability.EIP155ReplayProtection);return (null===(n=null==r?void 0:r.freeze)||void 0===n||n)&&Object.freeze(i),i}return o(t,e),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,t){void 0===t&&(t={});var r=s.rlp.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,t)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),6!==e.length&&9!==e.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");var n=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value);}catch(e){i={error:e};}finally{try{n&&!n.done&&(r=o.return)&&r.call(o);}finally{if(i)throw i.error}}return a}(e,9);return new t({nonce:n[0],gasPrice:n[1],gasLimit:n[2],to:n[3],value:n[4],data:n[5],v:n[6],r:n[7],s:n[8]},r)},t.prototype.raw=function(){return [(0, s.bnToUnpaddedBuffer)(this.nonce),(0, s.bnToUnpaddedBuffer)(this.gasPrice),(0, s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0, s.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0, s.bnToUnpaddedBuffer)(this.v):i.from([]),void 0!==this.r?(0, s.bnToUnpaddedBuffer)(this.r):i.from([]),void 0!==this.s?(0, s.bnToUnpaddedBuffer)(this.s):i.from([])]},t.prototype.serialize=function(){return s.rlp.encode(this.raw())},t.prototype._getMessageToSign=function(){var e=[(0, s.bnToUnpaddedBuffer)(this.nonce),(0, s.bnToUnpaddedBuffer)(this.gasPrice),(0, s.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0, s.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(u.Capability.EIP155ReplayProtection)&&(e.push((0, s.toBuffer)(this.common.chainIdBN())),e.push((0, s.unpadBuffer)((0, s.toBuffer)(0))),e.push((0, s.unpadBuffer)((0, s.toBuffer)(0)))),e},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this._getMessageToSign();return e?(0, s.rlphash)(t):t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.hash=function(){return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0, s.rlphash)(this.raw())),this.cache.hash):(0, s.rlphash)(this.raw())},t.prototype.getMessageToVerifySignature=function(){if(!this.isSigned())throw Error("This transaction is not signed");var e=this._getMessageToSign();return (0, s.rlphash)(e)},t.prototype.getSenderPublicKey=function(){var e,t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(u.N_DIV_2)))throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");var r=this,n=r.v,i=r.r,o=r.s;try{return (0,s.ecrecover)(t,n,(0,s.bnToUnpaddedBuffer)(i),(0,s.bnToUnpaddedBuffer)(o),this.supports(u.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(e){throw new Error("Invalid Signature")}},t.prototype._processSignature=function(e,r,n){var i=new s.BN(e);this.supports(u.Capability.EIP155ReplayProtection)&&i.iadd(this.common.chainIdBN().muln(2).addn(8));var o={common:this.common};return t.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:i,r:new s.BN(r),s:new s.BN(n)},o)},t.prototype.toJSON=function(){return {nonce:(0, s.bnToHex)(this.nonce),gasPrice:(0, s.bnToHex)(this.gasPrice),gasLimit:(0, s.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0, s.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0, s.bnToHex)(this.v):void 0,r:void 0!==this.r?(0, s.bnToHex)(this.r):void 0,s:void 0!==this.s?(0, s.bnToHex)(this.s):void 0}},t.prototype._validateTxV=function(e,t){var r;if(void 0!==e&&!e.eqn(0)&&(!t||t.gteHardfork("spuriousDragon"))&&!e.eqn(27)&&!e.eqn(28))if(t){var n=t.chainIdBN().muln(2);if(!e.eq(n.addn(35))&&!e.eq(n.addn(36)))throw new Error("Incompatible EIP155-based V "+e.toString()+" and chain id "+t.chainIdBN().toString()+". See the Common parameter of the Transaction constructor to set the chain id.")}else {var i;i=e.subn(35).isEven()?35:36,r=e.subn(i).divn(2);}return this._getCommon(t,r)},t.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},t.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned())throw Error("This transaction is not signed");var e=this.common.gteHardfork("spuriousDragon"),t=this.v,r=this.common.chainIdBN().muln(2);return (t.eq(r.addn(35))||t.eq(r.addn(36)))&&e},t}(r(75058).BaseTransaction);t.default=f;},89562:(e,t,r)=>{var n=r(29033).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var i=r(33062),o=r(42339),a=function(){function e(){}return e.fromTxData=function(e,t){if(void 0===t&&(t={}),"type"in e&&void 0!==e.type){var r=new i.BN((0, i.toBuffer)(e.type)).toNumber();if(0===r)return o.Transaction.fromTxData(e,t);if(1===r)return o.AccessListEIP2930Transaction.fromTxData(e,t);if(2===r)return o.FeeMarketEIP1559Transaction.fromTxData(e,t);throw new Error("Tx instantiation with type "+r+" not supported")}return o.Transaction.fromTxData(e,t)},e.fromSerializedData=function(e,t){if(void 0===t&&(t={}),e[0]<=127){var r=void 0;switch(e[0]){case 1:r=2930;break;case 2:r=1559;break;default:throw new Error("TypedTransaction with ID "+e[0]+" unknown")}return 1559===r?o.FeeMarketEIP1559Transaction.fromSerializedTx(e,t):o.AccessListEIP2930Transaction.fromSerializedTx(e,t)}return o.Transaction.fromSerializedTx(e,t)},e.fromBlockBodyData=function(e,t){if(void 0===t&&(t={}),n.isBuffer(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return o.Transaction.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")},e.getTransactionClass=function(e,t){if(void 0===e&&(e=0),0==e||e>=128&&e<=255)return o.Transaction;switch(e){case 1:return o.AccessListEIP2930Transaction;case 2:return o.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID "+e+" unknown")}},e}();t.default=a;},87325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var n,i=r(33062);function o(e){if(0===e.length)return !0;var t=e[0];return !!Array.isArray(t)}(n=t.Capability||(t.Capability={}))[n.EIP155ReplayProtection=155]="EIP155ReplayProtection",n[n.EIP1559FeeMarket=1559]="EIP1559FeeMarket",n[n.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",n[n.EIP2930AccessLists=2930]="EIP2930AccessLists",t.isAccessListBuffer=o,t.isAccessList=function(e){return !o(e)},t.N_DIV_2=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16);},53789:(e,t