From 4365cd6401713b2e207d8c032c0558487e860154 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 28 Jul 2020 14:22:35 +0530 Subject: towards the new withdrawal API (temporarily breaks WebExtension wallet) --- src/webex/wxApi.ts | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'src/webex/wxApi.ts') diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts index de37b3639..99a581007 100644 --- a/src/webex/wxApi.ts +++ b/src/webex/wxApi.ts @@ -37,14 +37,11 @@ import { WalletBalance, PurchaseDetails, WalletDiagnostics, - WithdrawalDetailsResponse, PreparePayResult, AcceptWithdrawalResponse, ExtendedPermissionsResponse, } from "../types/walletTypes"; -import { MessageMap, MessageType } from "./messages"; - /** * Response with information about available version upgrades. */ @@ -77,11 +74,11 @@ export class WalletApiError extends Error { } } -async function callBackend( - type: T, - detail: MessageMap[T]["request"], -): Promise { - return new Promise((resolve, reject) => { +async function callBackend( + type: string, + detail: any, +): Promise { + return new Promise((resolve, reject) => { chrome.runtime.sendMessage({ type, detail }, (resp) => { if (chrome.runtime.lastError) { console.log("Error calling backend"); @@ -206,7 +203,7 @@ export function getSenderWireInfos(): Promise { export function returnCoins(args: { amount: AmountJson; exchange: string; - senderWire: object; + senderWire: string; }): Promise { return callBackend("return-coins", args); } @@ -258,19 +255,6 @@ export function benchmarkCrypto(repetitions: number): Promise { return callBackend("benchmark-crypto", { repetitions }); } -/** - * Get details about a withdraw operation. - */ -export function getWithdrawDetails( - talerWithdrawUri: string, - maybeSelectedExchange: string | undefined, -): Promise { - return callBackend("get-withdraw-details", { - talerWithdrawUri, - maybeSelectedExchange, - }); -} - /** * Get details about a pay operation. */ -- cgit v1.2.3