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/woop-network
nico 18da2be63d woop 8 months ago
..
src woop 8 months ago
LICENSE woop 8 months ago
README.md woop 8 months ago
package.json woop 8 months ago
tsconfig.json woop 8 months ago
tsconfig.test.json woop 8 months ago

README.md

@woop-js/network

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

Installation

npm install @woop-js/network

Usage

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