aboutsummaryrefslogtreecommitdiff
path: root/src/webex/wxApi.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-29 16:27:53 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-29 16:27:53 +0200
commit1c3346cd534143f4dd56a625b963a1a3acfa83d1 (patch)
treee7c3571e63e35f745571b606e1d0db9bc80f6675 /src/webex/wxApi.ts
parentd0e0c6baf274aab378233a7ae0d67307c03b3a7c (diff)
downloadwallet-core-1c3346cd534143f4dd56a625b963a1a3acfa83d1.tar.xz
less ad-hoc messaging, fix some lint warnings
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r--src/webex/wxApi.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts
index e5a502406..c120f34e7 100644
--- a/src/webex/wxApi.ts
+++ b/src/webex/wxApi.ts
@@ -24,10 +24,13 @@
*/
import {
AmountJson,
+ CheckPayResult,
+ ConfirmPayResult,
CoinRecord,
CurrencyRecord,
DenominationRecord,
ExchangeRecord,
+ OfferRecord,
PreCoinRecord,
ReserveCreationInfo,
ReserveRecord,
@@ -172,3 +175,26 @@ export async function refresh(coinPub: string): Promise<void> {
export async function payback(coinPub: string): Promise<void> {
return await callBackend("payback-coin", { coinPub });
}
+
+/**
+ * Get an offer stored in the wallet by its offer id.
+ * Note that the numeric offer id is not to be confused with
+ * the string order_id from the contract terms.
+ */
+export async function getOffer(offerId: number) {
+ return await callBackend("get-offer", { offerId });
+}
+
+/**
+ * Check if payment is possible or already done.
+ */
+export async function checkPay(offer: OfferRecord): Promise<CheckPayResult> {
+ return await callBackend("check-pay", { offer });
+}
+
+/**
+ * Pay for an offer.
+ */
+export async function confirmPay(offer: OfferRecord): Promise<ConfirmPayResult> {
+ return await callBackend("confirm-pay", { offer });
+}