aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/db.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-07-12 17:41:14 +0200
committerFlorian Dold <florian@dold.me>2022-07-12 17:41:14 +0200
commitf11483b511ff1f839b9913c4832eee9109f67aeb (patch)
tree6f4e1c5891a24bbb7500cea3964d3826d2ef87e1 /packages/taler-wallet-core/src/db.ts
parentb214934b75418d0d01c9556577d9594f1db5a319 (diff)
downloadwallet-core-f11483b511ff1f839b9913c4832eee9109f67aeb.tar.xz
wallet-core: implement accepting p2p push payments
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r--packages/taler-wallet-core/src/db.ts40
1 files changed, 37 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts
index 8cf5170e5..e4f4ba255 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -42,6 +42,7 @@ import {
TalerProtocolDuration,
AgeCommitmentProof,
PayCoinSelection,
+ PeerContractTerms,
} from "@gnu-taler/taler-util";
import { RetryInfo } from "./util/retries.js";
import { Event, IDBDatabase } from "@gnu-taler/idb-bridge";
@@ -561,6 +562,12 @@ export interface ExchangeRecord {
* Retry status for fetching updated information about the exchange.
*/
retryInfo?: RetryInfo;
+
+ /**
+ * Public key of the reserve that we're currently using for
+ * receiving P2P payments.
+ */
+ currentMergeReservePub?: string;
}
/**
@@ -1675,7 +1682,6 @@ export interface BalancePerCurrencyRecord {
* Record for a push P2P payment that this wallet initiated.
*/
export interface PeerPushPaymentInitiationRecord {
-
/**
* What exchange are funds coming from?
*/
@@ -1704,18 +1710,40 @@ export interface PeerPushPaymentInitiationRecord {
*/
mergePriv: string;
+ contractPriv: string;
+
+ contractPub: string;
+
purseExpiration: TalerProtocolTimestamp;
/**
* Did we successfully create the purse with the exchange?
*/
purseCreated: boolean;
+
+ timestampCreated: TalerProtocolTimestamp;
}
/**
- * Record for a push P2P payment that this wallet accepted.
+ * Record for a push P2P payment that this wallet was offered.
+ *
+ * Primary key: (exchangeBaseUrl, pursePub)
*/
-export interface PeerPushPaymentAcceptanceRecord {}
+export interface PeerPushPaymentIncomingRecord {
+ exchangeBaseUrl: string;
+
+ pursePub: string;
+
+ mergePriv: string;
+
+ contractPriv: string;
+
+ timestampAccepted: TalerProtocolTimestamp;
+
+ contractTerms: PeerContractTerms;
+
+ // FIXME: add status etc.
+}
export const WalletStoresV1 = {
coins: describeStore(
@@ -1893,6 +1921,12 @@ export const WalletStoresV1 = {
}),
{},
),
+ peerPushPaymentIncoming: describeStore(
+ describeContents<PeerPushPaymentIncomingRecord>("peerPushPaymentIncoming", {
+ keyPath: ["exchangeBaseUrl", "pursePub"],
+ }),
+ {},
+ ),
};
export interface MetaConfigRecord {