diff options
author | Florian Dold <florian@dold.me> | 2023-06-26 12:57:00 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-26 12:57:00 +0200 |
commit | 4b61945f6b7b073acf5de825b7678bddc56ad5d0 (patch) | |
tree | ae4cc6d49ea934f34ce0a5b37c18975be24ff0fa /packages/taler-wallet-core | |
parent | eae357160760fba990f705b092e30a0eec6f7b29 (diff) | |
download | wallet-core-4b61945f6b7b073acf5de825b7678bddc56ad5d0.tar.xz |
wallet-core: return numCoins in checkPeerPullCredit response
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts index 5baba8cdc..c0b728567 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer-pull-credit.ts @@ -649,10 +649,16 @@ export async function checkPeerPullPaymentInitiation( logger.trace(`got withdrawal info`); + let numCoins = 0; + for (let i = 0; i < wi.selectedDenoms.selectedDenoms.length; i++) { + numCoins += wi.selectedDenoms.selectedDenoms[i].count; + } + return { exchangeBaseUrl: exchangeUrl, amountEffective: wi.withdrawalAmountEffective, amountRaw: req.amount, + numCoins, }; } |