diff --git a/packages/taler-util/src/walletTypes.ts b/packages/taler-util/src/walletTypes.ts index 006140070..10dbf75eb 100644 --- a/packages/taler-util/src/walletTypes.ts +++ b/packages/taler-util/src/walletTypes.ts @@ -68,8 +68,6 @@ export class CreateReserveResponse { reservePub: string; } - - export interface Balance { available: AmountString; pendingIncoming: AmountString; @@ -949,4 +947,9 @@ export interface WalletCurrencyInfo { export interface DeleteTransactionRequest { transactionId: string; -} \ No newline at end of file +} + +export const codecForDeleteTransactionRequest = (): Codec => + buildCodecForObject() + .property("transactionId", codecForString()) + .build("DeleteTransactionRequest"); diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index c380786ab..317d81ceb 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -25,6 +25,7 @@ import { BackupRecovery, codecForAny, + codecForDeleteTransactionRequest, DeleteTransactionRequest, TalerErrorCode, WalletCurrencyInfo, @@ -1191,9 +1192,15 @@ export class Wallet { const req = codecForCreateDepositGroupRequest().decode(payload); return await createDepositGroup(this.ws, req); } - case "trackDepositGroup": + case "trackDepositGroup": { const req = codecForTrackDepositGroupRequest().decode(payload); return trackDepositGroup(this.ws, req); + } + case "deleteTransaction": { + const req = codecForDeleteTransactionRequest().decode(payload); + await deleteTransaction(this.ws, req.transactionId); + return {}; + } } throw OperationFailedError.fromCode( TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN,