diff options
author | Florian Dold <florian@dold.me> | 2023-06-21 08:17:25 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-21 08:17:25 +0200 |
commit | 9f8faed2d170a37efa0328e42c83e6e5717bf06c (patch) | |
tree | 6e6021dfe58a22aa8c4a56a097b1018fe69c674b /packages/taler-harness/src/harness/harness.ts | |
parent | 7dcfd02dae23fe2a6249893ae19ab59b8b5a09f5 (diff) | |
download | wallet-core-9f8faed2d170a37efa0328e42c83e6e5717bf06c.tar.xz |
harness: fix/modernize peer-to-peer-push
Diffstat (limited to 'packages/taler-harness/src/harness/harness.ts')
-rw-r--r-- | packages/taler-harness/src/harness/harness.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts index a2ff451d8..7b2f980cc 100644 --- a/packages/taler-harness/src/harness/harness.ts +++ b/packages/taler-harness/src/harness/harness.ts @@ -53,6 +53,9 @@ import { HarnessExchangeBankAccount, openPromise, WalletCoreApiClient, + WalletCoreRequestType, + WalletCoreResponseType, + WalletOperations, } from "@gnu-taler/taler-wallet-core"; import { deepStrictEqual } from "assert"; import axiosImp, { AxiosError } from "axios"; @@ -2247,6 +2250,16 @@ export class WalletClient { remoteWallet: RemoteWallet | undefined = undefined; private waiter: WalletNotificationWaiter = makeNotificationWaiter(); + async call<Op extends keyof WalletOperations>( + operation: Op, + payload: WalletCoreRequestType<Op>, + ): Promise<WalletCoreResponseType<Op>> { + if (!this.remoteWallet) { + throw Error("wallet not connected"); + } + const client = getClientFromRemoteWallet(this.remoteWallet); + return client.call(operation, payload); + } constructor(private args: WalletClientArgs) {} async connect(): Promise<void> { |