Skip to content

Commit

Permalink
Add methods to restore backup
Browse files Browse the repository at this point in the history
  • Loading branch information
tmalahie committed Dec 7, 2024
1 parent f727907 commit fae5cfa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ exports.generateKeys = function generateKeys(bitcoinNetwork) {
return JSON.parse(lib.rgblib_generate_keys(bitcoinNetwork));
};

exports.restoreBackup = function (backupPath, password, targetDir) {
validateTypes(
{ backupPath, password, targetDir },
{ backupPath: "string", password: "string", targetDir: "string" },
);
lib.rgblib_restore_backup(backupPath, password, targetDir);
}

exports.restoreKeys = function (bitcoinNetwork, mnemonic) {
validateEnumValues(
{ bitcoinNetwork },
Expand Down Expand Up @@ -217,6 +225,16 @@ exports.Wallet = class Wallet {
this.wallet = null;
}

backup(backupPath, password) {
const params = { backupPath, password };
const expectedTypes = {
backupPath: "string",
password: "string",
};
validateTypes(params, expectedTypes);
lib.rgblib_backup(this.wallet, backupPath, password);
}

blindReceive(
assetId,
amount,
Expand Down

0 comments on commit fae5cfa

Please sign in to comment.