diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-30 17:08:54 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-30 17:08:54 +0200 |
commit | 008926b18470e7f394cd640302957b29728a9803 (patch) | |
tree | 45f914f5117116bb3af5010f9e7570e99b015952 /src/types.ts | |
parent | 24e021fef360448caf11ab5a489b570102e66f6f (diff) | |
download | wallet-core-008926b18470e7f394cd640302957b29728a9803.tar.xz |
compute full fees for refresh and spending
Diffstat (limited to 'src/types.ts')
-rw-r--r-- | src/types.ts | 36 |
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; +} |