diff --git a/nym-wallet/src/requests/account.ts b/nym-wallet/src/requests/account.ts index dc66ddab5f..4aa826a40e 100644 --- a/nym-wallet/src/requests/account.ts +++ b/nym-wallet/src/requests/account.ts @@ -1,9 +1,8 @@ import { Account, Balance, AccountEntry } from '@nymproject/types'; -import { invoke } from '@tauri-apps/api'; import { invokeWrapper } from './wrapper'; export const signInWithMnemonic = async (mnemonic: string): Promise => - invoke('connect_with_mnemonic', { mnemonic }); + invokeWrapper('connect_with_mnemonic', { mnemonic }); export const userBalance = async () => invokeWrapper('get_balance'); diff --git a/nym-wallet/src/requests/wrapper.ts b/nym-wallet/src/requests/wrapper.ts index 348d6b9f3c..9e9ccfc832 100644 --- a/nym-wallet/src/requests/wrapper.ts +++ b/nym-wallet/src/requests/wrapper.ts @@ -5,7 +5,14 @@ import { Console } from '../utils/console'; export async function invokeWrapper(operationName: string, args?: any): Promise { const res = await invoke(operationName, args); if (config.LOG_TAURI_OPERATIONS) { - Console.log({ operationName, args, res }); + const argsToLog: any = {}; + Object.keys(args).forEach((key) => { + // check if the key should be excluded from logs + if (!['mnemonic', 'password', 'currentPassword', 'newPassword'].includes(key)) { + argsToLog[key] = args[key]; + } + }); + Console.log({ operationName, argsToLog, res }); } return res; }