Javascript SDK of WoopChain protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
sdk/packages/harmony-network
Ganesha Upadhyaya 8f8e17fdae v0.1.56 4 years ago
..
src update sdk api reference 4 years ago
LICENSE [feat] update LICENSE 6 years ago
README.md Improve README with clear examples throughout packages 4 years ago
package-lock.json v0.1.56 4 years ago
package.json v0.1.56 4 years ago
tsconfig.json fix(travis):test travis 5 years ago
tsconfig.test.json [fix] update a lot and add test fixtures for transaction 6 years ago

README.md

@harmony-js/network

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

Installation

npm install @harmony-js/network

Usage

const { Messenger, HttpProvider, WSProvider } = require('@harmony-js/network');
const { ChainID, ChainType } = require('@harmony-js/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.Harmony, ChainID.HmyTestnet); // for local ChainID.HmyLocal
const customWSMessenger = new Messenger(ws, ChainType.Harmony, ChainID.HmyTestnet); // for local ChainID.HmyLocal