{"size": 664, "ext": "js", "max_stars_repo_path": "packages/hw-app-btc/lib-es/getAppAndVersion.js", "max_stars_repo_name": "nicholasmueller/ledger-poc", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/hw-app-btc/lib-es/getAppAndVersion.js", "max_issues_repo_name": "nicholasmueller/ledger-poc", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/hw-app-btc/lib-es/getAppAndVersion.js", "max_forks_repo_name": "nicholasmueller/ledger-poc", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.2, "max_line_length": 68, "alphanum_fraction": 0.6656626506}
import invariant from "invariant";
import Transport from "@ledgerhq/hw-transport";
export const getAppAndVersion = async (transport) => {
  const r = await transport.send(0xb0, 0x01, 0x00, 0x00);
  let i = 0;
  const format = r[i++];
  invariant(format === 1, "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