Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zilliqa-js/subscriptions

Package Overview
Dependencies
Maintainers
6
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zilliqa-js/subscriptions

Class(es) for interactiong with websocket API of Zilliqa node

  • 3.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
661
decreased by-4.48%
Maintainers
6
Weekly downloads
 
Created
Source

@zilliqa-js/subscriptions

JavaScript library for managing and handling subscription-based events with the Zilliqa blockchain.

Table of Contents

  • Installation
  • Usage
  • Examples
  • Supported Events
  • Documentation
  • License

Installation

npm install @zilliqa-js/subscriptions --save

or

yarn add @zilliqa-js/subscriptions

Usage

To start using the subscriptions package, first import the necessary components:

const { SubscriptionBuilder, Zilliqa } = require("@zilliqa-js/subscriptions");

or using ES6 imports:

import { SubscriptionBuilder, Zilliqa } from "@zilliqa-js/subscriptions";

Examples

Subscribe to New Blocks

const zilliqa = new Zilliqa("https://api.zilliqa.com");
const subscription = zilliqa.subscriptionBuilder.buildNewBlockSubscriptions();

subscription.subscribe();
subscription.emitter.on(StatusType.SUBSCRIBE_NEW_BLOCK, (event) => {
  console.log("New block:", event.value);
});

Unsubscribing

After subscribing, you can also unsubscribe from events:

subscription.unsubscribe();

Supported Events

  • New Block Subscriptions (SUBSCRIBE_NEW_BLOCK)
  • Transaction Subscriptions (SUBSCRIBE_TX)
  • [Add more supported events as per the library]

Documentation

For comprehensive documentation, please refer to Zilliqa Official Documentation.

License

This project is licensed under the GPL License. View LICENSE for more information.

FAQs

Package last updated on 06 Dec 2023

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