aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/transactions.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-08-24 22:42:30 +0200
committerFlorian Dold <florian@dold.me>2022-08-24 22:42:30 +0200
commitf3231ccdf9a2ce944bdc039fa8351117d18c3fe3 (patch)
tree09526df32c6c234eb9cfcc85ee6221c3f36a12f2 /packages/taler-wallet-core/src/operations/transactions.ts
parenta11ac57535b0375f152ce115ee541cb8aca98e84 (diff)
downloadwallet-core-f3231ccdf9a2ce944bdc039fa8351117d18c3fe3.tar.xz
wallet-core: put taler:// URIs in transactions list
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts26
1 files changed, 21 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index 62df996c3..8eff945c5 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -21,6 +21,8 @@ import {
AbsoluteTime,
AmountJson,
Amounts,
+ constructPayPullUri,
+ constructPayPushUri,
Logger,
OrderShortInfo,
PaymentStatus,
@@ -156,6 +158,10 @@ export async function getTransactions(
frozen: false,
pending: !pi.purseCreated,
timestamp: pi.timestampCreated,
+ talerUri: constructPayPushUri({
+ exchangeBaseUrl: pi.exchangeBaseUrl,
+ contractPriv: pi.contractPriv,
+ }),
transactionId: makeEventId(
TransactionType.PeerPushDebit,
pi.pursePub,
@@ -203,7 +209,7 @@ export async function getTransactions(
return;
}
let withdrawalDetails: WithdrawalDetails;
- if (wsr.withdrawalType === WithdrawalRecordType.PeerPullCredit) {
+ if (wsr.wgInfo.withdrawalType === WithdrawalRecordType.PeerPullCredit) {
transactions.push({
type: TransactionType.PeerPullCredit,
amountEffective: Amounts.stringify(wsr.denomsSel.totalCoinValue),
@@ -211,6 +217,10 @@ export async function getTransactions(
exchangeBaseUrl: wsr.exchangeBaseUrl,
pending: !wsr.timestampFinish,
timestamp: wsr.timestampStart,
+ talerUri: constructPayPullUri({
+ exchangeBaseUrl: wsr.exchangeBaseUrl,
+ contractPriv: wsr.wgInfo.contractPriv,
+ }),
transactionId: makeEventId(
TransactionType.PeerPullCredit,
wsr.withdrawalGroupId,
@@ -219,7 +229,9 @@ export async function getTransactions(
...(wsr.lastError ? { error: wsr.lastError } : {}),
});
return;
- } else if (wsr.withdrawalType === WithdrawalRecordType.PeerPushCredit) {
+ } else if (
+ wsr.wgInfo.withdrawalType === WithdrawalRecordType.PeerPushCredit
+ ) {
transactions.push({
type: TransactionType.PeerPushCredit,
amountEffective: Amounts.stringify(wsr.denomsSel.totalCoinValue),
@@ -235,12 +247,16 @@ export async function getTransactions(
...(wsr.lastError ? { error: wsr.lastError } : {}),
});
return;
- } else if (wsr.bankInfo) {
+ } else if (
+ wsr.wgInfo.withdrawalType === WithdrawalRecordType.BankIntegrated
+ ) {
withdrawalDetails = {
type: WithdrawalType.TalerBankIntegrationApi,
- confirmed: wsr.bankInfo.timestampBankConfirmed ? true : false,
+ confirmed: wsr.wgInfo.bankInfo.timestampBankConfirmed
+ ? true
+ : false,
reservePub: wsr.reservePub,
- bankConfirmationUrl: wsr.bankInfo.confirmUrl,
+ bankConfirmationUrl: wsr.wgInfo.bankInfo.confirmUrl,
};
} else {
const exchangeDetails = await getExchangeDetails(