summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-05-25 12:19:00 +0200
committerFlorian Dold <florian@dold.me>2023-05-25 12:19:00 +0200
commita4112bae9edd509ea66984b950c23fcbfedb66fb (patch)
treea7315770569150b7f37c535cb969c9eb70193a29 /packages/taler-wallet-core/src
parent0b4d900088d3a319c23ce228bfd5cf286dbb44e8 (diff)
downloadwallet-core-a4112bae9edd509ea66984b950c23fcbfedb66fb.tar.gz
wallet-core-a4112bae9edd509ea66984b950c23fcbfedb66fb.tar.bz2
wallet-core-a4112bae9edd509ea66984b950c23fcbfedb66fb.zip
wallet-core: implement request to return sample transactions
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r--packages/taler-wallet-core/src/wallet-api-types.ts11
-rw-r--r--packages/taler-wallet-core/src/wallet.ts4
2 files changed, 14 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts
index 928831ed5..21a228b64 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -133,6 +133,7 @@ export enum WalletApiOperation {
AddExchange = "addExchange",
GetTransactions = "getTransactions",
GetTransactionById = "getTransactionById",
+ TestingGetSampleTransactions = "testingGetSampleTransactions",
ListExchanges = "listExchanges",
ListKnownBankAccounts = "listKnownBankAccounts",
AddKnownBankAccounts = "addKnownBankAccounts",
@@ -285,6 +286,15 @@ export type GetTransactionsOp = {
response: TransactionsResponse;
};
+/**
+ * Get sample transactions.
+ */
+export type TestingGetSampleTransactionsOp = {
+ op: WalletApiOperation.TestingGetSampleTransactions;
+ request: EmptyObject;
+ response: TransactionsResponse;
+};
+
export type GetTransactionByIdOp = {
op: WalletApiOperation.GetTransactionById;
request: TransactionByIdRequest;
@@ -932,6 +942,7 @@ export type WalletOperations = {
[WalletApiOperation.GetBalances]: GetBalancesOp;
[WalletApiOperation.GetBalanceDetail]: GetBalancesDetailOp;
[WalletApiOperation.GetTransactions]: GetTransactionsOp;
+ [WalletApiOperation.TestingGetSampleTransactions]: TestingGetSampleTransactionsOp;
[WalletApiOperation.GetTransactionById]: GetTransactionByIdOp;
[WalletApiOperation.RetryPendingNow]: RetryPendingNowOp;
[WalletApiOperation.GetPendingOperations]: GetPendingTasksOp;
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index da9445602..b20791241 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -113,6 +113,7 @@ import {
j2s,
parsePayTemplateUri,
parsePaytoUri,
+ sampleWalletCoreTransactions,
validateIban,
} from "@gnu-taler/taler-util";
import {
@@ -1241,6 +1242,8 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>(
await setCoinSuspended(ws, req.coinPub, req.suspended);
return {};
}
+ case WalletApiOperation.TestingGetSampleTransactions:
+ return { transactions: sampleWalletCoreTransactions };
case WalletApiOperation.ForceRefresh: {
const req = codecForForceRefreshRequest().decode(payload);
if (req.coinPubList.length == 0) {
@@ -1507,7 +1510,6 @@ export function getVersion(ws: InternalWalletState): WalletCoreVersion {
return version;
}
-
/**
* Handle a request to the wallet-core API.
*/