diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 04:16:12 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 04:16:12 +0200 |
commit | d5bba630a35fff72b11273fb5e62c2208f9e1f5b (patch) | |
tree | 3397a580d663161be1ba7c46df368ac10d566cdc /src/webex/wxBackend.ts | |
parent | 419a05e801da688a1d0917a6bf16d468e6362a3d (diff) |
implement returning coins to user's account
Diffstat (limited to 'src/webex/wxBackend.ts')
-rw-r--r-- | src/webex/wxBackend.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/webex/wxBackend.ts b/src/webex/wxBackend.ts index 261477386..974bcb3c2 100644 --- a/src/webex/wxBackend.ts +++ b/src/webex/wxBackend.ts @@ -32,12 +32,13 @@ import { } from "../query"; import { AmountJson, + ConfirmReserveRequest, + CreateReserveRequest, Notifier, ProposalRecord, + ReturnCoinsRequest, } from "../types"; import { - ConfirmReserveRequest, - CreateReserveRequest, Stores, WALLET_DB_VERSION, Wallet, @@ -278,6 +279,18 @@ function handleMessage(sender: MessageSender, } return needsWallet().paymentSucceeded(contractTermsHash, merchantSig); } + case "get-sender-wire-infos": { + return needsWallet().getSenderWireInfos(); + } + case "return-coins": { + const d = { + amount: detail.amount, + exchange: detail.exchange, + senderWire: detail.senderWire, + }; + const req = ReturnCoinsRequest.checked(d); + return needsWallet().returnCoins(req); + } case "check-upgrade": { let dbResetRequired = false; if (!currentWallet) { |