diff options
Diffstat (limited to 'packages/taler-harness/src/harness')
-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> { |