summaryrefslogtreecommitdiff
path: root/src/types/walletTypes.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-28 23:17:12 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-28 23:17:12 +0530
commit732e764b376dff6b0262b869b29dbdee0c455a0e (patch)
treed1bcb7ed2257941251aec03346de321ec895deb4 /src/types/walletTypes.ts
parent43655adff0f8f1db082e1f0c18f1271a29ab8905 (diff)
downloadwallet-core-732e764b376dff6b0262b869b29dbdee0c455a0e.tar.gz
wallet-core-732e764b376dff6b0262b869b29dbdee0c455a0e.tar.bz2
wallet-core-732e764b376dff6b0262b869b29dbdee0c455a0e.zip
new balances API, remove defunct 'return funds to own account' implementation
Diffstat (limited to 'src/types/walletTypes.ts')
-rw-r--r--src/types/walletTypes.ts52
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.
*/