Code Monkey home page Code Monkey logo

wallet-lib's Introduction

Wallet Library

NPM Version Build Status Release Date standard-readme compliant

A pure and extensible JavaScript Wallet Library for Dash

Table of Contents

Background

Dash is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Dash network allows for highly resilient Dash infrastructure, and the developer community needs reliable, open-source tools to implement Dash apps and services.

Install

Node

In order to use this library, you will need to add it to your project as a dependency.

Having NodeJS installed, just type in your terminal :

npm install @dashevo/wallet-lib

CDN Standalone

For browser usage, you can also directly rely on unpkg. Below, we also assume you use localForage as your persistence adapter.

<script src="https://unpkg.com/@dashevo/wallet-lib"></script>
<script src="https://unpkg.com/localforage"></script>
const wallet = new Wallet({adapter: localforage});

Usage

In your file, where you want to execute it :

const { Wallet, EVENTS } = require('@dashevo/wallet-lib');

const wallet = new Wallet();

// We can dump our initialization parameters
const mnemonic = wallet.exportWallet();

wallet.getAccount().then((account) => {
  // At this point, account has fetch all UTXOs if they exists
  const balance = account.getTotalBalance();
  console.log(`Balance: ${balance}`);

  // We easily can get a new address to fund
  const { address } = account.getUnusedAddress();
});

Wallet will by default connects to DAPI and use either localforage (browser based device) or a InMem adapter. Account will by default be on expected BIP44 path (...0/0).

Transports:

Insight-Client has been removed from MVP and is not working since Wallet-lib v3.0.

Adapters :

Documentation

You can see some examples here.

More extensive documentation is available at https://dashevo.github.io/wallet-lib along with additional examples & snippets.

Maintainers

Wallet-Lib is maintained by the Dash Core Developers. We want to thank all members of the community that have submitted suggestions, issues and pull requests.

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Dash Core Group, Inc.

wallet-lib's People

Contributors

alex-werner avatar strophy avatar antouhou avatar shumkov avatar kamuelafranco avatar jawid-h avatar dn-l avatar nmarley avatar dashameter avatar thephez avatar abvgedeika avatar cofresi avatar davidka avatar kreshnikalidema avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.