Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: feat: change hw transport to web ble #560

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
37 changes: 37 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions src/domain/wallet/hardware-ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
14 changes: 7 additions & 7 deletions src/pages/access/Ledger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
state.disabled = true;
Expand Down