{"bugs":{"url":"https://github.com/ethereum-optimism/optimism/issues"},"dist":{"shasum":"ce60d96f2c11fc5067d2d8437c7c782fceceb26d","tarball":"https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.0.0-202211220335.tgz","fileCount":78,"integrity":"sha512-eITzdYQLql+FQ4VJzAXTqZmFk2nRQQQgWzicyLX8nkjfxRgu+RgOHZ6tqy5rmKYLe36Hq99iZO2oaINnQdsPtQ==","signatures":[{"sig":"MEQCIEujTjA29viaJtDoh+zTQ47oqd3kU67dZC6Emi7Cee7PAiAWzzq4pm4XxXVU15iL2K9+DoJkefb2JL3OrOSuwcNWvQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":105036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjimEMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgBg/5AGlVxMWA4RZbp1AwoIUDPFmXRNuqwsfDtNRMAOgwFQRczKTn\r\nmnFII2xnMJpQTGCPT3G3ym4tgw+l+JAIB4l5TsZoi7y67zmQXl/eexScR0PI\r\nTFuIgFvMMJmXgr03rugQAs100tI+1fzF6apedCFIEiKPwIvakTHqz9JZfQsM\r\nOuBf31AQYtLVygNml6jXJT+05XKZtM+2A5Oomdnl0HaGNAUmJyt/SRcCqgpq\r\n8Gd87r0hbOVt89shp0xC33whkJQtxfUqlhYsDMos0lwS3sJJFzIzP0k+hnTB\r\n3fTZVAfIgs1VtXg2DuPs8ySYeis726xhahCHJv0BEqQpdOk/F3jSLwWw+7xs\r\nH8X/7sWBzfP4ebEjgNmWi0rzlRJfe/JP759XpHRmQi+wd2Q7GZ5qm3R+d237\r\n/r0zlhUjVcCXfbVJ6XWLZb6yfKz1E3Tsv266I5L9ZSimOWnjRruXRMVWmhpB\r\nMfw/YuVa+TGfs/Pfkogisf0sR0BTMm9M+Q7Rp5T5rrH2IBZawnuJ/eMqvLjt\r\nDND/91k07bfUcKXN36v6OQTWxD08+wEXfayrFrNx1yd+lDgIryoFFPvpDEyg\r\nEQ/431zqWLl3rK/JbpOvMXDNy3z2o56/DWRM0m2mPQaMygHL0m3tEezDpE7F\r\nngA7z4W53axmiOO3pPBGZgbXPZxXesd00so=\r\n=kRVT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index","name":"@eth-optimism/core-utils","types":"dist/index","author":{"name":"Optimism PBC"},"readme":"# @eth-optimism/core-utils\n\n[![codecov](https://codecov.io/gh/ethereum-optimism/optimism/branch/develop/graph/badge.svg?token=0VTG7PG7YR&flag=core-utils-tests)](https://codecov.io/gh/ethereum-optimism/optimism)\n\n## What is this?\n\n`@eth-optimism/core-utils` contains the Optimistic Virtual Machine core utilities.\n\n## Getting started\n\n### Building and usage\n\nAfter cloning and switching to the repository, install dependencies:\n\n```bash\n$ yarn\n```\n\nUse the following commands to build, use, test, and lint:\n\n```bash\n$ yarn build\n$ yarn start\n$ yarn test\n$ yarn lint\n```\n\n### L2 Fees\n\n`TxGasLimit` can be used to `encode` and `decode` the L2 Gas Limit\nlocally.\n\n```typescript\nimport { TxGasLimit } from '@eth-optimism/core-utils'\nimport { JsonRpcProvider } from 'ethers'\n\nconst L2Provider = new JsonRpcProvider('https://mainnet.optimism.io')\nconst L1Provider = new JsonRpcProvider('http://127.0.0.1:8545')\n\nconst l2GasLimit = await L2Provider.send('eth_estimateExecutionGas', [tx])\nconst l1GasPrice = await L1Provider.getGasPrice()\n\nconst encoded = TxGasLimit.encode({\n  data: '0x',\n  l1GasPrice,\n  l2GasLimit,\n  l2GasPrice: 10000000,\n})\n\nconst decoded = TxGasLimit.decode(encoded)\nassert(decoded.eq(gasLimit))\n\nconst estimate = await L2Provider.estimateGas()\nassert(estimate.eq(encoded))\n```\n","gitHead":"26406af1ed83539f77834f436c90d48a923c44cb","license":"MIT","scripts":{"all":"yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint","lint":"yarn lint:fix && yarn lint:check","test":"ts-mocha test/*.spec.ts","build":"tsc -p tsconfig.json","clean":"rimraf dist/ ./tsconfig.tsbuildinfo","lint:fix":"yarn lint:check --fix","lint:check":"eslint . --max-warnings=0","pre-commit":"lint-staged","test:coverage":"nyc ts-mocha test/*.spec.ts && nyc merge .nyc_output coverage.json"},"_npmUser":{"name":"karlfloersch","email":"karl@karl.tech"},"homepage":"https://github.com/ethereum-optimism/optimism/tree/develop/packages/core-utils#readme","keywords":["optimism","ethereum","core","utils"],"repository":{"url":"git+https://github.com/ethereum-optimism/optimism.git","type":"git"},"_npmVersion":"8.19.2","description":"[Optimism] Core typescript utilities","directories":{},"maintainers":[{"name":"karlfloersch","email":"karl@karl.tech"},{"name":"ben-chain","email":"ben@optimism.io"},{"name":"k-ho","email":"kevin@optimism.io"},{"name":"tynes","email":"tyneway12@gmail.com"},{"name":"kelvinfichter","email":"kelvinfichter@gmail.com"}],"_nodeVersion":"16.18.1","dependencies":{"chai":"^4.3.4","bufio":"^1.0.7","@ethersproject/abi":"^5.7.0","@ethersproject/rlp":"^5.7.0","@ethersproject/web":"^5.7.0","@ethersproject/hash":"^5.7.0","@ethersproject/bytes":"^5.7.0","@ethersproject/address":"^5.7.0","@ethersproject/bignumber":"^5.7.0","@ethersproject/constants":"^5.7.0","@ethersproject/contracts":"^5.7.0","@ethersproject/keccak256":"^5.7.0","@ethersproject/providers":"^5.7.0","@ethersproject/properties":"^5.7.0","@ethersproject/transactions":"^5.7.0","@ethersproject/abstract-provider":"^5.7.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mocha":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core-utils_0.0.0-202211220335_1670013196673_0.6492108446277254","host":"s3://npm-registry-packages"},"_id":"@eth-optimism/core-utils@0.0.0-202211220335","version":"0.0.0-202211220335"}