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) --- .../src/components/ShowFullContractTermPopup.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx') diff --git a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx index 7c1d2c6fc..6461f76e3 100644 --- a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx +++ b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx @@ -14,7 +14,10 @@ GNU Taler; see the file COPYING. If not, see */ import { AbsoluteTime, Duration, Location } from "@gnu-taler/taler-util"; -import { WalletContractData } from "@gnu-taler/taler-wallet-core"; +import { + WalletApiOperation, + WalletContractData, +} from "@gnu-taler/taler-wallet-core"; import { styled } from "@linaria/react"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; @@ -26,9 +29,9 @@ import { useTranslationContext } from "../context/translation.js"; import { HookError, useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; import { ButtonHandler } from "../mui/handlers.js"; import { compose, StateViewMap } from "../utils/index.js"; -import * as wxApi from "../wxApi.js"; +import { wxApi } from "../wxApi.js"; import { Amount } from "./Amount.js"; -import { Link, LinkPrimary } from "./styled/index.js"; +import { Link } from "./styled/index.js"; const ContractTermsTable = styled.table` width: 100%; @@ -99,7 +102,9 @@ function useComponentState({ proposalId }: Props, api: typeof wxApi): State { const [show, setShow] = useState(false); const hook = useAsyncAsHook(async () => { if (!show) return undefined; - return await api.getContractTermsDetails(proposalId); + return await api.wallet.call(WalletApiOperation.GetContractTermsDetails, { + proposalId, + }); }, [show]); const hideHandler = { -- cgit v1.2.3