summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts b/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts
index 69f2a6028..d59501212 100644
--- a/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts
+++ b/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts
@@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import { HttpResponse } from "@gnu-taler/web-util/browser";
+import { OperationFailWithBody, OperationOk, OperationResult, TalerExchangeApi } from "@gnu-taler/taler-util";
import { ErrorAlertView } from "../../components/CurrentAlerts.js";
import { Loading } from "../../components/Loading.js";
import { ErrorAlert } from "../../context/alert.js";
@@ -22,7 +22,6 @@ import { TextFieldHandler } from "../../mui/handlers.js";
import { compose, StateViewMap } from "../../utils/index.js";
import { useComponentState } from "./state.js";
import { ConfirmView, VerifyView } from "./views.js";
-import { ExchangeListItem } from "@gnu-taler/taler-util";
export interface Props {
currency?: string;
@@ -35,6 +34,13 @@ export type State = State.Loading
| State.Confirm
| State.Verify;
+export type CheckExchangeErrors = {
+ "invalid-version": string;
+ "invalid-currency": string;
+ "already-active": void;
+ "invalid-protocol": void;
+}
+
export namespace State {
export interface Loading {
status: "loading";
@@ -64,8 +70,9 @@ export namespace State {
onAccept: () => Promise<void>;
url: TextFieldHandler,
+ loading: boolean;
knownExchanges: URL[],
- result: HttpResponse<{ currency_specification: { currency: string }, version: string }, unknown> | undefined,
+ result: OperationOk<TalerExchangeApi.ExchangeKeysResponse> | OperationFailWithBody<CheckExchangeErrors> | undefined,
expectedCurrency: string | undefined,
}
}