@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
21 lines • 724 B
JavaScript
import { GetAppAndVersionUnsupportedFormat } from "../errors";
export default async (transport) => {
const r = await transport.send(0xb0, 0x01, 0x00, 0x00);
let i = 0;
const format = r[i++];
if (format !== 1) {
throw new 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