feat: account backup

---

Co-authored-by: @schowdhuri 
Reviewed-by: @schowdhuri
This commit is contained in:
Ahmed Bouhuolia 2022-05-26 21:04:14 +02:00 committed by GitHub
parent ad493f5147
commit 500be9a7fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 443 additions and 11 deletions

View file

@ -20,6 +20,7 @@ interface Exposed {
readonly nodeCrypto: Readonly<typeof import("./src/nodeCrypto").nodeCrypto>;
readonly versions: Readonly<typeof import("./src/versions").versions>;
readonly electronStore: Readonly<typeof import("./src/store").store>;
readonly haveno: Readonly<typeof import("./src/haveno").store>;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface

View file

@ -0,0 +1,31 @@
// =============================================================================
// Copyright 2022 Haveno
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
import { ipcRenderer } from "electron";
import { exposeInMainWorld } from "./exposeInMainWorld";
import type { DownloadBackupInput } from "./types";
import { IpcChannels } from "./types";
// Export for types in contracts.d.ts
export const haveno = {
downloadBackup: async (data: DownloadBackupInput): Promise<void> =>
ipcRenderer.invoke(IpcChannels.DownloadBackup, data),
getBackupData: async (): Promise<Uint8Array> =>
ipcRenderer.invoke(IpcChannels.RestoreBackup),
};
exposeInMainWorld("haveno", haveno);

View file

@ -21,3 +21,4 @@
import "./nodeCrypto";
import "./versions";
import "./store";
import "./haveno";