@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
19 lines • 822 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const errors_1 = require("@ledgerhq/errors");
/**
* Specify a new name for a device. This is technically supported on all models
* but only allowed on LNX and Stax currently. There are some FW version based
* limitations on the max length to account for but these are enforced at the
* command user level.
*/
exports.default = async (transport, name) => {
await transport.send(0xe0, 0xd4, 0x00, 0x00, Buffer.from(name)).catch(e => {
if (e.statusCode === errors_1.StatusCodes.CONDITIONS_OF_USE_NOT_SATISFIED ||
e.statusCode === errors_1.StatusCodes.USER_REFUSED_ON_DEVICE) {
throw new errors_1.UserRefusedDeviceNameChange();
}
throw e;
});
};
//# sourceMappingURL=editDeviceName.js.map