/*! For license information please see web3.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Web3=t():e.Web3=t()}(self,(()=>(()=>{var e={1645:(e,t,r)=>{"use strict";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(7295)),a=i(r(1227)),s=i(r(439)),u=i(r(7098)),c=i(r(7687));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:u.default,goerli:c.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,f[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 f.names=i,f}t._getInitializedChains=f,t.chains=f()},425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1559:r(7523),2315:r(3339),2537:r(6769),2565:r(7897),2718:r(2170),2929:r(8436),2930:r(6213),3198:r(5491),3529:r(7852),3541:r(1871),3554:r(7225),3675:r(8571)}},7002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",r(114)],["homestead",r(2800)],["dao",r(7197)],["tangerineWhistle",r(2302)],["spuriousDragon",r(716)],["byzantium",r(6985)],["constantinople",r(5993)],["petersburg",r(4064)],["istanbul",r(3166)],["muirGlacier",r(2946)],["berlin",r(15)],["london",r(1250)],["shanghai",r(5553)],["merge",r(8648)]]},3863:(e,t,r)=>{"use strict";var n,i=r(9033).Buffer,o=r(8847)(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 c,f,d,l,h,p=r(8291),b=r(4628),y=r(3062),m=r(1645),v=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"}(c=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"}(f=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:f.Istanbul;try{for(var s=u(a._chainParams.hardforks),c=s.next();!c.done;c=s.next()){var d=c.value;d.forkHash||(d.forkHash=a._calcForkHash(d.name))}}catch(e){r={error:e}}finally{try{c&&!c.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===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});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,m._getInitializedChains)();return Boolean(t.names[e.toString()])},t._getChainParams=function(e,t){var r=(0,m._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 c=s.value;if(void 0===e[c])throw new Error("Missing required chain parameter: "+c)}}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(v.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=f.Chainstart;try{for(var c=u(this.hardforks()),d=c.next();!d.done;d=c.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=c.return)&&n.call(c)}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+":
没有合适的资源?快使用搜索试试~ 我知道了~
Web3.min.js开发工具
共1个文件
js:1个
需积分: 0 35 下载量 100 浏览量
2023-06-07
20:10:22
上传
评论
收藏 334KB ZIP 举报
温馨提示
帮助更多希望接触web3的朋友们入门这门技术
资源推荐
资源详情
资源评论
收起资源包目录
web3js工具.zip (1个子文件)
web3js工具
web3.min.js 1.13MB
共 1 条
- 1
资源评论
瑞晟技术服务中心-耿瑞
- 粉丝: 3367
- 资源: 33
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功