aboutsummaryrefslogtreecommitdiff
path: root/src/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/types.ts b/src/types.ts
index d016b7fea..90fe7cf9c 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -822,6 +822,10 @@ export enum CoinStatus {
* Coin fully paid back.
*/
PaybackDone,
+ /**
+ * Coin was dirty but can't be refreshed.
+ */
+ Useless,
}
@@ -1467,7 +1471,10 @@ export function mkAmount(value: number, fraction: number, currency: string): Amo
/**
* Possible results for checkPay.
*/
-export type CheckPayResult = "paid" | "payment-possible" | "insufficient-balance";
+export interface CheckPayResult {
+ status: "paid" | "payment-possible" | "insufficient-balance";
+ coinSelection?: CoinSelectionResult;
+}
/**
* Possible results for confirmPay.
@@ -1695,3 +1702,30 @@ export interface PurchaseRecord {
refundsPending: { [refundSig: string]: RefundPermission };
refundsDone: { [refundSig: string]: RefundPermission };
}
+
+
+/**
+ * Result of selecting coins, contains the exchange, and selected
+ * coins with their denomination.
+ */
+export interface CoinSelectionResult {
+ exchangeUrl: string;
+ cds: CoinWithDenom[];
+ totalFees: AmountJson;
+}
+
+
+/**
+ * Named tuple of coin and denomination.
+ */
+export interface CoinWithDenom {
+ /**
+ * A coin. Must have the same denomination public key as the associated
+ * denomination.
+ */
+ coin: CoinRecord;
+ /**
+ * An associated denomination.
+ */
+ denom: DenominationRecord;
+}