How to use the @polkadot/rpc-core/index function in @polkadot/rpc-core

To help you get started, we’ve selected a few @polkadot/rpc-core 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 polkadot-js / api / packages / rpc-rx / src / index.ts View on Github external
constructor (providerOrRpc?: Rpc | ProviderInterface) {
    this._api = providerOrRpc instanceof Rpc
      ? providerOrRpc
      : new Rpc(providerOrRpc);
    this._cacheMap = {};
    this._eventemitter = new EventEmitter();
    this._isConnected = new BehaviorSubject(this._api._provider.isConnected());

    this.initEmitters(this._api._provider);

    this.author = this.createInterface('author', this._api.author);
    this.chain = this.createInterface('chain', this._api.chain);
    this.state = this.createInterface('state', this._api.state);
    this.system = this.createInterface('system', this._api.system);
  }

@polkadot/rpc-core

A JavaScript wrapper for the Polkadot JsonRPC interface

Apache-2.0
Latest version published 9 days ago

Package Health Score

90 / 100
Full package analysis