aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-10-25 12:23:08 -0300
committerSebastian <sebasjm@gmail.com>2022-10-25 12:23:52 -0300
commit3f2db7707fdf4eb4c1dfdb527d5726dd1694e126 (patch)
tree4366d443db56eb200ba29760bf1f4a0b9def6c97 /packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts
parent587674dd10bd714b68ff5a6e836eb21113c0337a (diff)
downloadwallet-core-3f2db7707fdf4eb4c1dfdb527d5726dd1694e126.tar.xz
using new wallet api (typed interface)
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts')
-rw-r--r--packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts8
1 files changed, 4 insertions, 4 deletions
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 extends object> = S | (() => RecursiveState<S>);
@@ -31,7 +31,7 @@ export function useComponentState(
): RecursiveState<State> {
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<void> {
try {
- const resp = await api.initiatePeerPullPayment({
+ const resp = await api.wallet.call(WalletApiOperation.InitiatePeerPullPayment, {
amount: Amounts.stringify(amount),
exchangeBaseUrl: exchange.exchangeBaseUrl,
partialContractTerms: {