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

rbx-js-sdk

v1.0.4

Published

Typescript/Javascript integration for RBX with node and browser support.

Downloads

1

Readme

RBX JS SDK

This SDK allows for integrating with the RBX platform through javascript & typescript via node or a browser. Although yarn is used here, npm can be use instead. Simply replace yarn build:node with npm run build:node as an example.

Using

yarn add rbx-js-sdk #or npm install rbx-js-sdk --save

Install Packages

yarn

Testing

Create a test.env file in the root directory and include the following entries:

PRIVATE_KEY=""
PUBLIC_KEY=""
FROM_ADDRESS=""
TO_ADDRESS=""
WALLET_ADDRESS=""
EXPLORER_ADDRESS="https://data.rbx.network/api"

Note: keys can be generated without a wallet. To broadcast transactions, you must have a wallet running. It does not need to have any keys/balance associated with it (and shouldn't for security purposes) but needs to be syned to block height in order to validate transactions correctly.

Additionally: It is recommended you proxy this wallet with a server in the middle. This is for your own security benefits plus will allow you to manage CORS issues. For testing, you will either need to disable cors protection in your browser or have your wallet running on localhost.

Then run:

yarn test

build for node

yarn build:node

build for browser

yarn build:browser

This will create a file called lib/browser.js which can be included in your project. See example/browser-example/index.html for a basic integration example.

Note: this command will also copy the file to the example folder.

Running In Browser

Setting up CORS proxy

To combat issues with CORS and to protect your remote wallet's IP address, you'll want to use a proxy. See the file src/proxy/server.js. This is a simple node application that uses cors-anywhere to proxy requests.

You'll need to run this by entering the proxy directory and running yarn start. You can add a .env file to this folder to customize that host/port.

To run this online, you'll need to set this up on a node server. You can use the code contained within or visit this Github repo for more info.

Be sure to update the urls for your wallet / explorer including your proxy information in the index.html like so:

const txService = new rbx.TransactionService("http://localhost:3001/http://127.0.0.1:7292");
const explorerService = new rbx.ExplorerService("http://localhost:3001/https://data.rbx.network/api");

Although this is not required for node, you can still use it by updating your test.env file like so:

WALLET_ADDRESS="http://localhost:3001/http://localhost:7292"
EXPLORER_ADDRESS="http://localhost:3001/https://data.rbx.network/api"
Running

You can simply launch the file example/browser-example/index.html in your browser (no web server required!) Of course, feel free to use http-server or whatever you like.

NodeJS Example

See the folder example/node-example for a basic overview of how to integrate with this package.

cd example/node-example
yarn
yarn build
yarn start

Then head to http://localhost:8080 in your browser.

This is built in express with typescript but you can just use regular javascript. Express is also not required, it's just an easy way to showcase the functionality.

Cipher base fix

You may encounter an error building to the browser due to cipher-base. Open this file: node_modules/cipher-base/index.js

And replace the imports with the following:


var Buffer = require('safe-buffer').Buffer
var Transform = require('readable-stream').Transform // replacing instead of "stream"
var StringDecoder = require('string_decoder').StringDecoder
var inherits = require('inherits')

```

> Note: this is automated by the postinstall script but it may be something you run into.

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](issues).

## 📝 License

This project is [MIT](LICENSE) licensed.
```