First stage renames, rpc-{core,provider,rx} (#220)

* Docs renames (& removal for re-gen)

* Rename api, api-provider & api-rx

* Apoi -> Rpc, RxApi -> RpcRx (classes)

* Add .nodoc

* Bump version

* Link updates (summary)

* Cleanup deleted (master version)

* Deleted re-instated

* More... ;)

* Types...

* Revert .nodoc
This commit is contained in:
Jaco Greeff
2018-10-10 10:01:34 +02:00
committed by GitHub
parent cd7c17b265
commit 4344f33de8
102 changed files with 257 additions and 233 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@polkadot/api-observable",
"version": "0.30.45",
"version": "0.31.0",
"description": "An Observable wrapper around the Polkadot JS API",
"main": "index.js",
"keywords": [
@@ -27,13 +27,13 @@
"bugs": {
"url": "https://github.com/polkadot-js/api/issues"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-rx#readme",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-rx#readme",
"dependencies": {
"@babel/runtime": "^7.0.0",
"@polkadot/api": "^0.30.45",
"@polkadot/api-provider": "^0.30.45",
"@polkadot/extrinsics": "^0.30.45",
"@polkadot/storage": "^0.30.45",
"@polkadot/rpc-core": "^0.31.0",
"@polkadot/rpc-provider": "^0.31.0",
"@polkadot/extrinsics": "^0.31.0",
"@polkadot/storage": "^0.31.0",
"@types/rx": "^4.1.1",
"rxjs": "^6.3.2"
}
+5 -5
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import { RxApiInterface, RxApiInterface$Method, RxApiInterface$Section } from '@polkadot/api-rx/types';
import { RxRpcInterface, RxRpcInterface$Method, RxRpcInterface$Section } from '@polkadot/rpc-rx/types';
import { RpcMethod } from '@polkadot/jsonrpc/types';
import { EMPTY, Observable, combineLatest, from } from 'rxjs';
@@ -25,13 +25,13 @@ const defaultMapFn = (result: any): any =>
// Raw base implementation for the observable API. It simply provides access to raw calls, allowing
// decendants to make direct queries to either API methods or actual storage
export default class ApiBase {
protected _api: RxApiInterface;
protected _api: RxRpcInterface;
protected _genesisHash: Hash;
// Observable that returns the first time we are connected and loaded
whenReady: Observable<boolean>;
constructor (api: RxApiInterface) {
constructor (api: RxRpcInterface) {
this._api = api;
this._genesisHash = new Hash();
this.whenReady = from(this.init());
@@ -86,11 +86,11 @@ export default class ApiBase {
}
rawCall = <T> ({ method, section }: RpcMethod, ...params: Array<any>): Observable<T> => {
const apiSection = this._api[section as keyof RxApiInterface] as RxApiInterface$Section;
const apiSection = this._api[section as keyof RxRpcInterface] as RxRpcInterface$Section;
assert(apiSection, `Unable to find 'api.${section}'`);
const fn: RxApiInterface$Method = apiSection[method];
const fn: RxRpcInterface$Method = apiSection[method];
assert(fn, `Unable to find 'api.${section}.${method}'`);