# erc2771-wrapper

> Wrap an evm transaction in to ERC2771 compatible format

Latest version **0.1.4** (published 2023-04-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install erc2771-wrapper
pnpm add erc2771-wrapper
yarn add erc2771-wrapper
bun add erc2771-wrapper
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2023-04-06 |
| First published | 2023-04-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Peersky |
| Maintainers | peersky |

## Links

- npm: https://www.npmjs.com/package/erc2771-wrapper
- Repository: https://github.com/peersky/erc2771-wrapper
- npm.io page: https://npm.io/package/erc2771-wrapper

## Dependencies (1)

- [ethers](https://npm.io/package/ethers.md) ^5.6.6

## Recent versions

- 0.1.4 (latest) — 2023-04-06
- 0.1.3 — 2023-04-06
- 0.1.2 — 2023-04-06
- 0.1.1 — 2023-04-06
- 0.1.0 — 2023-04-06
- 0.0.1 — 2023-04-06

## README

# ERC2771 wrapper

This package allows to wrap a transaction in to a meta tx in compatible with OpenZeppelin MinimalForwarder contract.

## How to use

```javascript
const Wrapper = require("erc2771-wrapper").default;
const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const wrapper = new Wrapper(
  {
    name: "MinimalForwarder",
    version: "0.0.1",
    chainId: "5",
    verifyingContract: forwarderDeployment.address,
  },
  provider // provider is needed to estimate gas costs of a transaction
);

const metaTx = await wrapper.signMetaTxRequest(this.signer, {
  from: signer.address,
  to: registry.address,
  data: registry.interface.encodeFunctionData("register", [randomName]),
});
```

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