Interact with Ethereum wallets easily
Switch branches/tags
Clone or download
Pull request Compare This branch is 217 commits behind JoinColony:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.assets
.circleci
.github
docs
flow-typed
modules
scripts
.editorconfig
.eslintignore
.eslintrc
.flowconfig
.gitignore
.lintstagedrc
.nvmrc
LICENSE
README.md
babel.config.js
jest.config.js
package.json
yarn.lock

README.md

purser

Purser

Purser simplifies interaction with Ethereum based wallets. It supports both hardware and software wallets and provides a consistent and predictable interface to work with during dApp development.

Purser is:

Simple - Has an easy and intuitive API. Get started in minutes!

Predictable - Uses the same commands for all wallet types.

Sane - Maintains developer health by using proper error messages, validations and sanitisers.

Plug & Play - Supports Hardware (Ledger, Trezor) and Software (ethers.js) wallets out of the box.

Purser was brought to you by the fine folks at Colony. To learn more about Colony, you can visit the website or read the white paper.

Quickstart (software wallet)

To use the software wallet (based on the ethers wallet):

Installation

yarn add @colony/purser-sofware

Usage

Create a new wallet

import { create } from '@colony/purser-software'

const wallet = await create();

console.log(wallet); // { address: '...', privateKey: '...', publicKey: '...' }

or open an existing one (based on the mnemnonic)

import { open } from '@colony/purser-software'

const wallet = await open({ mnemonic: '...' });

console.log(wallet); // { address: '...', privateKey: '...', publicKey: '...' }

Quickstart (hardware wallet)

For hardware wallets (let's use trezor in this example) do:

Installation

yarn add @colony/purser-trezor

Usage

import { open } from '@colony/purser-trezor'

const wallet = await open();

console.log(wallet); // { address: '...', otherAddrresses: [...], publicKey: '...' }

wallet.setDefaultAddress(2); // Sets the current address to the third address in the list of `otherAddresses`

Documentation

Please see the documentation with detailed examples and explanations.

Packages

Purser is a monorepo consisting of a collection of Ethereum wallet libraries:

  • purser-core: A collection of helpers, utils, validators and normalizers to assist the individual purser modules.
  • purser-ledger: A javascript library to interact with a Ledger based Ethereum wallet.
  • purser-metamask: A javascript library to interact with the a Metamask based Ethereum wallet.
  • purser-software: A javascript library to interact with a software Ethereum wallet, based on the ethers.js library.
  • purser-trezor: A javascript library to interact with a Trezor based Ethereum wallet.

The future

We plan to add support more hardware wallets and other features that will make wallet interactions even easier. Stay tuned!

Contributing

We welcome all contributions to Purser. You can help by adding support for new wallet types, testing existing wallets, or improving the documentation.

Please read our Contributing Guidelines for how to get started.

License

The purser monorepo and each individual purser library are MIT licensed.