Contents

importDbFromFile#

Import the database from a JSON or SQLite file. Caution: this overrides existing data.

Request:

The request arguments must be an ImportDbFromFileRequest object.

Response:

On success, the result is an empty object.

Side effects:

Replaces the entire contents of the wallet database with the dump read from the given file.

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 path must end in .json or .sqlite3; other files are rejected with WALLET_CORE_API_BAD_REQUEST, as is a file that cannot be read. The progressToken behaves as for importDb.

interface ImportDbFromFileRequest {
  // Full path to a .json or .sqlite3 backup.
  path: string;

  // Correlates progress notifications and allows cancellation.
  progressToken?: string;
}