UNPKG

@trezor/connect

Version:

High-level javascript interface for Trezor hardware wallet.

40 lines (39 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const protobuf_1 = require("@trezor/protobuf"); const schema_utils_1 = require("@trezor/schema-utils"); const AbstractMethod_1 = require("../core/AbstractMethod"); class BackupDevice extends AbstractMethod_1.AbstractMethod { init() { this.requiredPermissions = ['management']; this.skipFinalReload = false; this.useDeviceState = false; const { payload } = this; (0, schema_utils_1.Assert)(protobuf_1.MessagesSchema.BackupDevice, payload); this.params = { group_threshold: payload.group_threshold, groups: payload.groups }; } get confirmation() { return { view: 'device-management', customConfirmButton: { className: 'confirm', label: 'Proceed' }, label: 'Do you want to initiate backup procedure?' }; } async run() { const cmd = this.device.getCommands(); const response = await cmd.typedCall('BackupDevice', 'Success', this.params); return response.message; } } exports.default = BackupDevice; //# sourceMappingURL=backupDevice.js.map