# bls-wallet-signer

> Client-side tool for signing bls transaction data

Latest version **0.8.0-rc.1** (published 2021-11-16) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install bls-wallet-signer
pnpm add bls-wallet-signer
yarn add bls-wallet-signer
bun add bls-wallet-signer
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.8.0-rc.1 |
| Published | 2021-11-16 |
| First published | 2021-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 80.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Andrew Morris |
| Maintainers | voltrevo, jameszaki |
| Keywords | ethereum, optimism, bls, signature, aggregation |

## Links

- npm: https://www.npmjs.com/package/bls-wallet-signer
- Repository: https://github.com/jzaki/bls-wallet-signer
- Homepage: https://github.com/jzaki/bls-wallet-signer#readme
- Issues: https://github.com/jzaki/bls-wallet-signer/issues
- npm.io page: https://npm.io/package/bls-wallet-signer

## Dependencies (8)

- [mcl-wasm](https://npm.io/package/mcl-wasm.md) 0.7.6
- [typescript](https://npm.io/package/typescript.md) ^4.3.5
- [@ethersproject/abi](https://npm.io/package/@ethersproject/abi.md) ^5.4.0
- [@ethersproject/sha2](https://npm.io/package/@ethersproject/sha2.md) ^5.4.0
- [@ethersproject/bytes](https://npm.io/package/@ethersproject/bytes.md) ^5.4.0
- [@ethersproject/solidity](https://npm.io/package/@ethersproject/solidity.md) ^5.4.0
- [@ethersproject/bignumber](https://npm.io/package/@ethersproject/bignumber.md) ^5.4.1
- [@ethersproject/keccak256](https://npm.io/package/@ethersproject/keccak256.md) ^5.4.0

## Recent versions

- 0.8.0-rc.1 (latest) — 2021-11-16
- 0.6.1 — 2021-11-01
- 0.6.1-rc.1 — 2021-10-31
- 0.6.0 — 2021-10-22
- 0.6.0-rc.1 — 2021-10-21
- 0.5.1 — 2021-10-20
- 0.5.1-testDirectBls.3 — 2021-10-20
- 0.5.1-testDirectBls.2 — 2021-10-20
- 0.5.1-testDirectBls.1 — 2021-10-20
- 0.5.0 — 2021-10-08
- 0.5.0-rc.0 — 2021-10-07
- 0.4.0 — 2021-09-23
- 0.3.7 — 2021-09-09
- 0.3.6 — 2021-09-07
- 0.3.5 — 2021-08-19
- … 8 more at https://npm.io/package/bls-wallet-signer/versions

## README

# BLS Wallet Signer

Typescript module for signing, aggregating and verifying transactions using the bls signature scheme. Signed transactions are actioned in [bls-wallet-contracts](https://github.com/jzaki/bls-wallet-contracts).
Useful in the [aggregator](https://github.com/jzaki/bls-wallet-aggregator) for verification and aggregation, and in the [plugin](https://github.com/jzaki/bls-wallet-plugin) for signing and aggregation.

```sh
npm install bls-wallet-signer
```

## Usage

```ts
import ethers from "ethers";
import { initBlsWalletSigner } from "bls-wallet-signer";

(async () => {
  const signer = await initBlsWalletSigner({ chainId: 10 });

  const privateKey = "0x...256 bits of private hex data here";

  const someToken = new ethers.Contract(
    // See https://docs.ethers.io/v5/getting-started/
  );

  const signedTransactionData = signer.sign(
    {
      nonce: ethers.BigNumber.from(0),
      ethValue: ethers.BigNumber.from(0),
      contractAddress: someToken.address,

      // If you don't want to call a function and just send `ethValue` above,
      // use '0x' to signify an empty byte array here
      encodedFunction: someToken.interface.encodeFunctionData(
        "transfer",
        ["0x...some address...", ethers.BigNumber.from(10).pow(18)],
      ),
    },
    privateKey,
  );

  // Send signedTransactionData to an aggregator or use it with
  // VerificationGateway directly.
})();
```

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