aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/wallet/History.tsx
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/wallet/History.tsx
parent587674dd10bd714b68ff5a6e836eb21113c0337a (diff)
downloadwallet-core-3f2db7707fdf4eb4c1dfdb527d5726dd1694e126.tar.xz
using new wallet api (typed interface)
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/History.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/wallet/History.tsx13
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx
index 53913501d..4b9c5c711 100644
--- a/packages/taler-wallet-webextension/src/wallet/History.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/History.tsx
@@ -20,6 +20,7 @@ import {
NotificationType,
Transaction,
} from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { Fragment, h, VNode } from "preact";
import { useEffect, useState } from "preact/hooks";
import { Loading } from "../components/Loading.js";
@@ -38,7 +39,7 @@ import { Button } from "../mui/Button.js";
import { NoBalanceHelp } from "../popup/NoBalanceHelp.js";
import DownloadIcon from "../svg/download_24px.svg";
import UploadIcon from "../svg/upload_24px.svg";
-import * as wxApi from "../wxApi.js";
+import { wxApi } from "../wxApi.js";
interface Props {
currency?: string;
@@ -52,16 +53,14 @@ export function HistoryPage({
}: Props): VNode {
const { i18n } = useTranslationContext();
const state = useAsyncAsHook(async () => ({
- b: await wxApi.getBalance(),
- tx: await wxApi.getTransactions(),
+ b: await wxApi.wallet.call(WalletApiOperation.GetBalances, {}),
+ tx: await wxApi.wallet.call(WalletApiOperation.GetTransactions, {}),
}));
useEffect(() => {
- return wxApi.onUpdateNotification(
+ return wxApi.listener.onUpdateNotification(
[NotificationType.WithdrawGroupFinished],
- () => {
- state?.retry();
- },
+ state?.retry,
);
});