@@ -11,7 +11,7 @@ import { combineLatest, map, switchMap } from 'rxjs';
1111
1212import { BN , BN_ZERO } from '@polkadot/util' ;
1313
14- import { firstObservable , memo } from '../util' ;
14+ import { firstMemo , memo } from '../util' ;
1515
1616const QUERY_OPTS = {
1717 withDestination : true ,
@@ -73,7 +73,9 @@ export function accounts (instanceId: string, api: ApiInterfaceRx): (accountIds:
7373 api . derive . staking . keysMulti ( accountIds ) ,
7474 api . derive . staking . queryMulti ( accountIds , QUERY_OPTS )
7575 ] ) . pipe (
76- map ( ( [ keys , queries ] ) => queries . map ( ( query , index ) => parseResult ( api , sessionInfo , keys [ index ] , query ) ) )
76+ map ( ( [ keys , queries ] ) =>
77+ queries . map ( ( q , index ) => parseResult ( api , sessionInfo , keys [ index ] , q ) )
78+ )
7779 )
7880 )
7981 )
@@ -83,8 +85,7 @@ export function accounts (instanceId: string, api: ApiInterfaceRx): (accountIds:
8385/**
8486 * @description From a stash, retrieve the controllerId and fill in all the relevant staking details
8587 */
86- export function account ( instanceId : string , api : ApiInterfaceRx ) : ( accountId : Uint8Array | string ) => Observable < DeriveStakingAccount > {
87- return memo ( instanceId , ( accountId : Uint8Array | string ) : Observable < DeriveStakingAccount > =>
88- firstObservable ( api . derive . staking . accounts ( [ accountId ] ) )
89- ) ;
90- }
88+ export const account = firstMemo (
89+ ( api : ApiInterfaceRx , accountId : Uint8Array | string ) =>
90+ api . derive . staking . accounts ( [ accountId ] )
91+ ) ;
0 commit comments