- importDb#
Import a wallet database dump, replacing the current database contents.
Request:
The request arguments must be an ImportDbRequest object.
Response:
On success, the result is an empty object.
Side effects:
Replaces the entire contents of the wallet database with the imported dump.
Expected errors:
The caller can handle the following errors inline:
WALLET_DB_BACKEND_UNSUPPORTED,WALLET_CORE_API_BAD_REQUEST,WALLET_CORE_REQUEST_CANCELLED.Details:
The format of
dump(JSON or SQLite) is detected automatically. Adumpthat does not look like a valid wallet database dump is rejected withWALLET_CORE_API_BAD_REQUEST; if the active database backend cannot import the dump’s format, the request fails withWALLET_DB_BACKEND_UNSUPPORTED. WhenprogressTokenis set, progress is reported via notifications and the import can be cancelled with cancelProgressToken; a cancelled import fails withWALLET_CORE_REQUEST_CANCELLED. After a successful import, all in-memory caches (exchange, denomination and refresh-cost data) are cleared, and the imported records are used to recompute the derived transaction view.
interface ImportDbRequest {
dump?: any;
// Correlates progress notifications and allows cancellation.
progressToken?: string;
}