aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/deposits.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-04-13 11:26:40 +0200
committerFlorian Dold <florian@dold.me>2023-04-13 11:26:46 +0200
commitc581cff749e147f22504465865c65effff6c0fbe (patch)
tree03abbc1e29311366063e2e203336d8d9cc16e6bb /packages/taler-wallet-core/src/operations/deposits.ts
parent4fbeb06d4e23f1373d231f417bd7bc386227be58 (diff)
downloadwallet-core-c581cff749e147f22504465865c65effff6c0fbe.tar.xz
wallet-core: implement 'generateDepositGroupTxId' request
Diffstat (limited to 'packages/taler-wallet-core/src/operations/deposits.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/deposits.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts
index 9abec89bf..d1dbf5f53 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -75,6 +75,7 @@ import {
getTotalPaymentCost,
} from "./pay-merchant.js";
import { selectPayCoinsNew } from "../util/coinSelection.js";
+import { constructTransactionIdentifier } from "./transactions.js";
/**
* Logger.
@@ -571,6 +572,14 @@ export async function prepareDepositGroup(
};
}
+export function generateDepositGroupTxId(): string {
+ const depositGroupId = encodeCrock(getRandomBytes(32));
+ return constructTransactionIdentifier({
+ tag: TransactionType.Deposit,
+ depositGroupId: depositGroupId,
+ });
+}
+
export async function createDepositGroup(
ws: InternalWalletState,
req: CreateDepositGroupRequest,