# tianwei-qa-test

> [Optimism] Core typescript utilities

Latest version **0.12.2** (published 2023-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install tianwei-qa-test
pnpm add tianwei-qa-test
yarn add tianwei-qa-test
bun add tianwei-qa-test
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.12.2 |
| Published | 2023-10-19 |
| First published | 2022-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 103.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6475 |
| Author | Optimism PBC |
| Maintainers | t5428561 |
| Keywords | optimism, ethereum, core, utils |

## Links

- npm: https://www.npmjs.com/package/tianwei-qa-test
- Repository: https://github.com/ethereum-optimism/optimism
- Homepage: https://github.com/ethereum-optimism/optimism/tree/develop/packages/core-utils#readme
- Issues: https://github.com/ethereum-optimism/optimism/issues
- npm.io page: https://npm.io/package/tianwei-qa-test

## Dependencies (16)

- [chai](https://npm.io/package/chai.md) ^4.3.4
- [bufio](https://npm.io/package/bufio.md) ^1.0.7
- [@ethersproject/abi](https://npm.io/package/@ethersproject/abi.md) ^5.7.0
- [@ethersproject/rlp](https://npm.io/package/@ethersproject/rlp.md) ^5.7.0
- [@ethersproject/web](https://npm.io/package/@ethersproject/web.md) ^5.7.0
- [@ethersproject/hash](https://npm.io/package/@ethersproject/hash.md) ^5.7.0
- [@ethersproject/bytes](https://npm.io/package/@ethersproject/bytes.md) ^5.7.0
- [@ethersproject/address](https://npm.io/package/@ethersproject/address.md) ^5.7.0
- [@ethersproject/bignumber](https://npm.io/package/@ethersproject/bignumber.md) ^5.7.0
- [@ethersproject/constants](https://npm.io/package/@ethersproject/constants.md) ^5.7.0
- [@ethersproject/contracts](https://npm.io/package/@ethersproject/contracts.md) ^5.7.0
- [@ethersproject/keccak256](https://npm.io/package/@ethersproject/keccak256.md) ^5.7.0
- [@ethersproject/providers](https://npm.io/package/@ethersproject/providers.md) ^5.7.0
- [@ethersproject/properties](https://npm.io/package/@ethersproject/properties.md) ^5.7.0
- [@ethersproject/transactions](https://npm.io/package/@ethersproject/transactions.md) ^5.7.0
- [@ethersproject/abstract-provider](https://npm.io/package/@ethersproject/abstract-provider.md) ^5.7.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.12.2 (latest) — 2023-10-19
- 0.5.1 (alpha) — 2023-05-31
- 0.12.0 — 2023-10-18
- 0.4.2 — 2023-06-30
- 0.5.4 — 2023-06-07
- 0.5.3 — 2023-06-07
- 0.5.2 — 2023-06-07
- 0.5.0 — 2023-05-31
- 0.4.0 — 2023-05-27
- 5.0.0 — 2023-05-07
- 4.0.0 — 2023-05-07
- 3.0.0 — 2022-11-11
- 2.0.0 — 2022-11-11
- 1.0.0 — 2022-11-11

## README

# @eth-optimism/core-utils

[![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)

## What is this?

`@eth-optimism/core-utils` contains the Optimistic Virtual Machine core utilities.

## Getting started

### Building and usage

After cloning and switching to the repository, install dependencies:

```bash
$ yarn
```

Use the following commands to build, use, test, and lint:

```bash
$ yarn build
$ yarn start
$ yarn test
$ yarn lint
```

### L2 Fees

`TxGasLimit` can be used to `encode` and `decode` the L2 Gas Limit
locally.

```typescript
import { TxGasLimit } from '@eth-optimism/core-utils'
import { JsonRpcProvider } from 'ethers'

const L2Provider = new JsonRpcProvider('https://mainnet.optimism.io')
const L1Provider = new JsonRpcProvider('http://127.0.0.1:8545')

const l2GasLimit = await L2Provider.send('eth_estimateExecutionGas', [tx])
const l1GasPrice = await L1Provider.getGasPrice()

const encoded = TxGasLimit.encode({
  data: '0x',
  l1GasPrice,
  l2GasLimit,
  l2GasPrice: 10000000,
})

const decoded = TxGasLimit.decode(encoded)
assert(decoded.eq(gasLimit))

const estimate = await L2Provider.estimateGas()
assert(estimate.eq(encoded))
```

---
_Source: https://npm.io/package/tianwei-qa-test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
