npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ambisafe-client-javascript

v0.14.1

Published

Javascript library used by Ambisafe.co for general purposes.

Downloads

109

Readme

Ambisafe Javascript Lib (ambisafe-lib)

Javascript library used by Ambisafe.co for general purposes.

Installation

npm install -g browserify
npm install -g uglifyjs
npm install -g jshint

npm install

Library Generation

npm run build

Examples

Example 1: create account & save

This supposed to happen after user have filled registration form and clicked submit:

  • Create an account with the Ambisafe.generateAccount function.

    • The currency value has to be selected from the Ambisafe.currency object (eg: Ambisafe.currency.BITCOIN)
    • The password value is required.
    • The salt value is not required.

    Example:

    account = Ambisafe.generateAccount(
    			currency, 
    			password, 
    			salt);
  • To convert the account attributes to a JSON string, execute the following line: accountSerialized = account.toString();

  • The rest is done on server side. We don't need username and other details here.

Example 2: sign in & create transaction

Container with account JSON should be fetched from a server after successful login. The most optimal way to fetch it depends client application and therefore delegated to it.

  • Decrypting account with private key: account json as it returned by Server + password, entered during authentication. Password should never be transmitted to server. Exception can be thrown here if password is incorrect.
    account = new Ambisafe.Account(
    			container, 
    			password
    );
  • Constructing transaction & validating against business logic rules like with account, creation and validation of transaction is out of scope of this library.
  • Signing transaction with customer key:
    signedTransaction = Ambisafe.signTransaction(
    			transaction, 
    			privateKey);
  • Signed transaction should be submitted to server for co-signing and broadcasting.
Example 3: change password

To change the password of a created account the user has to call to the setNewPassword function:

  • Based on a created account:
    account = new Ambisafe.Account(
    			container, 
    			password);
  • Call the setNewPassword function with the newPassword attribute:
    account.setNewPassword(newPassword);
Example 4: scan QR Code

To scan a QR code uses the following javascript code.


Ambisafe.QRScanner.scanQR(divId, 
	function(data){
		alert(data);
	},
	function(error){
		console.log(error);
	}
);
  • The first parameter is a string that indicates the "id" attribute of a created "div" HTML element.
  • The second parameter is the function called when the QR code is captured.
  • The third parameter is the function called when an error happens.

License

See LICENSE