aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-07-16 21:03:22 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-07-16 21:03:22 +0530
commitdd3a31f33dc54b475b204e15d8d0a5c5e2a70ee8 (patch)
treee005deb080e6bc915ce54201c3aecb2d16fea2df
parent041911a15f7ad7538fbd81dc4c6cc731b5cd39ab (diff)
transactions list
-rw-r--r--src/operations/transactions.ts14
-rw-r--r--src/types/transactions.ts8
2 files changed, 13 insertions, 9 deletions
diff --git a/src/operations/transactions.ts b/src/operations/transactions.ts
index f2845cb18..bcf7a9e68 100644
--- a/src/operations/transactions.ts
+++ b/src/operations/transactions.ts
@@ -36,6 +36,8 @@ import {
WithdrawalDetails,
} from "../types/transactions";
import { WithdrawalDetailsResponse } from "../types/walletTypes";
+import { Logger } from "../util/logging";
+import { addPaytoQueryParams } from "../util/payto";
/**
* Create an event ID from the type and the primary key for the event.
@@ -202,7 +204,6 @@ export async function getTransactions(
}
withdrawalDetails = {
type: WithdrawalType.ManualTransfer,
- reservePublicKey: r.reservePub,
exchangePaytoUris: exchange.wireInfo?.accounts.map((x) => x.payto_uri) ?? [],
};
}
@@ -261,10 +262,17 @@ export async function getTransactions(
// FIXME: report somehow
return;
}
+ const plainPaytoUris = exchange.wireInfo?.accounts.map((x) => x.payto_uri) ?? [];
+ if (!plainPaytoUris) {
+ // FIXME: report somehow
+ return;
+ }
withdrawalDetails = {
type: WithdrawalType.ManualTransfer,
- reservePublicKey: r.reservePub,
- exchangePaytoUris: exchange.wireInfo?.accounts.map((x) => x.payto_uri) ?? [],
+ exchangePaytoUris: plainPaytoUris.map((x) => addPaytoQueryParams(x, {
+ amount: Amounts.stringify(r.instructedAmount),
+ message: `Taler Withdrawal ${r.reservePub}`,
+ })),
};
}
transactions.push({
diff --git a/src/types/transactions.ts b/src/types/transactions.ts
index aa618cd4e..b87726bad 100644
--- a/src/types/transactions.ts
+++ b/src/types/transactions.ts
@@ -118,13 +118,9 @@ interface WithdrawalDetailsForManualTransfer {
type: WithdrawalType.ManualTransfer;
/**
- * Public key of the reserve that needs to be funded
- * manually.
- */
- reservePublicKey: string;
-
- /**
* Payto URIs that the exchange supports.
+ *
+ * Already contains the amount and message.
*/
exchangePaytoUris: string[];
}