summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-12-13 08:52:17 +0100
committerFlorian Dold <florian@dold.me>2023-12-13 08:52:17 +0100
commitdf67d5dbb205665b57c8f860d79be16c94ba5a68 (patch)
treee734dedc598eef18eb98716c579df742c1177ecd /packages/taler-wallet-core/src/operations
parent80c61a93e6c33d771cec95a9acfde43ce7148935 (diff)
downloadwallet-core-df67d5dbb205665b57c8f860d79be16c94ba5a68.tar.gz
wallet-core-df67d5dbb205665b57c8f860d79be16c94ba5a68.tar.bz2
wallet-core-df67d5dbb205665b57c8f860d79be16c94ba5a68.zip
wallet-core: add hint about responsible transaction ID in balance change notification
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r--packages/taler-wallet-core/src/operations/deposits.ts1
-rw-r--r--packages/taler-wallet-core/src/operations/pay-merchant.ts13
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts5
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts7
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts5
-rw-r--r--packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts5
-rw-r--r--packages/taler-wallet-core/src/operations/refresh.ts10
-rw-r--r--packages/taler-wallet-core/src/operations/reward.ts5
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts5
9 files changed, 45 insertions, 11 deletions
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts b/packages/taler-wallet-core/src/operations/deposits.ts
index de413a514..057450b78 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -1449,6 +1449,7 @@ export async function createDepositGroup(
ws.notify({
type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
});
return {
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts b/packages/taler-wallet-core/src/operations/pay-merchant.ts
index b3ea5b3fe..2d364a866 100644
--- a/packages/taler-wallet-core/src/operations/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts
@@ -933,7 +933,13 @@ async function handleInsufficientFunds(
});
});
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: constructTransactionIdentifier({
+ tag: TransactionType.Payment,
+ proposalId,
+ }),
+ });
}
async function unblockBackup(
@@ -1482,7 +1488,10 @@ export async function confirmPay(
});
notifyTransition(ws, transactionId, transitionInfo);
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
return runPayForConfirmPay(ws, proposalId);
}
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts
index f8ab07b10..ec482b2dd 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts
@@ -833,7 +833,10 @@ export async function initiatePeerPullPayment(
});
// The pending-incoming balance has changed.
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
notifyTransition(ws, transactionId, transitionInfo);
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts
index cf5fc355d..72e9e2e4a 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-debit.ts
@@ -460,13 +460,16 @@ export async function confirmPeerPullDebit(
return pi;
});
- ws.notify({ type: NotificationType.BalanceChange });
-
const transactionId = constructTransactionIdentifier({
tag: TransactionType.PeerPullDebit,
peerPullDebitId,
});
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
+
return {
transactionId,
};
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts
index 1174ccc8e..78263c4c3 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts
@@ -234,7 +234,10 @@ export async function preparePeerPushCredit(
notifyTransition(ws, transactionId, transitionInfo);
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
return {
amount: purseStatus.balance,
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts b/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
index 534114ed8..3eed52b91 100644
--- a/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
+++ b/packages/taler-wallet-core/src/operations/pay-peer-push-debit.ts
@@ -696,7 +696,10 @@ export async function initiatePeerPushDebit(
};
});
notifyTransition(ws, transactionId, transitionInfo);
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
return {
contractPriv: contractKeyPair.priv,
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts
index e5bc3277d..c58f03e05 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -295,7 +295,10 @@ async function provideRefreshSession(
const newTxState = computeRefreshTransactionState(rg);
return { oldTxState, newTxState };
});
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
notifyTransition(ws, transactionId, transitionInfo);
return;
}
@@ -509,7 +512,10 @@ async function refreshMelt(
newTxState,
};
});
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
notifyTransition(ws, transactionId, transitionInfo);
return;
}
diff --git a/packages/taler-wallet-core/src/operations/reward.ts b/packages/taler-wallet-core/src/operations/reward.ts
index 90320d7cb..a1bf13ec4 100644
--- a/packages/taler-wallet-core/src/operations/reward.ts
+++ b/packages/taler-wallet-core/src/operations/reward.ts
@@ -429,7 +429,10 @@ export async function processTip(
return { oldTxState, newTxState };
});
notifyTransition(ws, transactionId, transitionInfo);
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
return TaskRunResult.finished();
}
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts
index e7ba6d820..8a718dd49 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -1642,7 +1642,10 @@ async function processWithdrawalGroupPendingReady(
}
notifyTransition(ws, transactionId, res.transitionInfo);
- ws.notify({ type: NotificationType.BalanceChange });
+ ws.notify({
+ type: NotificationType.BalanceChange,
+ hintTransactionId: transactionId,
+ });
if (numPlanchetErrors > 0) {
return {