Socket
Socket
Sign inDemoInstall

bls-wallet-clients

Package Overview
Dependencies
50
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bls-wallet-clients

Client libraries for interacting with BLS Wallet components


Version published
Maintainers
1
Created

Readme

Source

BLS Wallet Clients

Client libraries for interacting with BLS Wallet components

Aggregator

Exposes typed functions for interacting with the Aggregator's HTTP api.

import { Aggregator } from 'bls-wallet-clients';

const aggregator = new Aggregator('https://rinkarby.blswallet.org');

await aggregator.addTransaction(...);

BlsWallet

Models a BLS wallet, storing the private key and providing .sign(...) to produce TransactionData, that can be used with aggregator.addTransaction(...).

import { BlsWallet } from 'bls-wallet-clients';

const wallet = await BlsWallet.connectOrCreate(
  privateKey,
  verificationGatewayAddress,
  parentWallet, // A regular ethers wallet
);

const tx = wallet.sign({
  contract: someToken, // An ethers.Contract
  method: 'transfer',
  args: [recipientAddress, ethers.utils.parseUnits('1', 18)],
  nonce: await wallet.Nonce(),
});

await aggregator.addTransaction(tx);

VerificationGateway

Wraps an ethers.Contract with a typed interface for VerificationGateway. Allows sending transactions without relying on an aggregator.

import { VerificationGateway } from 'bls-wallet-clients';
import { initBlsWalletSigner } from 'bls-wallet-signer';

const blsWalletSigner = await initBlsWalletSigner({
  chainId: 1,
});

const verificationGateway = new VerificationGateway(
  verificationGatewayAddress,
  regularWallet, // An ethers.Wallet
);

await verificationGateway.actionCalls(
  ethers.constants.AddressZero,
  blsWalletSigner.aggregate([tx]),
);

FAQs

Last updated on 19 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc