diff --git a/package.json b/package.json index 25097935..b6b7ce14 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "dependencies": { "@hashgraph/sdk": "2.0.25-beta.1", "@ledgerhq/hw-transport": "^6.3.0", + "@ledgerhq/hw-transport-web-ble": "^6.11.2", "@ledgerhq/hw-transport-webusb": "^6.3.0", "@vueuse/core": "^5.3.0", "awilix": "^4.3.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cad93393..effbc176 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,7 @@ specifiers: '@hashgraph/sdk': 2.0.25-beta.1 '@intlify/vite-plugin-vue-i18n': ^2.4.0 '@ledgerhq/hw-transport': ^6.3.0 + '@ledgerhq/hw-transport-web-ble': ^6.11.2 '@ledgerhq/hw-transport-webusb': ^6.3.0 '@tailwindcss/forms': ^0.3.3 '@types/ledgerhq__hw-transport': ^4.21.4 @@ -63,6 +64,7 @@ specifiers: dependencies: '@hashgraph/sdk': 2.0.25-beta.1 '@ledgerhq/hw-transport': 6.3.0 + '@ledgerhq/hw-transport-web-ble': 6.11.2 '@ledgerhq/hw-transport-webusb': 6.3.0 '@vueuse/core': 5.3.0_vue@3.2.6 awilix: 4.3.4 @@ -1535,6 +1537,15 @@ packages: '@intlify/runtime': 9.1.7 '@intlify/shared': 9.1.7 + /@ledgerhq/devices/6.11.2: + resolution: {integrity: sha512-j2SoG0Ifm7khsPKC2UFhJIoi1oCDCvJemmO+pz7Oc9jx8JRhIGtCfqEIUhL+ZIl0TrIYuApPLaSqJjiFi7VGCQ==} + dependencies: + '@ledgerhq/errors': 6.10.0 + '@ledgerhq/logs': 6.10.0 + rxjs: 6.6.7 + semver: 7.3.5 + dev: false + /@ledgerhq/devices/6.3.0: resolution: {integrity: sha512-DmVxqMAf3FhkpKjkbBCFVJ5DmesfplujeCLzFwO/zF5VGuwY7xxPqeSxlpusXJkqhEq+DbFzIDRWJYDf7rtXqg==} dependencies: @@ -1544,10 +1555,24 @@ packages: semver: 7.3.5 dev: false + /@ledgerhq/errors/6.10.0: + resolution: {integrity: sha512-fQFnl2VIXh9Yd41lGjReCeK+Q2hwxQJvLZfqHnKqWapTz68NHOv5QcI0OHuZVNEbv0xhgdLhi5b65kgYeQSUVg==} + dev: false + /@ledgerhq/errors/6.2.0: resolution: {integrity: sha512-eO03x8HJmG60WtlrMuahigW/rwywFdcGzCnihta/MjkM8BD9A660cKVkyIuheCcpaB7UV/r+QsRl9abHbjjaag==} dev: false + /@ledgerhq/hw-transport-web-ble/6.11.2: + resolution: {integrity: sha512-DH2llLwVorVyZipxaNIgwvM5FRYqspWcQlDMlXGtuAw+GveXImR9cPSZeFJ042Dw4B7K9oPB13JfMyilBFiaSQ==} + dependencies: + '@ledgerhq/devices': 6.11.2 + '@ledgerhq/errors': 6.10.0 + '@ledgerhq/hw-transport': 6.11.2 + '@ledgerhq/logs': 6.10.0 + rxjs: 6.6.7 + dev: false + /@ledgerhq/hw-transport-webusb/6.3.0: resolution: {integrity: sha512-zDwQ6JZOvZYdxxPvwqbG21A4JWEV5XGmhwBIGA/DmZ50mdZ/Tq4q+Eo9GJxoU3+j0UHidKhfmPzbnJfOjfYADQ==} dependencies: @@ -1557,6 +1582,14 @@ packages: '@ledgerhq/logs': 6.2.0 dev: false + /@ledgerhq/hw-transport/6.11.2: + resolution: {integrity: sha512-VZbGfyQ8iFl2W6TUkVmQ3rz8kyOXMbOdFiht3VNlglMe3KBGJWOjW9s/5LhOR348NJs797B1gl4V0Zqmn11kUg==} + dependencies: + '@ledgerhq/devices': 6.11.2 + '@ledgerhq/errors': 6.10.0 + events: 3.3.0 + dev: false + /@ledgerhq/hw-transport/6.3.0: resolution: {integrity: sha512-kdnVrgmxrFtKaRdkoaQBEa02RXgLzEBiooYbxA65BGSJig3PGWDS9LrqNpzLTZM1RQlivd9NLBmfwU2ze4chWA==} dependencies: @@ -1565,6 +1598,10 @@ packages: events: 3.3.0 dev: false + /@ledgerhq/logs/6.10.0: + resolution: {integrity: sha512-lLseUPEhSFUXYTKj6q7s2O3s2vW2ebgA11vMAlKodXGf5AFw4zUoEbTz9CoFOC9jS6xY4Qr8BmRnxP/odT4Uuw==} + dev: false + /@ledgerhq/logs/6.2.0: resolution: {integrity: sha512-SLyFyD7ElMhgKWPYedFGCT/ilcbGPgL5hXXYHxOM79Fs5fWi0zaUpt5oGqGMsOAAFaMa9/rbun0pokzPhEFz8A==} dev: false diff --git a/src/domain/wallet/hardware-ledger.ts b/src/domain/wallet/hardware-ledger.ts index 50cd42bd..f6a6890d 100644 --- a/src/domain/wallet/hardware-ledger.ts +++ b/src/domain/wallet/hardware-ledger.ts @@ -49,15 +49,21 @@ export class LedgerHardwareWallet extends Wallet { return this.transport; } - const TransportWebUSB = ( - await import("@ledgerhq/hw-transport-webusb") - )["default"]; + // const TransportWebUSB = ( + // await import("@ledgerhq/hw-transport-webusb") + // )["default"]; + // // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // // @ts-ignore + // this.transport = await TransportWebUSB.create( + // OPEN_TIMEOUT, + // LISTENER_TIMEOUT + // ); + + const TransportWebBLE = (await import("@ledgerhq/hw-transport-web-ble"))["default"]; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - this.transport = await TransportWebUSB.create( - OPEN_TIMEOUT, - LISTENER_TIMEOUT - ); + this.transport = await TransportWebBLE.create(OPEN_TIMEOUT, LISTENER_TIMEOUT); + if (this.transport != null) { this.transport.on("disconnect", async () => { diff --git a/src/pages/access/Ledger.vue b/src/pages/access/Ledger.vue index 90f7a5a9..1bf29788 100644 --- a/src/pages/access/Ledger.vue +++ b/src/pages/access/Ledger.vue @@ -46,19 +46,19 @@ export default defineComponent({ setup() { const router = useRouter(); const store = useStore(); - const i18n = useI18n(); + // const i18n = useI18n(); const state = reactive({ busy: false, disabled: false, errorMessage: "", }); - onMounted(async () => { - if (!await isWebUsbSupported()) { - state.disabled = true; - state.errorMessage = i18n.t("Ledger.WebUSBNotSupported").toString(); - } - }); + // onMounted(async () => { + // if (!await isWebUsbSupported()) { + // state.disabled = true; + // state.errorMessage = i18n.t("Ledger.WebUSBNotSupported").toString(); + // } + // }); async function handleConnect(): Promise { state.disabled = true;