summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/types')
-rw-r--r--packages/taler-wallet-core/src/types/dbTypes.ts40
-rw-r--r--packages/taler-wallet-core/src/types/notifications.ts3
-rw-r--r--packages/taler-wallet-core/src/types/pending.ts3
-rw-r--r--packages/taler-wallet-core/src/types/talerTypes.ts22
-rw-r--r--packages/taler-wallet-core/src/types/walletTypes.ts8
5 files changed, 32 insertions, 44 deletions
diff --git a/packages/taler-wallet-core/src/types/dbTypes.ts b/packages/taler-wallet-core/src/types/dbTypes.ts
index 4e2ba1bb4..3e24f787b 100644
--- a/packages/taler-wallet-core/src/types/dbTypes.ts
+++ b/packages/taler-wallet-core/src/types/dbTypes.ts
@@ -694,17 +694,28 @@ export interface PlanchetRecord {
lastError: TalerErrorDetails | undefined;
/**
- * Public key of the reserve, this might be a reserve not
- * known to the wallet if the planchet is from a tip.
+ * Public key of the reserve that this planchet
+ * is being withdrawn from.
+ *
+ * Can be the empty string (non-null/undefined for DB indexing)
+ * if this is a tipping reserve.
*/
reservePub: string;
+
denomPubHash: string;
+
denomPub: string;
+
blindingKey: string;
+
withdrawSig: string;
+
coinEv: string;
+
coinEvHash: string;
+
coinValue: AmountJson;
+
isFromTip: boolean;
}
@@ -772,6 +783,8 @@ export interface RefreshCoinSource {
export interface TipCoinSource {
type: CoinSourceType.Tip;
+ walletTipId: string;
+ coinIndex: number;
}
export type CoinSource = WithdrawCoinSource | RefreshCoinSource | TipCoinSource;
@@ -950,9 +963,9 @@ export interface TipRecord {
/**
* The tipped amount.
*/
- amount: AmountJson;
+ tipAmountRaw: AmountJson;
- totalFees: AmountJson;
+ tipAmountEffective: AmountJson;
/**
* Timestamp, the tip can't be picked up anymore after this deadline.
@@ -1481,18 +1494,6 @@ export enum WithdrawalSourceType {
Reserve = "reserve",
}
-export interface WithdrawalSourceTip {
- type: WithdrawalSourceType.Tip;
- tipId: string;
-}
-
-export interface WithdrawalSourceReserve {
- type: WithdrawalSourceType.Reserve;
- reservePub: string;
-}
-
-export type WithdrawalSource = WithdrawalSourceTip | WithdrawalSourceReserve;
-
export interface DenominationSelectionInfo {
totalCoinValue: AmountJson;
totalWithdrawCost: AmountJson;
@@ -1524,12 +1525,7 @@ export interface DenomSelectionState {
export interface WithdrawalGroupRecord {
withdrawalGroupId: string;
- /**
- * Withdrawal source. Fields that don't apply to the respective
- * withdrawal source type must be null (i.e. can't be absent),
- * otherwise the IndexedDB indexing won't like us.
- */
- source: WithdrawalSource;
+ reservePub: string;
exchangeBaseUrl: string;
diff --git a/packages/taler-wallet-core/src/types/notifications.ts b/packages/taler-wallet-core/src/types/notifications.ts
index e1b9a7aff..d86c5ae59 100644
--- a/packages/taler-wallet-core/src/types/notifications.ts
+++ b/packages/taler-wallet-core/src/types/notifications.ts
@@ -23,7 +23,6 @@
* Imports.
*/
import { TalerErrorDetails } from "./walletTypes";
-import { WithdrawalSource } from "./dbTypes";
import { ReserveHistorySummary } from "../util/reserveHistoryUtil";
export enum NotificationType {
@@ -141,7 +140,7 @@ export interface WithdrawalGroupCreatedNotification {
export interface WithdrawalGroupFinishedNotification {
type: NotificationType.WithdrawGroupFinished;
- withdrawalSource: WithdrawalSource;
+ reservePub: string;
}
export interface WaitingForRetryNotification {
diff --git a/packages/taler-wallet-core/src/types/pending.ts b/packages/taler-wallet-core/src/types/pending.ts
index d07754fe9..b14872d74 100644
--- a/packages/taler-wallet-core/src/types/pending.ts
+++ b/packages/taler-wallet-core/src/types/pending.ts
@@ -22,7 +22,7 @@
* Imports.
*/
import { TalerErrorDetails, BalancesResponse } from "./walletTypes";
-import { WithdrawalSource, RetryInfo, ReserveRecordStatus } from "./dbTypes";
+import { RetryInfo, ReserveRecordStatus } from "./dbTypes";
import { Timestamp, Duration } from "../util/time";
export enum PendingOperationType {
@@ -219,7 +219,6 @@ export interface PendingRecoupOperation {
*/
export interface PendingWithdrawOperation {
type: PendingOperationType.Withdraw;
- source: WithdrawalSource;
lastError: TalerErrorDetails | undefined;
retryInfo: RetryInfo;
withdrawalGroupId: string;
diff --git a/packages/taler-wallet-core/src/types/talerTypes.ts b/packages/taler-wallet-core/src/types/talerTypes.ts
index 52dc4cb62..16d00e2ea 100644
--- a/packages/taler-wallet-core/src/types/talerTypes.ts
+++ b/packages/taler-wallet-core/src/types/talerTypes.ts
@@ -593,11 +593,11 @@ export interface TipPickupRequest {
* Reserve signature, defined as separate class to facilitate
* schema validation with "@Checkable".
*/
-export class ReserveSigSingleton {
+export class BlindSigWrapper {
/**
* Reserve signature.
*/
- reserve_sig: string;
+ blind_sig: string;
}
/**
@@ -606,14 +606,9 @@ export class ReserveSigSingleton {
*/
export class TipResponse {
/**
- * Public key of the reserve
- */
- reserve_pub: string;
-
- /**
* The order of the signatures matches the planchets list.
*/
- reserve_sigs: ReserveSigSingleton[];
+ blind_sigs: BlindSigWrapper[];
}
/**
@@ -1166,15 +1161,14 @@ export const codecForMerchantRefundResponse = (): Codec<
.property("refunds", codecForList(codecForMerchantRefundPermission()))
.build("MerchantRefundResponse");
-export const codecForReserveSigSingleton = (): Codec<ReserveSigSingleton> =>
- buildCodecForObject<ReserveSigSingleton>()
- .property("reserve_sig", codecForString())
- .build("ReserveSigSingleton");
+export const codecForBlindSigWrapper = (): Codec<BlindSigWrapper> =>
+ buildCodecForObject<BlindSigWrapper>()
+ .property("blind_sig", codecForString())
+ .build("BlindSigWrapper");
export const codecForTipResponse = (): Codec<TipResponse> =>
buildCodecForObject<TipResponse>()
- .property("reserve_pub", codecForString())
- .property("reserve_sigs", codecForList(codecForReserveSigSingleton()))
+ .property("blind_sigs", codecForList(codecForBlindSigWrapper()))
.build("TipResponse");
export const codecForRecoup = (): Codec<Recoup> =>
diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts
index fb049caf9..c9014830b 100644
--- a/packages/taler-wallet-core/src/types/walletTypes.ts
+++ b/packages/taler-wallet-core/src/types/walletTypes.ts
@@ -359,8 +359,8 @@ export interface PrepareTipResult {
* Has the tip already been accepted?
*/
accepted: boolean;
- amount: AmountString;
- totalFees: AmountString;
+ tipAmountRaw: AmountString;
+ tipAmountEffective: AmountString;
exchangeBaseUrl: string;
expirationTimestamp: Timestamp;
}
@@ -368,8 +368,8 @@ export interface PrepareTipResult {
export const codecForPrepareTipResult = (): Codec<PrepareTipResult> =>
buildCodecForObject<PrepareTipResult>()
.property("accepted", codecForBoolean())
- .property("amount", codecForAmountString())
- .property("totalFees", codecForAmountString())
+ .property("tipAmountRaw", codecForAmountString())
+ .property("tipAmountEffective", codecForAmountString())
.property("exchangeBaseUrl", codecForString())
.property("expirationTimestamp", codecForTimestamp)
.property("walletTipId", codecForString())