0.8.0-rc.1 • Published 2 years ago

bls-wallet-signer v0.8.0-rc.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

BLS Wallet Signer

Typescript module for signing, aggregating and verifying transactions using the bls signature scheme. Signed transactions are actioned in bls-wallet-contracts. Useful in the aggregator for verification and aggregation, and in the plugin for signing and aggregation.

npm install bls-wallet-signer

Usage

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.
})();
0.8.0-rc.1

2 years ago

0.6.1-rc.1

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.6.0-rc.1

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.5.0-rc.0

3 years ago

0.4.0

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago