Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
bls-wallet-clients
Advanced tools
Readme
Client libraries for interacting with BLS Wallet components
Deployed contract addresses and metadata.
import { NetworkConfig, getConfig } from 'bls-wallet-clients';
const netCfg: NetworkConfig = await getConfig(
'/path/to/network/config',
async (path) => ... /* fetch, fs.readFile, etc. */
);
// Read from netCfg.addresses.verificationGateway, etc.
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(...);
Wraps a BLS wallet, storing the private key and providing .sign(...)
to
produce a Bundle
, that can be used with aggregator.addTransaction(...)
.
import { BlsWalletWrapper } from 'bls-wallet-clients';
const wallet = await BlsWalletWrapper.connect(
privateKey,
verificationGatewayAddress,
provider,
);
const bundle = wallet.sign({
nonce: await wallet.Nonce(),
actions: [
{
contract: someToken, // An ethers.Contract
method: 'transfer',
args: [recipientAddress, ethers.utils.parseUnits('1', 18)],
},
// Additional actions can go here. When using multiple actions, they'll
// either all succeed or all fail.
],
});
await aggregator.addTransaction(bundle);
Exposes VerificationGateway
and VerificationGateway__factory
generated by
typechain to enable typed
interactions with the VerificationGateway
.
import { VerificationGateway__factory } from 'bls-wallet-clients';
const verificationGateway = VerificationGateway__factory.connect(
verificationGatewayAddress,
signer, // An ethers signer
);
await verificationGateway.processBundle(bundle);
Utilities for signing, aggregating and verifying transaction bundles using the bls signature scheme. Bundles are actioned in contracts.
Useful in the aggregator for verification and aggregation, and in the extension for signing and aggregation.
import ethers from "ethers";
import { initBlsWalletSigner } from "bls-wallet-clients";
(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 bundle = 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 bundle to an aggregator or use it with VerificationGateway directly.
})();
FAQs
Client libraries for interacting with BLS Wallet components
The npm package bls-wallet-clients receives a total of 7 weekly downloads. As such, bls-wallet-clients popularity was classified as not popular.
We found that bls-wallet-clients demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
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.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.