New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gorillapool/js-junglebus

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gorillapool/js-junglebus

TypeScript library for connecting to a GorillaPool JungleBus server

  • 0.4.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-61.11%
Maintainers
2
Weekly downloads
 
Created
Source

Gorilla Pool JungleBus: JS Client

last commit version Npm license Mergify Status Sponsor

Table of Contents


What is JungleBus?

Read more about JungleBus


Installation

Install the JungleBus library into your project:

$ npm install @gorillapool/js-junglebus

or, with yarn

$ yarn add @gorillapool/js-junglebus

Usage

Here's the getting started with JungleBus

import { JungleBusClient } from '@gorillapool/js-junglebus';

const server = "junglebus.gorillapool.io";
const jungleBusClient = new JungleBusClient(server, {
  onConnected(ctx) {
    // add your own code here
    console.log(ctx);
  },
  onConnecting(ctx) {
    // add your own code here
    console.log(ctx);
  },
  onDisconnected(ctx) {
    // add your own code here
    console.log(ctx);
  },
  onError(ctx) {
    // add your own code here
    console.error(ctx);
  }
});

// create subscriptions in the dashboard of the JungleBus website
const subId = "....";
const fromBlock = 750000;
const subscription = jungleBusClient.Subscribe(
  subId,
  fromBlock,
  onPublish(tx) => {
    // add your own code here
    console.log(tx);

  },
  onStatus(ctx) => {
    // add your own code here
    console.log(ctx);
  },
  onError(ctx) => {
    // add your own code here
    console.log(ctx);
  },
  onMempool(tx) => {
    // add your own code here
    console.log(tx);
  });

Lite Mode

JungleBus also supports a lite mode, which delivers only the transaction hash and block height. This is useful for applications that only need to know when a transaction is included in a block.

To use lite mode, just pass true as a final argument to the Subscribe method.

await client.Subscribe("a5e2fa655c41753331539a2a86546bf9335ff6d9b7a512dc9acddb00ab9985c0", 1550000, onPublish, onStatus, onError, onMempool, true);

Documentation

View more JungleBus documentation.

Code Standards

Please read our code standards document

Contributing

View the contributing guidelines and follow the code of conduct.

How can I help?

All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:. You can also support this project by becoming a sponsor on GitHub :clap:

Stars


Contributors ✨

Thank you to these wonderful people (emoji key):


Siggi

🚇 💻 🛡️

This project follows the all-contributors specification.


License

License

Keywords

FAQs

Package last updated on 06 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc