# @songkeys/op-viem

Latest version **1.3.1-alpha.2** (published 2024-02-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @songkeys/op-viem
pnpm add @songkeys/op-viem
yarn add @songkeys/op-viem
bun add @songkeys/op-viem
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1-alpha.2 |
| Published | 2024-02-05 |
| First published | 2024-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 552.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | songkeys |

## Links

- npm: https://www.npmjs.com/package/@songkeys/op-viem
- npm.io page: https://npm.io/package/@songkeys/op-viem

## Dependencies (1)

- [@eth-optimism/contracts-ts](https://npm.io/package/@eth-optimism/contracts-ts.md) ^0.15.0

## Recent versions

- 1.3.1-alpha.2 (latest) — 2024-02-05
- 1.3.1-alpha.1 — 2024-01-05
- 1.3.1-alpha.0 — 2024-01-02

## README

<br/>

<p align="center">
  <a href="https://op-viem-site.vercel.app/">
  <h1>OP Viem</h1>
  </a>
</p>

<p align="center">
  Viem Extension for OP Stack Chains
<p>

<br>

## Features

- Simplifies cross L1 & L2 interactions
- Seamless extension to [Viem](https://github.com/wagmi-dev/viem)
- TypeScript ready
- Test suite running against [forked](https://ethereum.org/en/glossary/#fork) Ethereum network

## Overview

```ts
// import modules
import { createWalletClient, createPublicClient, custom, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { mainnet, base } from 'viem/chains'
import { baseAddresses } from 'op-viem/chains'
import { walletL1OpStackActions, publicL1OpStackActions, publicL2OpStackActions } from 'op-viem'

// create clients
export const opStackL1WalletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum)
}).extend(walletL1OpStackActions)

export const opStackL1PublicClient = createPublicClient({
  chain: mainnet,
  transport: http()
}).extend(publicL1OpStackActions)

export const opStackL2PublicClient = createPublicClient({
  chain: base,
  transport: http()
}).extend(publicL2OpStackActions)

// perform an action
opStackL1PublicClient.getOutputForL2Block(blockNumber: 2725977n, ...baseAddresses)
```

## Community

Check out the following places for more viem-related content:

- Follow [@wilsoncusack](https://twitter.com/wilsoncusack) Twitter for project updates

## Contributing

If you're interested in contributing, please read the [contributing docs](CONTRIBUTING.md) **before submitting a pull request**.

## Authors

- [@wilsoncusack](https://github.com/wilsoncusack) (wilsoncusack.eth [Twitter](https://twitter.com/wilsoncusack))
- [@zencephalon](https://github.com/zencephalon) (zencephalon.eth, [Twitter](https://twitter.com/zencephalon))
- [@roninjin10](https://github.com/roninjin10) (fucory.eth, [Twitter](https://twitter.com/FUCORY))

## License

[MIT](LICENSE.md) License

---
_Source: https://npm.io/package/@songkeys/op-viem · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
