diff options
author | Florian Dold <florian@dold.me> | 2021-03-15 13:43:53 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-03-15 13:44:25 +0100 |
commit | 44b1896b9ec8af72aa0eb25e8c89a4cc0c841766 (patch) | |
tree | 5a1b60cfd7334a64bb9cf6e465b3d62ee9dacde0 /packages/taler-wallet-core/src/types/dbTypes.ts | |
parent | fb3da3a28d6ed6a16ca7d0fa8ec775de51c7df6b (diff) | |
download | wallet-core-44b1896b9ec8af72aa0eb25e8c89a4cc0c841766.tar.xz |
improved pay coin selection
support for multiple exchanges and healing a previous selection
Diffstat (limited to 'packages/taler-wallet-core/src/types/dbTypes.ts')
-rw-r--r-- | packages/taler-wallet-core/src/types/dbTypes.ts | 41 |
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; /** |