-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* human name saves to config using PromiseIPC Signed-off-by: Sven Dowideit <[email protected]> * use react-editext for inline editing - styling and fixes to come Signed-off-by: Sven Dowideit <[email protected]> * AccountView Alias edit styling hack Signed-off-by: Sven Dowideit <[email protected]> * linties Signed-off-by: Sven Dowideit <[email protected]> * save the private key when WB creates a new KeyPair Signed-off-by: Sven Dowideit <[email protected]> * linties Signed-off-by: Sven Dowideit <[email protected]>
- Loading branch information
1 parent
b41430a
commit 5e7f96b
Showing
15 changed files
with
293 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import cfg from 'electron-cfg'; | ||
import promiseIpc from 'electron-promise-ipc'; | ||
import type { IpcMainEvent, IpcRendererEvent } from 'electron'; | ||
|
||
import { logger } from '../logger'; | ||
|
||
declare type IpcEvent = IpcRendererEvent & IpcMainEvent; | ||
|
||
// Need to import the file and call a function (from the main process) to get the IPC promise to exist. | ||
export function initAccountPromises() { | ||
// gets written to .\AppData\Roaming\SolanaWorkbench\electron-cfg.json on windows | ||
promiseIpc.on('ACCOUNT-GetAll', (event: IpcEvent | undefined) => { | ||
logger.silly('main: called ACCOUNT-GetAll', event); | ||
const config = cfg.get('accounts'); | ||
if (!config) { | ||
return {}; | ||
} | ||
return config; | ||
}); | ||
// TODO: so the idea is that this == a list of private keys with annotations (like human name...) | ||
// so it could be key: public key, value is a map[string]interface{} with a convention that 'privatekey' contains that in X form... | ||
promiseIpc.on( | ||
'ACCOUNT-Set', | ||
(key: unknown, val: unknown, event?: IpcEvent | undefined) => { | ||
logger.silly(`main: called ACCOUNT-Set, ${key}, ${val}, ${event}`); | ||
return cfg.set(`accounts.${key}`, val); | ||
} | ||
); | ||
} | ||
|
||
export default {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.