aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-01-11 17:12:08 +0100
committerFlorian Dold <florian@dold.me>2023-01-11 17:14:49 +0100
commit143a4fe4ac5b8724cf6e13a704e88daa99dd4202 (patch)
tree07b2fe6d993ae46838bc4072db8eba609bbb1801 /packages/taler-util
parent5fc0cb7927e7a81a80129f6165b2027e72b89d33 (diff)
wallet-core: refresh when aborting payments
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/transactions-types.ts11
-rw-r--r--packages/taler-util/src/wallet-types.ts20
2 files changed, 21 insertions, 10 deletions
diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts
index 62caaa055..59116a150 100644
--- a/packages/taler-util/src/transactions-types.ts
+++ b/packages/taler-util/src/transactions-types.ts
@@ -49,6 +49,15 @@ import {
TransactionIdStr,
} from "./wallet-types.js";
+export enum ExtendedStatus {
+ Pending = "pending",
+ Done = "done",
+ Aborting = "aborting",
+ Aborted = "aborted",
+ Failed = "failed",
+ KycRequired = "kyc-required",
+}
+
export interface TransactionsRequest {
/**
* return only transactions in the given currency
@@ -80,6 +89,8 @@ export interface TransactionCommon {
// main timestamp of the transaction
timestamp: TalerProtocolTimestamp;
+ extendedStatus: ExtendedStatus;
+
// true if the transaction is still pending, false otherwise
// If a transaction is not longer pending, its timestamp will be updated,
// but its transactionId will remain unchanged
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts
index b33eac0df..1ad5ef0ec 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -538,7 +538,7 @@ export interface WalletDiagnostics {
export interface TalerErrorDetail {
code: TalerErrorCode;
- when: string;
+ when?: string;
hint?: string;
[x: string]: unknown;
}
@@ -1553,8 +1553,8 @@ export const codecForAcceptTipRequest = (): Codec<AcceptTipRequest> =>
.property("walletTipId", codecForString())
.build("AcceptTipRequest");
-export interface AbortPayRequest {
- proposalId: string;
+export interface AbortTransactionRequest {
+ transactionId: string;
/**
* Move the payment immediately into an aborted state.
@@ -1563,15 +1563,15 @@ export interface AbortPayRequest {
*
* Defaults to false.
*/
- cancelImmediately?: boolean;
+ forceImmediateAbort?: boolean;
}
-export const codecForAbortPayRequest =
- (): Codec<AbortPayRequest> =>
- buildCodecForObject<AbortPayRequest>()
- .property("proposalId", codecForString())
- .property("cancelImmediately", codecOptional(codecForBoolean()))
- .build("AbortPayRequest");
+export const codecForAbortTransaction =
+ (): Codec<AbortTransactionRequest> =>
+ buildCodecForObject<AbortTransactionRequest>()
+ .property("transactionId", codecForString())
+ .property("forceImmediateAbort", codecOptional(codecForBoolean()))
+ .build("AbortTransactionRequest");
export interface GetFeeForDepositRequest {
depositPaytoUri: string;