New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vocdoni/wallets

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocdoni/wallets

Javascript/Typescript wallets package

latest
Source
npmnpm
Version
1.16.0
Version published
Maintainers
6
Created
Source

@vocdoni/wallets

@vocdoni/wallets contains wallets helpers for the dvote-js library

Installation

Use npm to install @vocdoni/wallets.

npm install @vocdoni/wallets

Usage

Metamask

import { SignerUtil } from "@vocdoni/wallets"

const signer = SignerUtil.fromInjectedWeb3()
// wallet.signMessage(...)

// See ethers.js > Signer

Ethereum

import { WalletUtil } from "@vocdoni/wallets"

const wallet = WalletUtil.fromSeededPassphrase("my-passphrase", hexSeed)
// wallet.signMessage(...)

// See ethers.js > Wallet

Baby JubJub

import { WalletBabyJub } from "@vocdoni/wallets"
import { Random } from "@vocdoni/common"

const wallet1 = WalletBabyJub.fromProcessCredentials(loginKey, processId, chosenSecret)

const seed = Random.getHex()
const wallet2 = WalletBabyJub.fromHexSeed(seed)

const privK = "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0"
const wallet3 = new WalletBabyJub(privK)

// sign
const msg = Buffer.from("my message", "utf8")
const sign = wallet1.sign(msg)

// verify
const valid = WalletBabyJub.verify(msg, sig, wallet1.publicKey)
// => true

Testing

To execute library tests just run

npm run test

FAQs

Package last updated on 24 Jan 2022

Did you know?

Socket

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