diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 74df9acfb..84f879f58 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -75,6 +75,7 @@ import { } from "./common.js"; import { abortDepositGroup, + cancelAbortingDepositGroup, computeDepositTransactionStatus, processDepositGroup, resumeDepositGroup, @@ -1401,6 +1402,23 @@ export async function suspendTransaction( } } +export async function cancelAbortingTransaction( + ws: InternalWalletState, + transactionId: string, +): Promise<void> { + const tx = parseTransactionIdentifier(transactionId); + if (!tx) { + throw Error("invalid transaction ID"); + } + switch (tx.tag) { + case TransactionType.Deposit: + await cancelAbortingDepositGroup(ws, tx.depositGroupId); + return; + default: + logger.warn(`unable to suspend transaction of type '${tx.tag}'`); + } +} + /** * Resume a suspended transaction. */ |