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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nexajs

v24.11.15

Published

A comprehensive JavaScript Library + SDK for building Nexa applications on Node.js (back-end) and web browsers (front-end).

Downloads

252

Readme

NEXA.js

https://nexajs.org

NEXA.js Banner

A pure JavaScript Library and Software Development Kit (SDK) for building decentralized applications (dApps) powered by the Nexa blockchain.

Released under the terms of the MIT LICENSE.

Documentation

Our docs are updated regularly.

https://docs.nexajs.org

Table of contents

Quick Start

To quickly get started using Nexa in your existing Webapp, simply include this tag in the section of your HTML:

Web2 (CDN) Installation

<!-- CDN (Web2) integration solution -->
<script src="https://cdn.nexajs.org/nexa.min.js"
  integrity="sha384-qBLa2DVAThYbLO3kajnReZVS5cG3m3swWmBL0tNN7CxvzgRZQw/cfwsmbXOGma7K"
  crossorigin="anonymous"></script>

Web3 (IPFS) Installation

<!-- IPFS Gateway (Web3) integration solution -->
<script src="https://bafybeifohi5njjlohhkwcsola3346cn3ngyaqyl5bwn5k7a4mbvtzy4y3m.ipfs.dweb.link/"
  integrity="sha384-qBLa2DVAThYbLO3kajnReZVS5cG3m3swWmBL0tNN7CxvzgRZQw/cfwsmbXOGma7K"
  crossorigin="anonymous"></script>

Web4 (CAPD | Nostr) Installation

<!-- Counterparty and Protocol Discovery (Web4) integration solution -->
<script src="proto://9addf9bc724b2e14094950598918dde63b091253e6106b7d9716nexaverse888"></script>

Package Manager Installation

npm install --save nexajs
yarn add nexajs
pnpm install nexajs

WARNING: We presently don't provide any tooling to verify that the release on npm matches GitHub. As such, you should verify anything downloaded by npm against your own verified copy.

Introduction

The NEXA.js Library + SDK aims to be a modern & comprehensive toolkit for creating decentralized applications (dApps) on the Nexa Blockchain and its expansive Web3 ecosystem.

Prerequisites

  • Node v12+

Requirements

  • Basic JavaScript knowledge

Installation

npm install nexajs

Building the Workspace

Install your preferred Integrated Development Environment (IDE) or text editor, eg:

  • Visual Studio Code (VSC)
  • Atom
  • Sublime

Example file: send-tx.js

import Nexa from 'nexajs'

const privateKey = new Nexa.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy')

const utxo = {
    txId        : '115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986',
    outputIndex : 0,
    address     : '17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV',
    script      : '76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac',
    satoshis    : 50000,
}

const transaction = new Nexa.Transaction()
    .from(utxo)
    .to('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 15000)
    .sign(privateKey)

From the terminal / command-line:

$ node examples/send-tx.js

Should I use this in Production?

If you are thinking of using the master branch of this library in production, stop. Master is not stable; it is our development branch, and only tagged releases may be classified as stable.

Can I trust this Code?

Don't trust. Verify.

We recommend every user of this library and the nexajs ecosystem audit and verify any underlying code for its validity and suitability, including reviewing any and all of your project's dependencies.

Mistakes and bugs happen, but with your help in resolving and reporting issues, together we can produce open source software that is:

  • Easy to audit and verify,
  • Tested, with test coverage >95%,
  • Advanced and feature rich,
  • Standardized, using prettier and Node Buffer's throughout, and
  • Friendly, with a strong and helpful community, ready to answer questions.

Usage

Crypto is hard.

When working with private keys, the random number generator is fundamentally one of the most important parts of any software you write. For random number generation, we default to the randombytes module, which uses window.crypto.getRandomValues in the browser, or Node js' crypto.randomBytes, depending on your build system. Although this default is ~OK, there is no simple way to detect if the underlying RNG provided is good enough, or if it is catastrophically bad. You should always verify this yourself to your own standards.

Finally, adhere to best practice. We are not an authorative source of best practice, but, at the very least:

Browser

The recommended method of using nexajs-lib in your browser is through Browserify. If you're familiar with how to use browserify, ignore this and carry on, otherwise, it is recommended to read the tutorial at https://browserify.org/.

NOTE: We use Node Maintenance LTS features, if you need strict ES5, use --transform babelify in conjunction with your browserify step (using an es2015 preset).

WARNING: iOS devices have problems, use at least [email protected] or greater, and enforce the test suites (for Buffer, and any other dependency) pass before use.

Examples

The below examples are implemented as integration tests, they should be very easy to understand. Otherwise, pull requests are appreciated. Some examples interact (via HTTPS) with a 3rd Party Blockchain Provider (3PBP).

If you have a use case that you feel could be listed here, please ask for it!

Packages List

The following suite of 26 packages compose the entire NEXA.js Library and Software Development Kit (SDK).

  • NOTE: Not all packages are published to the NPM registry.

NPM Repository Deployment

cd nexajs/lib/package/<package-name>
rm -rf node_modules/ yarn.lock
yarn

# update package.json version
# !cdn, !daemon, !yarn.lock

npm publish

Contributing

See CONTRIBUTING.md.

Running the Test Suite

npm test
npm run-script coverage

Similar Libraries