summaryrefslogtreecommitdiff
path: root/src/webex/wxApi.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-29 23:12:55 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-29 23:12:55 +0200
commitdefbf625bdef0f8a666b72b8ce99de5e01af6b91 (patch)
tree1bfe7c1ae0b56721d764893f62aca17271a20dbd /src/webex/wxApi.ts
parent1390175a9afc53948dd1d6f8a2f88e51c1bf53cc (diff)
downloadwallet-core-defbf625bdef0f8a666b72b8ce99de5e01af6b91.tar.gz
wallet-core-defbf625bdef0f8a666b72b8ce99de5e01af6b91.tar.bz2
wallet-core-defbf625bdef0f8a666b72b8ce99de5e01af6b91.zip
url-based pay/withdraw, use react hooks
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r--src/webex/wxApi.ts23
1 files changed, 23 insertions, 0 deletions
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<BenchmarkResult> {
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