@garizonchain/network
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@garizonchain/network

This package provides a collection of apis to create messengers (HTTP, WebSocket) to connect to blockchain networks.

Installation

npm install @garizonchain/network

Usage

const { Messenger, HttpProvider, WSProvider } = require('@garizonchain/network');
const { ChainID, ChainType } = require('@garizonchain/utils');
const testnetHTTP = 'https://api.s0.b.hmny.io';
const testnetWS = 'wss://ws.s0.b.hmny.io';
const localHTTP = 'http://localhost:9500/';
const localWS = 'http://localhost:9800/';
const http = new HttpProvider(testnetHTTP); // for local use localHTTP
const ws = new WSProvider(testnetWS); // for local use testnetWS
const customHTTPMessenger = new Messenger(http, ChainType.Garizon, ChainID.GarTestnet); // for local ChainID.GarLocal
const customWSMessenger = new Messenger(ws, ChainType.Garizon, ChainID.GarTestnet); // for local ChainID.GarLocal

Readme

Keywords

none

Package Sidebar

Install

npm i @garizonchain/network

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

338 kB

Total Files

121

Last publish

Collaborators

  • portuu3