aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/common.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/common.ts19
1 files changed, 15 insertions, 4 deletions
diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts
index d69bc09f8..d17530c7f 100644
--- a/packages/taler-wallet-core/src/operations/common.ts
+++ b/packages/taler-wallet-core/src/operations/common.ts
@@ -25,6 +25,7 @@ import {
RefreshReason,
TalerErrorCode,
TalerErrorDetail,
+ TombstoneIdStr,
TransactionIdStr,
TransactionType,
} from "@gnu-taler/taler-util";
@@ -280,9 +281,19 @@ export enum TombstoneTag {
/**
* Create an event ID from the type and the primary key for the event.
*/
-export function makeEventId(
- type: TransactionType | TombstoneTag,
+export function makeTransactionId(
+ type: TransactionType,
...args: string[]
-): string {
- return type + ":" + args.map((x) => encodeURIComponent(x)).join(":");
+): TransactionIdStr {
+ return `txn:${type}:${args.map((x) => encodeURIComponent(x)).join(":")}`;
+}
+
+/**
+ * Create an event ID from the type and the primary key for the event.
+ */
+export function makeTombstoneId(
+ type: TombstoneTag,
+ ...args: string[]
+): TombstoneIdStr {
+ return `tmb:${type}:${args.map((x) => encodeURIComponent(x)).join(":")}`;
}