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

@zilliqa-js/zilliqa

Package Overview
Dependencies
Maintainers
6
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zilliqa-js/zilliqa

Main entry point to the Zilliqa JS client.

  • 3.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
541
decreased by-16.51%
Maintainers
6
Weekly downloads
 
Created
Source

@zilliqa-js/zilliqa

JavaScript library for interacting with the Zilliqa blockchain.

Table of Contents

  • Installation
  • Usage
  • Examples
  • Documentation
  • License

Installation

npm install @zilliqa-js/zilliqa --save

or

yarn add @zilliqa-js/zilliqa

Usage

First, you need to import the library:

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

or using ES6 imports:

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

Then, create an instance:

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

Examples

Sending a Transaction

const myAddress = "Your Zilliqa Address";
const recipient = "Recipient Zilliqa Address";
const amount = Zilliqa.utils.units.toQa("1", Zilliqa.utils.units.Units.Zil);

const tx = await zilliqa.blockchain.createTransaction({
  toAddr: recipient,
  amount: amount,
  gasPrice: "2000",
  gasLimit: "1",
});

console.log(`Transaction ID: ${tx.id}`);
console.log(
  `After sending, your new balance is: ${await zilliqa.blockchain.getBalance(
    myAddress
  )}`
);

Fetching Account Balance

const myAddress = "Your Zilliqa Address";
const balance = await zilliqa.blockchain.getBalance(myAddress);
console.log(`Your balance is: ${balance}`);

Documentation

For in-depth documentation, please refer to Zilliqa Official Documentation.

License

This project is licensed under the GPL License. See LICENSE for details.

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