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/wallet.ts | |
parent | b8ac91dbf9a89c7dad0a255154cf1b025c85648a (diff) |
UI fixes
Diffstat (limited to 'lib/wallet/wallet.ts')
-rw-r--r-- | lib/wallet/wallet.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/wallet/wallet.ts b/lib/wallet/wallet.ts index dde7a8248..3c9f3ffed 100644 --- a/lib/wallet/wallet.ts +++ b/lib/wallet/wallet.ts @@ -522,6 +522,28 @@ export class Wallet { /** + * Add a contract to the wallet and sign coins, + * but do not send them yet. + */ + checkPay(offer: Offer): Promise<any> { + console.log("executing checkPay"); + return Promise.resolve().then(() => { + return this.getPossibleExchangeCoins(offer.contract.amount, + offer.contract.max_fee, + offer.contract.exchanges) + }).then((mcs) => { + if (Object.keys(mcs).length == 0) { + console.log("not confirming payment, insufficient coins"); + return { + error: "coins-insufficient", + }; + } + return {}; + }); + } + + + /** * Retrieve all necessary information for looking up the contract * with the given hash. */ |