allow deletion via API

This commit is contained in:
Florian Dold 2021-05-20 18:27:35 +02:00
parent 6f1b7f5b99
commit 9a861b80ef
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 14 additions and 4 deletions

View File

@ -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;
}
}
export const codecForDeleteTransactionRequest = (): Codec<DeleteTransactionRequest> =>
buildCodecForObject<DeleteTransactionRequest>()
.property("transactionId", codecForString())
.build("DeleteTransactionRequest");

View File

@ -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,