pchain-client-js
TypeScript icon, indicating that this package has built-in type declarations

5.1.0 • Public • Published

ParallelChain Mainnet Javascript Client Library

Introduction

ParallelChain Mainnet Javascript Client Library (pchain-client-js) is a package providing a HTTP client for interacting with the Parallelchain Mainnet Protocol RPC API.


Installation

The library is built with npm (8.x) and compatible to node (v16.x). pchain-client-js is available as an npm package

// Using NPM
npm install pchain-client-js

// Yarn
yarn add pchain-client-js

Importing

// Lexical/ ESM/ TypeScript
import { Client } from "pchain-client-js";
// Non-lexical/ CommonJS
const Client = require("pchain-client-js").Client;

Usage

const client = new Client('https://pchain-test-rpc02.parallelchain.io');
const blockResponse: BlockResponse = client.block({
  block_hash,
})
console.log(blockResponse);
// Output
BlockResponse {
  block: Option {
    value: Block {
      blockHeader: ...,
      transactions: [...],
      receipts: [...]
    }
  }
}

Package Sidebar

Install

npm i pchain-client-js

Weekly Downloads

6

Version

5.1.0

License

ISC

Unpacked Size

71.4 kB

Total Files

24

Last publish

Collaborators

  • pchainlab