diff options
author | Florian Dold <florian@dold.me> | 2022-06-21 12:40:12 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-07-08 11:08:30 +0200 |
commit | b214934b75418d0d01c9556577d9594f1db5a319 (patch) | |
tree | d8ec18217a16e6b89859b30003a4a825fc63a66e /packages/taler-wallet-core/src/db.ts | |
parent | 05cdbfb534bb194dbe6bdf049113ebea8139234f (diff) |
wallet-core: P2P push payments (still incomplete)
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 70 |
1 files changed, 58 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index eefa43113..8cf5170e5 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -1309,9 +1309,9 @@ export const WALLET_BACKUP_STATE_KEY = "walletBackupState"; */ export type ConfigRecord = | { - key: typeof WALLET_BACKUP_STATE_KEY; - value: WalletBackupConfState; - } + key: typeof WALLET_BACKUP_STATE_KEY; + value: WalletBackupConfState; + } | { key: "currencyDefaultsApplied"; value: boolean }; export interface WalletBackupConfState { @@ -1497,17 +1497,17 @@ export enum BackupProviderStateTag { export type BackupProviderState = | { - tag: BackupProviderStateTag.Provisional; - } + tag: BackupProviderStateTag.Provisional; + } | { - tag: BackupProviderStateTag.Ready; - nextBackupTimestamp: TalerProtocolTimestamp; - } + tag: BackupProviderStateTag.Ready; + nextBackupTimestamp: TalerProtocolTimestamp; + } | { - tag: BackupProviderStateTag.Retrying; - retryInfo: RetryInfo; - lastError?: TalerErrorDetail; - }; + tag: BackupProviderStateTag.Retrying; + retryInfo: RetryInfo; + lastError?: TalerErrorDetail; + }; export interface BackupProviderTerms { supportedProtocolVersion: string; @@ -1671,6 +1671,52 @@ export interface BalancePerCurrencyRecord { pendingOutgoing: AmountString; } +/** + * Record for a push P2P payment that this wallet initiated. + */ +export interface PeerPushPaymentInitiationRecord { + + /** + * What exchange are funds coming from? + */ + exchangeBaseUrl: string; + + amount: AmountString; + + /** + * Purse public key. Used as the primary key to look + * up this record. + */ + pursePub: string; + + /** + * Purse private key. + */ + pursePriv: string; + + /** + * Public key of the merge capability of the purse. + */ + mergePub: string; + + /** + * Private key of the merge capability of the purse. + */ + mergePriv: string; + + purseExpiration: TalerProtocolTimestamp; + + /** + * Did we successfully create the purse with the exchange? + */ + purseCreated: boolean; +} + +/** + * Record for a push P2P payment that this wallet accepted. + */ +export interface PeerPushPaymentAcceptanceRecord {} + export const WalletStoresV1 = { coins: describeStore( describeContents<CoinRecord>("coins", { |