From 732e764b376dff6b0262b869b29dbdee0c455a0e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 28 Jul 2020 23:17:12 +0530 Subject: new balances API, remove defunct 'return funds to own account' implementation --- src/types/walletTypes.ts | 52 ++++++++++++++---------------------------------- 1 file changed, 15 insertions(+), 37 deletions(-) (limited to 'src/types/walletTypes.ts') diff --git a/src/types/walletTypes.ts b/src/types/walletTypes.ts index d68f41564..f37815333 100644 --- a/src/types/walletTypes.ts +++ b/src/types/walletTypes.ts @@ -146,48 +146,26 @@ export interface ExchangeWithdrawDetails { walletVersion: string; } -/** - * Mapping from currency/exchange to detailed balance - * information. - */ -export interface WalletBalance { - /** - * Mapping from currency name to detailed balance info. - */ - byExchange: { [exchangeBaseUrl: string]: WalletBalanceEntry }; - /** - * Mapping from currency name to detailed balance info. - */ - byCurrency: { [currency: string]: WalletBalanceEntry }; -} +export interface Balance { + available: AmountString; + pendingIncoming: AmountString; + pendingOutgoing: AmountString; -/** - * Detailed wallet balance for a particular currency. - */ -export interface WalletBalanceEntry { - /** - * Directly available amount. - */ - available: AmountJson; - /** - * Amount that we're waiting for (refresh, withdrawal). - */ - pendingIncoming: AmountJson; - /** - * Amount that's marked for a pending payment. - */ - pendingPayment: AmountJson; - /** - * Amount that was paid back and we could withdraw again. - */ - paybackAmount: AmountJson; + // Does the balance for this currency have a pending + // transaction? + hasPendingTransactions: boolean; - pendingIncomingWithdraw: AmountJson; - pendingIncomingRefresh: AmountJson; - pendingIncomingDirty: AmountJson; + // Is there a pending transaction that would affect the balance + // and requires user input? + requiresUserInput: boolean; } +export interface BalancesResponse { + balances: Balance[]; +} + + /** * For terseness. */ -- cgit v1.2.3