Skip to content

Commit

Permalink
frontend: type keys of various maps
Browse files Browse the repository at this point in the history
Before the key was just of type string, but in these cases
we have proper types.
  • Loading branch information
thisconnect committed May 16, 2024
1 parent b244162 commit 17fb979
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontends/web/src/api/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ export const getAccounts = (): Promise<IAccount[]> => {
};

export type TAccountsBalanceByCoin = {
[key: string]: IAmount;
[key in CoinCode]: IAmount;
};

export type TAccountsBalance = {
[rootFingerprint: string]: TAccountsBalanceByCoin;
[rootFingerprint in TKeystore['rootFingerprint']]: TAccountsBalanceByCoin;
};

export const getAccountsBalance = (): Promise<TAccountsBalance> => {
Expand All @@ -87,7 +87,7 @@ export type TAccountTotalBalance = {
};

export type TAccountsTotalBalance = {
[key: string]: TAccountTotalBalance;
[rootFingerprint in TKeystore['rootFingerprint']]: TAccountTotalBalance;
};

export type TAccountsTotalBalanceResponse = {
Expand All @@ -104,7 +104,7 @@ export const getAccountsTotalBalance = (): Promise<TAccountsTotalBalanceResponse
};

export type TCoinsTotalBalance = {
[key: string]: IAmount;
[key in CoinCode]: IAmount;
};

export const getCoinsTotalBalance = (): Promise<TCoinsTotalBalance> => {
Expand Down

0 comments on commit 17fb979

Please sign in to comment.