How to use @cennznet/api - 2 common examples

To help you get started, we’ve selected a few @cennznet/api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cennznet / runanode / app / renderer / api / api.js View on Github external
initRemoteApiWithUrl = async (remoteStreamUrl): Promise => {
    Logger.debug(`initRemoteApiWithUrl start`);
    // eslint-disable-next-line
    Logger.debug(`initRemoteApiWithUrl remoteStreamUrl: ${remoteStreamUrl}`);
    this.apiRemote = new Api({
      provider: remoteStreamUrl,
      // types,
    });
    this.apiRemote.on('connected', () => {
      Logger.debug(`initRemoteApiWithUrl apiRemote connected`);
      this.dispatch({
        type: actionTypes.wsRemoteStatusChange.triggered,
        payload: {
          type: 'connected',
        },
      });
    });
    this.apiRemote.on('ready', () => {
      Logger.debug(`initRemoteApiWithUrl ready`);
      this.dispatch({
        type: actionTypes.wsRemoteStatusChange.triggered,
github cennznet / runanode / app / renderer / api / api.js View on Github external
initApi = async (): Promise => {
    Logger.debug(`initApi start`);
    Logger.debug(`initApi streamUrl: ${appConfig.webSocket.localStreamUrl}`);
    this.api = new Api({
      provider: appConfig.webSocket.localStreamUrl,
    });
    this.api.on('connected', () => {
      Logger.debug(`initApi connected`);
      this.dispatch({
        type: actionTypes.wsLocalStatusChange.triggered,
        payload: {
          type: 'connected',
        },
      });
    });
    this.api.on('ready', async () => {
      Logger.debug(`initApi ready`);
      this.dispatch({
        type: actionTypes.wsLocalStatusChange.triggered,
        payload: {

@cennznet/api

CENNZnet's javascript api

Apache-2.0
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Popular @cennznet/api functions