summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/types
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-03-15 13:43:53 +0100
committerFlorian Dold <florian@dold.me>2021-03-15 13:44:25 +0100
commit44b1896b9ec8af72aa0eb25e8c89a4cc0c841766 (patch)
tree5a1b60cfd7334a64bb9cf6e465b3d62ee9dacde0 /packages/taler-wallet-core/src/types
parentfb3da3a28d6ed6a16ca7d0fa8ec775de51c7df6b (diff)
downloadwallet-core-44b1896b9ec8af72aa0eb25e8c89a4cc0c841766.tar.gz
wallet-core-44b1896b9ec8af72aa0eb25e8c89a4cc0c841766.tar.bz2
wallet-core-44b1896b9ec8af72aa0eb25e8c89a4cc0c841766.zip
improved pay coin selection
support for multiple exchanges and healing a previous selection
Diffstat (limited to 'packages/taler-wallet-core/src/types')
-rw-r--r--packages/taler-wallet-core/src/types/dbTypes.ts41
1 files changed, 11 insertions, 30 deletions
diff --git a/packages/taler-wallet-core/src/types/dbTypes.ts b/packages/taler-wallet-core/src/types/dbTypes.ts
index 6c37971ad..689055df8 100644
--- a/packages/taler-wallet-core/src/types/dbTypes.ts
+++ b/packages/taler-wallet-core/src/types/dbTypes.ts
@@ -41,6 +41,7 @@ import { ReserveTransaction } from "./ReserveTransaction";
import { Timestamp, Duration } from "../util/time";
import { IDBKeyPath } from "@gnu-taler/idb-bridge";
import { RetryInfo } from "../util/retries";
+import { PayCoinSelection } from "../util/coinSelection";
export enum ReserveRecordStatus {
/**
@@ -1138,36 +1139,6 @@ export interface WalletContractData {
maxDepositFee: AmountJson;
}
-/**
- * Result of selecting coins, contains the exchange, and selected
- * coins with their denomination.
- */
-export interface PayCoinSelection {
- /**
- * Amount requested by the merchant.
- */
- paymentAmount: AmountJson;
-
- /**
- * Public keys of the coins that were selected.
- */
- coinPubs: string[];
-
- /**
- * Amount that each coin contributes.
- */
- coinContributions: AmountJson[];
-
- /**
- * How much of the wire fees is the customer paying?
- */
- customerWireFees: AmountJson;
-
- /**
- * How much of the deposit fees is the customer paying?
- */
- customerDepositFees: AmountJson;
-}
export enum AbortStatus {
None = "none",
@@ -1210,6 +1181,16 @@ export interface PurchaseRecord {
payCoinSelection: PayCoinSelection;
+ /**
+ * Pending removals from pay coin selection.
+ *
+ * Used when a the pay coin selection needs to be changed
+ * because a coin became known as double-spent or invalid,
+ * but a new coin selection can't immediately be done, as
+ * there is not enough balance (e.g. when waiting for a refresh).
+ */
+ pendingRemovedCoinPubs?: string[];
+
totalPayCost: AmountJson;
/**