@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
23 lines • 856 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const errors_1 = require("../errors");
exports.default = async (transport, { abortTimeoutMs } = {}) => {
const r = await transport.send(0xb0, 0x01, 0x00, 0x00, undefined, undefined, { abortTimeoutMs });
let i = 0;
const format = r[i++];
if (format !== 1) {
throw new errors_1.GetAppAndVersionUnsupportedFormat("getAppAndVersion: format not supported");
}
const nameLength = r[i++];
const name = r.slice(i, (i += nameLength)).toString("ascii");
const versionLength = r[i++];
const version = r.slice(i, (i += versionLength)).toString("ascii");
const flagLength = r[i++];
const flags = r.slice(i, (i += flagLength));
return {
name,
version,
flags,
};
};
//# sourceMappingURL=getAppAndVersion.js.map