commit b7cb0b7fb93cd587f7dbddb17a0988695848c167
parent f0b8b496221d1a2536424886d1a1310fa2a35052
Author: Florian Dold <florian@dold.me>
Date: Tue, 2 Jun 2026 14:47:10 +0200
wallet-core: improve error message for flex withdrawals of non-foreign accounts
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
@@ -3860,6 +3860,10 @@ export async function confirmWithdrawal(
exchange,
instructedAmount,
});
+ } else if (!withdrawalGroup.isForeignAccount) {
+ throw Error(
+ "confirming withdrawals with non-foreign accounts and flexible amount is not supported",
+ );
}
const senderWire = withdrawalGroup.wgInfo.bankInfo.senderWire;
@@ -3871,9 +3875,15 @@ export async function confirmWithdrawal(
throw Error("invalid payto URI");
}
let acceptable = false;
+ if (withdrawalAccountList.length == 0) {
+ logger.warn(`empty list of withdrawal accounts`);
+ }
for (const acc of withdrawalAccountList) {
const parsedExchangeWire = parsePaytoUri(acc.paytoUri);
if (!parsedExchangeWire) {
+ logger.warn(
+ `unable to parse payto ${acc.paytoUri} of ${selectedExchange}`,
+ );
continue;
}
const checkRes = checkAccountRestriction(
@@ -3881,6 +3891,9 @@ export async function confirmWithdrawal(
acc.creditRestrictions ?? [],
);
if (!checkRes.ok) {
+ logger.trace(
+ `payto URI ${senderWire} does not satisfy credit restrictions of ${selectedExchange}`,
+ );
continue;
}
acceptable = true;