summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-10-02 23:24:06 +0200
committerFlorian Dold <florian@dold.me>2023-10-02 23:24:06 +0200
commit8e70b89593a375bb19432e6521daed618ae779f5 (patch)
treec44131dcd82f7b58244611fab1dc85c44b847899 /packages/taler-wallet-core/src/wallet.ts
parent671bbf29548e2ec078b29e75e368d77ee7bdb81f (diff)
downloadwallet-core-8e70b89593a375bb19432e6521daed618ae779f5.tar.gz
wallet-core-8e70b89593a375bb19432e6521daed618ae779f5.tar.bz2
wallet-core-8e70b89593a375bb19432e6521daed618ae779f5.zip
wallet-core: currency hint for preset exchanges
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts18
1 files changed, 12 insertions, 6 deletions
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<void> {
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<WalletConfig> = {
builtin: {
- exchanges: ["https://exchange.demo.taler.net/"],
+ exchanges: [
+ {
+ exchangeBaseUrl: "https://exchange.demo.taler.net/",
+ currencyHint: "KUDOS",
+ },
+ ],
},
features: {
allowHttp: false,