aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/refresh.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-01-05 18:45:49 +0100
committerFlorian Dold <florian@dold.me>2023-01-05 18:45:54 +0100
commit92f1b5928c764b3af12a29b97bbc3e434a82b1b0 (patch)
tree040f88aa54aec8fedb99ba57ad18218715d19e25 /packages/taler-wallet-core/src/operations/refresh.ts
parent44aaa7a636ba25b37c1c26a306e64e0db75a2747 (diff)
downloadwallet-core-92f1b5928c764b3af12a29b97bbc3e434a82b1b0.tar.xz
wallet-core: implement insufficient balance details
For now, only for merchant payments
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refresh.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/refresh.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts
index eeff84be6..638dec8a6 100644
--- a/packages/taler-wallet-core/src/operations/refresh.ts
+++ b/packages/taler-wallet-core/src/operations/refresh.ts
@@ -850,6 +850,7 @@ export async function createRefreshGroup(
refreshGroups: typeof WalletStoresV1.refreshGroups;
coinAvailability: typeof WalletStoresV1.coinAvailability;
}>,
+ currency: string,
oldCoinPubs: CoinRefreshRequest[],
reason: RefreshReason,
): Promise<RefreshGroupId> {
@@ -934,6 +935,7 @@ export async function createRefreshGroup(
const refreshGroup: RefreshGroupRecord = {
operationStatus: RefreshOperationStatus.Pending,
+ currency,
timestampFinished: undefined,
statusPerCoin: oldCoinPubs.map(() => RefreshCoinStatus.Pending),
oldCoinPubs: oldCoinPubs.map((x) => x.coinPub),
@@ -1018,7 +1020,7 @@ export async function autoRefresh(
])
.runReadWrite(async (tx) => {
const exchange = await tx.exchanges.get(exchangeBaseUrl);
- if (!exchange) {
+ if (!exchange || !exchange.detailsPointer) {
return;
}
const coins = await tx.coins.indexes.byBaseUrl
@@ -1059,6 +1061,7 @@ export async function autoRefresh(
const res = await createRefreshGroup(
ws,
tx,
+ exchange.detailsPointer?.currency,
refreshCoins,
RefreshReason.Scheduled,
);