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

@radarrelay/wallet-manager

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radarrelay/wallet-manager

A library that simplifies Ethereum wallet creation.

latest
Source
npmnpm
Version
0.3.3
Version published
Maintainers
2
Created
Source

wallet-manager

A library that simplifies Ethereum wallet creation.

npm version CircleCI

Installation

npm

npm install @radarrelay/wallet-manager

Yarn

yarn add @radarrelay/wallet-manager

LightWallet Usage

Import

import { LightWalletManager } from '@radarrelay/wallet-manager';

LightWalletManager Methods

Create a new wallet

Create a new lightwallet and save it into local storage or as a file.

Options:

  • password (mandatory) A string used to encrypt the vault when serialized.
  • seedPhrase (optional) A twelve-word mnemonic used to generate all accounts. Randomly generated if not supplied.
  • salt (optional) The salt used to encrypt & decrypt the vault. Randomly generated if not supplied.
  • hdPathString (optional) A BIP39 compliant HD Path String. Defaults to m/44'/60'/0'/0.
  • storageKeyName (optional) The local storage key or file name.
const lightWallet = await LightWalletManager.createWalletAsync(options: LightWalletOptions): Promise<LightWallet>

Save an existing wallet

Save the encrypted lightwallet into local storage or as a file.

LightWalletManager.saveWallet(wallet: LightWallet): void

Load an existing wallet

Load the lightwallet from local storage or the file system.

const lightWallet = await LightWalletManager.loadWalletAsync(password: string): Promise<LightWallet>

LightWallet Methods

Add new accounts

Adds 1 or more accounts to the lightwallet instance and saves the updated wallet.

lightWallet.addNewAccounts(numberOfAccounts: number = 1): void

Export private key

Exports the private key for a single account.

const privateKey = lightWallet.exportAccountPrivateKeyAsync(account: string, password: string): Promise<string>

Export seed phrase

Exports the wallet's seed phrase.

const seedPhrase = await lightWallet.exportSeedPhraseAsync(password: string): Promise<string>

Get accounts

Gets all the accounts from the wallet.

const accounts = lightWallet.getAccounts(): string[]

Serialize

Serialize the encrypted lightwallet.

const serializedWallet = lightWallet.serialize(): string

Signer Methods

Sign a message

const signedMsg = await lightWallet.signer.signPersonalMessageAsync(account: string, message: string): Promise<string>

Sign a message hash

const signedMsgHash = await lightWallet.signer.signPersonalMessageHashAsync(account: string, messageHash: string): Promise<string>

Sign a transaction

const signedTx = await lightWallet.signer.signTransactionAsync(txParams: PartialTxParams): Promise<string>

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

ethereum

FAQs

Package last updated on 10 Sep 2018

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