Mortal -> Extrinsic, expand for decoding start (#212)

* Mortal -> Extrinsic, expand for decoding start

* Method, Section -> Rpc{Method, Section}

* Only expose callIndex

* CallIndex -> MethodIndex in spec
This commit is contained in:
Jaco Greeff
2018-10-05 12:29:06 +02:00
committed by GitHub
parent ff8aeb02f7
commit 82dbc93f79
28 changed files with 312 additions and 333 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
// of the ISC license. See the LICENSE file for details.
import { RxApiInterface, RxApiInterface$Method, RxApiInterface$Section } from '@polkadot/api-rx/types';
import { Method } from '@polkadot/jsonrpc/types';
import { RpcMethod } from '@polkadot/jsonrpc/types';
import { EMPTY, Observable, combineLatest, from } from 'rxjs';
import { defaultIfEmpty, map } from 'rxjs/operators';
@@ -83,7 +83,7 @@ export default class ApiBase {
return this._api.isConnected();
}
rawCall = <T> ({ method, section }: Method, ...params: Array<any>): Observable<T> => {
rawCall = <T> ({ method, section }: RpcMethod, ...params: Array<any>): Observable<T> => {
const apiSection = this._api[section as keyof RxApiInterface] as RxApiInterface$Section;
assert(apiSection, `Unable to find 'api.${section}'`);
+2 -2
View File
@@ -4,7 +4,7 @@
import { Observable } from 'rxjs';
import { defaultIfEmpty, map } from 'rxjs/operators';
import { BlockNumber, Hash, Header, SignedBlock, UncheckedMortalExtrinsic } from '@polkadot/types/index';
import { BlockNumber, Hash, Header, SignedBlock, Extrinsic } from '@polkadot/types/index';
import ApiQueries from './Queries';
@@ -44,7 +44,7 @@ export default class ApiCalls extends ApiQueries {
return this._api.system.version();
}
submitExtrinsic = (extrinsic: UncheckedMortalExtrinsic): Observable<Hash | undefined> => {
submitExtrinsic = (extrinsic: Extrinsic): Observable<Hash | undefined> => {
return this._api.author.submitExtrinsic(extrinsic);
}
}