Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ VITE_WALLET_MIGRATION_URL=https://wallets.shapeshift.com/api/migrate
VITE_FRIENDLY_CAPTCHA_SITE_KEY=FCMM7AFC0S6A8NUK

# keepkey
VITE_KEEPKEY_VERSIONS_URL=https://raw.githack.com/keepkey/keepkey-updater/master/firmware/releases.json
VITE_KEEPKEY_LATEST_RELEASE_URL=https://api.github.com/repos/keepkey/keepkey-desktop/releases/latest
VITE_KEEPKEY_VERSIONS_URL=https://raw.githack.com/keepkey/keepkey-vault/master/firmware/releases.json
VITE_KEEPKEY_LATEST_RELEASE_URL=https://api.github.com/repos/keepkey/keepkey-vault/releases/latest

# swappers
VITE_COWSWAP_BASE_URL=https://api.cow.fi
Expand Down Expand Up @@ -281,9 +281,9 @@ VITE_BANXA_API_KEY=9b682e36d91849427377a710b40d8722f74ae1b1
VITE_YAT_NODE_URL=https://a.y.at

# Keepkey updater
VITE_KEEPKEY_UPDATER_RELEASE_PAGE=https://github.com/keepkey/keepkey-desktop/releases/latest
VITE_KEEPKEY_UPDATER_RELEASE_PAGE=https://github.com/keepkey/keepkey-vault/releases/latest
VITE_KEEPKEY_DESKTOP_URL=http://localhost:1646/
VITE_KEEPKEY_UPDATER_BASE_URL=https://github.com/keepkey/keepkey-desktop/releases/download/
VITE_KEEPKEY_UPDATER_BASE_URL=https://github.com/keepkey/keepkey-vault/releases/download/

