soulswap-rubik-sdk
Version:
Simplify dApp creation
1 lines • 1.42 MB
JavaScript
var RubicSDK;(()=>{var e={74083:function(e,t,r){"use strict";var n=this&&this.__values||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=this&&this.__importDefault||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)),c=i(r(37098)),u=i(r(17687));function f(e){var t,r,i={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli"},f={mainnet:o.default,ropsten:a.default,rinkeby:s.default,kovan:c.default,goerli:u.default};if(e)try{for(var l=n(e),d=l.next();!d.done;d=l.next()){var h=d.value,p=h.name;i[h.chainId.toString()]=p,f[p]=h}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return f.names=i,f}t._getInitializedChains=f,t.chains=f()},97616:(e,t,r)=>{"use strict";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),4345:r(74818)}},37459:(e,t,r)=>{"use strict";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)],["arrowGlacier",r(51971)],["merge",r(88648)]]},2832:function(e,t,r){"use strict";var n,i=r(48764).Buffer,o=this&&this.__extends||(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=this&&this.__assign||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)},s=this&&this.__values||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 c,u,f=r(17187),l=r(34606),d=r(22751),h=r(74083),p=r(37459),y=r(97616);!function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"}(c=t.CustomChain||(t.CustomChain={})),function(e){e[e.Mainnet=1]="Mainnet",e[e.Ropsten=3]="Ropsten",e[e.Rinkeby=4]="Rinkeby",e[e.Kovan=42]="Kovan",e[e.Goerli=5]="Goerli"}(t.Chain||(t.Chain={})),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.ArrowGlacier="arrowGlacier",e.Shanghai="shanghai",e.Merge="merge"}(u=t.Hardfork||(t.Hardfork={})),function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"}(t.ConsensusType||(t.ConsensusType={})),function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"}(t.ConsensusAlgorithm||(t.ConsensusAlgorithm={}));var b=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:u.Istanbul;try{for(var c=s(a._chainParams.hardforks),f=c.next();!f.done;f=c.next()){var l=f.value;l.forkHash||(l.forkHash=a._calcForkHash(l.name))}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}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 o(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=a({},t._getChainParams(i));if(o.name="custom-chain","string"!=typeof e)return new t(a({chain:a(a({},o),e)},r));if(e===c.PolygonMainnet)return t.custom({name:c.PolygonMainnet,chainId:137,networkId:137});if(e===c.PolygonMumbai)return t.custom({name:c.PolygonMumbai,chainId:80001,networkId:80001});if(e===c.ArbitrumRinkebyTestnet)return t.custom({name:c.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611});if(e===c.xDaiChain)return t.custom({name:c.xDaiChain,chainId:100,networkId:100});if(e===c.OptimisticKovan)return t.custom({name:c.OptimisticKovan,chainId:69,networkId:69},{hardfork:u.Berlin});if(e===c.OptimisticEthereum)return t.custom({name:c.OptimisticEthereum,chainId:10,networkId:10},{hardfork:u.Berlin});throw new Error("Custom chain "+e+" not supported")},t.forCustomChain=function(e,r,n,i){var o=t._getChainParams(e);return new t({chain:a(a({},o),r),hardfork:n,supportedHardforks:i})},t.isSupportedChainId=function(e){var t=(0,h._getInitializedChains)();return Boolean(t.names[e.toString()])},t._getChainParams=function(e,t){var r=(0,h._getInitializedChains)(t);if("number"==typeof e||d.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||d.BN.isBN(e)){var i=void 0;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"!=typeof 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 o=s(["networkId","genesis","hardforks","bootstrapNodes"]),a=o.next();!a.done;a=o.next()){var c=a.value;if(void 0===e[c])throw new Error("Missing required chain parameter: "+c)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}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=s(p.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,d.toType)(e,d.TypeOutput.BN),t=(0,d.toType)(t,d.TypeOutput.BN);var i,o,a,c=u.Chainstart;try{for(var f=s(this.hardforks()),l=f.next();!l.done;l=f.next()){var h=l.value;if(null!==h.block)e.gte(new d.BN(h.block))&&(c=h.name),t&&h.td&&(t.gte(new d.BN(h.td))?i=h.name:o=a),a=h.name;else if(null!=t&&void 0!==h.td&&null!==h.td&&t.gte(new d.BN(h.td)))return h.name}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}if(t){var p="block number: "+e+" (-> "+c+"), ";if(i&&!this.hardforkGteHardfork(c,i)){var y="HF determined by block number is lower than the minimum total difficulty HF";throw p+="total difficulty: "+t+" (-> "+i+")",new Error(y+": "+p)}if(o&&!this.hardforkGteHardfork(o,c)){y="Maximum HF determined by total difficulty is lower than the block number HF";throw p+="total difficulty: "+t+" (-> "+o+")",new Error(y+": "+p)}}return c},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=s(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=s(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 y.EIPs))throw new Error(t+" not supported");var r=o.gteHardfork(y.EIPs[t].minimumHardfork);if(!r)throw new Error(t+" cannot be activated on hardfork "+o.hardfork()+", minimumHardfork: "+r);y.EIPs[t].requiredEIPs&&y.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=s(e),c=a.next();!c.done;c=a.next()){i(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.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=s(this._eips),a=o.next();!a.done;a=o.next()){var c=a.value;if(null!==(i=this.paramByEIP(e,t,c)))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 c=null;try{for(var u=s(p.hardforks),f=u.next();!f.done;f=u.next()){var l=f.value;if("eips"in l[1]){var d=l[1].eips;try{for(var h=(o=void 0,s(d)),y=h.next();!y.done;y=h.next()){var b=y.value,m=this.paramByEIP(e,t,b);c=null!==m?m:c}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}}else{if(!l[1][e])throw new Error("Topic "+e+" not defined");void 0!==l[1][e][t]&&(c=l[1][e][t].v)}if(l[0]===r)break}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return c},t.prototype.paramByEIP=function(e,t,r){if(!(r in y.EIPs))throw new Error(r+" not supported");var n=y.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=s(p.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,d.toType)(t,d.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 c=-1,u=-1,f=0;try{for(var l=s(o),d=l.next();!d.done;d=l.next()){var h=d.value;h.name===e&&(c=f),h.name===t&&(u=f),f+=1}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return c>=u&&-1!==u},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=s(this.hardforks()),c=a.next();!c.done;c=a.next()){var u=c.value;if(u.name===e&&null!==u.block)return!0}}catch(e){r={error:e}}finally{try{c&&!c.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=s(o),c=a.next();!c.done;c=a.next()){var u=c.value;if(null!==u.block){if(null!=e&&e<u.block)break;t.onlySupported&&!this._isSupportedHardfork(u.name)||i.push(u)}}}catch(e){r={error:e}}finally{try{c&&!c.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(0,d.toType)(t,d.TypeOutput.Number)},t.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).block;return null==t?null:new d.BN(t)},t.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).td;return null==t?null:new d.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0,d.toType)(e,d.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(0,d.toType)(t,d.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 d.BN(r.block);return n.gt(t)&&null===e?n:e}),null)},t.prototype.isNextHardforkBlock=function(e,t){e=(0,d.toType)(e,d.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 c=s(this.hardforks()),u=c.next();!u.done;u=c.next()){var f=u.value,h=f.block;if(0!==h&&null!==h&&h!==a){var p=i.from(h.toString(16).padStart(16,"0"),"hex");o=i.concat([o,p])}if(f.name===e)break;null!==h&&(a=h)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}var y=i.concat([n,o]);return"0x"+(0,d.intToBuffer)((0,l.buf)(y)>>>0).toString("hex")},t.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t.block&&void 0===t.td){throw new Error("No fork hash calculation possible for 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=s(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,d.toType)(this.chainIdBN(),d.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new d.BN(this._chainParams.chainId)},t.prototype.chainName=function(){return this._chainParams.name},t.prototype.networkId=function(){return(0,d.toType)(this.networkIdBN(),d.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new d.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=s(p.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=s(p.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=s(p.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 c=this.consensusAlgorithm();return this._chainParams.consensus[c]},t.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},t}(f.EventEmitter);t.default=b},36225:function(e,t,r){"use strict";var n=this&&this.__createBinding||(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=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||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},a=this&&this.__values||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.")},s=this&&this.__read||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 c=o(r(2832)),u=r(22751),f=r(63458),l=function(){function e(e){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=c.Chain.Mainnet,this.DEFAULT_HARDFORK=c.Hardfork.Istanbul;var t=e.nonce,r=e.gasLimit,n=e.to,i=e.value,o=e.data,a=e.v,s=e.r,f=e.s,l=e.type;this._type=new u.BN((0,u.toBuffer)(l)).toNumber();var d=(0,u.toBuffer)(""===n?"0x":n),h=(0,u.toBuffer)(""===a?"0x":a),p=(0,u.toBuffer)(""===s?"0x":s),y=(0,u.toBuffer)(""===f?"0x":f);this.nonce=new u.BN((0,u.toBuffer)(""===t?"0x":t)),this.gasLimit=new u.BN((0,u.toBuffer)(""===r?"0x":r)),this.to=d.length>0?new u.Address(d):void 0,this.value=new u.BN((0,u.toBuffer)(""===i?"0x":i)),this.data=(0,u.toBuffer)(""===o?"0x":o),this.v=h.length>0?new u.BN(h):void 0,this.r=p.length>0?new u.BN(p):void 0,this.s=y.length>0?new u.BN(y):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 u.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,u.unpadBuffer)(e).length}catch(e){return!1}},e.prototype.getSenderAddress=function(){return new u.Address((0,u.publicToAddress)(this.getSenderPublicKey()))},e.prototype.sign=function(e){if(32!==e.length){var t=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(t)}var r=!1;0===this.type&&this.common.gteHardfork("spuriousDragon")&&!this.supports(f.Capability.EIP155ReplayProtection)&&(this.activeCapabilities.push(f.Capability.EIP155ReplayProtection),r=!0);var n=this.getMessageToSign(!0),i=(0,u.ecsign)(n,e),o=i.v,a=i.r,s=i.s,c=this._processSignature(o,a,s);if(r){var l=this.activeCapabilities.indexOf(f.Capability.EIP155ReplayProtection);l>-1&&this.activeCapabilities.splice(l,1)}return c},e.prototype._getCommon=function(e,t){var r;if(t){var n=new u.BN((0,u.toBuffer)(t));if(e){if(!e.chainIdBN().eq(n)){var i=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(i)}return e.copy()}return c.default.isSupportedChainId(n)?new c.default({chain:n,hardfork:this.DEFAULT_HARDFORK}):c.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 c.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=a(Object.entries(e)),o=i.next();!o.done;o=i.next()){var c=s(o.value,2),f=c[0],l=c[1];if(53===t){if(null==l?void 0:l.gt(u.MAX_INTEGER)){var d=this._errorMsg(f+" cannot exceed MAX_INTEGER, given "+l);throw new Error(d)}}else{if(256!==t){d=this._errorMsg("unimplemented bits value");throw new Error(d)}if(null==l?void 0:l.gte(u.TWO_POW256)){var d=this._errorMsg(f+" must be less than 2^256, given "+l);throw new Error(d)}}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},e.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,u.bufferToHex)(this.hash()):"not available (unsigned)"}catch(t){e="error"}var t="";try{t=this.isSigned().toString()}catch(t){e="error"}var r="";try{r=this.common.hardfork()}catch(e){r="error"}var n="tx type="+this.type+" hash="+e+" nonce="+this.nonce+" value="+this.value+" ";return n+="signed="+t+" hf="+r},e}();t.BaseTransaction=l},47669:function(e,t,r){"use strict";var n,i=r(48764).Buffer,o=this&&this.__extends||(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=this&&this.__assign||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)},s=this&&this.__read||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});var c=r(22751),u=r(36225),f=r(63458),l=r(82942),d=i.from(2..toString(16).padStart(2,"0"),"hex"),h=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 s=t.chainId,u=t.accessList,d=t.maxFeePerGas,h=t.maxPriorityFeePerGas;if(o.common=o._getCommon(r.common,s),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=l.AccessLists.getAccessListData(null!=u?u:[]);if(o.accessList=p.accessList,o.AccessListJSON=p.AccessListJSON,l.AccessLists.verifyAccessList(o.accessList),o.maxFeePerGas=new c.BN((0,c.toBuffer)(""===d?"0x":d)),o.maxPriorityFeePerGas=new c.BN((0,c.toBuffer)(""===h?"0x":h)),o._validateCannotExceedMaxInteger({maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas},256),o.maxFeePerGas.lt(o.maxPriorityFeePerGas)){var y=o._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(y)}if(o.v&&!o.v.eqn(0)&&!o.v.eqn(1)){y=o._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(y)}if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(f.N_DIV_2))){y=o._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(y)}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=c.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=s(e,12),i=n[0],o=n[1],a=n[2],u=n[3],f=n[4],l=n[5],d=n[6],h=n[7],p=n[8],y=n[9],b=n[10],m=n[11];return new t({chainId:new c.BN(i),nonce:o,maxPriorityFeePerGas:a,maxFeePerGas:u,gasLimit:f,to:l,value:d,data:h,accessList:null!=p?p:[],v:void 0!==y?new c.BN(y):void 0,r:b,s:m},r)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(l.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(e){void 0===e&&(e=new c.BN(0));var t=c.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(e)).add(e);return this.gasLimit.mul(t).add(this.value)},t.prototype.raw=function(){return[(0,c.bnToUnpaddedBuffer)(this.chainId),(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,c.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,c.bnToUnpaddedBuffer)(this.v):i.from([]),void 0!==this.r?(0,c.bnToUnpaddedBuffer)(this.r):i.from([]),void 0!==this.s?(0,c.bnToUnpaddedBuffer)(this.s):i.from([])]},t.prototype.serialize=function(){var e=this.raw();return i.concat([d,c.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),r=i.concat([d,c.rlp.encode(t)]);return e?(0,c.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,c.keccak256)(this.serialize())),this.cache.hash):(0,c.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(f.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var n=this,i=n.v,o=n.r,a=n.s;try{return(0,c.ecrecover)(r,i.addn(27),(0,c.bnToUnpaddedBuffer)(o),(0,c.bnToUnpaddedBuffer)(a))}catch(e){t=this._errorMsg("Invalid Signature");throw new Error(t)}},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 c.BN(e-27),r:new c.BN(r),s:new c.BN(n)},i)},t.prototype.toJSON=function(){var e=l.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,c.bnToHex)(this.chainId),nonce:(0,c.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,c.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,c.bnToHex)(this.maxFeePerGas),gasLimit:(0,c.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,c.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,c.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e=this._getSharedErrorPostfix();return e+=" maxFeePerGas="+this.maxFeePerGas+" maxPriorityFeePerGas="+this.maxPriorityFeePerGas},t.prototype._errorMsg=function(e){return e+" ("+this.errorStr()+")"},t}(u.BaseTransaction);t.default=h},29325:function(e,t,r){"use strict";var n,i=r(48764).Buffer,o=this&&this.__extends||(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=this&&this.__assign||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)},s=this&&this.__read||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});var c=r(22751),u=r(36225),f=r(63458),l=r(82942),d=i.from(1..toString(16).padStart(2,"0"),"hex"),h=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 s=t.chainId,u=t.accessList,d=t.gasPrice;if(o.common=o._getCommon(r.common,s),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=l.AccessLists.getAccessListData(null!=u?u:[]);if(o.accessList=h.accessList,o.AccessListJSON=h.AccessListJSON,l.AccessLists.verifyAccessList(o.accessList),o.gasPrice=new c.BN((0,c.toBuffer)(""===d?"0x":d)),o._validateCannotExceedMaxInteger({gasPrice:o.gasPrice}),o.v&&!o.v.eqn(0)&&!o.v.eqn(1)){var p=o._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(p)}if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(f.N_DIV_2))){p=o._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(p)}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=c.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=s(e,11),i=n[0],o=n[1],a=n[2],u=n[3],f=n[4],l=n[5],d=n[6],h=n[7],p=n[8],y=n[9],b=n[10];return new t({chainId:new c.BN(i),nonce:o,gasPrice:a,gasLimit:u,to:f,value:l,data:d,accessList:null!=h?h:[],v:void 0!==p?new c.BN(p):void 0,r:y,s:b},r)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(l.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.raw=function(){return[(0,c.bnToUnpaddedBuffer)(this.chainId),(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.gasPrice),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,c.bnToUnpaddedBuffer)(this.v):i.from([]),void 0!==this.r?(0,c.bnToUnpaddedBuffer)(this.r):i.from([]),void 0!==this.s?(0,c.bnToUnpaddedBuffer)(this.s):i.from([])]},t.prototype.serialize=function(){var e=this.raw();return i.concat([d,c.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),r=i.concat([d,c.rlp.encode(t)]);return e?(0,c.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,c.keccak256)(this.serialize())),this.cache.hash):(0,c.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(f.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var n=this,i=n.yParity,o=n.r,a=n.s;try{return(0,c.ecrecover)(r,i.addn(27),(0,c.bnToUnpaddedBuffer)(o),(0,c.bnToUnpaddedBuffer)(a))}catch(e){t=this._errorMsg("Invalid Signature");throw new Error(t)}},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 c.BN(e-27),r:new c.BN(r),s:new c.BN(n)},i)},t.prototype.toJSON=function(){var e=l.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,c.bnToHex)(this.chainId),nonce:(0,c.bnToHex)(this.nonce),gasPrice:(0,c.bnToHex)(this.gasPrice),gasLimit:(0,c.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,c.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,c.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e,t,r=this._getSharedErrorPostfix();return r+=" gasPrice="+this.gasPrice+" accessListCount="+(null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0)},t.prototype._errorMsg=function(e){return e+" ("+this.errorStr()+")"},t}(u.BaseTransaction);t.default=h},66052:function(e,t,r){"use strict";var n=this&&this.__createBinding||(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=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},o=this&&this.__importDefault||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 a=r(35534);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return o(a).default}});var s=r(29325);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return o(s).default}});var c=r(31932);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return o(c).default}});var u=r(47669);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return o(u).default}}),i(r(63458),t)},35534:function(e,t,r){"use strict";var n,i=r(48764).Buffer,o=this&&this.__extends||(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=this&&this.__assign||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)},s=this&&this.__read||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});var c=r(22751),u=r(63458),f=r(36225),l=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 c.BN((0,c.toBuffer)(""===t.gasPrice?"0x":t.gasPrice)),i._validateCannotExceedMaxInteger({gasPrice:i.gasPrice}),i.common.gteHardfork("spuriousDragon"))if(i.isSigned()){var o=i.v,s=i.common.chainIdBN().muln(2);(o.eq(s.addn(35))||o.eq(s.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=c.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=s(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,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.gasPrice),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,c.bnToUnpaddedBuffer)(this.v):i.from([]),void 0!==this.r?(0,c.bnToUnpaddedBuffer)(this.r):i.from([]),void 0!==this.s?(0,c.bnToUnpaddedBuffer)(this.s):i.from([])]},t.prototype.serialize=function(){return c.rlp.encode(this.raw())},t.prototype._getMessageToSign=function(){var e=[(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.gasPrice),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:i.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(u.Capability.EIP155ReplayProtection)&&(e.push((0,c.toBuffer)(this.common.chainIdBN())),e.push((0,c.unpadBuffer)((0,c.toBuffer)(0))),e.push((0,c.unpadBuffer)((0,c.toBuffer)(0)))),e},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this._getMessageToSign();return e?(0,c.rlphash)(t):t},t.prototype.getDataFee=function(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:e.prototype.getDataFee.call(this),hardfork:this.common.hardfork()}),e.prototype.getDataFee.call(this))},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,c.rlphash)(this.raw())),this.cache.hash):(0,c.rlphash)(this.raw())},t.prototype.getMessageToVerifySignature=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this._getMessageToSign();return(0,c.rlphash)(t)},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))){var r=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(r)}var n=this,i=n.v,o=n.r,a=n.s;try{return(0,c.ecrecover)(t,i,(0,c.bnToUnpaddedBuffer)(o),(0,c.bnToUnpaddedBuffer)(a),this.supports(u.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(e){r=this._errorMsg("Invalid Signature");throw new Error(r)}},t.prototype._processSignature=function(e,r,n){var i=new c.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 c.BN(r),s:new c.BN(n)},o)},t.prototype.toJSON=function(){return{nonce:(0,c.bnToHex)(this.nonce),gasPrice:(0,c.bnToHex)(this.gasPrice),gasLimit:(0,c.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0,c.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,c.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+" and chain id "+t.chainIdBN()+". See the Common parameter of the Transaction constructor to set the chain id.")}else{var i=void 0;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()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this.common.gteHardfork("spuriousDragon"),r=this.v,n=this.common.chainIdBN().muln(2);return(r.eq(n.addn(35))||r.eq(n.addn(36)))&&t},t.prototype.errorStr=function(){var e=this._getSharedErrorPostfix();return e+=" gasPrice="+this.gasPrice},t.prototype._errorMsg=function(e){return e+" ("+this.errorStr()+")"},t}(f.BaseTransaction);t.default=l},31932:(e,t,r)=>{"use strict";var n=r(48764).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var i=r(22751),o=r(66052),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},63458:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var n=r(22751);function i(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}!function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"}(t.Capability||(t.Capability={})),t.isAccessListBuffer=i,t.isAccessList=function(e){return!i(e)},t.N_DIV_2=new n.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},82942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessLists=void 0;var n=r(22751),i=r(63458),o=function(){function e(){}return e.getAccessListData=function(e){var t,r;if(e&&(0,i.isAccessList)(e)){t=e;for(var o=[],a=0;a<e.length;a++){for(var s=e[a],c=(0,n.toBuffer)(s.address),u=[],f=0;f<s.storageKeys.length;f++)u.push((0,n.toBuffer)(s.storageKeys[f]));o.push([c,u])}r=o}else{r=null!=e?e:[];var l=[];for(a=0;a<r.length;a++){var d=r[a],h=(0,n.bufferToHex)(d[0]),p=[];for(s=0;s<d[1].length;s++)p.push((0,n.bufferToHex)(d[1][s]));var y={address:h,storageKeys:p};l.push(y)}t=l}return{AccessListJSON:t,accessList:r}},e.verifyAccessList=function(e){for(var t=0;t<e.length;t++){var r=e[t],n=r[0],i=r[1];if(void 0!==r[2])throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(20!=n.length)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(var o=0;o<i.length;o++)if(32!=i[o].length)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},e.getAccessListJSON=function(e){for(var t=[],r=0;r<e.length;r++){for(var i=e[r],o={address:"0x"+(0,n.setLengthLeft)(i[0],20).toString("hex"),storageKeys:[]},a=i[1],s=0;s<a.length;s++){var c=a[s];o.storageKeys.push("0x"+(0,n.setLengthLeft)(c,32).toS