Update @polkadot/types (#105)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
|
||||
import { Interface$Sections } from '@polkadot/jsonrpc/types';
|
||||
import { ProviderInterface } from '@polkadot/api-provider/types';
|
||||
import { RxApiInterface } from './types';
|
||||
|
||||
@@ -15,11 +16,10 @@ import createInterface from './interface';
|
||||
|
||||
export default function rxApi (provider: ProviderInterface = createWs(defaults.WS_URL)): RxApiInterface {
|
||||
const api = createApi(provider);
|
||||
const exposed = createExposed(provider);
|
||||
|
||||
return [...interfaces.keys()].reduce((result, type) => {
|
||||
result[type] = createInterface(api, type);
|
||||
return Object.keys(interfaces).reduce((result, type) => {
|
||||
result[type as Interface$Sections] = createInterface(api, type as Interface$Sections);
|
||||
|
||||
return result;
|
||||
}, exposed);
|
||||
}, createExposed(provider));
|
||||
}
|
||||
|
||||
Vendored
+7
-4
@@ -2,6 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the ISC license. See the LICENSE file for details.
|
||||
|
||||
import { Interfaces } from '@polkadot/jsonrpc/types';
|
||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Interface$Sections } from '@polkadot/jsonrpc/types';
|
||||
@@ -12,8 +13,10 @@ export type RxApiInterface$Section = {
|
||||
[index: string]: RxApiInterface$Method
|
||||
};
|
||||
|
||||
export type RxApiInterface = {
|
||||
// @ts-ignore this is the odd one out... doesn't quite match index sig
|
||||
isConnected: () => BehaviorSubject<boolean>;
|
||||
[index: string]: RxApiInterface$Section;
|
||||
type RxApiInterface$Keys = {
|
||||
[key in keyof Interfaces]: RxApiInterface$Section;
|
||||
};
|
||||
|
||||
export type RxApiInterface = RxApiInterface$Keys & {
|
||||
isConnected: () => BehaviorSubject<boolean>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user