{"bugs":{"url":"https://github.com/ethereum-optimism/optimism/issues"},"dist":{"shasum":"ac38da35640b8bb5f3057883aed3469d5d400f57","tarball":"https://registry.npmjs.org/@eth-optimism/core-utils/-/core-utils-0.0.0-2022310341.tgz","fileCount":60,"integrity":"sha512-a4aTA2KK0e5w4+SYQK0lmp03uJu13GIsaSrNoShmHqj3unrMmttcaIB0Lnt/e4VLM68/GNDR5Yzxvm0PjuKqLA==","signatures":[{"sig":"MEUCIHpkKcMhwiWvcWGlYfaFyY/NoVm1w7CUQLC4VDrqYsp5AiEAjMAWMQi/Lfmi/VBpLC5c0lU/8qwhA9d2oAtk8Vr+50o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62801,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRkFoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoeRA/6AucaGMIbMm/EAre2XExUw4aKSawTjawWBCI+eppljnyCnjcy\r\n0dzF+GLREEZHmtdlaE0Unh/7Fis2Pq/rFWu0FcTOG9B/A28ieAOK0frnPPsc\r\nnLEilSwXyObawZKPzL1mV6X/xv3wrmGp5hxXxLhRf5/1KS/GSqCv85xn+kSR\r\nTxb1L0p93vrVAb4EWYyZFo/W2d+z44dgwicHPq8MlEJDXr9f6/+EXOjVm1Cv\r\nFWh3uKa/m1K/0Wn3H+GoVW3gZ9tRRdv94rT3CJoUEYQ4ma+zzlFqOhuHB53g\r\nNclXA2A872A/g3KWxnwzz8hmtjvK3Hh79pHh2oIMkfi0JlNnG+AFaitUIwQs\r\nkntuAFqVv3LyEFlJuUbhjp/convYv3pUB0DmRxPpUW7kBQBCM61Qe4yHjVIf\r\n0rDCsc1jU9+QXcFonJ219dWpOfaI9iYrVoG6Qk3GBuqJ2evkVe2cAgN2n1ql\r\n92z/3ROvYgyg+ur4NbwflXmVgCyB6oPqCtcEPtD0A8sr/OsZM4uNA9fbYtkx\r\nD2ro1YniNNw4L4qBuJv8x82rfHCOPqTlZ04kNLFxvoi1rjeh7n5K/NO4lp2C\r\nn4S6zXgPLScB5MxunTEkZctG880GhF5fgUPCS6uaVdDqyfBnMx9znPxMDXDt\r\niQaMmnZrNTcTGPGJV22MMF+N12veVuy9y+8=\r\n=tWb8\r\n-----END PGP SIGNATURE-----\r\n"},"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","gitHead":"ef1b11e91f268a1b0807e30f75ec344b20752b73","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 . --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.3.1","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.14.0","dependencies":{"chai":"^4.3.4","bufio":"^1.0.7","ethers":"^5.5.4","@ethersproject/web":"^5.5.1","@ethersproject/bytes":"^5.5.0","@ethersproject/providers":"^5.5.3","@ethersproject/transactions":"^5.5.0","@ethersproject/abstract-provider":"^5.5.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^15.1.0","mocha":"^8.4.0","eslint":"^7.27.0","prettier":"^2.3.1","ts-mocha":"^8.0.0","typescript":"^4.3.5","@types/chai":"^4.2.18","lint-staged":"11.0.0","@types/mocha":"^8.2.2","babel-eslint":"^10.1.0","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-2022310341_1648771431999_0.023649002973533895","host":"s3://npm-registry-packages"},"_id":"@eth-optimism/core-utils@0.0.0-2022310341","version":"0.0.0-2022310341"}