commit 924021844669875d25ea73352ced9d43ef3b16a8
parent 4577031f7e1c8146454e3ce53e0c6cfe6ff803f7
Author: Florian Dold <dold@taler.net>
Date: Fri, 17 Jul 2026 17:11:11 +0200
wallet-core: replace WalletIndexedDbTransaction with LegacyWalletTxHandle in operation helpers
Diffstat:
14 files changed, 94 insertions(+), 90 deletions(-)
diff --git a/packages/taler-wallet-core/src/balance.ts b/packages/taler-wallet-core/src/balance.ts
@@ -95,7 +95,6 @@ import {
import {
DonationSummaryRecord,
RefreshGroupRecord,
- WalletIndexedDbTransaction,
WithdrawalRecordType,
} from "./db-indexeddb.js";
import {
@@ -103,7 +102,11 @@ import {
getExchangeDetailsInTx,
getExchangeScopeInfo,
} from "./exchanges.js";
-import { getDenomInfo, WalletExecutionContext } from "./wallet.js";
+import {
+ getDenomInfo,
+ LegacyWalletTxHandle,
+ WalletExecutionContext,
+} from "./wallet.js";
/**
* Logger.
@@ -181,7 +184,7 @@ class BalancesStore {
constructor(
private wex: WalletExecutionContext,
- private tx: WalletIndexedDbTransaction,
+ private tx: LegacyWalletTxHandle,
) {}
setNonDemoExchange(baseUrl: string) {
@@ -398,7 +401,7 @@ class BalancesStore {
*/
export async function getBalancesInsideTransaction(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
): Promise<BalancesResponse> {
const balanceStore: BalancesStore = new BalancesStore(wex, tx);
@@ -889,7 +892,7 @@ export async function getPaymentBalanceDetails(
export async function getPaymentBalanceDetailsInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: PaymentRestrictionsForBalance,
): Promise<PaymentBalanceDetails> {
const d: PaymentBalanceDetails = {
diff --git a/packages/taler-wallet-core/src/coinSelection.ts b/packages/taler-wallet-core/src/coinSelection.ts
@@ -61,16 +61,17 @@ import {
PaymentBalanceDetails,
} from "./balance.js";
import { getAutoRefreshExecuteThreshold } from "./common.js";
-import {
- DenominationRecord,
- WalletIndexedDbTransaction,
-} from "./db-indexeddb.js";
+import { DenominationRecord } from "./db-indexeddb.js";
import {
checkExchangeInScopeTx,
ExchangeDetails,
getExchangeDetailsInTx,
} from "./exchanges.js";
-import { getDenomInfo, WalletExecutionContext } from "./wallet.js";
+import {
+ getDenomInfo,
+ LegacyWalletTxHandle,
+ WalletExecutionContext,
+} from "./wallet.js";
const logger = new Logger("coinSelection.ts");
@@ -190,7 +191,7 @@ export type SelectPayCoinsResult =
async function internalSelectPayCoins(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: SelectPayCoinRequestNg,
includePendingCoins: boolean,
): Promise<
@@ -277,7 +278,7 @@ async function internalSelectPayCoins(
export async function selectPayCoinsInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: SelectPayCoinRequestNg,
): Promise<SelectPayCoinsResult> {
if (logger.shouldLogTrace()) {
@@ -351,7 +352,7 @@ export async function selectPayCoins(
async function maybeRepairCoinSelection(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
prevPayCoins: PreviousPayCoins,
coinRes: SelectedCoin[],
tally: CoinSelectionTally,
@@ -399,7 +400,7 @@ async function maybeRepairCoinSelection(
* as not enough coins are actually available.
*/
async function assembleSelectPayCoinsSuccessResult(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
finalSel: SelResult,
coinRes: SelectedCoin[],
tally: CoinSelectionTally,
@@ -494,7 +495,7 @@ function getHint(
export async function reportInsufficientBalanceDetails(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: ReportInsufficientBalanceRequest,
): Promise<PaymentInsufficientBalanceDetails> {
const currency = Amounts.currencyOf(req.instructedAmount);
@@ -944,7 +945,7 @@ export interface PayCoinCandidates {
async function selectPayCandidates(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: SelectPayCandidatesRequest,
): Promise<PayCoinCandidates> {
// FIXME: Use the existing helper (from balance.ts) to
@@ -1137,7 +1138,7 @@ export interface PeerCoinSelectionRequest {
export async function computeCoinSelMaxExpirationDate(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
selectedDenom: SelResult,
): Promise<TalerProtocolTimestamp> {
let minAutorefreshExecuteThreshold = TalerProtocolTimestamp.never();
@@ -1205,7 +1206,7 @@ function getGlobalFees(
async function internalSelectPeerCoins(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: PeerCoinSelectionRequest,
exch: ExchangeDetails,
includePendingCoins: boolean,
@@ -1258,7 +1259,7 @@ async function internalSelectPeerCoins(
export async function selectPeerCoinsInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: PeerCoinSelectionRequest,
): Promise<SelectPeerCoinsResult> {
const instructedAmount = req.instructedAmount;
@@ -1394,7 +1395,7 @@ function getMaxDepositAmountForAvailableCoins(
export async function getExchangesForDepositInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: { restrictScope?: ScopeInfo; currency: string },
): Promise<Exchange[]> {
logger.trace(`getting exchanges for deposit ${j2s(req)}`);
diff --git a/packages/taler-wallet-core/src/common.ts b/packages/taler-wallet-core/src/common.ts
@@ -75,7 +75,6 @@ import {
PurchaseRecord,
RecoupGroupRecord,
RefreshGroupRecord,
- WalletIndexedDbTransaction,
WithdrawalGroupRecord,
} from "./db-indexeddb.js";
import { ReadyExchangeSummary } from "./exchanges.js";
@@ -106,7 +105,7 @@ export interface TokensSpendInfo {
export async function makeCoinsVisible(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
transactionId: string,
): Promise<void> {
const coins =
@@ -134,7 +133,7 @@ export async function makeCoinsVisible(
export async function makeCoinAvailable(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
coinRecord: CoinRecord,
): Promise<void> {
checkLogicInvariant(coinRecord.status === CoinStatus.Fresh);
@@ -179,7 +178,7 @@ export async function makeCoinAvailable(
*/
export async function spendCoins(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
csi: CoinsSpendInfo,
): Promise<void> {
if (csi.coinPubs.length != csi.contributions.length) {
@@ -266,7 +265,7 @@ export async function spendCoins(
}
export async function spendTokens(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
tsi: TokensSpendInfo,
): Promise<void> {
if (tsi.tokenPubs.length === 0) {
diff --git a/packages/taler-wallet-core/src/deposits.ts b/packages/taler-wallet-core/src/deposits.ts
@@ -121,7 +121,6 @@ import {
DepositGroupRecord,
DepositInfoPerExchange,
DepositTrackingInfo,
- WalletIndexedDbTransaction,
WithdrawalGroupRecord,
WithdrawalRecordType,
} from "./db-indexeddb.js";
@@ -1222,7 +1221,7 @@ async function processDepositGroupPendingKyc(
}
async function tryFindAccountKeypair(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<EddsaKeyPairStrings | undefined> {
let candidateTimestamp: AbsoluteTime | undefined = undefined;
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts
@@ -158,7 +158,6 @@ import {
ExchangeEntryRecord,
ExchangeMigrationReason,
ReserveRecord,
- WalletIndexedDbTransaction,
} from "./db-indexeddb.js";
import {
createTimeline,
@@ -216,7 +215,7 @@ interface ExchangeTosDownloadResult {
* Get exchange details from the database.
*/
async function getExchangeRecordsInternal(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<ExchangeDetailsRecord | undefined> {
const r = await tx.exchanges.get(exchangeBaseUrl);
@@ -261,7 +260,7 @@ async function getExchangeRecordsInternal(
}
export async function getScopeForAllCoins(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
coinPubs: string[],
): Promise<ScopeInfo[]> {
let exchangeSet = new Set<string>();
@@ -280,7 +279,7 @@ export async function getScopeForAllCoins(
* Get a list of scope infos applicable to a list of exchanges.
*/
export async function getScopeForAllExchanges(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exs: string[],
): Promise<ScopeInfo[]> {
const scopes: ScopeInfo[] = [];
@@ -300,7 +299,7 @@ export async function getScopeForAllExchanges(
}
export async function getExchangeScopeInfoOrUndefined(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<ScopeInfo | undefined> {
const det = await getExchangeRecordsInternal(tx, exchangeBaseUrl);
@@ -311,7 +310,7 @@ export async function getExchangeScopeInfoOrUndefined(
}
export async function getExchangeScopeInfo(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
currency: string,
): Promise<ScopeInfo> {
@@ -327,7 +326,7 @@ export async function getExchangeScopeInfo(
}
async function internalGetExchangeScopeInfo(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeDetails: ExchangeDetailsRecord,
): Promise<ScopeInfo> {
const globalExchangeRec =
@@ -484,7 +483,7 @@ export interface ExchangeDetails {
}
export async function getExchangeDetailsInTx(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<ExchangeDetails | undefined> {
const det = await getExchangeRecordsInternal(tx, exchangeBaseUrl);
@@ -724,7 +723,7 @@ async function validateGlobalFees(
* if the DB transaction succeeds.
*/
export async function putPresetExchangeEntry(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
exchangeType: string,
currencyHint?: string,
@@ -771,7 +770,7 @@ export async function putPresetExchangeEntry(
async function provideExchangeRecordInTx(
ws: InternalWalletState,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
baseUrl: string,
): Promise<{
exchange: ExchangeEntryRecord;
@@ -964,7 +963,7 @@ async function downloadTosMeta(
*/
async function checkExchangeEntryOutdated(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<boolean> {
// We currently consider the exchange outdated when no
@@ -1202,7 +1201,7 @@ export class OutdatedExchangeError extends Error {
*/
export async function requireExchangeReadyTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<void> {
const exchange = await tx.exchanges.get(exchangeBaseUrl);
@@ -2626,7 +2625,7 @@ export class DenomLossTransactionContext implements TransactionContext {
async function handleRecoup(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
recoup: Recoup[],
): Promise<void> {
@@ -2958,7 +2957,7 @@ export async function listExchanges(
* succeeded.
*/
export async function markExchangeUsed(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<void> {
logger.trace(`marking exchange ${exchangeBaseUrl} as used`);
@@ -3144,7 +3143,7 @@ export async function getExchangeDetailedInfo(
}
async function internalGetExchangeResources(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
): Promise<GetExchangeResourcesResponse> {
let numWithdrawals = 0;
@@ -4070,7 +4069,7 @@ export async function processExchangeKyc(
}
export async function checkExchangeInScopeTx(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
scope: ScopeInfo,
): Promise<boolean> {
diff --git a/packages/taler-wallet-core/src/mailbox.ts b/packages/taler-wallet-core/src/mailbox.ts
@@ -336,11 +336,11 @@ export async function refreshMailbox(
}),
);
return {
- messages: records
+ messages: records,
};
}
return {
- messages: []
+ messages: [],
}; // No new messages;
default:
throw Error("unexpected mailbox messages response empty");
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts b/packages/taler-wallet-core/src/pay-merchant.ts
@@ -162,7 +162,6 @@ import {
RefundReason,
SlateRecord,
TokenRecord,
- WalletIndexedDbTransaction,
} from "./db-indexeddb.js";
import { acceptDonauBlindSigs, generateDonauPlanchets } from "./donau.js";
import {
@@ -584,7 +583,7 @@ export class PayMerchantTransactionContext implements TransactionContext {
}
async function computePayMerchantExchangesInTx(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
purchaseRecord: PurchaseRecord,
): Promise<string[]> {
if (purchaseRecord?.exchanges) {
@@ -604,7 +603,7 @@ async function computePayMerchantExchangesInTx(
}
async function computePayMerchantTransactionScopesInTx(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
purchaseRec: PurchaseRecord,
): Promise<ScopeInfo[]> {
if (purchaseRec.exchanges && purchaseRec.exchanges.length > 0) {
@@ -788,7 +787,7 @@ export class RefundTransactionContext implements TransactionContext {
}
async function lookupMaybeContractData(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
proposalId: string,
): Promise<DownloadedContractData | undefined> {
let contractData: DownloadedContractData | undefined = undefined;
@@ -832,7 +831,7 @@ export async function getTotalPaymentCost(
export async function getTotalPaymentCostInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
currency: string,
pcs: SelectedProspectiveCoin[],
): Promise<AmountJson> {
@@ -887,7 +886,7 @@ function getPayRequestTimeout(purchase: PurchaseRecord): Duration {
export async function expectProposalDownloadByIdInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
proposalId: string,
): Promise<DownloadedContractData> {
const rec = await tx.purchases.get(proposalId);
@@ -899,7 +898,7 @@ export async function expectProposalDownloadByIdInTx(
export async function expectProposalDownloadInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
p: PurchaseRecord,
): Promise<DownloadedContractData> {
if (!p.download) {
@@ -1611,7 +1610,7 @@ function setCoinSel(rec: PurchaseRecord, coinSel: PayCoinSelection): void {
}
async function reselectCoinsTx(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
ctx: PayMerchantTransactionContext,
excludeCoinPub?: string,
): Promise<void> {
@@ -4616,7 +4615,7 @@ export async function startQueryRefund(
async function computeRefreshRequest(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
items: RefundItemRecord[],
): Promise<CoinRefreshRequest[]> {
const refreshCoins: CoinRefreshRequest[] = [];
diff --git a/packages/taler-wallet-core/src/pay-peer-common.ts b/packages/taler-wallet-core/src/pay-peer-common.ts
@@ -27,10 +27,13 @@ import { SpendCoinDetails } from "./crypto/cryptoImplementation.js";
import {
DbPeerPushPaymentCoinSelection,
ReserveRecord,
- WalletIndexedDbTransaction,
} from "./db-indexeddb.js";
import { getTotalRefreshCost } from "./refresh.js";
-import { WalletExecutionContext, getDenomInfo } from "./wallet.js";
+import {
+ LegacyWalletTxHandle,
+ WalletExecutionContext,
+ getDenomInfo,
+} from "./wallet.js";
import { updateWithdrawalDenomsForExchange } from "./withdraw.js";
/**
@@ -72,7 +75,7 @@ export async function queryCoinInfosForSelection(
export async function getTotalPeerPaymentCostInTx(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
pcs: SelectedProspectiveCoin[],
): Promise<AmountJson> {
const costs: AmountJson[] = [];
diff --git a/packages/taler-wallet-core/src/recoup.ts b/packages/taler-wallet-core/src/recoup.ts
@@ -61,7 +61,6 @@ import {
CoinSourceType,
RecoupGroupRecord,
RefreshCoinSource,
- WalletIndexedDbTransaction,
WithdrawCoinSource,
WithdrawalRecordType,
} from "./db-indexeddb.js";
@@ -82,7 +81,7 @@ const logger = new Logger("operations/recoup.ts");
*/
export async function putGroupAsFinished(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
recoupGroup: RecoupGroupRecord,
coinIdx: number,
): Promise<void> {
@@ -499,7 +498,7 @@ export class RecoupTransactionContext implements TransactionContext {
export async function createRecoupGroup(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
coinPubs: string[],
): Promise<string> {
diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts
@@ -105,7 +105,6 @@ import {
RefreshGroupPerExchangeInfo,
RefreshGroupRecord,
RefreshSessionRecord,
- WalletIndexedDbTransaction,
} from "./db-indexeddb.js";
import { selectWithdrawalDenominations } from "./denomSelection.js";
import {
@@ -352,7 +351,7 @@ export class RefreshTransactionContext implements TransactionContext {
export async function getTotalRefreshCost(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
refreshedDenom: DenominationInfo,
amountLeft: AmountJson,
): Promise<AmountJson> {
@@ -419,7 +418,7 @@ function getTotalRefreshCostInternal(
async function getCoinAvailabilityForDenom(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
denom: DenominationInfo,
ageRestriction: number,
): Promise<CoinAvailabilityRecord> {
@@ -448,7 +447,7 @@ async function getCoinAvailabilityForDenom(
*/
async function initRefreshSession(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
refreshGroup: RefreshGroupRecord,
coinIndex: number,
): Promise<void> {
@@ -546,7 +545,7 @@ async function initRefreshSession(
*/
async function destroyRefreshSession(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
refreshGroup: RefreshGroupRecord,
refreshSession: RefreshSessionRecord,
): Promise<void> {
@@ -1463,7 +1462,7 @@ export interface RefreshOutputInfo {
export async function calculateRefreshOutput(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
currency: string,
oldCoinPubs: CoinRefreshRequest[],
): Promise<RefreshOutputInfo> {
@@ -1512,7 +1511,7 @@ export async function calculateRefreshOutput(
async function applyRefreshToOldCoins(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
oldCoinPubs: CoinRefreshRequest[],
refreshGroupId: string,
): Promise<void> {
@@ -1606,7 +1605,7 @@ export interface CreateRefreshGroupResult {
*/
export async function createRefreshGroup(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
currency: string,
oldCoinPubs: CoinRefreshRequest[],
refreshReason: RefreshReason,
diff --git a/packages/taler-wallet-core/src/taldir.ts b/packages/taler-wallet-core/src/taldir.ts
@@ -75,14 +75,17 @@ export async function lookupAlias(
}
}
if (!typeFound) {
- return { }
+ return {};
}
break;
default:
throw Error("unable to get directory service config");
}
// SHA-512(len($ALIASTYPE)+len($ALIAS)||$ALIASTYPE||$ALIAS)
- const hAliasBuffer = createHAliasBuffer(lookupRequest.aliasType, lookupRequest.alias);
+ const hAliasBuffer = createHAliasBuffer(
+ lookupRequest.aliasType,
+ lookupRequest.alias,
+ );
const hAlias = encodeCrock(sha512(hAliasBuffer));
const res = await taldirClient.lookupAlias({ hAlias: hAlias });
switch (res.case) {
@@ -118,7 +121,9 @@ export async function registerAlias(
case "ok":
return res.body;
case HttpStatusCode.NotFound:
- throw Error("taldir reported not found, this means that the alias type was not supported");
+ throw Error(
+ "taldir reported not found, this means that the alias type was not supported",
+ );
default:
throw Error("unexpected taldir messages response empty");
}
@@ -143,7 +148,10 @@ export async function completeAliasRegistration(
combined.set(bytes2, bytes1.length);
const solution = encodeCrock(sha512(combined));
// SHA-512(len($ALIASTYPE)+len($ALIAS)||$ALIASTYPE||$ALIAS)
- const hAliasBuffer = createHAliasBuffer(completionRequest.aliasType, completionRequest.alias);
+ const hAliasBuffer = createHAliasBuffer(
+ completionRequest.aliasType,
+ completionRequest.alias,
+ );
const hAlias = encodeCrock(sha512(hAliasBuffer));
const res = await taldirClient.postRegistration({
hAlias: hAlias,
@@ -157,11 +165,10 @@ export async function completeAliasRegistration(
case HttpStatusCode.Forbidden:
throw TalerError.fromDetail(TalerErrorCode.GENERIC_FORBIDDEN, {});
case HttpStatusCode.TooManyRequests:
- throw Error("taldir reported that too many tries have been made to solve this registration challenge");
- default:
+ throw Error(
+ "taldir reported that too many tries have been made to solve this registration challenge",
+ );
+ default:
throw Error("unexpected taldir messages response empty");
}
}
-
-
-
diff --git a/packages/taler-wallet-core/src/transactions.ts b/packages/taler-wallet-core/src/transactions.ts
@@ -58,10 +58,7 @@ import {
PurchaseStatus,
timestampPreciseToDb,
} from "./db-common.js";
-import {
- TransactionMetaRecord,
- WalletIndexedDbTransaction,
-} from "./db-indexeddb.js";
+import { TransactionMetaRecord } from "./db-indexeddb.js";
import { DepositTransactionContext } from "./deposits.js";
import { DenomLossTransactionContext } from "./exchanges.js";
import {
@@ -254,7 +251,7 @@ function checkFilterIncludes(
async function addFiltered(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req: GetTransactionsV2Request | undefined,
target: Transaction[],
source: TransactionMetaRecord[],
@@ -313,7 +310,7 @@ function sortTransactions(
}
async function findOffsetTransaction(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
req?: GetTransactionsV2Request,
): Promise<TransactionMetaRecord | undefined> {
let forwards = req?.limit == null || req.limit >= 0;
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -563,7 +563,7 @@ export type RegisterAliasOp = {
op: WalletApiOperation.RegisterAlias;
request: TaldirRegistrationRequest;
response: TaldirRegistrationResponse;
-}
+};
/**
* Complete alias registration
@@ -572,7 +572,7 @@ export type CompleteRegisterAliasOp = {
op: WalletApiOperation.CompleteRegisterAlias;
request: TaldirRegistrationCompletionRequest;
response: EmptyObject;
-}
+};
/**
* Lookup alias
@@ -581,7 +581,7 @@ export type LookupAliasOp = {
op: WalletApiOperation.LookupAlias;
request: TaldirLookupRequest;
response: TaldirLookupResponse;
-}
+};
// group: Mailbox
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts
@@ -141,7 +141,6 @@ import {
DenominationRecord,
OperationRetryRecord,
PlanchetRecord,
- WalletIndexedDbTransaction,
WgInfo,
WithdrawalGroupRecord,
WithdrawalRecordType,
@@ -1272,7 +1271,7 @@ async function getWithdrawableDenoms(
*/
export async function getWithdrawableDenomsTx(
_wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
exchangeBaseUrl: string,
currency: string,
maxAmount?: AmountLike,
@@ -3640,7 +3639,7 @@ export async function internalPerformCreateWithdrawalGroup(
*/
async function internalPerformExchangeWasUsed(
wex: WalletExecutionContext,
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
canonExchange: string,
): Promise<void> {
const exchange = await tx.exchanges.get(canonExchange);
@@ -3785,7 +3784,7 @@ export async function prepareBankIntegratedWithdrawal(
* if the account already exists.
*/
async function storeKnownBankAccount(
- tx: WalletIndexedDbTransaction,
+ tx: LegacyWalletTxHandle,
instructedCurrency: string,
senderWire: string,
): Promise<string | undefined> {