Skip to content
Draft
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
4 changes: 2 additions & 2 deletions packages/desktop/electron/lib/Ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const TransportHid = require('@ledgerhq/hw-transport-node-hid').default
const TransportSpeculos = require('@ledgerhq/hw-transport-node-speculos').default
const Iota = require('hw-app-iota').default

const USE_SIMULATOR = false
const USE_SIMULATOR = true
const SIMULATOR_PORT = 9999

async function createTransport() {
Expand Down Expand Up @@ -94,7 +94,7 @@ class Ledger {

this.iota = new Iota(this.transport)

await this.iota.setActiveSeed(`44'/4218'/${index}'/${page}'`, security || 2)
await this.iota.setActiveSeed(`44'/4218'/${508396330 + index}'/${page}'`, security || 2)

clearTimeout(timeout)

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "desktop",
"productName": "IOTA Legacy Migration Tool",
"version": "0.0.2",
"version": "0.0.3-beta-4",
"description": "Official IOTA Legacy Migration Tool on desktop",
"main": "public/build/main.js",
"repository": "[email protected]:iotaledger/legacy-migration-tool.git",
Expand Down
11 changes: 9 additions & 2 deletions packages/shared/lib/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const LEGACY_ADDRESS_WITH_CHECKSUM_LENGTH = 90

let intervalTimer

export const ledgerSimulator = false
export const ledgerSimulator = true
export const ledgerDeviceState = writable<LedgerDeviceState>(LedgerDeviceState.NotDetected)
export const isLedgerLegacyConnected = writable<boolean>(false)

Expand Down Expand Up @@ -65,6 +65,11 @@ export function calculateLedgerDeviceState(status: LedgerStatus): LedgerDeviceSt
if (locked) {
return LedgerDeviceState.Locked
} else {
if (app?.version === '0.8.6') {
return LedgerDeviceState.Connected
} else if (app?.version === '0.5.9') {
return LedgerDeviceState.LegacyConnected
}
switch (app?.name) {
default:
if (connected) {
Expand Down Expand Up @@ -244,7 +249,7 @@ export function stopPollingLedgerStatus(): void {
}
}

export function getLegacyErrorMessage(error: { name; statusCode }, shouldLocalize: boolean = false): string {
export function getLegacyErrorMessage(error: { name; statusCode; message }, shouldLocalize: boolean = false): string {
let errorMessage = 'error.global.generic'
switch (error?.name) {
case LegacyLedgerErrorName.TransportStatusError:
Expand All @@ -260,6 +265,8 @@ export function getLegacyErrorMessage(error: { name; statusCode }, shouldLocaliz
case LegacyLedgerErrorName.DisconnectedDeviceDuringOperation:
errorMessage = 'error.ledger.disconnected'
break
default:
errorMessage = error?.message
}

return shouldLocalize ? localize(errorMessage) : errorMessage
Expand Down