aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-06-17 13:50:43 +0200
committerFlorian Dold <florian@dold.me>2024-06-17 13:50:43 +0200
commitabbab3b029002eb5d603af611db6f411daf5d490 (patch)
treec48a79a4dc28649ac274b3dafdbb849e3bf517b0 /packages/taler-util/src
parent05535fdc226f39666ed0a692871f54dea904af7b (diff)
downloadwallet-core-abbab3b029002eb5d603af611db6f411daf5d490.tar.xz
wallet-core: coin history
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r--packages/taler-util/src/wallet-types.ts46
1 files changed, 38 insertions, 8 deletions
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts
index 099e5c060..360d8b183 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -627,6 +627,32 @@ export enum CoinStatus {
Dormant = "dormant",
}
+export type WalletCoinHistoryItem =
+ | {
+ type: "withdraw";
+ transactionId: TransactionIdStr;
+ }
+ | {
+ type: "spend";
+ transactionId: TransactionIdStr;
+ amount: AmountString;
+ }
+ | {
+ type: "refresh";
+ transactionId: TransactionIdStr;
+ amount: AmountString;
+ }
+ | {
+ type: "recoup";
+ transactionId: TransactionIdStr;
+ amount: AmountString;
+ }
+ | {
+ type: "refund";
+ transactionId: TransactionIdStr;
+ amount: AmountString;
+ };
+
/**
* Easy to process format for the public data of coins
* managed by the wallet.
@@ -636,38 +662,42 @@ export interface CoinDumpJson {
/**
* The coin's denomination's public key.
*/
- denom_pub: DenominationPubKey;
+ denomPub: DenominationPubKey;
/**
* Hash of denom_pub.
*/
- denom_pub_hash: string;
+ denomPubHash: string;
/**
* Value of the denomination (without any fees).
*/
- denom_value: string;
+ denomValue: string;
/**
* Public key of the coin.
*/
- coin_pub: string;
+ coinPub: string;
/**
* Base URL of the exchange for the coin.
*/
- exchange_base_url: string;
+ exchangeBaseUrl: string;
/**
* Public key of the parent coin.
* Only present if this coin was obtained via refreshing.
*/
- refresh_parent_coin_pub: string | undefined;
+ refreshParentCoinPub: string | undefined;
/**
* Public key of the reserve for this coin.
* Only present if this coin was obtained via refreshing.
*/
- withdrawal_reserve_pub: string | undefined;
- coin_status: CoinStatus;
+ withdrawalReservePub: string | undefined;
+ /**
+ * Status of the coin.
+ */
+ coinStatus: CoinStatus;
/**
* Information about the age restriction
*/
ageCommitmentProof: AgeCommitmentProof | undefined;
+ history: WalletCoinHistoryItem[];
}>;
}