initial commit
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
// Only these specific calls are exposed to the renderer (webpage) side.
|
||||
// Nothing here touches the filesystem or private keys directly — every
|
||||
// call is proxied through main.js, which is the only place that ever
|
||||
// holds a decrypted mnemonic or private key.
|
||||
contextBridge.exposeInMainWorld('macu', {
|
||||
hasKeystore: () => ipcRenderer.invoke('wallet:hasKeystore'),
|
||||
generateMnemonic: () => ipcRenderer.invoke('wallet:generateMnemonic'),
|
||||
createWallet: (mnemonic, password) => ipcRenderer.invoke('wallet:create', { mnemonic, password }),
|
||||
importWallet: (mnemonic, password) => ipcRenderer.invoke('wallet:import', { mnemonic, password }),
|
||||
unlock: (password) => ipcRenderer.invoke('wallet:unlock', { password }),
|
||||
lock: () => ipcRenderer.invoke('wallet:lock'),
|
||||
getBalances: () => ipcRenderer.invoke('wallet:balances'),
|
||||
sendEth: (to, amountEth) => ipcRenderer.invoke('wallet:sendEth', { to, amountEth }),
|
||||
});
|
||||
Reference in New Issue
Block a user