How to use the @polkadot/rpc-core 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._eventemitter = new EventEmitter();
    this._isConnected = new BehaviorSubject(this._api._provider.isConnected());

    this.initEmitters(this._api._provider);

    this.author = this.createInterface(this._api.author);
    this.chain = this.createInterface(this._api.chain);
    this.state = this.createInterface(this._api.state);
    this.system = this.createInterface(this._api.system);
  }
github polkadot-js / api / packages / api / src / base / Decorate.ts View on Github external
constructor (options: ApiOptions, type: ApiTypes, decorateMethod: DecorateMethod) {
    super();

    this.registry = options.registry || new TypeRegistry();

    const thisProvider = options.source
      ? options.source._rpcCore.provider.clone()
      : (options.provider || new WsProvider());

    this.decorateMethod = decorateMethod;
    this._options = options;
    this._type = type;
    this._rpcCore = new RpcCore(this.registry, thisProvider, this._options.rpc);
    this._isConnected = new BehaviorSubject(this._rpcCore.provider.isConnected());
    this._rx.hasSubscriptions = this._rpcCore.provider.hasSubscriptions;
    this._rx.registry = this.registry;
  }

@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