const { HttpProvider, Messenger } = require('@harmony-js/network');
const { ChainType, ChainID } = require('@harmony-js/utils');
// create a custom messengerconst customMessenger = new Messenger(
new HttpProvider('http://localhost:9500'),
ChainType.Harmony, // if you are connected to Harmony's blockchain
ChainID.HmyLocal, // check if the chainId is correct
)
About this package
@harmony-js/network
provides functions to handle messenger, providers and subscriptions...How to use this package
1. Create a Message
const { HttpProvider, Messenger } = require('@harmony-js/network'); const { ChainType, ChainID } = require('@harmony-js/utils'); // create a custom messenger const customMessenger = new Messenger( new HttpProvider('http://localhost:9500'), ChainType.Harmony, // if you are connected to Harmony's blockchain ChainID.HmyLocal, // check if the chainId is correct )