# etherscan
VITE_ETHERSCAN_API_KEY=XT8BI6VDYUGD9675X861ATHZNK3AN6HRMF
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "KeepKey Aktualisierung \n verfügbar",
"newUpdateAvailable": "Eine neue KeepKey Aktualisierung ist verfügbar.",
"downloadCta": "Aktualisierung herunterladen",
"updateRequiredForFeature": "Dieses Update ist erforderlich, um %{feature} zu unterstützen"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "Lade den KeepKey-Updater",
"button": "Lade %{filename}",
"wrongPlatform": "Sie verwenden %{platform} nicht? Klick hier"
},
"disconnect": {
Expand Down
14 changes: 11 additions & 3 deletions src/assets/translations/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
"keepKey": {
"title": "KeepKey Update Available",
"newUpdateAvailable": "A new KeepKey update is available.",
"downloadCta": "Download Update",
"downloadCta": "Update KeepKey",
"updateRequiredForFeature": "This update is required to support %{feature}"
}
},
Expand Down Expand Up @@ -1232,8 +1232,16 @@
},
"downloadUpdater": {
"header": "Download KeepKey Updater",
"button": "Download %{filename}",
"wrongPlatform": "Not using %{platform}? Click here"
"body": "We couldn't connect to your KeepKey. Install KeepKey Vault to update your device, then try pairing again.",
"bodyUpdateAvailable": "A firmware update is available for your KeepKey. Install KeepKey Vault to update your device.",
"wrongPlatform": "Not using %{platform}? Click here",
"download": {
"windows": "Download for Windows",
"linux": "Download for Linux",
"macAppleSilicon": "Download for Apple Silicon (M1 or newer)",
"macIntel": "Download for Intel",
"releasePage": "View all downloads"
}
},
"disconnect": {
"header": "Disconnect KeepKey device",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/es/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "Actualización de KeepKey disponible",
"newUpdateAvailable": "Hay una nueva actualización de KeepKey disponible.",
"downloadCta": "Descargar actualización",
"updateRequiredForFeature": "Esta actualización es necesaria para admitir %{feature}"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "Descargar KeepKey Updater",
"button": "Descargar %{filename}",
"wrongPlatform": "¿No usas %{platform}? haga clic aquí"
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "Mise à jour KeepKey disponible",
"newUpdateAvailable": "Une nouvelle mise à jour KeepKey est disponible.",
"downloadCta": "Télécharger la mise à jour",
"updateRequiredForFeature": "Cette mise à jour est nécessaire pour prendre en charge %{feature}"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "Télécharger le programme de mise à jour KeepKey",
"button": "Télécharger %{filename}",
"wrongPlatform": "Vous n'utilisez pas %{platform} ? Cliquez ici"
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "KeepKey アップデート利用可能",
"newUpdateAvailable": "新しい KeepKey アップデートが利用可能です",
"downloadCta": "アップデートをダウンロード",
"updateRequiredForFeature": "このアップデートは %{feature} をサポートするために必要です"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "KeepKeyアップデーターをダウンロード",
"button": "%{filename}をダウンロード",
"wrongPlatform": "%{platform} を使用していませんか?ここをクリック"
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/pt/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "Atualização KeepKey disponível",
"newUpdateAvailable": "Uma nova atualização da KeepKey está disponível.",
"downloadCta": "Baixar atualização",
"updateRequiredForFeature": "Esta atualização é necessária para suportar %{feature}"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "Baixar o app para atualizações da KeepKey.",
"button": "Baixar %{filename}",
"wrongPlatform": "Não está utilizando %{platform}? Clique aqui."
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/ru/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "Доступно обновление KeepKey",
"newUpdateAvailable": "Доступно новое обновление KeepKey.",
"downloadCta": "Загрузить обновление",
"updateRequiredForFeature": "Это обновление необходимо для поддержки %{feature}"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "Скачать KeepKey Updater",
"button": "Скачать %{filename}",
"wrongPlatform": "Не используете %{platform}? Нажмите здесь"
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/tr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "KeepKey Güncellemesi Mevcut",
"newUpdateAvailable": "Yeni bir KeepKey güncellemesi mevcut.",
"downloadCta": "Güncellemeyi İndir",
"updateRequiredForFeature": "Bu güncelleme, %{feature}'ı desteklemek için gereklidir"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "KeepKey Updater'ı İndirin",
"button": "%{filename} dosyasını indir",
"wrongPlatform": "%{platform}? kullanmıyor musunuz? Buraya Tıklayın"
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/uk/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "Доступне оновлення KeepKey",
"newUpdateAvailable": "Доступне нове оновлення KeepKey.",
"downloadCta": "Завантажити оновлення",
"updateRequiredForFeature": "Дане оновлення необхідне для підтримки %{feature}"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "Завантажити оновлення KeepKey",
"button": "Завантажити %{filename}",
"wrongPlatform": "Не використовуєш %{platform}? Клацніть тут"
},
"disconnect": {
Expand Down
2 changes: 0 additions & 2 deletions src/assets/translations/zh/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@
"keepKey": {
"title": "KeepKey 更新可用",
"newUpdateAvailable": "新的 KeepKey 更新现已推出。",
"downloadCta": "下载更新",
"updateRequiredForFeature": "需要更新才能支持 %{feature}"
}
},
Expand Down Expand Up @@ -1230,7 +1229,6 @@
},
"downloadUpdater": {
"header": "下载 KeepKey 更新程序",
"button": "下载 %{filename}",
"wrongPlatform": "不使用 %{platform} ?点击这里"
},
"disconnect": {
Expand Down
41 changes: 9 additions & 32 deletions src/components/Layout/Header/NavBar/KeepKey/KeepKeyMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
MenuItem,
useDisclosure,
} from '@chakra-ui/react'
import { useCallback, useEffect, useMemo } from 'react'
import { useCallback, useEffect } from 'react'
import { useTranslate } from 'react-polyglot'

