aboutsummaryrefslogtreecommitdiff
path: root/src/webex/wxApi.ts
diff options
context:
space:
mode:
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 });
}