From 3f2db7707fdf4eb4c1dfdb527d5726dd1694e126 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 25 Oct 2022 12:23:08 -0300 Subject: using new wallet api (typed interface) --- .../taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx') diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx b/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx index 859a7f86b..a0c62787a 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx @@ -18,11 +18,12 @@ import { canonicalizeBaseUrl, TalerConfigResponse, } from "@gnu-taler/taler-util"; +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; import { queryToSlashKeys } from "../utils/index.js"; -import * as wxApi from "../wxApi.js"; +import { wxApi } from "../wxApi.js"; import { ExchangeAddConfirmPage } from "./ExchangeAddConfirm.js"; import { ExchangeSetUrlPage } from "./ExchangeSetUrl.js"; @@ -36,7 +37,9 @@ export function ExchangeAddPage({ currency, onBack }: Props): VNode { { url: string; config: TalerConfigResponse } | undefined >(undefined); - const knownExchangesResponse = useAsyncAsHook(wxApi.listExchanges); + const knownExchangesResponse = useAsyncAsHook(() => + wxApi.wallet.call(WalletApiOperation.ListExchanges, {}), + ); const knownExchanges = !knownExchangesResponse ? [] : knownExchangesResponse.hasError @@ -72,7 +75,7 @@ export function ExchangeAddPage({ currency, onBack }: Props): VNode { url={verifying.url} onCancel={onBack} onConfirm={async () => { - await wxApi.addExchange({ + await wxApi.wallet.call(WalletApiOperation.AddExchange, { exchangeBaseUrl: canonicalizeBaseUrl(verifying.url), forceUpdate: true, }); -- cgit v1.2.3