diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-28 14:22:35 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-28 14:22:35 +0530 |
commit | 4365cd6401713b2e207d8c032c0558487e860154 (patch) | |
tree | f66b4bc5aa9dd7e92b72546e0b2fe79c18ed6573 /src/webex/wxApi.ts | |
parent | 472307a607b046e32f50b05a8be44c47c4b153d4 (diff) | |
download | wallet-core-4365cd6401713b2e207d8c032c0558487e860154.tar.xz |
towards the new withdrawal API (temporarily breaks WebExtension wallet)
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r-- | src/webex/wxApi.ts | 28 |
1 files changed, 6 insertions, 22 deletions
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<T extends MessageType>( - type: T, - detail: MessageMap[T]["request"], -): Promise<MessageMap[T]["response"]> { - return new Promise<MessageMap[T]["response"]>((resolve, reject) => { +async function callBackend( + type: string, + detail: any, +): Promise<any> { + return new Promise<any>((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<SenderWireInfos> { export function returnCoins(args: { amount: AmountJson; exchange: string; - senderWire: object; + senderWire: string; }): Promise<void> { return callBackend("return-coins", args); } @@ -259,19 +256,6 @@ export function benchmarkCrypto(repetitions: number): Promise<BenchmarkResult> { } /** - * Get details about a withdraw operation. - */ -export function getWithdrawDetails( - talerWithdrawUri: string, - maybeSelectedExchange: string | undefined, -): Promise<WithdrawalDetailsResponse> { - return callBackend("get-withdraw-details", { - talerWithdrawUri, - maybeSelectedExchange, - }); -} - -/** * Get details about a pay operation. */ export function preparePay(talerPayUri: string): Promise<PreparePayResult> { |