diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-08 10:27:26 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-08 10:27:26 +0200 |
commit | 2c90c1e9037455415f3a56fcfdb1e02283d4ee2c (patch) | |
tree | cdf22461eff3106df555bb4e9ac3ad2f633505c4 /lib/wallet/wallet.ts | |
parent | 12a12d883aae49a9dcedc8b487121b9926cff0fa (diff) | |
parent | dc83b85e85110eb7ed2e96ecdbcbb90b5a5620aa (diff) |
Merge branch 'master' of git+ssh://taler.net/var/git/wallet-webex
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. */ |