0.1.59 • Published 4 years ago
@harmony-js-time/network v0.1.59
@harmony-js-time/network
This package provides a collection of apis to create messengers (HTTP, WebSocket) to connect to blockchain networks.
Installation
npm install @harmony-js-time/network
Usage
const { Messenger, HttpProvider, WSProvider } = require('@harmony-js-time/network');
const { ChainID, ChainType } = require('@harmony-js-time/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
0.1.59
4 years ago
0.1.59-alpha.3
4 years ago
0.1.59-alpha.4
4 years ago
0.1.59-alpha.2
4 years ago
0.1.58
4 years ago
0.1.57
4 years ago
0.1.56
4 years ago