From 8e70b89593a375bb19432e6521daed618ae779f5 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 2 Oct 2023 23:24:06 +0200 Subject: wallet-core: currency hint for preset exchanges --- packages/taler-wallet-core/src/wallet.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'packages/taler-wallet-core/src/wallet.ts') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 44076667d..203adec0f 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -200,7 +200,6 @@ import { downloadTosFromAcceptedFormat, getExchangeDetails, getExchangeRequestTimeout, - provideExchangeRecordInTx, updateExchangeFromUrl, updateExchangeFromUrlHandler, } from "./operations/exchanges.js"; @@ -535,10 +534,12 @@ async function fillDefaults(ws: InternalWalletState): Promise { logger.trace("defaults already applied"); return; } - for (const baseUrl of ws.config.builtin.exchanges) { - await addPresetExchangeEntry(tx, baseUrl); - const now = AbsoluteTime.now(); - provideExchangeRecordInTx(ws, tx, baseUrl, now); + for (const exch of ws.config.builtin.exchanges) { + await addPresetExchangeEntry( + tx, + exch.exchangeBaseUrl, + exch.currencyHint, + ); } await tx.config.put({ key: ConfigRecordKey.CurrencyDefaultsApplied, @@ -1672,7 +1673,12 @@ export class Wallet { public static defaultConfig: Readonly = { builtin: { - exchanges: ["https://exchange.demo.taler.net/"], + exchanges: [ + { + exchangeBaseUrl: "https://exchange.demo.taler.net/", + currencyHint: "KUDOS", + }, + ], }, features: { allowHttp: false, -- cgit v1.2.3