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) --- packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts') diff --git a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts index 205a664e0..d845e121a 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts @@ -16,11 +16,11 @@ /* eslint-disable react-hooks/rules-of-hooks */ import { Amounts, TalerErrorDetail } from "@gnu-taler/taler-util"; -import { TalerError } from "@gnu-taler/taler-wallet-core"; +import { TalerError, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useState } from "preact/hooks"; import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js"; import { useSelectedExchange } from "../../hooks/useSelectedExchange.js"; -import * as wxApi from "../../wxApi.js"; +import { wxApi } from "../../wxApi.js"; import { Props, State } from "./index.js"; type RecursiveState = S | (() => RecursiveState); @@ -31,7 +31,7 @@ export function useComponentState( ): RecursiveState { const amount = Amounts.parseOrThrow(amountStr); - const hook = useAsyncAsHook(api.listExchanges); + const hook = useAsyncAsHook(() => api.wallet.call(WalletApiOperation.ListExchanges, {})); if (!hook) { return { @@ -69,7 +69,7 @@ export function useComponentState( async function accept(): Promise { try { - const resp = await api.initiatePeerPullPayment({ + const resp = await api.wallet.call(WalletApiOperation.InitiatePeerPullPayment, { amount: Amounts.stringify(amount), exchangeBaseUrl: exchange.exchangeBaseUrl, partialContractTerms: { -- cgit v1.2.3