How to use the @ledgerhq/devices.getDeviceModel function in @ledgerhq/devices

To help you get started, weā€™ve selected a few @ledgerhq/devices examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledger-live-desktop / src / components / Onboarding / steps / SelectPIN / SelectPINRestoreNanoX.js View on Github external
render() {
    const { t } = this.props
    const device = getDeviceModel('nanoX')

    const stepsLedgerNano = [
      {
        key: 'step1',
        icon: {'1.'},
        desc: t('onboarding.selectPIN.restore.instructions.nanoX.step1', device),
      },
      {
        key: 'step2',
        icon: {'2.'},
        desc: t('onboarding.selectPIN.restore.instructions.nanoX.step2', device),
      },
      {
        key: 'step3',
        icon: {'3.'},
        desc: (
github LedgerHQ / ledger-live-common / src / apps / hw.js View on Github external
bytes: version.bytes,
            warning: version.warning,
            indexOfMarketCap
          });

          return app;
        })
        .filter(Boolean);

      log(
        "list-apps",
        `${installedList.length} apps installed. ${applicationsList.length} apps store total. ${apps.length} available.`,
        { installedList }
      );

      const deviceModel = getDeviceModel(deviceModelId);

      const installed = installedList.map(({ name, hash, blocks }) => {
        const ins =
          (hash && apps.find(i => hash === i.hash)) ||
          apps.find(i => name === i.name);
        return {
          name,
          updated: ins ? ins.hash === hash : false,
          blocks:
            blocks ||
            Math.ceil(((ins && ins.bytes) || 0) / deviceModel.blockSize),
          hash
        };
      });

      const appByName = {};
github LedgerHQ / ledger-live-desktop / src / components / Onboarding / steps / SelectPIN / index.js View on Github external
export default (props: StepProps) => {
  const { nextStep, prevStep, t, onboarding } = props

  const model = getDeviceModel(onboarding.deviceModelId)

  return (
    
      
        
        {onboarding.flowType === 'restoreDevice' ? (
          
            <title>{t('onboarding.selectPIN.restore.title')}</title>
github LedgerHQ / ledger-live-desktop / src / components / Onboarding / steps / GenuineCheck / GenuineCheckUnavailable.js View on Github external
export function GenuineCheckUnavailableMessage({
  handleOpenGenuineCheckModal,
  onboarding,
  t,
}: {
  handleOpenGenuineCheckModal: () =&gt; void,
  t: T,
  onboarding: OnboardingState,
}) {
  const model = getDeviceModel(onboarding.deviceModelId || 'nanoS')

  return (
    
      
      <span>
        
      </span>
github LedgerHQ / ledger-live-common / src / apps / logic.js View on Github external
export const initState = ({
  deviceModelId,
  appsListNames,
  ...listAppsResult
}: ListAppsResult): State => ({
  ...listAppsResult,
  apps: appsListNames.map(name => listAppsResult.appByName[name]),
  deviceModel: getDeviceModel(deviceModelId),
  installQueue: [],
  uninstallQueue: [],
  currentProgress: null,
  currentError: null,
  currentAppOp: null
});
github LedgerHQ / ledger-live-mobile / src / screens / PairDevices / PendingPairing.js View on Github external
render() {
    const deviceWording = getDeviceModel("nanoX");
    return (
github LedgerHQ / ledger-live-desktop / src / components / ManagerPage / AppsList.js View on Github external
fontSize={4}
            ff="Inter|Regular"
            textAlign="center"
            style={{ maxWidth: 350 }}
          &gt;
            {t(
              `manager.apps.${
                isSupported
                  ? hasAccount
                    ? 'supportedCurrency'
                    : 'supportedCurrencyNeedAccount'
                  : 'unsupportedCurrency'
              }`,
              {
                app: app.name,
                device: getDeviceModel(device.modelId).productName,
                currency: (app &amp;&amp; ((app.currency &amp;&amp; app.currency.name) || app.name)) || '',
              },
            )}
          
        ) : null}
      
    ) : null
  }
github LedgerHQ / ledger-live-desktop / src / components / Onboarding / steps / Finish.js View on Github external
render() {
    const { finish, t, onboarding } = this.props
    const { emit } = this.state

    const model = getDeviceModel(onboarding.deviceModelId || 'nanoS')

    return (
github LedgerHQ / ledger-live-mobile / src / screens / PairDevices / Paired.js View on Github external
bg={colors.pillActiveBackground}
            floatingIcon={}
            floatingBg={colors.green}
          &gt;