aboutsummaryrefslogtreecommitdiff
path: root/src/webex/wxApi.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-31 13:27:12 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-31 13:27:12 +0200
commitc35b3be7957a90bd1e861c0502736aa1eb7acfbf (patch)
tree0d3277f26ac07131cf94f0600e055b191e88239f /src/webex/wxApi.ts
parentc3f47e8f5866838b8c58ad8762d636a2b3ec2217 (diff)
downloadwallet-core-c35b3be7957a90bd1e861c0502736aa1eb7acfbf.tar.xz
refund view
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r--src/webex/wxApi.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts
index d2e8c94f1..7e4d17e37 100644
--- a/src/webex/wxApi.ts
+++ b/src/webex/wxApi.ts
@@ -41,6 +41,7 @@ import {
SenderWireInfos,
TipStatus,
WalletBalance,
+ PurchaseDetails,
} from "../walletTypes";
import {
@@ -91,7 +92,7 @@ async function callBackend<T extends MessageType>(
return new Promise<MessageMap[T]["response"]>((resolve, reject) => {
chrome.runtime.sendMessage({ type, detail }, (resp) => {
if (typeof resp === "object" && resp && resp.error) {
- const e = new WalletApiError(resp.message, resp);
+ const e = new WalletApiError(resp.error.message, resp.error);
reject(e);
} else {
resolve(resp);
@@ -318,8 +319,8 @@ export function getReport(reportUid: string): Promise<any> {
* Look up a purchase in the wallet database from
* the contract terms hash.
*/
-export function getPurchase(contractTermsHash: string): Promise<PurchaseRecord> {
- return callBackend("get-purchase", { contractTermsHash });
+export function getPurchaseDetails(contractTermsHash: string): Promise<PurchaseDetails> {
+ return callBackend("get-purchase-details", { contractTermsHash });
}
@@ -356,7 +357,7 @@ export function downloadProposal(url: string): Promise<number> {
/**
* Download a refund and accept it.
*/
-export function acceptRefund(refundUrl: string): Promise<string> {
+export function applyRefund(refundUrl: string): Promise<string> {
return callBackend("accept-refund", { refundUrl });
}