{"bugs":{"url":"https://github.com/ethereum-optimism/core-utils/issues"},"dist":{"shasum":"0c9683caf22b53bee0f6d0736b2c9c2fd20db599","tarball":"https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.0.0-20219516434.tgz","fileCount":52,"integrity":"sha512-DFoEHpBPaB+244IPtlJ3cSfAkApFJPegezXqwW1vWB5O4VBh3lBbm6ywvz5YkRwyCcVCQsadCDS17kjy6asmOA==","signatures":[{"sig":"MEYCIQDpmKzLXvV5X+awBRtMvRmL3Xe82arV/jfRz938qzbAPwIhAOme+ViYDeqqZtOmCm368UidrhI0ykot9ndOy7M2R+yx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":56269},"main":"dist/index","name":"@eth-optimism/core-utils","types":"dist/index","author":{"name":"Optimism PBC"},"readme":"[![codecov](https://codecov.io/gh/ethereum-optimism/optimism/branch/master/graph/badge.svg?token=0VTG7PG7YR&flag=core-utils)](https://codecov.io/gh/ethereum-optimism/optimism)\n\n# @eth-optimism/core-utils\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","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.build.json","clean":"rimraf dist/ ./tsconfig.build.tsbuildinfo","lint:fix":"yarn lint:check --fix","lint:check":"eslint .","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/core-utils#readme","repository":{"url":"git+ssh://git@github.com/ethereum-optimism/core-utils.git","type":"git"},"_npmVersion":"6.14.15","description":"[![codecov](https://codecov.io/gh/ethereum-optimism/optimism/branch/master/graph/badge.svg?token=0VTG7PG7YR&flag=core-utils)](https://codecov.io/gh/ethereum-optimism/optimism)","directories":{},"maintainers":[{"name":"karlfloersch","email":"karl@karl.tech"},{"name":"ben-chain","email":"ben@optimism.io"},{"name":"will_optimism","email":"will@optimism.io"},{"name":"k-ho","email":"kevin@optimism.io"},{"name":"tynes","email":"tyneway12@gmail.com"},{"name":"kelvinfichter","email":"kelvinfichter@gmail.com"}],"_nodeVersion":"12.22.6","dependencies":{"ethers":"^5.4.5","lodash":"^4.17.21","@ethersproject/providers":"^5.4.5","@ethersproject/abstract-provider":"^5.4.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^15.1.0","chai":"^4.3.0","mocha":"^8.3.0","eslint":"^7.27.0","prettier":"^2.2.1","ts-mocha":"^8.0.0","typescript":"^4.2.3","@types/chai":"^4.2.17","lint-staged":"11.0.0","@types/mocha":"^8.2.2","babel-eslint":"^10.1.0","@types/lodash":"^4.14.168","@types/prettier":"^2.2.3","eslint-plugin-ban":"^1.5.2","eslint-plugin-jsdoc":"^35.1.2","eslint-plugin-react":"^7.24.0","eslint-plugin-import":"^2.23.4","eslint-plugin-unicorn":"^32.0.1","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.26.0","eslint-plugin-prefer-arrow":"^1.2.3","@typescript-eslint/eslint-plugin":"^4.26.0"},"_npmOperationalInternal":{"tmp":"tmp/core-utils_0.0.0-20219516434_1633452192761_0.08683539502759796","host":"s3://npm-registry-packages"},"_id":"@eth-optimism/core-utils@0.0.0-20219516434","version":"0.0.0-20219516434"}