import { ExpandedMenuItem } from '@/components/Layout/Header/NavBar/ExpandedMenuItem'
Expand All @@ -20,11 +20,7 @@ import { SubMenuContainer } from '@/components/Layout/Header/NavBar/SubMenuConta
import { SubmenuHeader } from '@/components/Layout/Header/NavBar/SubmenuHeader'
import { WalletImage } from '@/components/Layout/Header/NavBar/WalletImage'
import { RawText, Text } from '@/components/Text'
import {
getPlatform,
RELEASE_PAGE,
UPDATER_BASE_URL,
} from '@/context/WalletProvider/KeepKey/helpers'
import { WalletActions } from '@/context/WalletProvider/actions'
import { useKeepKeyVersions } from '@/context/WalletProvider/KeepKey/hooks/useKeepKeyVersions'
import { useKeepKey } from '@/context/WalletProvider/KeepKeyProvider'
import { useModal } from '@/hooks/useModal/useModal'
Expand Down Expand Up @@ -57,12 +53,12 @@ export const KeepKeyMenu = () => {
state: { deviceTimeout, features },
} = useKeepKey()
const {
dispatch,
setDeviceState,
state: { wallet, isConnected, walletInfo },
} = useWallet()
const { versionsQuery, stableDesktopVersionQuery } = useKeepKeyVersions({ wallet })
const { versionsQuery } = useKeepKeyVersions({ wallet })
const versions = versionsQuery.data?.versions
const stableVersion = stableDesktopVersionQuery.data
const keepKeyWipe = useModal('keepKeyWipe')

// Reset ephemeral device state properties when opening the KeepKey menu
Expand All @@ -73,28 +69,9 @@ export const KeepKeyMenu = () => {
})
}, [setDeviceState])

// Get the platform and construct the dynamic download URL
const platform = useMemo(() => getPlatform(), [])
const latestVersion = stableVersion

const platformFilename = useMemo(() => {
switch (platform) {
case 'Mac OS':
return `KeepKey-Desktop-${latestVersion}-universal.dmg`
case 'Windows':
return `KeepKey-Desktop-Setup-${latestVersion}.exe`
case 'Linux':
return `KeepKey-Desktop-${latestVersion}.AppImage`
default:
return null
}
}, [platform, latestVersion])

const updaterUrl = useMemo(
() =>
platformFilename ? `${UPDATER_BASE_URL}v${latestVersion}/${platformFilename}` : RELEASE_PAGE,
[platformFilename, latestVersion],
)
const handleUpdateClick = useCallback(() => {
dispatch({ type: WalletActions.DOWNLOAD_UPDATER })
}, [dispatch])

const getBooleanLabel = (value: boolean | undefined) => {
return value
Expand Down Expand Up @@ -165,7 +142,7 @@ export const KeepKeyMenu = () => {
badgeColor={versions?.bootloader.updateAvailable ? 'yellow' : 'green'}
valueDisposition={versions?.bootloader.updateAvailable ? 'info' : 'neutral'}
isDisabled={!versions?.bootloader.updateAvailable}
externalUrl={updaterUrl}
onClick={handleUpdateClick}
/>
<ExpandedMenuItem
label='walletProvider.keepKey.settings.menuLabels.firmware'
Expand All @@ -174,7 +151,7 @@ export const KeepKeyMenu = () => {
badgeColor={versions?.firmware.updateAvailable ? 'yellow' : 'green'}
valueDisposition={versions?.firmware.updateAvailable ? 'info' : 'neutral'}
isDisabled={!versions?.firmware.updateAvailable}
externalUrl={updaterUrl}
onClick={handleUpdateClick}
/>
<MenuDivider />
<ExpandedMenuItem
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ const validators = {
VITE_ONRAMPER_API_KEY: str(),
VITE_ONRAMPER_SIGNING_KEY: str(),
VITE_KEEPKEY_UPDATER_RELEASE_PAGE: url({
default: 'https://github.com/keepkey/keepkey-desktop/releases/latest',
default: 'https://github.com/keepkey/keepkey-vault/releases/latest',
}),
VITE_KEEPKEY_UPDATER_BASE_URL: url({
default: 'https://github.com/keepkey/keepkey-desktop/releases/download/',
default: 'https://github.com/keepkey/keepkey-vault/releases/download/',
}),
VITE_ETHERSCAN_API_KEY: str({
default: 'XT8BI6VDYUGD9675X861ATHZNK3AN6HRMF',
Expand Down
Loading
Loading