Compare commits

..

5 Commits

Author SHA1 Message Date
66c93dcc00 Merge remote-tracking branch 'origin/draply/mac-os-support' into draply/mac-os-support
# Conflicts:
#	electron/ipcHandlers.ts
#	src/composables/useNeptuneWallet.ts
#	src/stores/neptuneStore.ts
2025-11-11 09:30:40 +07:00
7f050a9a09 feat: linux sp 2025-11-11 09:22:59 +07:00
d3c20789e9 optimize scan UTXO 2025-11-10 21:15:42 +07:00
035e4cd1b4 optimize scan UTXO 2025-11-10 15:50:35 +07:00
6998ea5982 mac os support 2025-11-10 10:38:44 +07:00

View File

@ -78,7 +78,7 @@ ipcMain.handle('wallet:checkKeystore', async () => {
fs.statSync(path.join(walletDir, a)).mtime.getTime()
)[0]
if (!newestFile) return { exists: false, filePath: null }
if (!newestFile?.length) return { exists: false, filePath: null }
const resolvedPath = path.join(walletDir, newestFile)
let minBlockHeight: number | null = null
@ -88,11 +88,10 @@ ipcMain.handle('wallet:checkKeystore', async () => {
const data = JSON.parse(json)
const height = data?.minBlockHeight
if (typeof height === 'number' && Number.isFinite(height)) {
minBlockHeight = height
}
if (Number.isFinite(height)) minBlockHeight = height
} catch (error) {
console.warn('Unable to read minBlockHeight from keystore:', error)
return { exists: true, filePath: resolvedPath }
}
return { exists: true, filePath: resolvedPath, minBlockHeight }
@ -137,9 +136,7 @@ ipcMain.handle(
}
)
ipcMain.handle(
'wallet:getMinBlockHeight',
async (_event, filePath: string | null) => {
ipcMain.handle('wallet:getMinBlockHeight', async (_event, filePath: string | null) => {
if (!filePath) {
return { success: false, error: 'No keystore file path provided.', minBlockHeight: null }
}
@ -157,7 +154,7 @@ ipcMain.handle(
const walletJson = JSON.parse(fileContents)
const height = walletJson?.minBlockHeight
if (typeof height === 'number' && Number.isFinite(height)) {
if (Number.isFinite(height)) {
return { success: true, minBlockHeight: height }
}
@ -166,8 +163,7 @@ ipcMain.handle(
console.error('Error reading min block height:', error)
return { success: false, error: String(error), minBlockHeight: null }
}
}
)
})
ipcMain.handle('wallet:generateKeysFromSeed', async (_event, seedPhrase: string[]) => {
try {
@ -188,7 +184,6 @@ ipcMain.handle('wallet:buildTransaction', async (_event, args) => {
import.meta.env.VITE_APP_API,
spendingKeyHex,
inputAdditionRecords,
// pass minBlockHeight from args if provided, default 0
typeof args?.minBlockHeight === 'number' && Number.isFinite(args.minBlockHeight)
? args.minBlockHeight
: 0,