diff options
author | Florian Dold <florian@dold.me> | 2022-08-23 11:29:45 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-08-23 20:35:11 +0200 |
commit | f3ff5a72257dda27cab555f8b8d921d45bfc3e4b (patch) | |
tree | 708494a3aa2346fead51931fe4bfc41cc0249659 /packages/taler-wallet-core/src/db.ts | |
parent | 4ca38113abee2c0ca17b26aa55cf6a0ecafe49c9 (diff) | |
download | wallet-core-f3ff5a72257dda27cab555f8b8d921d45bfc3e4b.tar.xz |
peer-to-peer pull payments MVP
p2p pull wip
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 65 |
1 files changed, 51 insertions, 14 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index a34a09f75..266197eb5 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -393,7 +393,6 @@ export interface ExchangeDetailsRecord { wireInfo: WireInfo; } - export interface ExchangeDetailsPointer { masterPublicKey: string; @@ -922,7 +921,6 @@ export interface RefreshSessionRecord { norevealIndex?: number; } - export enum RefundState { Failed = "failed", Applied = "applied", @@ -1186,9 +1184,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 { @@ -1405,17 +1403,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; @@ -1625,6 +1623,36 @@ export interface PeerPushPaymentInitiationRecord { timestampCreated: TalerProtocolTimestamp; } +export interface PeerPullPaymentInitiationRecord { + /** + * What exchange are we using for the payment request? + */ + exchangeBaseUrl: string; + + /** + * Amount requested. + */ + amount: AmountString; + + /** + * Purse public key. Used as the primary key to look + * up this record. + */ + pursePub: string; + + /** + * Purse private key. + */ + pursePriv: string; + + /** + * Contract terms for the other party. + * + * FIXME: Nail down type! + */ + contractTerms: any; +} + /** * Record for a push P2P payment that this wallet was offered. * @@ -1825,6 +1853,15 @@ export const WalletStoresV1 = { ]), }, ), + peerPullPaymentInitiation: describeStore( + describeContents<PeerPullPaymentInitiationRecord>( + "peerPushPaymentInitiation", + { + keyPath: "pursePub", + }, + ), + {}, + ), }; export interface MetaConfigRecord { |