From defbf625bdef0f8a666b72b8ce99de5e01af6b91 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 29 Aug 2019 23:12:55 +0200 Subject: url-based pay/withdraw, use react hooks --- src/webex/wxApi.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/webex/wxApi.ts') diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts index 4f7500368..feabc7819 100644 --- a/src/webex/wxApi.ts +++ b/src/webex/wxApi.ts @@ -79,6 +79,8 @@ export interface UpgradeResponse { export class WalletApiError extends Error { constructor(message: string, public detail: any) { super(message); + // restore prototype chain + Object.setPrototypeOf(this, new.target.prototype); } } @@ -401,3 +403,24 @@ export function abortFailedPayment(contractTermsHash: string) { 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) { + return callBackend("get-withdraw-details", { talerWithdrawUri, maybeSelectedExchange }); +} + +/** + * Get details about a pay operation. + */ +export function preparePay(talerPayUri: string) { + return callBackend("prepare-pay", { talerPayUri }); +} + +/** + * Get details about a withdraw operation. + */ +export function acceptWithdrawal(talerWithdrawUri: string, selectedExchange: string) { + return callBackend("accept-withdrawal", { talerWithdrawUri, selectedExchange }); +} \ No newline at end of file -- cgit v1.2.3