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.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts
index 8a7bf8250..a1b0380b9 100644
--- a/src/webex/wxApi.ts
+++ b/src/webex/wxApi.ts
@@ -29,6 +29,7 @@ import {
DenominationRecord,
ExchangeRecord,
PreCoinRecord,
+ ProposalDownloadRecord,
PurchaseRecord,
ReserveRecord,
} from "../dbTypes";
@@ -71,8 +72,11 @@ export interface UpgradeResponse {
}
-async function callBackend<T extends MessageType>(type: T, detail: MessageMap[T]["request"]): Promise<any> {
- return new Promise<any>((resolve, reject) => {
+async function callBackend<T extends MessageType>(
+ type: T,
+ detail: MessageMap[T]["request"],
+): Promise<MessageMap[T]["response"]> {
+ return new Promise<MessageMap[T]["response"]>((resolve, reject) => {
chrome.runtime.sendMessage({ type, detail }, (resp) => {
if (resp && resp.error) {
reject(resp);
@@ -201,7 +205,7 @@ export function payback(coinPub: string): Promise<void> {
/**
* Get a proposal stored in the wallet by its proposal id.
*/
-export function getProposal(proposalId: number) {
+export function getProposal(proposalId: number): Promise<ProposalDownloadRecord | undefined> {
return callBackend("get-proposal", { proposalId });
}