diff options
author | Florian Dold <florian@dold.me> | 2024-05-15 23:47:00 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-05-15 23:47:00 +0200 |
commit | ca3234b53f8d28ff9cc41af68a0057eaecf69df2 (patch) | |
tree | 4f35eef59ed65a0b4daf4dcae5876b1d008b4e30 /packages/taler-wallet-webextension | |
parent | 6529421a5c09dec082f33ea80b1df2861e0bf5c9 (diff) |
wallet-core: phase out support for public key in taler://withdraw-exchange URI
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/state.ts | 1 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx | 121 |
2 files changed, 63 insertions, 59 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 044f2434f..0b36be1fd 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -55,7 +55,6 @@ export function useComponentStateFromParams({ if (exchangeByTalerUri) { await api.wallet.call(WalletApiOperation.AddExchange, { exchangeBaseUrl: exchangeByTalerUri, - masterPub: uri.exchangePub, }); const info = await api.wallet.call( WalletApiOperation.GetExchangeDetailedInfo, diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx index 53380e263..7b6ac8895 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx @@ -19,12 +19,10 @@ import { Amounts, CoinDumpJson, CoinStatus, - ExchangeListItem, ExchangeTosStatus, LogLevel, NotificationType, ScopeType, - parseWithdrawUri, stringifyWithdrawExchange, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; @@ -32,10 +30,19 @@ import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { Fragment, VNode, h } from "preact"; import { useEffect, useRef, useState } from "preact/hooks"; +import { Pages } from "../NavigationBar.js"; import { Checkbox } from "../components/Checkbox.js"; import { SelectList } from "../components/SelectList.js"; import { Time } from "../components/Time.js"; -import { DestructiveText, LinkPrimary, NotifyUpdateFadeOut, SubTitle, SuccessText, WarningText } from "../components/styled/index.js"; +import { ActiveTasksTable } from "../components/WalletActivity.js"; +import { + DestructiveText, + LinkPrimary, + NotifyUpdateFadeOut, + SubTitle, + SuccessText, + WarningText, +} from "../components/styled/index.js"; import { useAlertContext } from "../context/alert.js"; import { useBackendContext } from "../context/backend.js"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; @@ -44,9 +51,6 @@ import { Button } from "../mui/Button.js"; import { Grid } from "../mui/Grid.js"; import { Paper } from "../mui/Paper.js"; import { TextField } from "../mui/TextField.js"; -import { Pages } from "../NavigationBar.js"; -import { CoinInfo } from "@gnu-taler/taler-wallet-core/dbless"; -import { ActiveTasksTable } from "../components/WalletActivity.js"; type CoinsInfo = CoinDumpJson["coins"]; type CalculatedCoinfInfo = { @@ -72,7 +76,7 @@ function hashObjectId(o: any): string { return JSON.stringify(o); } -export function DeveloperPage({ }: Props): VNode { +export function DeveloperPage({}: Props): VNode { const { i18n } = useTranslationContext(); const [downloadedDatabase, setDownloadedDatabase] = useState< { time: Date; content: string } | undefined @@ -110,8 +114,8 @@ export function DeveloperPage({ }: Props): VNode { useEffect(() => { return api.listener.onUpdateNotification(listenAllEvents, (ev) => { - console.log("event", ev) - return hook?.retry() + console.log("event", ev); + return hook?.retry(); }); }); @@ -275,7 +279,6 @@ export function DeveloperPage({ }: Props): VNode { })} /> - <SubTitle> <i18n.Translate>Exchange Entries</i18n.Translate> </SubTitle> @@ -336,19 +339,31 @@ export function DeveloperPage({ }: Props): VNode { ); } } - const uri = !e.masterPub ? undefined : stringifyWithdrawExchange({ - exchangeBaseUrl: e.exchangeBaseUrl, - exchangePub: e.masterPub, - }); + const uri = !e.masterPub + ? undefined + : stringifyWithdrawExchange({ + exchangeBaseUrl: e.exchangeBaseUrl, + }); return ( <tr key={idx}> <td> <a href={!uri ? undefined : Pages.defaultCta({ uri })}> - {e.scopeInfo ? `${e.scopeInfo.currency} (${e.scopeInfo.type === ScopeType.Global ? "global" : "regional"})` : e.currency} + {e.scopeInfo + ? `${e.scopeInfo.currency} (${ + e.scopeInfo.type === ScopeType.Global + ? "global" + : "regional" + })` + : e.currency} </a> </td> <td> - <a href={new URL(`/keys`, e.exchangeBaseUrl).href} target="_blank">{e.exchangeBaseUrl}</a> + <a + href={new URL(`/keys`, e.exchangeBaseUrl).href} + target="_blank" + > + {e.exchangeBaseUrl} + </a> </td> <td> {e.exchangeEntryStatus} / {e.exchangeUpdateStatus} @@ -359,10 +374,10 @@ export function DeveloperPage({ }: Props): VNode { <td> {e.lastUpdateTimestamp ? AbsoluteTime.toIsoString( - AbsoluteTime.fromPreciseTimestamp( - e.lastUpdateTimestamp, - ), - ) + AbsoluteTime.fromPreciseTimestamp( + e.lastUpdateTimestamp, + ), + ) : "never"} </td> <td> @@ -381,31 +396,25 @@ export function DeveloperPage({ }: Props): VNode { </button> <button onClick={() => { - api.wallet.call( - WalletApiOperation.DeleteExchange, - { - exchangeBaseUrl: e.exchangeBaseUrl, - }, - ); + api.wallet.call(WalletApiOperation.DeleteExchange, { + exchangeBaseUrl: e.exchangeBaseUrl, + }); }} > Delete </button> <button onClick={() => { - api.wallet.call( - WalletApiOperation.DeleteExchange, - { - exchangeBaseUrl: e.exchangeBaseUrl, - purge: true, - }, - ); + api.wallet.call(WalletApiOperation.DeleteExchange, { + exchangeBaseUrl: e.exchangeBaseUrl, + purge: true, + }); }} > Purge </button> - {e.scopeInfo && e.masterPub && e.currency ? - (e.scopeInfo.type === ScopeType.Global ? + {e.scopeInfo && e.masterPub && e.currency ? ( + e.scopeInfo.type === ScopeType.Global ? ( <button onClick={() => { api.wallet.call( @@ -418,30 +427,27 @@ export function DeveloperPage({ }: Props): VNode { ); }} > - Make regional </button> - : e.scopeInfo.type === ScopeType.Auditor ? - undefined - - : e.scopeInfo.type === ScopeType.Exchange ? - <button - onClick={() => { - api.wallet.call( - WalletApiOperation.AddGlobalCurrencyExchange, - { - exchangeBaseUrl: e.exchangeBaseUrl, - currency: e.currency!, - exchangeMasterPub: e.masterPub!, - }, - ); - }} - > - - Make global - </button> - : undefined) : undefined - } + ) : e.scopeInfo.type === + ScopeType.Auditor ? undefined : e.scopeInfo.type === + ScopeType.Exchange ? ( + <button + onClick={() => { + api.wallet.call( + WalletApiOperation.AddGlobalCurrencyExchange, + { + exchangeBaseUrl: e.exchangeBaseUrl, + currency: e.currency!, + exchangeMasterPub: e.masterPub!, + }, + ); + }} + > + Make global + </button> + ) : undefined + ) : undefined} <button onClick={() => { api.wallet.call( @@ -469,7 +475,6 @@ export function DeveloperPage({ }: Props): VNode { </LinkPrimary> </div> - <Paper style={{ padding: 10, margin: 10 }}> <h3>Logging</h3> <div> |