accountId-only lookups on paymentInfo (#2569)

This commit is contained in:
Jaco Greeff
2020-09-02 15:13:45 +02:00
committed by GitHub
parent 8fdc518651
commit 5a90da5df8
3 changed files with 46 additions and 2 deletions
+2 -2
View File
@@ -82,8 +82,8 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable<Re
*/
export function account (api: ApiInterfaceRx): (address: AccountIndex | AccountId | Address | string) => Observable<DeriveBalancesAccount> {
return memo((address: AccountIndex | AccountId | Address | string): Observable<DeriveBalancesAccount> =>
api.derive.accounts.info(address).pipe(
switchMap(({ accountId }): Observable<[AccountId, Result]> =>
api.derive.accounts.accountId(address).pipe(
switchMap((accountId): Observable<[AccountId, Result]> =>
(accountId
? combineLatest([
of(accountId),