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

wax-ws-rpc-js

v1.1.0

Published

JavaScript client SDK for WAX WebSocket RPC.

Downloads

206

Readme

wax-ws-rpc-js

JavaScript client SDK for WAX WebSocket RPC.

Installation

NPM

The official distribution package can be found at npm.

npm install wax-ws-rpc-js

Import

ES Modules

Importing using ESM syntax is supported using TypeScript, webpack

import { WebsocketJsonRpc } from "wax-ws-rpc-js";

CommonJS

Importing using commonJS syntax is supported by Node.js

const { WebsocketJsonRpc } = require("wax-ws-rpc-js");

Basic Usage

default config

const rpc = new WebsocketJsonRpc('ws://localhost:3000');

custom config

const rpc = new WebsocketJsonRpc('ws://localhost:3000', {
  autoConnect: true,
  autoReconnect: true,
  reconnectInterval: 3000,
  maxRetries: 10,
  requestTimeOut: 3000
});

Chain API Request

const info = await rpc.get_info();

const table_rows = await rpc.get_table_rows({ 
  "json": true, 
  "code": "eosio.token", 
  "scope": "eosio.saving", 
  "table": "accounts" 
});

const account = await rpc.get_account("eosio");

Table Deltas

let unsubscribe_eosio_token = rpc.subscribeTable('eosio.token', 'eosio.stake', 'accounts', (msg) => {
    console.log('Balance Updated:', msg);

    // example response
    // {
    //   action: "UPDATE",
    //   code: "eosio.token",
    //   data: {
    //     balance: "1102920036.56360517 WAX",
    //   },
    //   old_data: {
    //     balance: "1102920036.56360115 WAX",
    //   },
    //   payer: "eosio.stake",
    //   primary_key: 5783895,
    //   scope: "eosio.stake",
    //   table: "accounts",
    //   type: "table_delta",
    // }
});

Action Trace

const unsubscribe_eosio_token = rpc.subscribeTrace('eosio.token::transfer', (msg) => {
    console.log(msg);

    // example response
    // {
    //   block_num: 416203521,
    //   block_time: "2026-01-28T06:47:32.000Z",
    //   cpu_usage_us: 620,
    //   net_usage: 176,
    //   receiver: "eosio.token",
    //   trace: {
    //     account: "eosio.token",
    //     authorization: [
    //       {
    //         actor: "oouso.gm",
    //         permission: "active",
    //       }
    //     ],
    //     data: {
    //       from: "oouso.gm",
    //       memo: "stake bandwidth",
    //       quantity: "0.00000015 WAX",
    //       to: "eosio.stake",
    //     },
    //     name: "transfer",
    //   },
    //   tx_id: "d9d0320a743d8c380dbf71839fa52547f010fc578ec389ecdca3dec16b2c48bc",
    //   type: "action_trace",
    // }
});

Using With wharfkit APIClient

import { WebSocketProvider } from 'wax-ws-rpc-js';
import { APIClient } from '@wharfkit/antelope';

const waxApiClient = new APIClient({
  provider: new WebSocketProvider("ws://localhost:3000", "https://wax.greymass.com")
});

const info = await waxApiClient.v1.chain.get_info();

const table_rows = await waxApiClient.v1.chain.get_table_rows({ 
  "json": true, 
  "code": "eosio.token", 
  "scope": "eosio.saving", 
  "table": "accounts" 
});

const account = await waxApiClient.v1.chain.get_account("eosio");

const actions = await waxApiClient.v1.history.get_actions("eosio");

Using With eosjs

import { Api } from 'eosjs';
import { JsSignatureProvider } from 'eosjs/dist/eosjs-jssig';
import { WebsocketJsonRpc } from 'wax-ws-rpc-js';

const defaultPrivateKey = "5Hpu95MCJsYWzMMkhWR7bxjxJtEZ3JqLNeBCTiNT2XdPkSSCCkD";
const signatureProvider = new JsSignatureProvider([defaultPrivateKey]);

const rpc = new WebsocketJsonRpc('ws://localhost:3000');
const api = new Api({ 
  rpc, 
  signatureProvider, 
  textDecoder: new TextDecoder(), 
  textEncoder: new TextEncoder() 
});

const result = await api.transact({
  actions: [
    {
      account: 'eosio.token',
      name: 'transfer',
      authorization: [
        {
          actor: 'account1',
          permission: 'active',
        }
      ],
      data: {
        from: 'account1',
        to: 'account2',
        quantity: '1.00000000 WAX',
        memo: "(>'.')> <('.'<)"
      },
    }
  ]
}, {
    blocksBehind: 3,
    expireSeconds: 30,
});
console.dir(result, { depth: null });

WAX Labs