Skip to content

Commit

Permalink
feat: add unlock function in ipc handler
Browse files Browse the repository at this point in the history
  • Loading branch information
rushilbg committed Jul 17, 2024
1 parent 1e6f2ef commit 3d3426d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ async function createWindow() {
}
);

ipcMain.handle('unlock', async (event, otp) => {
const response = await sdk.unlock({ otp });
return response;
});

ipcMain.handle(
'sweepV1',
async (event, coin, parameters) => {
Expand Down
4 changes: 4 additions & 0 deletions electron/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type Commands = {
| createDotBroadcastableSweepTransactionParameters
| createSolBroadcastableSweepTransactionParameters
): Promise<Error | BroadcastableSweepTransaction>;
unlock(otp: string);
sweepV1(coin: string, parameters);
recoverConsolidations(
coin: string,
Expand Down Expand Up @@ -160,6 +161,9 @@ const commands: Commands = {
parameters
);
},
unlock(otp: string) {
return ipcRenderer.invoke('unlock', otp);
},
sweepV1(coin, parameters) {
return ipcRenderer.invoke('sweepV1', coin, parameters);
},
Expand Down
1 change: 1 addition & 0 deletions src/preload.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type Commands = {
| createDotBroadcastableSweepTransactionParameters
| createSolBroadcastableSweepTransactionParameters
): Promise<Error | BroadcastableSweepTransaction>;
unlock(otp: string);
sweepV1(coin: string, parameters);
recoverConsolidations(
coin: string,
Expand Down

0 comments on commit 3d3426d

Please sign in to comment.