diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-28 23:17:12 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-28 23:17:12 +0530 |
commit | 732e764b376dff6b0262b869b29dbdee0c455a0e (patch) | |
tree | d1bcb7ed2257941251aec03346de321ec895deb4 /src/types/walletTypes.ts | |
parent | 43655adff0f8f1db082e1f0c18f1271a29ab8905 (diff) | |
download | wallet-core-732e764b376dff6b0262b869b29dbdee0c455a0e.tar.xz |
new balances API, remove defunct 'return funds to own account' implementation
Diffstat (limited to 'src/types/walletTypes.ts')
-rw-r--r-- | src/types/walletTypes.ts | 52 |
1 files changed, 15 insertions, 37 deletions
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. */ |