Cipherem

Cipweb3.js

cipweb3.js is a clone of the web3 package tailored specifically for the Cipherem chain. This package allows developers to interact with the Cipherem blockchain in a similar way to how they would with Ethereum using the web3.js package.

Overview

cipweb3.js is designed to be a drop-in replacement for web3.js but for the Cipherem blockchain. This makes it easier for developers familiar with web3.js to transition to working with Cipherem.

Installation

Requires Node.js

To install cipweb3.js in your Node.js project, use the following command:

npm install cipweb3

Usage

To use cipweb3.js, you need to require it in your project just like you would with web3.js.

Here is a basic example:

const CipWeb3 = require('cipweb3');
const cipweb3 = new CipWeb3(new CipWeb3.providers.HttpProvider('https://cipherem-network-node'));

cipweb3.eth.getBlockNumber()
    .then(blockNumber => {
        console.log("Latest Block Number:", blockNumber);
    })
    .catch(error => {
        console.error("Error fetching block number:", error);
    });

This example demonstrates how to initialize the cipweb3 instance and retrieve the latest block number from the Cipherem blockchain.

Types

All the TypeScript typings for cipweb3.js are located in the types folder. You can refer to these typings to understand the various types and interfaces used in cipweb3.js.

If you are using TypeScript, you can include these typings in your project for better type safety and IntelliSense support.

This documentation should help you get started with cipweb3.js and provide the necessary information to integrate it into your projects.


Copyright © 2024