21 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2025-10-29 19:55:44 +07:00
// See the Electron documentation for details on how to use preload scripts:
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
import { contextBridge, ipcRenderer } from 'electron'
contextBridge.exposeInMainWorld('walletApi', {
createKeystore: (seed: string, password: string) =>
ipcRenderer.invoke('wallet:createKeystore', seed, password),
2025-11-05 04:14:37 +07:00
saveKeystoreAs: (seed: string, password: string) =>
ipcRenderer.invoke('wallet:saveKeystoreAs', seed, password),
decryptKeystore: (filePath: string, password: string) =>
ipcRenderer.invoke('wallet:decryptKeystore', filePath, password),
checkKeystore: () => ipcRenderer.invoke('wallet:checkKeystore'),
generateKeysFromSeed: (seedPhrase: string[]) =>
ipcRenderer.invoke('wallet:generateKeysFromSeed', seedPhrase),
2025-11-10 15:50:35 +07:00
buildTransaction: (args: any) => ipcRenderer.invoke('wallet:buildTransaction', args),
updateMinBlockHeight: (filePath: string | null, minBlockHeight: number | null) =>
ipcRenderer.invoke('wallet:updateMinBlockHeight', filePath, minBlockHeight),
getMinBlockHeight: (filePath: string | null) =>
ipcRenderer.invoke('wallet:getMinBlockHeight', filePath),
})