summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 2f94d5e82..3d83ec21d 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -45,6 +45,7 @@ import {
PaytoUri,
codecForGetFeeForDeposit,
codecForListKnownBankAccounts,
+ codecForImportDbRequest,
} from "@gnu-taler/taler-util";
import {
addBackupProvider,
@@ -130,6 +131,7 @@ import {
AuditorTrustRecord,
CoinSourceType,
exportDb,
+ importDb,
ReserveRecordStatus,
WalletStoresV1,
} from "./db.js";
@@ -997,6 +999,11 @@ async function dispatchRequestInternal(
const dbDump = await exportDb(ws.db.idbHandle());
return dbDump;
}
+ case "importDb": {
+ const req = codecForImportDbRequest().decode(payload);
+ await importDb(ws.db.idbHandle(), req.dump);
+ return [];
+ }
}
throw OperationFailedError.fromCode(
TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN,