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