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

murambl

v1.1.0

Published

![GitHub pages](https://github.com/Topl/Brambl-JS/workflows/GitHub%20pages/badge.svg?branch=master)

Downloads

7

Readme

GitHub pages

A vanillajs library to facilitate interaction with the Topl blockchain network. This server-side SDK is compliant with the Dion version of the Topl protocol as defined by the reference implementation, Bifrost client.

Installation

To install from npm run npm install --save mubrambl in your project directory

To install from source:

  • Git clone using git clone https://github.com/topl/muBrambl
  • Run npm run install within the cloned repo to install all dependencies

Usage

To create a minimal instance of BramblJS in your application, include the following commands:

const Brambl = require('mubrambl');
const brambl = new BramblJS('PASSWORD')

This will create a new Requests instance targetting a local node running at http://localhost:9085 and generate a new KeyManager instance for signing transactions, using Curve25519 and encrypted with PASSWORD

BramblJS provides the following modules:

  • Brambl - primary module that provides high-level capabilities and access to
  • Requests - sub-module for sending json-rpc requests to a specified chain provider.
  • KeyManager - sub-module that provides functions for creating, importing, and exporting Bifrost compatible keyfiles.

A brief overview of each module is given below

Brambl

A helper library for interacting with the Topl protocol. Requests to the API layer of a chain provider conform to JSON-RPC standards and are managed by the Requests module. Key Management conforms to the Dion specification of the Topl protocol as implemented in the reference client Bifrost v1.0.0.

Transactions may be issued using the method brambl.transaction following instantiation of the class. In summary, a transaction is implemented by:

  1. Requesting a prototype transaction from a specified network provider (i.e Topl Torus service or local private testnet)
  2. Signing the raw transaction bytes using the keyfile in the KeyManager instance.
  3. Sending the fully formed transaction to the broadcastTx method available in the Requests module.

After issuance, the pollTx method may be used to begin polling the chain provider to determine the status of the newly issued transaction.

Requests

The Requests module is compliant with Bifrost's JSON-RPC interface documented at https://topl-rpc.docs.topl.co A new JSON-RPC interface class may be instantiated by

const requests = Brambl.Requests()

By default requests will be sent to http://localhost:9085. This is the standard address and API port that Bifrost listens on when launched locally. All of the methods available in this module are asynchronous and will return Promises that must be handled using async/await structures or .then(). For example:

requests.chainInfo().then(console.log).catch(console.error)

Brambl-layer API key protection

By default, Bifrost uses an API key of topl_the_world! to validate requests on locally running test nets. If you are planning to use the Topl Torus service for servicing API requests, you will need to register for an API key from Torus and subsequently use this value in the constructor of the Brambl layer object. Standard best practices for protecting API keys should be followed in this case (i.e. saving variables in .ENV or config files that are not shared with version control).

KeyManager

The KeyManager module is compliant with Bifrost's Gjallarhorn Key Manager service and provides an straightforward interface for creating new keyfiles as well as creating and verifying signatures on transactions. New encrypted keyfiles are generated using Curve25519 key pairs and are encrypted using an AES-256 cipher with a user-specified password. All data within the keyfile is encoded using Base58.

A new KeyManager may be created directly using

const keyManager = Brambl.KeyManager('PASSWORD')

where 'PASSWORD' is the user provided encryption password for the keyfile.

Testing

To test run "npm test" from the root directory. This will run a mocha test that will ensure that the encryption and KeyManager code is functioning properly.

Examples

Below are examples for using the BramblJS library with a private testnet running on your localhost. Please consult the Bifrost documentation for further instructions on deploying a local private testnet.

Retrieving the timestamp of the latest block

Brambl.Requests().chainInfo().then(x => {
    const timestamp = new Date(x.result.bestBlock.timestamp)
    const blockHeight = x.result.height
    console.log('Block #' + blockHeight + ' forged at ' + timestamp)
})

Importing a keyfile to a KeyManager instance

const keyManager = Brambl.KeyManager({ keyPath: '/path/to/file', password: 'encryption_password' })

Issuing a createAsset transaction

const brambl = new Brambl('test')

const createParams = {
    issuer: brambl.keyManager.pk,
    assetCode: "test-" + Date.now(),
    recipient: brambl.keyManager.pk,
    amount: 1,
    fee: 0
};

brambl.transaction('createAssetsPrototype', createParams).then(console.log)

Creating and polling a createAsset transaction

const brambl = new Brambl('test')

const createParams = {
    issuer: brambl.keyManager.pk,
    assetCode: "test-" + Date.now(),
    recipient: brambl.keyManager.pk,
    amount: 1,
    fee: 0
};

brambl.transaction('createAssetsPrototype', createParams)
    .then(res => { console.log('Unconfirmed transaction'); console.log(res); return res })
    .then(res => brambl.pollTx(res.result.txHash))
    .then(res => { console.log('\nConfirmed transaction'); console.log(res) })
    .catch(console.log)

License

Brambl is licensed under the Mozilla Public License version 2.0 (MPL 2.0). A copy of this license may be found here