diff options
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r-- | src/webex/wxApi.ts | 26 |
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 }); +} |