diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-04-27 06:03:04 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-04-27 06:03:04 +0200 |
commit | d0a4f9f934cea5bbb3da90ea13ccf91d9fb1c933 (patch) | |
tree | 4c54834cd27034b91a7dc521472c14c190321dec /lib/wallet/wxMessaging.ts | |
parent | b8ac91dbf9a89c7dad0a255154cf1b025c85648a (diff) | |
download | wallet-core-d0a4f9f934cea5bbb3da90ea13ccf91d9fb1c933.tar.xz |
UI fixes
Diffstat (limited to 'lib/wallet/wxMessaging.ts')
-rw-r--r-- | lib/wallet/wxMessaging.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/wallet/wxMessaging.ts b/lib/wallet/wxMessaging.ts index 64b16de8d..164342f4e 100644 --- a/lib/wallet/wxMessaging.ts +++ b/lib/wallet/wxMessaging.ts @@ -99,6 +99,24 @@ function makeHandlers(db: IDBDatabase, return wallet.confirmPay(offer); }, + ["check-pay"]: function(detail, sender) { + let offer; + try { + offer = Offer.checked(detail.offer); + } catch (e) { + if (e instanceof Checkable.SchemaError) { + console.error("schema error:", e.message); + return Promise.resolve({ + error: "invalid contract", + hint: e.message, + detail: detail + }); + } else { + throw e; + } + } + return wallet.checkPay(offer); + }, ["execute-payment"]: function(detail, sender) { return wallet.executePayment(detail.H_contract); }, |