gorillapool / js-junglebus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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,
  function onPublish(tx) {
    // add your own code here
    console.log(tx);

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

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 πŸ™Œ! The most basic way to show your support is to star 🌟 the project, or to raise issues πŸ’¬. You can also support this project by becoming a sponsor on GitHub πŸ‘

Stars


Contributors ✨

Thank you to these wonderful people (emoji key):


Siggi

πŸš‡ πŸ’» πŸ›‘οΈ

This project follows the all-contributors specification.


License

License

About

License:Other


Languages

Language:TypeScript 84.1%Language:Makefile 9.9%Language:JavaScript 6.0%