diff --git a/source/common/ipc/api.ts b/source/common/ipc/api.ts index dd69d9cb06..dd9180d93b 100644 --- a/source/common/ipc/api.ts +++ b/source/common/ipc/api.ts @@ -308,8 +308,7 @@ export type ExportWalletsMainResponse = { */ export const GENERATE_WALLET_MIGRATION_REPORT_CHANNEL = 'GENERATE_WALLET_MIGRATION_REPORT_CHANNEL'; -export type GenerateWalletMigrationReportRendererRequest = - WalletMigrationReportData; +export type GenerateWalletMigrationReportRendererRequest = WalletMigrationReportData; export type GenerateWalletMigrationReportMainResponse = void; /** @@ -366,8 +365,7 @@ export type ResumeDownloadMainResponse = ResumeDownloadResponse | void; */ export const DELETE_DOWNLOADED_FILE = 'DELETE_DOWNLOADED_FILE'; export type DeleteDownloadedFileRendererRequest = DeleteDownloadedFileRequest; -export type DeleteDownloadedFileMainResponse = - DeleteDownloadedFileResponse | void; +export type DeleteDownloadedFileMainResponse = DeleteDownloadedFileResponse | void; /** * Channel for initiating the download manager @@ -380,16 +378,14 @@ export type DownloadLocalDataMainResponse = DownloadLocalDataResponse; * Channel for initiating the download manager */ export const GET_DOWNLOADS_LOCAL_DATA = 'GET_DOWNLOADS_LOCAL_DATA'; -export type DownloadsLocalDataRendererRequest = - DownloadsLocalDataRequest | void; +export type DownloadsLocalDataRendererRequest = DownloadsLocalDataRequest | void; export type DownloadsLocalDataMainResponse = DownloadsLocalDataResponse | void; /** * Channel for initiating the download manager */ export const CLEAR_DOWNLOAD_LOCAL_DATA = 'CLEAR_DOWNLOAD_LOCAL_DATA'; -export type ClearDownloadLocalDataRendererRequest = - ClearDownloadLocalDataRequest; +export type ClearDownloadLocalDataRendererRequest = ClearDownloadLocalDataRequest; export type ClearDownloadLocalDataMainResponse = ClearDownloadLocalDataResponse; /** @@ -465,16 +461,12 @@ export type GetBlockReplayProgressMainResponse = number; */ export const GET_HARDWARE_WALLET_TRANSPORT_CHANNEL = 'GET_HARDWARE_WALLET_TRANSPORT_CHANNEL'; -export type getHardwareWalletTransportRendererRequest = - HardwareWalletTransportDeviceRequest; -export type getHardwareWalletTransportMainResponse = - HardwareWalletTransportDeviceResponse; +export type getHardwareWalletTransportRendererRequest = HardwareWalletTransportDeviceRequest; +export type getHardwareWalletTransportMainResponse = HardwareWalletTransportDeviceResponse; export const GET_EXTENDED_PUBLIC_KEY_CHANNEL = 'GET_EXTENDED_PUBLIC_KEY_CHANNEL'; -export type getExtendedPublicKeyRendererRequest = - HardwareWalletExtendedPublicKeyRequest; -export type getExtendedPublicKeyMainResponse = - HardwareWalletExtendedPublicKeyResponse; +export type getExtendedPublicKeyRendererRequest = HardwareWalletExtendedPublicKeyRequest; +export type getExtendedPublicKeyMainResponse = HardwareWalletExtendedPublicKeyResponse; export const GET_CARDANO_ADA_APP_CHANNEL = 'GET_CARDANO_ADA_APP_CHANNEL'; export type getCardanoAdaAppRendererRequest = { path: string | null | undefined; @@ -482,8 +474,7 @@ export type getCardanoAdaAppRendererRequest = { export type getCardanoAdaAppMainResponse = HardwareWalletCardanoAdaAppResponse; export const GET_HARDWARE_WALLET_CONNECTION_CHANNEL = 'GET_HARDWARE_WALLET_CONNECTION_CHANNEL'; -export type getHardwareWalletConnectiontMainRequest = - HardwareWalletConnectionRequest; +export type getHardwareWalletConnectiontMainRequest = HardwareWalletConnectionRequest; export type getHardwareWalletConnectiontRendererResponse = Record; export const SIGN_TRANSACTION_LEDGER_CHANNEL = 'SIGN_TRANSACTION_LEDGER_CHANNEL'; diff --git a/source/common/types/hardware-wallets.types.ts b/source/common/types/hardware-wallets.types.ts index 43c78c500a..1cf779b407 100644 --- a/source/common/types/hardware-wallets.types.ts +++ b/source/common/types/hardware-wallets.types.ts @@ -141,8 +141,9 @@ export type StakingBlockchainPointer = { txIndex: number; certificateIndex: number; }; -export type LedgerSignTransactionInputsType = - Array; +export type LedgerSignTransactionInputsType = Array< + LedgerSignTransactionInputType +>; export type LedgerSignTransactionOutputsType = | [] | Array; @@ -188,8 +189,9 @@ export type TrezorOutputTypeChange = { stakingPath: string; }; }; -export type TrezorSignTransactionInputsType = - Array; +export type TrezorSignTransactionInputsType = Array< + TrezorSignTransactionInputType +>; export type TrezorSignTransactionOutputsType = Array< TrezorOutputTypeAddress | TrezorOutputTypeChange >; diff --git a/source/common/utils/files.ts b/source/common/utils/files.ts index 45ce947195..f13d4beb75 100644 --- a/source/common/utils/files.ts +++ b/source/common/utils/files.ts @@ -32,14 +32,14 @@ export const generateFileNameWithTimestamp = (props: Props = {}) => { if (sanitize) fileName = sanitizeFilename(fileName); return fileName; }; -export const isFileNameWithTimestamp = - (prefix = 'logs', extension = 'zip') => - (fileName: string) => - fileName.match( - RegExp( - `(${prefix}-)([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{6}.0[0-9]{3}Z)(.${extension})` - ) - ); +export const isFileNameWithTimestamp = (prefix = 'logs', extension = 'zip') => ( + fileName: string +) => + fileName.match( + RegExp( + `(${prefix}-)([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{6}.0[0-9]{3}Z)(.${extension})` + ) + ); export const getPathSlash = (path: string) => path.indexOf('/') > -1 ? '/' : '\\'; export const extractFileNameFromPath = (path: string) => diff --git a/source/main/cardano/CardanoSelfnodeLauncher.ts b/source/main/cardano/CardanoSelfnodeLauncher.ts index be1d6498ec..1676f89f85 100644 --- a/source/main/cardano/CardanoSelfnodeLauncher.ts +++ b/source/main/cardano/CardanoSelfnodeLauncher.ts @@ -41,8 +41,12 @@ export async function CardanoSelfnodeLauncher( replyPort: number; }> { return new Promise(async (resolve, reject) => { - const { selfnodeBin, mockTokenMetadataServerBin, processName, onStop } = - selfnodeOptions; + const { + selfnodeBin, + mockTokenMetadataServerBin, + processName, + onStop, + } = selfnodeOptions; setupMockTokenMetadataServer(mockTokenMetadataServerBin); // @ts-ignore ts-migrate(2322) FIXME: Type '{ pid: number; ppid?: number; uid?: number; ... Remove this comment to see the full error message const processList: Array = await find('port', CARDANO_WALLET_PORT); diff --git a/source/main/cardano/utils.ts b/source/main/cardano/utils.ts index b81ede4251..adb190b67e 100644 --- a/source/main/cardano/utils.ts +++ b/source/main/cardano/utils.ts @@ -174,8 +174,13 @@ export const exportWallets = async ( mainWindow: BrowserWindow, locale: string ): Promise => { - const { legacySecretKey, legacyWalletDB, stateDir, cluster, isFlight } = - launcherConfig; + const { + legacySecretKey, + legacyWalletDB, + stateDir, + cluster, + isFlight, + } = launcherConfig; logger.info('ipcMain: Starting wallets export...', { exportSourcePath, legacySecretKey, diff --git a/source/main/config.ts b/source/main/config.ts index 93968a36b0..b199bcf92b 100644 --- a/source/main/config.ts +++ b/source/main/config.ts @@ -109,8 +109,9 @@ export const windowOptions: WindowOptionsType = { }, useContentSize: true, }; -export const launcherConfig: LauncherConfig = - readLauncherConfig(LAUNCHER_CONFIG); +export const launcherConfig: LauncherConfig = readLauncherConfig( + LAUNCHER_CONFIG +); export const { cluster, nodeImplementation, diff --git a/source/main/ipc/downloadManagerChannel.ts b/source/main/ipc/downloadManagerChannel.ts index 0ad41fd41f..27a7c2f83c 100644 --- a/source/main/ipc/downloadManagerChannel.ts +++ b/source/main/ipc/downloadManagerChannel.ts @@ -183,7 +183,9 @@ const requestResumeDownload = async ( const deleteDownloadedFile = async ({ id, -}: DeleteDownloadedFileRendererRequest): Promise => { +}: DeleteDownloadedFileRendererRequest): Promise< + DeleteDownloadedFileMainResponse +> => { const downloadLocalData = await getDownloadLocalData({ id, }); @@ -199,7 +201,9 @@ const deleteDownloadedFile = async ({ const getDownloadLocalData = async ({ fileName, id = fileName, -}: DownloadLocalDataRendererRequest): Promise => { +}: DownloadLocalDataRendererRequest): Promise< + DownloadLocalDataMainResponse +> => { if (!id) throw new Error('Requires `id` or `fileName`'); const downloadId: string = getIdFromFileName(String(id)); return localStorage.get(downloadId); @@ -212,7 +216,9 @@ const getDownloadsLocalData = const clearDownloadLocalData = async ({ fileName, id = fileName, -}: ClearDownloadLocalDataRendererRequest): Promise => { +}: ClearDownloadLocalDataRendererRequest): Promise< + ClearDownloadLocalDataMainResponse +> => { if (!id) throw new Error('Requires `id` or `fileName`'); const downloadId: string = getIdFromFileName(String(id)); return localStorage.unset(downloadId); @@ -235,11 +241,15 @@ const checkFileExists = async ({ }; const requestDownloadChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(REQUEST_DOWNLOAD); +MainIpcChannel< + DownloadRendererRequest, + DownloadMainResponse +> = new MainIpcChannel(REQUEST_DOWNLOAD); const requestResumeDownloadChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(RESUME_DOWNLOAD); +MainIpcChannel< + ResumeDownloadRendererRequest, + ResumeDownloadMainResponse +> = new MainIpcChannel(RESUME_DOWNLOAD); const deleteDownloadedFileChannel: // IpcChannel MainIpcChannel< DeleteDownloadedFileRendererRequest, @@ -261,8 +271,10 @@ MainIpcChannel< ClearDownloadLocalDataMainResponse > = new MainIpcChannel(CLEAR_DOWNLOAD_LOCAL_DATA); const checkFileExistsChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(CHECK_FILE_EXISTS); +MainIpcChannel< + CheckFileExistsRendererRequest, + CheckFileExistsMainResponse +> = new MainIpcChannel(CHECK_FILE_EXISTS); export const downloadManagerChannel = (window: BrowserWindow) => { requestDownloadChannel.onRequest( (downloadRequestPayload: DownloadRendererRequest) => diff --git a/source/main/ipc/generateCsvChannel.ts b/source/main/ipc/generateCsvChannel.ts index 8bc5a8d51d..b09037cd72 100644 --- a/source/main/ipc/generateCsvChannel.ts +++ b/source/main/ipc/generateCsvChannel.ts @@ -8,8 +8,10 @@ import type { } from '../../common/ipc/api'; export const generateCsvChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(GENERATE_CSV_CHANNEL); +MainIpcChannel< + GenerateCsvRendererRequest, + GenerateCsvMainResponse +> = new MainIpcChannel(GENERATE_CSV_CHANNEL); export const handleRewardsCsvRequests = () => { generateCsvChannel.onReceive( (request: GenerateCsvRendererRequest) => diff --git a/source/main/ipc/generateFileMetaChannel.ts b/source/main/ipc/generateFileMetaChannel.ts index edb66d84e7..965662cfbd 100644 --- a/source/main/ipc/generateFileMetaChannel.ts +++ b/source/main/ipc/generateFileMetaChannel.ts @@ -8,8 +8,10 @@ import type { } from '../../common/ipc/api'; export const generateFileMetaChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(GENERATE_FILE_META_CHANNEL); +MainIpcChannel< + GenerateFileMetaRendererRequest, + GenerateFileMetaMainResponse +> = new MainIpcChannel(GENERATE_FILE_META_CHANNEL); export const handleFileMetaRequests = () => { generateFileMetaChannel.onReceive( (request: GenerateFileMetaRendererRequest) => diff --git a/source/main/ipc/getHardwareWalletChannel.ts b/source/main/ipc/getHardwareWalletChannel.ts index 6bfa2adddf..d4ff461f55 100644 --- a/source/main/ipc/getHardwareWalletChannel.ts +++ b/source/main/ipc/getHardwareWalletChannel.ts @@ -748,11 +748,12 @@ export const handleHardwareWalletRequests = async ( }); if (deviceFeatures.success) { - const extendedPublicKeyResponse = - await TrezorConnect.cardanoGetPublicKey({ + const extendedPublicKeyResponse = await TrezorConnect.cardanoGetPublicKey( + { path: `m/${path}`, showOnTrezor: true, - }); + } + ); if (!extendedPublicKeyResponse.success) { throw extendedPublicKeyResponse.payload; diff --git a/source/main/ipc/manageAppUpdateChannel.ts b/source/main/ipc/manageAppUpdateChannel.ts index 7bc2fbe66d..62f082b806 100644 --- a/source/main/ipc/manageAppUpdateChannel.ts +++ b/source/main/ipc/manageAppUpdateChannel.ts @@ -15,8 +15,10 @@ import { safeExitWithCode } from '../utils/safeExitWithCode'; import { logger } from '../utils/logging'; import { launcherConfig } from '../config'; // IpcChannel -const manageAppUpdateChannel: MainIpcChannel = - new MainIpcChannel(MANAGE_APP_UPDATE); +const manageAppUpdateChannel: MainIpcChannel< + Request, + Response +> = new MainIpcChannel(MANAGE_APP_UPDATE); const logPrefix = 'appUpdateInstall'; const getMessage = (functionPrefix: string, message?: string): string => { diff --git a/source/main/ipc/rebuild-application-menu.ts b/source/main/ipc/rebuild-application-menu.ts index 155af3b028..47f90cba93 100644 --- a/source/main/ipc/rebuild-application-menu.ts +++ b/source/main/ipc/rebuild-application-menu.ts @@ -6,5 +6,7 @@ import type { } from '../../common/ipc/api'; export const rebuildApplicationMenu: // IpcChannel -MainIpcChannel = - new MainIpcChannel(REBUILD_APP_MENU_CHANNEL); +MainIpcChannel< + RebuildAppMenuRendererRequest, + RebuildAppMenuMainResponse +> = new MainIpcChannel(REBUILD_APP_MENU_CHANNEL); diff --git a/source/main/ipc/saveQRCodeImageChannel.ts b/source/main/ipc/saveQRCodeImageChannel.ts index 1123c087b3..e7aea53da6 100644 --- a/source/main/ipc/saveQRCodeImageChannel.ts +++ b/source/main/ipc/saveQRCodeImageChannel.ts @@ -8,8 +8,10 @@ import type { } from '../../common/ipc/api'; export const saveQRCodeImageChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(GENERATE_QRCODE_CHANNEL); +MainIpcChannel< + GenerateQRCodeRendererRequest, + GenerateQRCodeMainResponse +> = new MainIpcChannel(GENERATE_QRCODE_CHANNEL); export const saveQRCodeImageRequests = () => { saveQRCodeImageChannel.onReceive( (request: GenerateQRCodeRendererRequest) => diff --git a/source/main/ipc/show-file-dialog-channels.ts b/source/main/ipc/show-file-dialog-channels.ts index 1e32743d90..c8b0525924 100644 --- a/source/main/ipc/show-file-dialog-channels.ts +++ b/source/main/ipc/show-file-dialog-channels.ts @@ -13,11 +13,15 @@ import type { } from '../../common/ipc/api'; export const showOpenDialogChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(SHOW_OPEN_DIALOG_CHANNEL); +MainIpcChannel< + ShowOpenDialogRendererRequest, + ShowOpenDialogMainResponse +> = new MainIpcChannel(SHOW_OPEN_DIALOG_CHANNEL); export const showSaveDialogChannel: // IpcChannel -MainIpcChannel = - new MainIpcChannel(SHOW_SAVE_DIALOG_CHANNEL); +MainIpcChannel< + ShowSaveDialogRendererRequest, + ShowSaveDialogMainResponse +> = new MainIpcChannel(SHOW_SAVE_DIALOG_CHANNEL); export const handleFileDialogRequests = (window: BrowserWindow) => { showOpenDialogChannel.onReceive((request: ShowOpenDialogRendererRequest) => // @ts-ignore ts-migrate(2345) FIXME: Argument of type 'FileDialogRequestParams' is not ... Remove this comment to see the full error message diff --git a/source/main/utils/getContentMinimumSize.ts b/source/main/utils/getContentMinimumSize.ts index 83f0aad541..29d5ca9b5c 100644 --- a/source/main/utils/getContentMinimumSize.ts +++ b/source/main/utils/getContentMinimumSize.ts @@ -23,8 +23,10 @@ export const getContentMinimumSize = ( ): getContentMinimumSizeResponse => { const { isWindows } = environment; const { width: frameWidth, height: frameHeight } = window.getBounds(); - const { width: contentWidth, height: contentHeight } = - window.getContentBounds(); + const { + width: contentWidth, + height: contentHeight, + } = window.getContentBounds(); const paddingWidth = frameWidth - contentWidth || 0; let paddingHeight = frameHeight - contentHeight || 0; diff --git a/source/main/utils/logging.ts b/source/main/utils/logging.ts index b365da17b8..a8d7cfe3b1 100644 --- a/source/main/utils/logging.ts +++ b/source/main/utils/logging.ts @@ -23,14 +23,15 @@ const environmentData = { version, }; -const logToLevel = - (level: string) => - (message: string, data: Record | null | undefined) => - log[level](formatContext({ ...messageContext, level }), { - message, - data: toJS(data), - environmentData, - }); +const logToLevel = (level: string) => ( + message: string, + data: Record | null | undefined +) => + log[level](formatContext({ ...messageContext, level }), { + message, + data: toJS(data), + environmentData, + }); export const logger: Logger = { debug: logToLevel('debug'), diff --git a/source/main/utils/setupLogging.ts b/source/main/utils/setupLogging.ts index 1518b415b2..de382842d5 100644 --- a/source/main/utils/setupLogging.ts +++ b/source/main/utils/setupLogging.ts @@ -122,8 +122,13 @@ export const logStateSnapshot = ( ): MessageBody => { const { ...data } = props; const { currentTime: at, systemInfo, coreInfo } = data; - const { platform, platformVersion, cpu, ram, availableDiskSpace } = - systemInfo; + const { + platform, + platformVersion, + cpu, + ram, + availableDiskSpace, + } = systemInfo; const { daedalusVersion, daedalusProcessID, diff --git a/source/renderer/app/api/api.ts b/source/renderer/app/api/api.ts index f8a6d25c33..a36a35f841 100644 --- a/source/renderer/app/api/api.ts +++ b/source/renderer/app/api/api.ts @@ -242,8 +242,10 @@ export default class AdaApi { getWallets = async (): Promise> => { // @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. logger.debug('AdaApi::getWallets called'); - const { getHardwareWalletLocalData, getHardwareWalletsLocalData } = - global.daedalus.api.localStorage; + const { + getHardwareWalletLocalData, + getHardwareWalletsLocalData, + } = global.daedalus.api.localStorage; try { const wallets: AdaWallets = await getWallets(this.config); @@ -656,8 +658,7 @@ export default class AdaApi { logger.debug('AdaApi::getAssets success', { assets: response, }); - const assetsLocaldata = - await global.daedalus.api.localStorage.getAssetsLocalData(); + const assetsLocaldata = await global.daedalus.api.localStorage.getAssetsLocalData(); logger.debug('AdaApi::getAssetsLocalData success', { assetsLocaldata, }); @@ -1613,8 +1614,9 @@ export default class AdaApi { getCurrencyList = async (): Promise => { try { const apiResponse = await getCurrencyList(); - const response: GetCurrencyListResponse = - currencyConfig.responses.list(apiResponse); + const response: GetCurrencyListResponse = currencyConfig.responses.list( + apiResponse + ); logger.debug('AdaApi::getCurrencyList success', { response, }); @@ -1631,8 +1633,9 @@ export default class AdaApi { ): Promise => { try { const apiResponse = await getCurrencyRate(currency); - const response: GetCurrencyRateResponse = - currencyConfig.responses.rate(apiResponse); + const response: GetCurrencyRateResponse = currencyConfig.responses.rate( + apiResponse + ); logger.debug('AdaApi::getCurrencyRate success', { response, }); @@ -2140,8 +2143,9 @@ export default class AdaApi { logger.debug('AdaApi::getSmashSettings called'); try { - const { pool_metadata_source: poolMetadataSource } = - await getSmashSettings(this.config); + const { + pool_metadata_source: poolMetadataSource, + } = await getSmashSettings(this.config); logger.debug('AdaApi::getSmashSettings success', { poolMetadataSource, }); @@ -2165,8 +2169,12 @@ export default class AdaApi { return true; } - const { health }: CheckSmashServerHealthApiResponse = - await checkSmashServerHealth(this.config, url); + const { + health, + }: CheckSmashServerHealthApiResponse = await checkSmashServerHealth( + this.config, + url + ); const isValid = health === SMASH_SERVER_STATUSES.AVAILABLE; logger.debug('AdaApi::checkSmashServerIsValid success', { isValid, @@ -2381,10 +2389,12 @@ export default class AdaApi { }); try { - const response: TransferFundsCalculateFeeApiResponse = - await transferFundsCalculateFee(this.config, { + const response: TransferFundsCalculateFeeApiResponse = await transferFundsCalculateFee( + this.config, + { sourceWalletId, - }); + } + ); logger.debug('AdaApi::transferFundsCalculateFee success', { response, }); @@ -2587,8 +2597,9 @@ export default class AdaApi { logger.debug('AdaApi::getNetworkParameters called'); try { - const networkParameters: GetNetworkParametersApiResponse = - await getNetworkParameters(this.config); + const networkParameters: GetNetworkParametersApiResponse = await getNetworkParameters( + this.config + ); logger.debug('AdaApi::getNetworkParameters success', { networkParameters, }); diff --git a/source/renderer/app/components/assets/AssetTransactionConfirmation.tsx b/source/renderer/app/components/assets/AssetTransactionConfirmation.tsx index e33da64432..8226fad7b1 100644 --- a/source/renderer/app/components/assets/AssetTransactionConfirmation.tsx +++ b/source/renderer/app/components/assets/AssetTransactionConfirmation.tsx @@ -31,14 +31,16 @@ const messages = defineMessages({ '"unformattedAmountLabel" item on AssetTransactionConfirmation.', }, unformattedAmountMessageForHardwareWallets: { - id: 'asset.transactionConfirmation.unformattedAmountMessageForHardwareWallets', + id: + 'asset.transactionConfirmation.unformattedAmountMessageForHardwareWallets', defaultMessage: '!!!Native assets may specify a number of decimal places, as defined in the Cardano token registry. Daedalus uses this information to format the amount that is being sent in the transaction.

The native token unformatted amount is the amount without these decimal places. Please ensure that you verify both amounts, as some wallet software may not yet use the Cardano token registry.', description: '"unformattedAmountMessageForHardwareWallets" item on AssetTransactionConfirmation.', }, unformattedAmountMessageForSoftwareWallets: { - id: 'asset.transactionConfirmation.unformattedAmountMessageForSoftwareWallets', + id: + 'asset.transactionConfirmation.unformattedAmountMessageForSoftwareWallets', defaultMessage: '!!!Native assets may specify a number of decimal places, as defined in the Cardano token registry. Daedalus uses this information to format the amount that is being sent in the transaction.

The native token unformatted amount is the amount without these decimal places. Please ensure that you verify both amounts, as some wallet software may not yet use the Cardano token registry.

The native token unformatted amount will be displayed on the hardware wallet device during transaction confirmation.', description: diff --git a/source/renderer/app/components/dapp/DappTransactionRequest.tsx b/source/renderer/app/components/dapp/DappTransactionRequest.tsx index fb6a635d47..850812c180 100644 --- a/source/renderer/app/components/dapp/DappTransactionRequest.tsx +++ b/source/renderer/app/components/dapp/DappTransactionRequest.tsx @@ -93,8 +93,9 @@ type Props = { wallets: Array; }; const DappTransactionRequest = observer((props: Props) => { - const [isAdditionalDataVisible, toggleAdditionalData] = - useState(false); + const [isAdditionalDataVisible, toggleAdditionalData] = useState( + false + ); const [isMetadataVisible, toggleMetadata] = useState(false); // @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. const getToggleLabel = useCallback((isVisible: boolean) => @@ -133,8 +134,9 @@ const DappTransactionRequest = observer((props: Props) => { [assets, selectedWallet] ); const adaBalanceRequired = adaAmount.plus(transactionFee); - const walletsDropdownHasError = - selectedWallet?.amount.isLessThan(adaBalanceRequired); + const walletsDropdownHasError = selectedWallet?.amount.isLessThan( + adaBalanceRequired + ); if (walletsDropdownHasError) { hasAmountError = true; diff --git a/source/renderer/app/components/layout/SidebarLayout.tsx b/source/renderer/app/components/layout/SidebarLayout.tsx index 2c71a30f07..dc27f7785e 100644 --- a/source/renderer/app/components/layout/SidebarLayout.tsx +++ b/source/renderer/app/components/layout/SidebarLayout.tsx @@ -20,8 +20,13 @@ class SidebarLayout extends Component { }; render() { - const { children, sidebar, topbar, notification, contentDialogs } = - this.props; + const { + children, + sidebar, + topbar, + notification, + contentDialogs, + } = this.props; return (
{sidebar}
diff --git a/source/renderer/app/components/loading/no-disk-space-error/NoDiskSpaceError.tsx b/source/renderer/app/components/loading/no-disk-space-error/NoDiskSpaceError.tsx index 377a754fc0..c73023c97d 100644 --- a/source/renderer/app/components/loading/no-disk-space-error/NoDiskSpaceError.tsx +++ b/source/renderer/app/components/loading/no-disk-space-error/NoDiskSpaceError.tsx @@ -34,8 +34,11 @@ class NoDiskSpaceError extends Component { render() { const { intl } = this.context; - const { diskSpaceRequired, diskSpaceMissing, diskSpaceRecommended } = - this.props; + const { + diskSpaceRequired, + diskSpaceMissing, + diskSpaceRecommended, + } = this.props; return (
diff --git a/source/renderer/app/components/loading/syncing-connecting/SyncingConnectingStatus.tsx b/source/renderer/app/components/loading/syncing-connecting/SyncingConnectingStatus.tsx index ea57b688e4..70c37924c7 100644 --- a/source/renderer/app/components/loading/syncing-connecting/SyncingConnectingStatus.tsx +++ b/source/renderer/app/components/loading/syncing-connecting/SyncingConnectingStatus.tsx @@ -202,8 +202,10 @@ export default class SyncingConnectingStatus extends Component { showEllipsis ? styles.withoutAnimation : null, ]); - const { connectingMessage, connectingDescription } = - this._getConnectingMessage(); + const { + connectingMessage, + connectingDescription, + } = this._getConnectingMessage(); return (
diff --git a/source/renderer/app/components/profile/terms-of-use/TermsOfUseForm.tsx b/source/renderer/app/components/profile/terms-of-use/TermsOfUseForm.tsx index 52015b4ab9..210d827639 100644 --- a/source/renderer/app/components/profile/terms-of-use/TermsOfUseForm.tsx +++ b/source/renderer/app/components/profile/terms-of-use/TermsOfUseForm.tsx @@ -60,8 +60,12 @@ class TermsOfUseForm extends Component { render() { const { intl } = this.context; - const { isSubmitting, error, localizedTermsOfUse, onOpenExternalLink } = - this.props; + const { + isSubmitting, + error, + localizedTermsOfUse, + onOpenExternalLink, + } = this.props; const { areTermsOfUseAccepted } = this.state; const buttonClasses = classnames([ 'primary', diff --git a/source/renderer/app/components/staking/countdown/StakingCountdown.tsx b/source/renderer/app/components/staking/countdown/StakingCountdown.tsx index f1cd67b8d9..2a4b7b89ea 100644 --- a/source/renderer/app/components/staking/countdown/StakingCountdown.tsx +++ b/source/renderer/app/components/staking/countdown/StakingCountdown.tsx @@ -43,8 +43,11 @@ class StakingCountdown extends Component { }; render() { - const { redirectToStakingInfo, startDateTime, onLearnMoreClick } = - this.props; + const { + redirectToStakingInfo, + startDateTime, + onLearnMoreClick, + } = this.props; const { intl } = this.context; const heading = intl.formatMessage(messages.heading); const description = intl.formatMessage(messages.description); diff --git a/source/renderer/app/components/staking/delegation-center/WalletRow.tsx b/source/renderer/app/components/staking/delegation-center/WalletRow.tsx index 289a5b6ae3..5116e983c4 100644 --- a/source/renderer/app/components/staking/delegation-center/WalletRow.tsx +++ b/source/renderer/app/components/staking/delegation-center/WalletRow.tsx @@ -238,11 +238,10 @@ class WalletRow extends Component { const nextPendingDelegatedStakePool = nextPendingDelegatedStakePoolId ? getStakePoolById(nextPendingDelegatedStakePoolId) : null; - const futurePendingDelegatedStakePoolId = - this.getPendingDelegatedStakePoolId( - futureEpochNumber, - nextPendingDelegatedStakePoolId - ); + const futurePendingDelegatedStakePoolId = this.getPendingDelegatedStakePoolId( + futureEpochNumber, + nextPendingDelegatedStakePoolId + ); const futurePendingDelegatedStakePool = futurePendingDelegatedStakePoolId ? getStakePoolById(futurePendingDelegatedStakePoolId) : null; diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.messages.ts b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.messages.ts index a5a3267e38..8751d17a54 100644 --- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.messages.ts +++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseStakePoolDialog.messages.ts @@ -17,73 +17,84 @@ export const getMessages = () => { 'Description on the delegation setup "choose stake pool" dialog.', }, selectStakePoolLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.selectStakePoolLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.selectStakePoolLabel', defaultMessage: '!!!Select a stake pool to receive your delegated funds in the {selectedWalletName} wallet.', description: 'Select / Selected pool section label on the delegation setup "choose stake pool" dialog.', }, selectedStakePoolLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.selectedStakePoolLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.selectedStakePoolLabel', defaultMessage: '!!!You have selected [{selectedPoolTicker}] stake pool to delegate to for {selectedWalletName} wallet.', description: '"Selected Pools" Selected pool label on the delegation setup "choose stake pool" dialog.', }, selectedStakePoolLabelRetiring: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.selectedStakePoolLabelRetiring', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.selectedStakePoolLabelRetiring', defaultMessage: '!!!The [{selectedPoolTicker}] stake pool which you have selected to delegate your {selectedWalletName} wallet funds is about to retire.', description: '"Selected Pools" Selected pool label on the delegation setup "choose stake pool" dialog.', }, delegatedStakePoolLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.delegatedStakePoolLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.delegatedStakePoolLabel', defaultMessage: '!!!You are already delegating {selectedWalletName} wallet to [{selectedPoolTicker}] stake pool. If you wish to re-delegate your stake, please select a different pool.', description: '"You are already delegating to stake pool" label on the delegation setup "choose stake pool" dialog.', }, delegatedStakePoolNextLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.delegatedStakePoolNextLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.delegatedStakePoolNextLabel', defaultMessage: '!!!You are already pending delegation {selectedWalletName} wallet to [{selectedPoolTicker}] stake pool. If you wish to re-delegate your stake, please select a different pool.', description: '"You are already delegating to stake pool" label on the delegation setup "choose stake pool" dialog.', }, recentPoolsLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.recentPoolsLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.recentPoolsLabel', defaultMessage: '!!!Choose one of your recent stake pool choices:', description: 'Recent "Pool" choice section label on the delegation setup "choose stake pool" dialog.', }, searchInputLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.searchInput.label', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.searchInput.label', defaultMessage: '!!!Or select a stake pool from the list of all available stake pools:', description: 'Search "Pools" input label on the delegation setup "choose stake pool" dialog.', }, searchInputPlaceholder: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.searchInput.placeholder', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.searchInput.placeholder', defaultMessage: '!!!Search stake pools', description: 'Search "Pools" input placeholder on the delegation setup "choose stake pool" dialog.', }, continueButtonLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.continueButtonLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.continueButtonLabel', defaultMessage: '!!!Continue', description: 'Label for continue button on the delegation setup "choose stake pool" dialog.', }, stepIndicatorLabel: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.stepIndicatorLabel', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.stepIndicatorLabel', defaultMessage: '!!!STEP {currentStep} OF {totalSteps}', description: 'Step indicator label on the delegation setup "choose wallet" step dialog.', }, retiringPoolFooter: { - id: 'staking.delegationSetup.chooseStakePool.step.dialog.retiringPoolFooter', + id: + 'staking.delegationSetup.chooseStakePool.step.dialog.retiringPoolFooter', defaultMessage: '!!!The stake pool you have selected is about to be retired. If you continue the delegation process, you will need to delegate your stake to another pool at least one complete epoch before the current pool’s retirement date to avoid losing rewards.', description: diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseWalletDialog.tsx b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseWalletDialog.tsx index aa21c2e533..20211f3069 100644 --- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseWalletDialog.tsx +++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseWalletDialog.tsx @@ -33,13 +33,15 @@ const messages = defineMessages({ 'Description on the delegation setup "choose wallet" step dialog.', }, selectWalletInputLabel: { - id: 'staking.delegationSetup.chooseWallet.step.dialog.selectWalletInputLabel', + id: + 'staking.delegationSetup.chooseWallet.step.dialog.selectWalletInputLabel', defaultMessage: '!!!Wallet', description: 'Label "Wallet" for select input on the delegation setup "choose wallet" step dialog.', }, selectWalletInputPlaceholder: { - id: 'staking.delegationSetup.chooseWallet.step.dialog.selectWalletInputPlaceholder', + id: + 'staking.delegationSetup.chooseWallet.step.dialog.selectWalletInputPlaceholder', defaultMessage: '!!!Select Wallet', description: 'Placeholder "Select Wallet" for select input on the delegation setup "choose wallet" step dialog.', @@ -51,14 +53,16 @@ const messages = defineMessages({ 'Step indicator label on the delegation setup "choose wallet" step dialog.', }, errorMinDelegationFunds: { - id: 'staking.delegationSetup.chooseWallet.step.dialog.errorMinDelegationFunds', + id: + 'staking.delegationSetup.chooseWallet.step.dialog.errorMinDelegationFunds', defaultMessage: '!!!This wallet does not contain the minimum amount of {minDelegationFunds} ADA which is required for delegation to be available. Please select a wallet with a minimum amount of {minDelegationFunds} ADA and click continue.', description: 'errorMinDelegationFunds Error Label on the delegation setup "choose wallet" step dialog.', }, errorMinDelegationFundsRewardsOnly: { - id: 'staking.delegationSetup.chooseWallet.step.dialog.errorMinDelegationFundsRewardsOnly', + id: + 'staking.delegationSetup.chooseWallet.step.dialog.errorMinDelegationFundsRewardsOnly', defaultMessage: '!!!This wallet contains only rewards balances so it cannot be delegated.', description: diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.messages.ts b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.messages.ts index 8a7fa2a014..69b3165524 100644 --- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.messages.ts +++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsConfirmationDialog.messages.ts @@ -42,12 +42,14 @@ export const getMessages = () => { 'Deposit label on the delegation setup "confirmation" step dialog.', }, spendingPasswordPlaceholder: { - id: 'staking.delegationSetup.confirmation.step.dialog.spendingPasswordPlaceholder', + id: + 'staking.delegationSetup.confirmation.step.dialog.spendingPasswordPlaceholder', defaultMessage: '!!!Spending password', description: 'Placeholder for "spending password"', }, spendingPasswordLabel: { - id: 'staking.delegationSetup.confirmation.step.dialog.spendingPasswordLabel', + id: + 'staking.delegationSetup.confirmation.step.dialog.spendingPasswordLabel', defaultMessage: '!!!Spending password', description: 'Label for "spending password"', }, diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsNotAvailableDialog.tsx b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsNotAvailableDialog.tsx index 780c6a624b..19acaf3616 100644 --- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsNotAvailableDialog.tsx +++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsNotAvailableDialog.tsx @@ -35,7 +35,9 @@ const messages = defineMessages({ 'Label for close button on the delegation setup not available dialog.', }, }); -export default class DelegationStepsNotAvailableDialog extends Component { +export default class DelegationStepsNotAvailableDialog extends Component< + Props +> { static contextTypes = { intl: intlShape.isRequired, }; diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsSuccessDialog.tsx b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsSuccessDialog.tsx index 68c3fe47cf..6166330005 100644 --- a/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsSuccessDialog.tsx +++ b/source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsSuccessDialog.tsx @@ -97,8 +97,12 @@ class DelegationStepsSuccessDialog extends Component { render() { const { intl } = this.context; - const { delegatedWallet, delegatedStakePool, currentLocale, onClose } = - this.props; + const { + delegatedWallet, + delegatedStakePool, + currentLocale, + onClose, + } = this.props; const actions = [ { className: 'closeButton', diff --git a/source/renderer/app/components/staking/delegation-setup-wizard/OversaturationText.tsx b/source/renderer/app/components/staking/delegation-setup-wizard/OversaturationText.tsx index 50bd2d30ca..36b69a3a93 100644 --- a/source/renderer/app/components/staking/delegation-setup-wizard/OversaturationText.tsx +++ b/source/renderer/app/components/staking/delegation-setup-wizard/OversaturationText.tsx @@ -12,7 +12,8 @@ import styles from './OversaturationText.scss'; const messages: Record = defineMessages({ oversaturationWarning: { - id: 'staking.delegationSetup.confirmation.step.dialog.oversaturationWarning', + id: + 'staking.delegationSetup.confirmation.step.dialog.oversaturationWarning', defaultMessage: '!!!The selected stake pool will become oversaturated by {oversaturationPercentage}%, which will reduce future rewards for all delegators to that pool.', description: diff --git a/source/renderer/app/components/staking/epochs/StakingEpochsDataTable.tsx b/source/renderer/app/components/staking/epochs/StakingEpochsDataTable.tsx index be482fb97c..8320c8b2ae 100644 --- a/source/renderer/app/components/staking/epochs/StakingEpochsDataTable.tsx +++ b/source/renderer/app/components/staking/epochs/StakingEpochsDataTable.tsx @@ -25,8 +25,13 @@ type Props = { @observer class StakingEpochsDataTable extends Component { render() { - const { tableHeaders, tableBody, order, sortBy, handleDataSort } = - this.props; + const { + tableHeaders, + tableBody, + order, + sortBy, + handleDataSort, + } = this.props; return ( diff --git a/source/renderer/app/components/staking/info/StakingInfoCountdown.tsx b/source/renderer/app/components/staking/info/StakingInfoCountdown.tsx index 80c3707feb..808c2c1f46 100644 --- a/source/renderer/app/components/staking/info/StakingInfoCountdown.tsx +++ b/source/renderer/app/components/staking/info/StakingInfoCountdown.tsx @@ -69,8 +69,11 @@ class StakingInfoCountdown extends Component { } checkIfShouldSetStakingInfoWasOpen = () => { - const { onSetStakingInfoWasOpen, isAlonzoActivated, stakingInfoWasOpen } = - this.props; + const { + onSetStakingInfoWasOpen, + isAlonzoActivated, + stakingInfoWasOpen, + } = this.props; if (isAlonzoActivated && !stakingInfoWasOpen) { onSetStakingInfoWasOpen(); diff --git a/source/renderer/app/components/staking/navigation/StakingNavigation.tsx b/source/renderer/app/components/staking/navigation/StakingNavigation.tsx index 05aec41b8f..f39f3564b9 100644 --- a/source/renderer/app/components/staking/navigation/StakingNavigation.tsx +++ b/source/renderer/app/components/staking/navigation/StakingNavigation.tsx @@ -46,8 +46,12 @@ class StakingNavigation extends Component { }; render() { - const { onNavItemClick, activeItem, isActiveNavItem, showInfoTab } = - this.props; + const { + onNavItemClick, + activeItem, + isActiveNavItem, + showInfoTab, + } = this.props; const { intl } = this.context; const navigationItems = [ { diff --git a/source/renderer/app/components/staking/stake-pools/StakePoolsRanking.tsx b/source/renderer/app/components/staking/stake-pools/StakePoolsRanking.tsx index 023d4b88b8..0980538bc9 100644 --- a/source/renderer/app/components/staking/stake-pools/StakePoolsRanking.tsx +++ b/source/renderer/app/components/staking/stake-pools/StakePoolsRanking.tsx @@ -219,8 +219,11 @@ class StakePoolsRanking extends Component { rankStakePools(); }; onSliderChange = (sliderValue: number) => { - const { updateDelegatingStake, maxDelegationFunds, maxDelegationFundsLog } = - this.props; + const { + updateDelegatingStake, + maxDelegationFunds, + maxDelegationFundsLog, + } = this.props; let amountValue = null; if ( diff --git a/source/renderer/app/components/staking/widgets/ThumbPool.tsx b/source/renderer/app/components/staking/widgets/ThumbPool.tsx index 7f5fc3b46b..ede4596c07 100644 --- a/source/renderer/app/components/staking/widgets/ThumbPool.tsx +++ b/source/renderer/app/components/staking/widgets/ThumbPool.tsx @@ -30,8 +30,12 @@ export function ThumbPool(props: { disabledStakePoolId: string | null | undefined; isGridRewardsView?: boolean; }) { - const { isGridRewardsView, isSelected, numberOfRankedStakePools, stakePool } = - props; + const { + isGridRewardsView, + isSelected, + numberOfRankedStakePools, + stakePool, + } = props; const { ranking, id } = stakePool; const color = getColorFromRange(ranking, numberOfRankedStakePools); const isDisabled = props.disabledStakePoolId === id; diff --git a/source/renderer/app/components/staking/widgets/ThumbPoolContent.tsx b/source/renderer/app/components/staking/widgets/ThumbPoolContent.tsx index 82b9610bdd..521cb32471 100644 --- a/source/renderer/app/components/staking/widgets/ThumbPoolContent.tsx +++ b/source/renderer/app/components/staking/widgets/ThumbPoolContent.tsx @@ -47,8 +47,11 @@ class ThumbPoolContent extends Component { }; render() { - const { stakePool, numberOfRankedStakePools, isGridRewardsView } = - this.props; + const { + stakePool, + numberOfRankedStakePools, + isGridRewardsView, + } = this.props; const { ranking, nonMyopicMemberRewards, diff --git a/source/renderer/app/components/staking/widgets/ThumbSelectedPool.tsx b/source/renderer/app/components/staking/widgets/ThumbSelectedPool.tsx index cc67c667a1..5d1377f742 100644 --- a/source/renderer/app/components/staking/widgets/ThumbSelectedPool.tsx +++ b/source/renderer/app/components/staking/widgets/ThumbSelectedPool.tsx @@ -23,8 +23,11 @@ type Props = { @observer class ThumbSelectedPool extends Component { render() { - const { stakePool, alreadyDelegated, numberOfRankedStakePools } = - this.props; + const { + stakePool, + alreadyDelegated, + numberOfRankedStakePools, + } = this.props; const { ticker, retiring, ranking } = stakePool || {}; const rankColor = stakePool && !retiring && IS_RANKING_DATA_AVAILABLE diff --git a/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsChooseWallet.tsx b/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsChooseWallet.tsx index 234cd68dad..284f7e49a7 100644 --- a/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsChooseWallet.tsx +++ b/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsChooseWallet.tsx @@ -22,7 +22,8 @@ const messages = defineMessages({ 'Label "Wallet" for select input on the voting registration "choose wallet" step.', }, selectWalletInputPlaceholder: { - id: 'voting.votingRegistration.chooseWallet.step.selectWalletInputPlaceholder', + id: + 'voting.votingRegistration.chooseWallet.step.selectWalletInputPlaceholder', defaultMessage: '!!!Select a wallet', description: 'Placeholder "Select Wallet" for select input on the voting registration "choose wallet" step.', @@ -35,7 +36,8 @@ const messages = defineMessages({ 'errorMinVotingFunds Error Label on the voting registration "choose wallet" step.', }, errorMinVotingFundsRewardsOnly: { - id: 'voting.votingRegistration.chooseWallet.step.errorMinVotingFundsRewardsOnly', + id: + 'voting.votingRegistration.chooseWallet.step.errorMinVotingFundsRewardsOnly', defaultMessage: '!!!This wallet cannot be registered for voting as it contains rewards balance only.', description: diff --git a/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsEnterPinCode.tsx b/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsEnterPinCode.tsx index 72935565b7..7fd55c0956 100644 --- a/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsEnterPinCode.tsx +++ b/source/renderer/app/components/voting/voting-registration-wizard-steps/VotingRegistrationStepsEnterPinCode.tsx @@ -49,7 +49,8 @@ const messages = defineMessages({ description: 'Error message shown when repeat pin code is invalid.', }, invalidRepeatPinCode: { - id: 'voting.votingRegistration.enterPinCode.step.errors.invalidRepeatPinCode', + id: + 'voting.votingRegistration.enterPinCode.step.errors.invalidRepeatPinCode', defaultMessage: '!!!PIN doesn’t match', description: 'Error message shown when repeat pin code is invalid.', }, diff --git a/source/renderer/app/components/voting/voting-registration-wizard-steps/widgets/ConfirmationDialog.tsx b/source/renderer/app/components/voting/voting-registration-wizard-steps/widgets/ConfirmationDialog.tsx index f607bd00d7..6e96094b99 100644 --- a/source/renderer/app/components/voting/voting-registration-wizard-steps/widgets/ConfirmationDialog.tsx +++ b/source/renderer/app/components/voting/voting-registration-wizard-steps/widgets/ConfirmationDialog.tsx @@ -22,13 +22,15 @@ const messages = defineMessages({ 'Content for the voting registration cancellation confirmation dialog.', }, cancelButtonLabel: { - id: 'voting.votingRegistration.dialog.confirmation.button.cancelButtonLabel', + id: + 'voting.votingRegistration.dialog.confirmation.button.cancelButtonLabel', defaultMessage: '!!!Cancel registration', description: '"Cancel registration" button label for the voting registration cancellation confirmation dialog.', }, confirmButtonLabel: { - id: 'voting.votingRegistration.dialog.confirmation.button.confirmButtonLabel', + id: + 'voting.votingRegistration.dialog.confirmation.button.confirmButtonLabel', defaultMessage: '!!!Continue registration', description: '"Continue registration" button label for the voting registration cancellation confirmation dialog.', diff --git a/source/renderer/app/components/wallet/WalletSendForm.tsx b/source/renderer/app/components/wallet/WalletSendForm.tsx index 4f5cd77211..5524865ed0 100755 --- a/source/renderer/app/components/wallet/WalletSendForm.tsx +++ b/source/renderer/app/components/wallet/WalletSendForm.tsx @@ -429,8 +429,9 @@ class WalletSendForm extends Component { calculateTransactionFee = async () => { const { form } = this; const emptyAssetFieldValue = '0'; - const hasEmptyAssetFields = - this.selectedAssetsAmounts.includes(emptyAssetFieldValue); + const hasEmptyAssetFields = this.selectedAssetsAmounts.includes( + emptyAssetFieldValue + ); // @ts-ignore ts-migrate(2339) FIXME: Property 'isValid' does not exist on type 'ReactTo... Remove this comment to see the full error message if (!form.isValid || hasEmptyAssetFields) { diff --git a/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseDisplayDialog.tsx b/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseDisplayDialog.tsx index 4376b7735d..61335941db 100644 --- a/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseDisplayDialog.tsx +++ b/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseDisplayDialog.tsx @@ -21,7 +21,8 @@ const messages = defineMessages({ 'Instructions for backing up wallet recovery phrase on dialog that displays wallet recovery phrase.', }, buttonLabelIHaveWrittenItDown: { - id: 'wallet.backup.recovery.phrase.display.dialog.button.label.iHaveWrittenItDown', + id: + 'wallet.backup.recovery.phrase.display.dialog.button.label.iHaveWrittenItDown', defaultMessage: '!!!Yes, I have written down my wallet recovery phrase.', description: 'Label for button "Yes, I have written down my wallet recovery phrase." on wallet backup dialog', @@ -78,8 +79,7 @@ class WalletRecoveryPhraseDisplayDialog extends Component { } diff --git a/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseEntryDialog.tsx b/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseEntryDialog.tsx index b77715c2f9..e918a25d9e 100644 --- a/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseEntryDialog.tsx +++ b/source/renderer/app/components/wallet/backup-recovery/WalletRecoveryPhraseEntryDialog.tsx @@ -45,18 +45,21 @@ const messages = defineMessages({ description: 'Placeholder hint for the mnemonics autocomplete.', }, recoveryPhraseInputPlaceholder: { - id: 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInputPlaceholder', + id: + 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInputPlaceholder', defaultMessage: '!!!Enter word #{wordNumber}', description: 'Placeholder for the mnemonics autocomplete.', }, recoveryPhraseNoResults: { - id: 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInputNoResults', + id: + 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInputNoResults', defaultMessage: '!!!No results', description: '"No results" message for the recovery phrase input search results.', }, recoveryPhraseInvalidMnemonics: { - id: 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInvalidMnemonics', + id: + 'wallet.backup.recovery.phrase.entry.dialog.recoveryPhraseInvalidMnemonics', defaultMessage: '!!!Invalid recovery phrase', description: 'Error message shown when invalid recovery phrase was entered.', @@ -67,13 +70,15 @@ const messages = defineMessages({ description: 'Label for button "Confirm" on wallet backup dialog', }, termOffline: { - id: 'wallet.backup.recovery.phrase.entry.dialog.terms.and.condition.offline', + id: + 'wallet.backup.recovery.phrase.entry.dialog.terms.and.condition.offline', defaultMessage: '!!!I understand that the simplest way to keep my wallet recovery phrase secure is to never store it digitally or online. If I decide to use an online service, such as a password manager with an encrypted database, it is my responsibility to make sure that I use it correctly.', description: 'Term on wallet creation to store recovery phrase offline', }, termRecovery: { - id: 'wallet.backup.recovery.phrase.entry.dialog.terms.and.condition.recovery', + id: + 'wallet.backup.recovery.phrase.entry.dialog.terms.and.condition.recovery', defaultMessage: '!!!I understand that the only way to recover my wallet if my computer is lost, broken, stolen, or stops working is to use my wallet recovery phrase.', description: diff --git a/source/renderer/app/components/wallet/paper-wallet-certificate/CompletionDialog.tsx b/source/renderer/app/components/wallet/paper-wallet-certificate/CompletionDialog.tsx index 4b703488d2..4b1bead432 100644 --- a/source/renderer/app/components/wallet/paper-wallet-certificate/CompletionDialog.tsx +++ b/source/renderer/app/components/wallet/paper-wallet-certificate/CompletionDialog.tsx @@ -111,8 +111,12 @@ class CompletionDialog extends Component { render() { const { intl } = this.context; - const { onClose, walletCertificateAddress, onOpenExternalLink, network } = - this.props; + const { + onClose, + walletCertificateAddress, + onOpenExternalLink, + network, + } = this.props; const { showCopyNotification } = this.state; const dialogClasses = classnames([styles.component, 'completionDialog']); const actions = [ diff --git a/source/renderer/app/components/wallet/paper-wallet-certificate/InstructionsDialog.tsx b/source/renderer/app/components/wallet/paper-wallet-certificate/InstructionsDialog.tsx index 4ee7b33d71..70efcad940 100644 --- a/source/renderer/app/components/wallet/paper-wallet-certificate/InstructionsDialog.tsx +++ b/source/renderer/app/components/wallet/paper-wallet-certificate/InstructionsDialog.tsx @@ -40,13 +40,15 @@ const messages = defineMessages({ 'subtitle2 for the "Paper wallet create certificate instructions dialog".', }, instructionsListLabel: { - id: 'paper.wallet.create.certificate.instructions.dialog.instructionsList.label', + id: + 'paper.wallet.create.certificate.instructions.dialog.instructionsList.label', defaultMessage: '!!!Instructions', description: 'Instructions list label for the "Paper wallet create certificate instructions dialog".', }, instructionsListDefinition1: { - id: 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition1', + id: + 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition1', defaultMessage: `!!!Your printed certificate will include your paper wallet recovery phrase of {paperWalletRecoveryPhraseWordCount} words. Note that your paper wallet recovery phrase is different to the {walletRecoveryPhraseWordCount}-word recovery phrases used to restore your @@ -54,32 +56,37 @@ const messages = defineMessages({ description: 'Wallet certificate create instructions dialog definition 1.', }, instructionsListDefinition2: { - id: 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition2', + id: + 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition2', defaultMessage: `!!!For security reasons, the last {paperWalletWrittenWordsCount} words of your paper wallet recovery phrase will not be printed on the paper wallet certificate itself. You will need to write them on your certificate by hand in a moment.`, description: 'Wallet certificate create instructions dialog definition 2.', }, instructionsListDefinition3: { - id: 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition3', + id: + 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition3', defaultMessage: '!!!Use the address on your certificate to send funds to your paper wallet.', description: 'Wallet certificate create instructions dialog definition 3.', }, instructionsListDefinition4: { - id: 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition4', + id: + 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition4', defaultMessage: `!!!Your paper wallet will be offline so will not be held in Daedalus. To check the balance of the wallet, input the address on the certificate into`, description: 'Wallet certificate create instructions dialog definition 4.', }, instructionsListDefinition5: { - id: 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition5', + id: + 'paper.wallet.create.certificate.instructions.dialog.instructionsList.definition5', defaultMessage: '!!!Store your certificate containing your paper wallet recovery phrase in a safe place.', description: 'Wallet certificate create instructions dialog definition 5.', }, printingInstructions: { - id: 'paper.wallet.create.certificate.instructions.dialog.printingInstructions', + id: + 'paper.wallet.create.certificate.instructions.dialog.printingInstructions', defaultMessage: `!!!When you click “Save PDF file for printing” you will be prompted to choose a location on your computer where the PDF file will be saved. After that open the saved PDF file and print it.`, @@ -127,8 +134,14 @@ class InstructionsDialog extends Component { render() { const { intl } = this.context; - const { onClose, onPrint, inProgress, onOpenExternalLink, network, error } = - this.props; + const { + onClose, + onPrint, + inProgress, + onOpenExternalLink, + network, + error, + } = this.props; const dialogClasses = classnames([styles.component, 'instructionsDialog']); const printButtonClasses = classnames([ 'printButton', @@ -178,16 +191,13 @@ class InstructionsDialog extends Component {
  • {intl.formatMessage(messages.instructionsListDefinition1, { - paperWalletRecoveryPhraseWordCount: - PAPER_WALLET_RECOVERY_PHRASE_WORD_COUNT, - walletRecoveryPhraseWordCount: - WALLET_RECOVERY_PHRASE_WORD_COUNT, + paperWalletRecoveryPhraseWordCount: PAPER_WALLET_RECOVERY_PHRASE_WORD_COUNT, + walletRecoveryPhraseWordCount: WALLET_RECOVERY_PHRASE_WORD_COUNT, })}
  • {intl.formatMessage(messages.instructionsListDefinition2, { - paperWalletWrittenWordsCount: - PAPER_WALLET_WRITTEN_WORDS_COUNT, + paperWalletWrittenWordsCount: PAPER_WALLET_WRITTEN_WORDS_COUNT, })}
  • diff --git a/source/renderer/app/components/wallet/paper-wallet-certificate/PrintDialog.tsx b/source/renderer/app/components/wallet/paper-wallet-certificate/PrintDialog.tsx index 1cc84cdb0a..2b5eadff39 100644 --- a/source/renderer/app/components/wallet/paper-wallet-certificate/PrintDialog.tsx +++ b/source/renderer/app/components/wallet/paper-wallet-certificate/PrintDialog.tsx @@ -36,14 +36,16 @@ const messages = defineMessages({ description: '"Paper wallet create certificate print dialog" info.', }, certificatePrintedConfirmationLabel: { - id: 'paper.wallet.create.certificate.print.dialog.certificatePrintedConfirmation', + id: + 'paper.wallet.create.certificate.print.dialog.certificatePrintedConfirmation', defaultMessage: '!!!Yes, the paper wallet certificate printed successfully.', description: '"Paper wallet create certificate print dialog" certificate printed confirmation.', }, certificateReadableConfirmationLabel: { - id: 'paper.wallet.create.certificate.print.dialog.certificateReadableConfirmation', + id: + 'paper.wallet.create.certificate.print.dialog.certificateReadableConfirmation', defaultMessage: '!!!Yes, first {paperWalletPrintedWordsCount} words of the paper wallet recovery phrase are readable.', description: @@ -152,8 +154,7 @@ class PrintDialog extends Component { label={intl.formatMessage( messages.certificateReadableConfirmationLabel, { - paperWalletPrintedWordsCount: - PAPER_WALLET_PRINTED_WORDS_COUNT, + paperWalletPrintedWordsCount: PAPER_WALLET_PRINTED_WORDS_COUNT, } )} onChange={this.onConfirmReadable} diff --git a/source/renderer/app/components/wallet/paper-wallet-certificate/SecuringPasswordDialog.tsx b/source/renderer/app/components/wallet/paper-wallet-certificate/SecuringPasswordDialog.tsx index b1d8ff9b6f..5b1cb7bc49 100644 --- a/source/renderer/app/components/wallet/paper-wallet-certificate/SecuringPasswordDialog.tsx +++ b/source/renderer/app/components/wallet/paper-wallet-certificate/SecuringPasswordDialog.tsx @@ -35,7 +35,8 @@ const messages = defineMessages({ description: 'You may write the remaining words here:', }, securingPasswordConfirmation: { - id: 'paper.wallet.create.certificate.securingPassword.dialog.securingPasswordConfirmation', + id: + 'paper.wallet.create.certificate.securingPassword.dialog.securingPasswordConfirmation', defaultMessage: '!!!I have written the remaining {paperWalletWrittenWordsCount} words on the certificate.', description: diff --git a/source/renderer/app/components/wallet/paper-wallet-certificate/VerificationDialog.tsx b/source/renderer/app/components/wallet/paper-wallet-certificate/VerificationDialog.tsx index 747c786b23..bd42945360 100644 --- a/source/renderer/app/components/wallet/paper-wallet-certificate/VerificationDialog.tsx +++ b/source/renderer/app/components/wallet/paper-wallet-certificate/VerificationDialog.tsx @@ -44,19 +44,22 @@ const messages = defineMessages({ '"Paper wallet create certificate verification dialog" subtitle.', }, recoveryPhraseLabel: { - id: 'paper.wallet.create.certificate.verification.dialog.recoveryPhrase.label', + id: + 'paper.wallet.create.certificate.verification.dialog.recoveryPhrase.label', defaultMessage: '!!!Paper wallet recovery phrase', description: '"Paper wallet create certificate verification dialog" recovery phrase label.', }, recoveryPhraseHint: { - id: 'paper.wallet.create.certificate.verification.dialog.recoveryPhrase.hint', + id: + 'paper.wallet.create.certificate.verification.dialog.recoveryPhrase.hint', defaultMessage: '!!!Enter recovery phrase', description: '"Paper wallet create certificate verification dialog" recovery phrase hint.', }, recoveryPhraseNoResults: { - id: 'paper.wallet.create.certificate.verification.dialog.recoveryPhrase.noResults', + id: + 'paper.wallet.create.certificate.verification.dialog.recoveryPhrase.noResults', defaultMessage: '!!!No results', description: '"Paper wallet create certificate verification dialog" recovery phrase no results label.', @@ -68,14 +71,16 @@ const messages = defineMessages({ '"Paper wallet create certificate verification dialog" button clear label.', }, storingUnderstandanceLabel: { - id: 'paper.wallet.create.certificate.verification.dialog.storingUnderstandanceConfirmationLabel', + id: + 'paper.wallet.create.certificate.verification.dialog.storingUnderstandanceConfirmationLabel', defaultMessage: '!!!I understand that the paper wallet I create will not be stored in Daedalus.', description: '"Paper wallet create certificate verification dialog" storing understandance confirmation.', }, recoveringUnderstandanceLabel: { - id: 'paper.wallet.create.certificate.verification.dialog.recoveringUnderstandanceConfirmationLabel', + id: + 'paper.wallet.create.certificate.verification.dialog.recoveringUnderstandanceConfirmationLabel', defaultMessage: '!!!I understand that my paper wallet can be recovered only by using my paper wallet certificate.', description: @@ -223,8 +228,11 @@ class VerificationDialog extends Component { const { intl } = this.context; const { form, resetForm } = this; const { suggestedMnemonics, onClose } = this.props; - const { storingConfirmed, recoveringConfirmed, isRecoveryPhraseValid } = - this.state; + const { + storingConfirmed, + recoveringConfirmed, + isRecoveryPhraseValid, + } = this.state; // @ts-ignore ts-migrate(2339) FIXME: Property '$' does not exist on type 'ReactToolboxM... Remove this comment to see the full error message const recoveryPhraseField = form.$('recoveryPhrase'); const dialogClasses = classnames([styles.dialog, 'verificationDialog']); diff --git a/source/renderer/app/components/wallet/receive/WalletReceiveDialog.tsx b/source/renderer/app/components/wallet/receive/WalletReceiveDialog.tsx index 03c662cac4..70ccdcf0d9 100644 --- a/source/renderer/app/components/wallet/receive/WalletReceiveDialog.tsx +++ b/source/renderer/app/components/wallet/receive/WalletReceiveDialog.tsx @@ -196,8 +196,9 @@ class WalletReceiveDialog extends Component { }; constructPaths = (address: WalletAddress) => { const hardenedSpendingPath = utils.str_to_path(address.spendingPath); - const derivationSpendingPath = - hardenedPathToDerivationPath(hardenedSpendingPath); + const derivationSpendingPath = hardenedPathToDerivationPath( + hardenedSpendingPath + ); const spendingPath = map( derivationSpendingPath.constructed, (constructeSpendingPathChunk, index) => { diff --git a/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.messages.ts b/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.messages.ts index 319ace9ef8..f224536b3c 100644 --- a/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.messages.ts +++ b/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.messages.ts @@ -93,13 +93,15 @@ export const getMessages = () => { description: 'Label for "unformated amount"', }, unformattedAmountMessageForSoftwareWallets: { - id: 'wallet.send.confirmationDialog.unformattedAmountMessageForSoftwareWallets', + id: + 'wallet.send.confirmationDialog.unformattedAmountMessageForSoftwareWallets', defaultMessage: '!!!Native assets may specify a number of decimal places, as defined in the Cardano token registry. Daedalus uses this information to format the amount that is being sent in the transaction.

    The native token unformatted amount is the amount without these decimal places. Please ensure that you verify both amounts, as some wallet software may not yet use the Cardano token registry.', description: 'Message for "unformated amount"', }, unformattedAmountMessageForHardwareWallets: { - id: 'wallet.send.confirmationDialog.unformattedAmountMessageForHardwareWallets', + id: + 'wallet.send.confirmationDialog.unformattedAmountMessageForHardwareWallets', defaultMessage: '!!!Native assets may specify a number of decimal places, as defined in the Cardano token registry. Daedalus uses this information to format the amount that is being sent in the transaction.

    The native token unformatted amount is the amount without these decimal places. Please ensure that you verify both amounts, as some wallet software may not yet use the Cardano token registry.

    The native token unformatted amount will be displayed on the hardware wallet device during transaction confirmation.', description: 'Message for "unformated amount"', diff --git a/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.tsx b/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.tsx index b9a0be98ca..771f26347a 100644 --- a/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.tsx +++ b/source/renderer/app/components/wallet/send-form/WalletSendAssetsConfirmationDialog.tsx @@ -136,8 +136,12 @@ class WalletSendAssetsConfirmationDialog extends Component { this.form.submit({ onSuccess: (form) => { const { selectedAssets, assetsAmounts } = this.state; - const { receiver, amount, amountToNaturalUnits, isHardwareWallet } = - this.props; + const { + receiver, + amount, + amountToNaturalUnits, + isHardwareWallet, + } = this.props; const { passphrase } = form.values(); const transactionData = { receiver, @@ -162,8 +166,13 @@ class WalletSendAssetsConfirmationDialog extends Component { // @ts-ignore ts-migrate(2339) FIXME: Property '$' does not exist on type 'ReactToolboxM... Remove this comment to see the full error message const passphraseField = this.form.$('passphrase'); const { areTermsAccepted } = this.state; - const { hwDeviceStatus, isFlight, onExternalLinkClick, wallet, isTrezor } = - this.props; + const { + hwDeviceStatus, + isFlight, + onExternalLinkClick, + wallet, + isTrezor, + } = this.props; let returnJSX = null; if (!isFlight || (isFlight && areTermsAccepted)) { diff --git a/source/renderer/app/components/wallet/send-form/WalletSendConfirmationDialog.tsx b/source/renderer/app/components/wallet/send-form/WalletSendConfirmationDialog.tsx index 3525e88e5b..260f4613c3 100644 --- a/source/renderer/app/components/wallet/send-form/WalletSendConfirmationDialog.tsx +++ b/source/renderer/app/components/wallet/send-form/WalletSendConfirmationDialog.tsx @@ -106,8 +106,12 @@ class WalletSendConfirmationDialog extends Component { // @ts-ignore ts-migrate(2339) FIXME: Property 'submit' does not exist on type 'ReactToo... Remove this comment to see the full error message this.form.submit({ onSuccess: (form) => { - const { receiver, amount, amountToNaturalUnits, isHardwareWallet } = - this.props; + const { + receiver, + amount, + amountToNaturalUnits, + isHardwareWallet, + } = this.props; const { passphrase } = form.values(); const transactionData = { receiver, @@ -130,8 +134,13 @@ class WalletSendConfirmationDialog extends Component { // @ts-ignore ts-migrate(2339) FIXME: Property '$' does not exist on type 'ReactToolboxM... Remove this comment to see the full error message const passphraseField = this.form.$('passphrase'); const { areTermsAccepted } = this.state; - const { hwDeviceStatus, isFlight, onExternalLinkClick, wallet, isTrezor } = - this.props; + const { + hwDeviceStatus, + isFlight, + onExternalLinkClick, + wallet, + isTrezor, + } = this.props; if (!isFlight || (isFlight && areTermsAccepted)) { const { name } = wallet; diff --git a/source/renderer/app/components/wallet/settings/ICOPublicKeyBox.tsx b/source/renderer/app/components/wallet/settings/ICOPublicKeyBox.tsx index ec2bec5458..1e9ed96333 100644 --- a/source/renderer/app/components/wallet/settings/ICOPublicKeyBox.tsx +++ b/source/renderer/app/components/wallet/settings/ICOPublicKeyBox.tsx @@ -42,8 +42,13 @@ type Props = { }; const ICOPublicKeyBox = (props: Props) => { - const { publicKey, locale, onCopyICOPublicKey, openDialogAction, intl } = - props; + const { + publicKey, + locale, + onCopyICOPublicKey, + openDialogAction, + intl, + } = props; return ( <> diff --git a/source/renderer/app/components/wallet/settings/PublicKeyField.tsx b/source/renderer/app/components/wallet/settings/PublicKeyField.tsx index 45f26e9258..c3bb21dc35 100644 --- a/source/renderer/app/components/wallet/settings/PublicKeyField.tsx +++ b/source/renderer/app/components/wallet/settings/PublicKeyField.tsx @@ -58,10 +58,9 @@ const PublicKeyField = (props: Props) => { useEffect(() => { setPublicKeyHidden(true); }, []); - const handleCopyPublicKey = useCallback( - () => onCopyPublicKey(publicKey), - [publicKey] - ); + const handleCopyPublicKey = useCallback(() => onCopyPublicKey(publicKey), [ + publicKey, + ]); const fieldStyles = classnames([ styles.field, publicKeyHidden || !publicKey ? styles.valueHidden : styles.valueShown, diff --git a/source/renderer/app/components/wallet/settings/WalletRecoveryPhraseVerificationWidget.tsx b/source/renderer/app/components/wallet/settings/WalletRecoveryPhraseVerificationWidget.tsx index 623a021270..b73d5c6cdf 100644 --- a/source/renderer/app/components/wallet/settings/WalletRecoveryPhraseVerificationWidget.tsx +++ b/source/renderer/app/components/wallet/settings/WalletRecoveryPhraseVerificationWidget.tsx @@ -119,7 +119,8 @@ export const messages = defineMessages({ 'Label for the recoveryPhraseVerificationButton on wallet settings.', }, timeUntilWarningReplacement: { - id: 'wallet.settings.recoveryPhraseVerification.timeUntilWarningReplacement', + id: + 'wallet.settings.recoveryPhraseVerification.timeUntilWarningReplacement', defaultMessage: '!!!ヶ月,か月', description: 'Label for the recoveryPhraseVerificationButton on wallet settings.', @@ -226,8 +227,12 @@ class WalletRecoveryPhraseVerificationWidget extends Component { recoveryPhraseVerificationDate, isLegacy, } = this.props; - const { icon, message, timeAgo, timeUntilWarning } = - this.recoveryPhraseStatus; + const { + icon, + message, + timeAgo, + timeUntilWarning, + } = this.recoveryPhraseStatus; const { recoveryPhraseVerificationStatus } = getStatusFromWalletData({ creationDate, recoveryPhraseVerificationDate, diff --git a/source/renderer/app/components/wallet/settings/WalletSettings.tsx b/source/renderer/app/components/wallet/settings/WalletSettings.tsx index 665c14ef03..069d74dded 100644 --- a/source/renderer/app/components/wallet/settings/WalletSettings.tsx +++ b/source/renderer/app/components/wallet/settings/WalletSettings.tsx @@ -182,8 +182,11 @@ class WalletSettings extends Component { }); }; onUndelegateWalletClick = async () => { - const { walletId, openDialogAction, updateDataForActiveDialogAction } = - this.props; + const { + walletId, + openDialogAction, + updateDataForActiveDialogAction, + } = this.props; this.onBlockForm(); openDialogAction({ dialog: UndelegateWalletConfirmationDialog, diff --git a/source/renderer/app/components/wallet/tokens/WalletTokensList.tsx b/source/renderer/app/components/wallet/tokens/WalletTokensList.tsx index c2b66ff2c1..a2e7d31fb0 100644 --- a/source/renderer/app/components/wallet/tokens/WalletTokensList.tsx +++ b/source/renderer/app/components/wallet/tokens/WalletTokensList.tsx @@ -141,14 +141,16 @@ const WalletTokensList = observer((props: Props) => { }, [sortDirection, hasSorting, sortBy] ); - const onSortByToken = useCallback( - () => onSortBy('token'), - [sortDirection, sortBy, hasSorting] - ); - const onSortByAmount = useCallback( - () => onSortBy('quantity'), - [sortDirection, sortBy, hasSorting] - ); + const onSortByToken = useCallback(() => onSortBy('token'), [ + sortDirection, + sortBy, + hasSorting, + ]); + const onSortByAmount = useCallback(() => onSortBy('quantity'), [ + sortDirection, + sortBy, + hasSorting, + ]); const hasTokens = assets.length || isLoadingAssets; if (!hasTokens) return ( diff --git a/source/renderer/app/components/wallet/transactions/Transaction.tsx b/source/renderer/app/components/wallet/transactions/Transaction.tsx index fe26205f94..eae102b850 100644 --- a/source/renderer/app/components/wallet/transactions/Transaction.tsx +++ b/source/renderer/app/components/wallet/transactions/Transaction.tsx @@ -402,8 +402,12 @@ export default class Transaction extends Component { } get assetsList(): Array { - const { assetTokens, data, isInternalAddress, hasAssetsEnabled } = - this.props; + const { + assetTokens, + data, + isInternalAddress, + hasAssetsEnabled, + } = this.props; if (!hasAssetsEnabled) { return []; @@ -420,8 +424,9 @@ export default class Transaction extends Component { const type = this.hasAssets ? data.type : null; if (addresses && addresses.length > 0) { - const hasUnresolvedAddresses = - this.includesUnresolvedAddresses(addresses); + const hasUnresolvedAddresses = this.includesUnresolvedAddresses( + addresses + ); return type !== TransactionTypes.EXPEND && hasUnresolvedAddresses ? (
    { if (!filterOptions || !activeWallet) return null; let walletTransactions = null; // const { searchLimit } = filterOptions; - const numberOfFilterDimensionsApplied = - getNumberOfFilterDimensionsApplied(filterOptions); + const numberOfFilterDimensionsApplied = getNumberOfFilterDimensionsApplied( + filterOptions + ); const noTransactionsLabel = intl.formatMessage(messages.noTransactions); const isRestoreActive = activeWallet && activeWallet.isRestoring; const isFilterDisabled = diff --git a/source/renderer/app/components/wallet/transactions/WalletTransactionsList.tsx b/source/renderer/app/components/wallet/transactions/WalletTransactionsList.tsx index f0a17bb0f4..0e892bfb3f 100644 --- a/source/renderer/app/components/wallet/transactions/WalletTransactionsList.tsx +++ b/source/renderer/app/components/wallet/transactions/WalletTransactionsList.tsx @@ -45,10 +45,11 @@ const messages = defineMessages({ export type ScrollContextType = { setIsScrolling: (...args: Array) => any; }; -export const WalletTransactionsListScrollContext = - React.createContext({ - setIsScrolling: () => null, - }); +export const WalletTransactionsListScrollContext = React.createContext< + ScrollContextType +>({ + setIsScrolling: () => null, +}); type Props = { deletePendingTransaction: (...args: Array) => any; formattedWalletAmount: (...args: Array) => any; diff --git a/source/renderer/app/components/wallet/transactions/metadata/MetadataValueView.tsx b/source/renderer/app/components/wallet/transactions/metadata/MetadataValueView.tsx index 2d87be1e69..e9246fc5f1 100644 --- a/source/renderer/app/components/wallet/transactions/metadata/MetadataValueView.tsx +++ b/source/renderer/app/components/wallet/transactions/metadata/MetadataValueView.tsx @@ -31,16 +31,14 @@ function BytesView({ value }: { value: MetadataBytes }) { function ListView({ value }: { value: MetadataList }) { return (
      - {value.list.map( - ( - v, - index // eslint-disable-next-line react/no-array-index-key - ) => ( -
    1. - -
    2. - ) - )} + {value.list.map(( + v, + index // eslint-disable-next-line react/no-array-index-key + ) => ( +
    3. + +
    4. + ))}
    ); } @@ -48,16 +46,14 @@ function ListView({ value }: { value: MetadataList }) { function MapView({ value }: { value: MetadataMap }) { return (
      - {value.map.map( - ( - v, - index // eslint-disable-next-line react/no-array-index-key - ) => ( -
    1. - : -
    2. - ) - )} + {value.map.map(( + v, + index // eslint-disable-next-line react/no-array-index-key + ) => ( +
    3. + : +
    4. + ))}
    ); } diff --git a/source/renderer/app/components/wallet/transactions/render-strategies/SimpleTransactionList.tsx b/source/renderer/app/components/wallet/transactions/render-strategies/SimpleTransactionList.tsx index 20f064db9d..5838a3b57a 100644 --- a/source/renderer/app/components/wallet/transactions/render-strategies/SimpleTransactionList.tsx +++ b/source/renderer/app/components/wallet/transactions/render-strategies/SimpleTransactionList.tsx @@ -40,16 +40,14 @@ class SimpleTransactionList extends Component { className={styles.component} onScroll={(evt) => this.onListScroll(context, evt)} > - {rows.map( - ( - row, - index // eslint-disable-next-line react/no-array-index-key - ) => ( -
    - {renderRow(row)} -
    - ) - )} + {rows.map(( + row, + index // eslint-disable-next-line react/no-array-index-key + ) => ( +
    + {renderRow(row)} +
    + ))}
    )} diff --git a/source/renderer/app/components/wallet/wallet-import/WalletSelectImportDialog.tsx b/source/renderer/app/components/wallet/wallet-import/WalletSelectImportDialog.tsx index 7e05699a11..e2e3ff8d62 100644 --- a/source/renderer/app/components/wallet/wallet-import/WalletSelectImportDialog.tsx +++ b/source/renderer/app/components/wallet/wallet-import/WalletSelectImportDialog.tsx @@ -187,8 +187,8 @@ class WalletSelectImportDialog extends Component { ); if (checkboxes[index] && topWrapper.length) { - const checkboxTopOffset = - checkboxes[index].getBoundingClientRect().top; + const checkboxTopOffset = checkboxes[index].getBoundingClientRect() + .top; const topWrapperTopOffset = topWrapper[0].getBoundingClientRect().top; const topPart = topWrapperTopOffset + 121; const spaceForTooltip = checkboxTopOffset - topPart; diff --git a/source/renderer/app/components/wallet/wallet-restore/ConfigurationDialog.tsx b/source/renderer/app/components/wallet/wallet-restore/ConfigurationDialog.tsx index 2dfbe41fd2..a5de5f18cc 100644 --- a/source/renderer/app/components/wallet/wallet-restore/ConfigurationDialog.tsx +++ b/source/renderer/app/components/wallet/wallet-restore/ConfigurationDialog.tsx @@ -62,7 +62,8 @@ const messages = defineMessages({ 'Label for the "Repeat password" input in the wallet restore dialog.', }, passwordFieldsPlaceholder: { - id: 'wallet.restore.dialog.step.configuration.input.passwordFields.placeholder', + id: + 'wallet.restore.dialog.step.configuration.input.passwordFields.placeholder', defaultMessage: '!!!Password', description: 'Placeholder for the "Password" inputs in the wallet restore dialog.', diff --git a/source/renderer/app/components/wallet/wallet-restore/MnemonicsDialog.tsx b/source/renderer/app/components/wallet/wallet-restore/MnemonicsDialog.tsx index 89d3e44516..452195fb16 100644 --- a/source/renderer/app/components/wallet/wallet-restore/MnemonicsDialog.tsx +++ b/source/renderer/app/components/wallet/wallet-restore/MnemonicsDialog.tsx @@ -26,7 +26,8 @@ const messages = defineMessages({ description: 'Placeholder for the mnemonics autocomplete.', }, autocompleteMultiLengthPhrase: { - id: 'wallet.restore.dialog.step.mnemonics.autocomplete.multiLengthPhrase.placeholder', + id: + 'wallet.restore.dialog.step.mnemonics.autocomplete.multiLengthPhrase.placeholder', defaultMessage: '!!!Enter your 12, 18 or 24-word recovery phrase', description: 'Placeholder for the multi-length mnemonics autocomplete.', }, @@ -42,7 +43,8 @@ const messages = defineMessages({ description: 'Label for the mnemonics Continue button.', }, invalidRecoveryPhrase: { - id: 'wallet.restore.dialog.step.mnemonics.autocomplete.invalidRecoveryPhrase', + id: + 'wallet.restore.dialog.step.mnemonics.autocomplete.invalidRecoveryPhrase', defaultMessage: '!!!Invalid recovery phrase', description: 'Label for invalid recovery phrase', }, diff --git a/source/renderer/app/components/wallet/wallet-restore/WalletTypeDialog.tsx b/source/renderer/app/components/wallet/wallet-restore/WalletTypeDialog.tsx index c60e57d430..c59cb1d97a 100644 --- a/source/renderer/app/components/wallet/wallet-restore/WalletTypeDialog.tsx +++ b/source/renderer/app/components/wallet/wallet-restore/WalletTypeDialog.tsx @@ -51,25 +51,29 @@ const messages = defineMessages({ description: 'Label for the "labelDaedalusWalletKind" checkbox.', }, labelDaedalusWalletKind12WordByron: { - id: 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind12WordByron', + id: + 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind12WordByron', defaultMessage: '!!!12 words (Byron legacy wallet)', description: 'Label for the "labelDaedalusWalletKind12WordByron" checkbox.', }, labelDaedalusWalletKind15WordShelley: { - id: 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind15WordShelley', + id: + 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind15WordShelley', defaultMessage: '!!!15 words (Incentivized Testnet Rewards wallet)', description: 'Label for the "labelDaedalusWalletKind15WordShelley" checkbox.', }, labelDaedalusWalletKind24WordShelley: { - id: 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind24WordShelley', + id: + 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind24WordShelley', defaultMessage: '!!!24 words (Shelley wallet)', description: 'Label for the "labelDaedalusWalletKind24WordShelley" checkbox.', }, labelDaedalusWalletKind27WordPaper: { - id: 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind27WordPaper', + id: + 'wallet.restore.dialog.step.walletKind.label.daedalusWalletKind27WordPaper', defaultMessage: '!!!27 words - paper wallet (Byron legacy wallet)', description: 'Label for the "labelDaedalusWalletKind27WordPaper" checkbox.', }, @@ -79,12 +83,14 @@ const messages = defineMessages({ description: 'Label for the "labelYoroiWalletKind" checkbox.', }, labelYoroiWalletKind15WordByron: { - id: 'wallet.restore.dialog.step.walletKind.label.yoroiWalletKindByronLegacy15Word', + id: + 'wallet.restore.dialog.step.walletKind.label.yoroiWalletKindByronLegacy15Word', defaultMessage: '!!!15 words (Byron legacy wallet)', description: 'Label for the "labelDaedalusWalletKind15WordByron" checkbox.', }, labelYoroiWalletKind15WordShelley: { - id: 'wallet.restore.dialog.step.walletKind.label.yoroiWalletKindShelley15Word', + id: + 'wallet.restore.dialog.step.walletKind.label.yoroiWalletKindShelley15Word', defaultMessage: '!!!15 words (Shelley wallet)', description: 'Label for the "labelDaedalusWalletKind15WordShelley" checkbox.', diff --git a/source/renderer/app/components/widgets/BorderedBox.tsx b/source/renderer/app/components/widgets/BorderedBox.tsx index 5b600865d0..af929902cf 100644 --- a/source/renderer/app/components/widgets/BorderedBox.tsx +++ b/source/renderer/app/components/widgets/BorderedBox.tsx @@ -17,8 +17,13 @@ type Props = { @observer class BorderedBox extends Component { render() { - const { children, className, fullHeight, onMouseEnter, onMouseLeave } = - this.props; + const { + children, + className, + fullHeight, + onMouseEnter, + onMouseLeave, + } = this.props; const componentClasses = classnames([ styles.component, fullHeight ? styles.fullHeight : null, diff --git a/source/renderer/app/components/widgets/forms/PinCode.tsx b/source/renderer/app/components/widgets/forms/PinCode.tsx index d6f5bda92c..32e6dac27a 100644 --- a/source/renderer/app/components/widgets/forms/PinCode.tsx +++ b/source/renderer/app/components/widgets/forms/PinCode.tsx @@ -68,8 +68,16 @@ export default class PinCode extends Component { } generatePinCodeInput = () => { - const { id, name, type, autoFocus, length, error, value, disabled } = - this.props; + const { + id, + name, + type, + autoFocus, + length, + error, + value, + disabled, + } = this.props; const pinCodeClasses = classNames([ styles.pinCode, error ? styles.error : null, diff --git a/source/renderer/app/config/currencyConfig.ts b/source/renderer/app/config/currencyConfig.ts index 8d42f78b15..9291c45db6 100644 --- a/source/renderer/app/config/currencyConfig.ts +++ b/source/renderer/app/config/currencyConfig.ts @@ -27,8 +27,9 @@ export const CURRENCY_DEFAULT_SELECTED = currenciesList.usd; export const CURRENCY_REQUEST_RATE_INTERVAL = 60 * 1000; // 1 minute | unit: milliseconds // Generic function for all the Currency requests -export const genericCurrencyRequest = - (requestName: RequestName): ((...args: Array) => any) => +export const genericCurrencyRequest = ( + requestName: RequestName +): ((...args: Array) => any) => // @ts-ignore ts-migrate(1064) FIXME: The return type of an async function or method mus... Remove this comment to see the full error message async (payload?: any): any => { const request = currencyConfig.requests[requestName]; diff --git a/source/renderer/app/config/walletRestoreConfig.ts b/source/renderer/app/config/walletRestoreConfig.ts index e8b3621ca4..01f03727de 100644 --- a/source/renderer/app/config/walletRestoreConfig.ts +++ b/source/renderer/app/config/walletRestoreConfig.ts @@ -27,19 +27,21 @@ export const WALLET_KINDS: EnumMap = { YOROI: 'Yoroi', // HARDWARE: 'Hardware', }; -export const WALLET_DAEDALUS_KINDS: EnumMap = - isMainnet - ? { - BYRON_12_WORD: '12WordByron', - SHELLEY_24_WORD: '24WordShelley', - BYRON_27_WORD: '27WordPaper', - } - : { - BYRON_12_WORD: '12WordByron', - SHELLEY_15_WORD: '15WordShelley', - SHELLEY_24_WORD: '24WordShelley', - BYRON_27_WORD: '27WordPaper', - }; +export const WALLET_DAEDALUS_KINDS: EnumMap< + string, + WalletDaedalusKind +> = isMainnet + ? { + BYRON_12_WORD: '12WordByron', + SHELLEY_24_WORD: '24WordShelley', + BYRON_27_WORD: '27WordPaper', + } + : { + BYRON_12_WORD: '12WordByron', + SHELLEY_15_WORD: '15WordShelley', + SHELLEY_24_WORD: '24WordShelley', + BYRON_27_WORD: '27WordPaper', + }; export const WALLET_YOROI_KINDS: EnumMap = { BYRON_15_WORD: '15WordByron', diff --git a/source/renderer/app/containers/TopBarContainer.tsx b/source/renderer/app/containers/TopBarContainer.tsx index bd1a353903..7504832db1 100644 --- a/source/renderer/app/containers/TopBarContainer.tsx +++ b/source/renderer/app/containers/TopBarContainer.tsx @@ -24,8 +24,15 @@ const TopBarContainer = ( stores: null, } ) => { - const { sidebar, app, networkStatus, wallets, newsFeed, appUpdate, staking } = - stores; + const { + sidebar, + app, + networkStatus, + wallets, + newsFeed, + appUpdate, + staking, + } = stores; const { isSynced, syncPercentage, diff --git a/source/renderer/app/containers/appUpdate/AppUpdateContainer.tsx b/source/renderer/app/containers/appUpdate/AppUpdateContainer.tsx index 176acf97c9..2861e4c4e4 100644 --- a/source/renderer/app/containers/appUpdate/AppUpdateContainer.tsx +++ b/source/renderer/app/containers/appUpdate/AppUpdateContainer.tsx @@ -30,8 +30,11 @@ class AppUpdateContainer extends Component { isWaitingToQuitDaedalus, installationProgress, } = appUpdate; - const { installUpdate, closeAppUpdateOverlay, postponeUpdate } = - actions.appUpdate; + const { + installUpdate, + closeAppUpdateOverlay, + postponeUpdate, + } = actions.appUpdate; if (!availableUpdate) return null; return ( { } get isSystemTimeError() { - const { isSystemTimeCorrect, isNodeStopping, isNodeStopped } = - this.networkStatus; + const { + isSystemTimeCorrect, + isNodeStopping, + isNodeStopped, + } = this.networkStatus; return !isSystemTimeCorrect && !isNodeStopping && !isNodeStopped; } diff --git a/source/renderer/app/containers/loading/NoDiskSpaceErrorPage.tsx b/source/renderer/app/containers/loading/NoDiskSpaceErrorPage.tsx index e54b91aa96..626b4923ee 100644 --- a/source/renderer/app/containers/loading/NoDiskSpaceErrorPage.tsx +++ b/source/renderer/app/containers/loading/NoDiskSpaceErrorPage.tsx @@ -14,8 +14,11 @@ class NoDiskSpaceErrorPage extends Component { render() { const { stores } = this.props; - const { diskSpaceRequired, diskSpaceMissing, diskSpaceRecommended } = - stores.networkStatus; + const { + diskSpaceRequired, + diskSpaceMissing, + diskSpaceRecommended, + } = stores.networkStatus; return ( { }; render() { - const { newsFeed, appUpdate, networkStatus, profile, app } = - this.props.stores; + const { + newsFeed, + appUpdate, + networkStatus, + profile, + app, + } = this.props.stores; const { cardanoNodeState, isNodeResponding, diff --git a/source/renderer/app/containers/loading/SystemTimeErrorPage.tsx b/source/renderer/app/containers/loading/SystemTimeErrorPage.tsx index fbede1c78d..320aab74fd 100644 --- a/source/renderer/app/containers/loading/SystemTimeErrorPage.tsx +++ b/source/renderer/app/containers/loading/SystemTimeErrorPage.tsx @@ -15,8 +15,10 @@ class SystemTimeErrorPage extends Component { render() { const { actions, stores } = this.props; - const { localTimeDifference, ignoreSystemTimeChecks } = - stores.networkStatus; + const { + localTimeDifference, + ignoreSystemTimeChecks, + } = stores.networkStatus; const { forceCheckNetworkClock } = actions.networkStatus; const { app, networkStatus, profile } = stores; const { openExternalLink } = app; diff --git a/source/renderer/app/containers/news/NewsFeedContainer.tsx b/source/renderer/app/containers/news/NewsFeedContainer.tsx index f0ae4f9666..50a6339eb2 100644 --- a/source/renderer/app/containers/news/NewsFeedContainer.tsx +++ b/source/renderer/app/containers/news/NewsFeedContainer.tsx @@ -21,8 +21,11 @@ class NewsFeedContainer extends Component { const { app, profile, appUpdate, newsFeed } = stores; const { newsFeedData, isLoadingNews, proceedNewsAction } = newsFeed; const { openAppUpdateOverlay } = actions.appUpdate; - const { downloadProgress, displayAppUpdateNewsItem, isUpdatePostponed } = - appUpdate; + const { + downloadProgress, + displayAppUpdateNewsItem, + isUpdatePostponed, + } = appUpdate; const { toggleNewsFeed } = actions.app; const { openExternalLink, newsFeedIsOpen } = app; const { currentDateFormat } = profile; diff --git a/source/renderer/app/containers/notifications/NotificationsContainer.tsx b/source/renderer/app/containers/notifications/NotificationsContainer.tsx index 75219a0537..e0a1d2c97f 100644 --- a/source/renderer/app/containers/notifications/NotificationsContainer.tsx +++ b/source/renderer/app/containers/notifications/NotificationsContainer.tsx @@ -127,8 +127,8 @@ class NotificationsContainer extends Component { }, { id: 'downloadTransactionsCSVSuccess', - actionToListenAndOpen: - this.props.actions.transactions.requestCSVFileSuccess, + actionToListenAndOpen: this.props.actions.transactions + .requestCSVFileSuccess, actionToListenAndClose: this.props.actions.transactions.requestCSVFile, }, { @@ -145,8 +145,8 @@ class NotificationsContainer extends Component { }, { id: 'downloadAddressPDFSuccess', - actionToListenAndOpen: - this.props.actions.wallets.generateAddressPDFSuccess, + actionToListenAndOpen: this.props.actions.wallets + .generateAddressPDFSuccess, actionToListenAndClose: this.props.actions.wallets.generateAddressPDF, }, { @@ -161,13 +161,13 @@ class NotificationsContainer extends Component { }, { id: 'copyStateDirectoryPath', - actionToListenAndOpen: - this.props.actions.networkStatus.copyStateDirectoryPath, + actionToListenAndOpen: this.props.actions.networkStatus + .copyStateDirectoryPath, }, { id: 'copyAssetParam', - actionToListenAndOpen: - this.props.actions.assets.copyAssetParamNotification, + actionToListenAndOpen: this.props.actions.assets + .copyAssetParamNotification, }, ]; // @ts-ignore ts-migrate(2740) FIXME: Type '{ downloadLogsProgress: { icon: string; hasE... Remove this comment to see the full error message diff --git a/source/renderer/app/containers/profile/DataLayerMigrationPage.tsx b/source/renderer/app/containers/profile/DataLayerMigrationPage.tsx index ab006bad6c..c1ecd45076 100644 --- a/source/renderer/app/containers/profile/DataLayerMigrationPage.tsx +++ b/source/renderer/app/containers/profile/DataLayerMigrationPage.tsx @@ -16,8 +16,9 @@ class DataLayerMigrationPage extends Component { }; render() { - const { setDataLayerMigrationAcceptanceRequest } = - this.props.stores.profile; + const { + setDataLayerMigrationAcceptanceRequest, + } = this.props.stores.profile; return ( { render() { const { stores, actions } = this.props; - const { smashServerUrl, smashServerUrlError, smashServerLoading } = - stores.staking; + const { + smashServerUrl, + smashServerUrlError, + smashServerLoading, + } = stores.staking; const { isSynced, syncPercentage } = stores.networkStatus; const { openExternalLink } = stores.app; const { resetSmashServerError } = actions.staking; diff --git a/source/renderer/app/containers/staking/RedeemItnRewardsContainer.tsx b/source/renderer/app/containers/staking/RedeemItnRewardsContainer.tsx index 95097c1409..5a433a2a54 100644 --- a/source/renderer/app/containers/staking/RedeemItnRewardsContainer.tsx +++ b/source/renderer/app/containers/staking/RedeemItnRewardsContainer.tsx @@ -30,8 +30,11 @@ class RedeemItnRewardsContainer extends Component { render() { const { stores, actions } = this.props; const { allWallets } = stores.wallets; - const { redeemStep, isSubmittingReedem, isCalculatingReedemFees } = - stores.staking; + const { + redeemStep, + isSubmittingReedem, + isCalculatingReedemFees, + } = stores.staking; const { isSynced } = stores.networkStatus; const { onRedeemStart, closeRedeemDialog } = actions.staking; if (!redeemStep) return null; diff --git a/source/renderer/app/containers/staking/StakePoolsListPage.tsx b/source/renderer/app/containers/staking/StakePoolsListPage.tsx index cf627057c1..d60a5e6154 100644 --- a/source/renderer/app/containers/staking/StakePoolsListPage.tsx +++ b/source/renderer/app/containers/staking/StakePoolsListPage.tsx @@ -48,8 +48,14 @@ class StakePoolsListPage extends Component { }; render() { - const { uiDialogs, staking, app, networkStatus, profile, wallets } = - this.props.stores; + const { + uiDialogs, + staking, + app, + networkStatus, + profile, + wallets, + } = this.props.stores; const { currentTheme, currentLocale } = profile; const { isSynced } = networkStatus; const { diff --git a/source/renderer/app/containers/staking/Staking.tsx b/source/renderer/app/containers/staking/Staking.tsx index 2d87a55f10..3b8b538eb3 100644 --- a/source/renderer/app/containers/staking/Staking.tsx +++ b/source/renderer/app/containers/staking/Staking.tsx @@ -82,8 +82,12 @@ class Staking extends Component { stores: { app, staking, networkStatus, uiDialogs }, children, } = this.props; - const { isSynced, syncPercentage, isAlonzoPending, isAlonzoActivated } = - networkStatus; + const { + isSynced, + syncPercentage, + isAlonzoPending, + isAlonzoActivated, + } = networkStatus; const { isStakingDelegationCountdown } = staking; const shouldShowInfoTab = isAlonzoPending || isAlonzoActivated; const isDelegationWizardOpen = uiDialogs.isOpen( diff --git a/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.tsx b/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.tsx index 1c7751355b..41e4819678 100644 --- a/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.tsx +++ b/source/renderer/app/containers/staking/dialogs/DelegationSetupWizardDialogContainer.tsx @@ -165,10 +165,20 @@ class DelegationSetupWizardDialogContainer extends Component { }; render() { - const { activeStep, selectedWalletId, selectedPoolId, stakePoolJoinFee } = - this.state; - const { app, staking, wallets, profile, networkStatus, hardwareWallets } = - this.props.stores; + const { + activeStep, + selectedWalletId, + selectedPoolId, + stakePoolJoinFee, + } = this.state; + const { + app, + staking, + wallets, + profile, + networkStatus, + hardwareWallets, + } = this.props.stores; const { futureEpoch } = networkStatus; const { currentTheme, currentLocale } = profile; const { diff --git a/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step1ConfigurationContainer.tsx b/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step1ConfigurationContainer.tsx index 0a1d8c246f..3a41d7f117 100644 --- a/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step1ConfigurationContainer.tsx +++ b/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step1ConfigurationContainer.tsx @@ -45,11 +45,16 @@ class Step1ConfigurationContainer extends Component { const { actions, stores, onBack, onClose } = this.props; const { app, staking, wallets } = stores; const { allWallets } = wallets; - const { redeemWallet, isCalculatingReedemFees, redeemRecoveryPhrase } = - staking; + const { + redeemWallet, + isCalculatingReedemFees, + redeemRecoveryPhrase, + } = staking; const { openExternalLink } = app; - const { onConfigurationContinue, onCalculateRedeemWalletFees } = - actions.staking; + const { + onConfigurationContinue, + onCalculateRedeemWalletFees, + } = actions.staking; const selectedWalletId = get(redeemWallet, 'id', null); const selectedWallet: Wallet | null | undefined = allWallets.find( (current: Wallet) => current && current.id === selectedWalletId diff --git a/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step3ResultContainer.tsx b/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step3ResultContainer.tsx index 53d8d29112..6747fd4325 100644 --- a/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step3ResultContainer.tsx +++ b/source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step3ResultContainer.tsx @@ -15,8 +15,12 @@ class Step3ResultContainer extends Component { render() { const { onBack, onClose, stores, actions } = this.props; - const { redeemWallet, transactionFees, redeemedRewards, redeemSuccess } = - stores.staking; + const { + redeemWallet, + transactionFees, + redeemedRewards, + redeemSuccess, + } = stores.staking; const { onResultContinue } = actions.staking; if (!redeemWallet) throw new Error('Redeem wallet required'); diff --git a/source/renderer/app/containers/voting/dialogs/VotingRegistrationDialogContainer.tsx b/source/renderer/app/containers/voting/dialogs/VotingRegistrationDialogContainer.tsx index 233f9be29d..20f99ba2d9 100644 --- a/source/renderer/app/containers/voting/dialogs/VotingRegistrationDialogContainer.tsx +++ b/source/renderer/app/containers/voting/dialogs/VotingRegistrationDialogContainer.tsx @@ -145,10 +145,18 @@ class VotingRegistrationDialogContainer extends Component { }; render() { - const { selectedWalletId, transactionFee, transactionFeeError } = - this.state; - const { wallets, staking, voting, app, hardwareWallets } = - this.props.stores; + const { + selectedWalletId, + transactionFee, + transactionFeeError, + } = this.state; + const { + wallets, + staking, + voting, + app, + hardwareWallets, + } = this.props.stores; const { closeConfirmationDialog, saveAsPDF } = this.props.actions.voting; const { all } = wallets; const { stakePools, getStakePoolById } = staking; @@ -233,8 +241,14 @@ class VotingRegistrationDialogContainer extends Component { } async _handleCalculateTransactionFee() { - const { transactions, addresses, app, wallets, hardwareWallets, voting } = - this.props.stores; + const { + transactions, + addresses, + app, + wallets, + hardwareWallets, + voting, + } = this.props.stores; const { calculateTransactionFee } = transactions; const { getAddressesByWalletId } = addresses; const { getWalletById } = wallets; diff --git a/source/renderer/app/containers/wallet/TransferFundsPage.tsx b/source/renderer/app/containers/wallet/TransferFundsPage.tsx index 44be12f46d..c82fd1ef9f 100644 --- a/source/renderer/app/containers/wallet/TransferFundsPage.tsx +++ b/source/renderer/app/containers/wallet/TransferFundsPage.tsx @@ -18,8 +18,11 @@ class TransferFundsPage extends Component { const { actions, stores } = this.props; const { wallets: walletsActions } = actions; const { wallets: walletsStore } = stores; - const { transferFundsNextStep, transferFundsPrevStep, transferFundsClose } = - walletsActions; + const { + transferFundsNextStep, + transferFundsPrevStep, + transferFundsClose, + } = walletsActions; const { transferFundsStep } = walletsStore; if (!transferFundsStep) return null; let Container; diff --git a/source/renderer/app/containers/wallet/Wallet.tsx b/source/renderer/app/containers/wallet/Wallet.tsx index 830d708f5e..767df04818 100644 --- a/source/renderer/app/containers/wallet/Wallet.tsx +++ b/source/renderer/app/containers/wallet/Wallet.tsx @@ -70,8 +70,11 @@ class Wallet extends Component { ); } - const { hasNotification } = - walletSettings.getWalletsRecoveryPhraseVerificationData(activeWallet.id); + const { + hasNotification, + } = walletSettings.getWalletsRecoveryPhraseVerificationData( + activeWallet.id + ); const { isRestoring, isLegacy, diff --git a/source/renderer/app/containers/wallet/WalletReceivePage.tsx b/source/renderer/app/containers/wallet/WalletReceivePage.tsx index e29a7fdcef..e028f5070c 100755 --- a/source/renderer/app/containers/wallet/WalletReceivePage.tsx +++ b/source/renderer/app/containers/wallet/WalletReceivePage.tsx @@ -173,8 +173,13 @@ class WalletReceivePage extends Component { render() { const { actions, stores } = this.props; - const { uiDialogs, addresses, sidebar, hardwareWallets, walletSettings } = - stores; + const { + uiDialogs, + addresses, + sidebar, + hardwareWallets, + walletSettings, + } = stores; const { activeWallet } = this; const { addressToShare } = this.state; const { toggleSubMenus } = actions.sidebar; @@ -187,8 +192,10 @@ class WalletReceivePage extends Component { checkIsTrezorByWalletId, } = hardwareWallets; const { getLocalWalletDataById } = walletSettings; - const localWalletData: WalletLocalData | null | undefined = - getLocalWalletDataById(activeWallet ? activeWallet.id : ''); + const localWalletData: + | WalletLocalData + | null + | undefined = getLocalWalletDataById(activeWallet ? activeWallet.id : ''); const { showUsedAddresses } = localWalletData || {}; // Guard against potential null values if (!activeWallet) diff --git a/source/renderer/app/containers/wallet/WalletSendPage.tsx b/source/renderer/app/containers/wallet/WalletSendPage.tsx index 1d6b0470bb..6ac94c9f81 100755 --- a/source/renderer/app/containers/wallet/WalletSendPage.tsx +++ b/source/renderer/app/containers/wallet/WalletSendPage.tsx @@ -27,28 +27,36 @@ class WalletSendPage extends Component { isHardwareWallet: boolean; selectedAssets?: ApiTokens; }) => { - const { walletId, address, amount, isHardwareWallet, selectedAssets } = - params; + const { + walletId, + address, + amount, + isHardwareWallet, + selectedAssets, + } = params; let fee; let minimumAda; if (isHardwareWallet) { - const coinsSelection = - await this.props.stores.hardwareWallets.selectCoins({ + const coinsSelection = await this.props.stores.hardwareWallets.selectCoins( + { walletId, address, amount, assets: selectedAssets, - }); + } + ); fee = coinsSelection.fee; } else { - ({ fee, minimumAda } = - await this.props.stores.transactions.calculateTransactionFee({ - walletId, - address, - amount, - assets: selectedAssets, - })); + ({ + fee, + minimumAda, + } = await this.props.stores.transactions.calculateTransactionFee({ + walletId, + address, + amount, + assets: selectedAssets, + })); } return { diff --git a/source/renderer/app/containers/wallet/WalletSummaryPage.tsx b/source/renderer/app/containers/wallet/WalletSummaryPage.tsx index f6b01a9d6f..212031e132 100755 --- a/source/renderer/app/containers/wallet/WalletSummaryPage.tsx +++ b/source/renderer/app/containers/wallet/WalletSummaryPage.tsx @@ -61,8 +61,15 @@ class WalletSummaryPage extends Component { render() { const { intl } = this.context; const { stores, actions } = this.props; - const { app, wallets, addresses, transactions, profile, assets, currency } = - stores; + const { + app, + wallets, + addresses, + transactions, + profile, + assets, + currency, + } = stores; const { all, getAsset, assetSettingsDialogWasOpened, favorites } = assets; const { isInternalAddress } = addresses; const { diff --git a/source/renderer/app/containers/wallet/WalletTokensPage.tsx b/source/renderer/app/containers/wallet/WalletTokensPage.tsx index 70cd4dc64e..1173e30de9 100644 --- a/source/renderer/app/containers/wallet/WalletTokensPage.tsx +++ b/source/renderer/app/containers/wallet/WalletTokensPage.tsx @@ -19,8 +19,11 @@ const WalletTokensPage = inject( insertingAssetUniqueId, removingAssetUniqueId, } = assets; - const { onAssetSettingsOpen, onOpenAssetSend, onToggleFavorite } = - actions.assets; + const { + onAssetSettingsOpen, + onOpenAssetSend, + onToggleFavorite, + } = actions.assets; const { active: activeWallet } = wallets; const { currentLocale } = profile; // Guard against potential null values diff --git a/source/renderer/app/containers/wallet/dialogs/WalletCreateDialogContainer.tsx b/source/renderer/app/containers/wallet/dialogs/WalletCreateDialogContainer.tsx index e95a6637ae..6568bc664d 100644 --- a/source/renderer/app/containers/wallet/dialogs/WalletCreateDialogContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/WalletCreateDialogContainer.tsx @@ -45,8 +45,10 @@ class WalletCreateDialogContainer extends Component { } onContinue = () => { - const { createWalletChangeStep, createWalletClose } = - this.props.actions.wallets; + const { + createWalletChangeStep, + createWalletClose, + } = this.props.actions.wallets; if (this.currentStep !== null) { if (this.currentStep < CREATE_WALLET_STEPS.length - 1) { @@ -71,8 +73,10 @@ class WalletCreateDialogContainer extends Component { onAbort = () => this.props.actions.wallets.createWalletAbort.trigger(); render() { - const { createWalletStep, createWalletShowAbortConfirmation } = - this.props.stores.wallets; + const { + createWalletStep, + createWalletShowAbortConfirmation, + } = this.props.stores.wallets; if (createWalletStep === null) { return null; diff --git a/source/renderer/app/containers/wallet/dialogs/WalletRestoreDialogContainer.tsx b/source/renderer/app/containers/wallet/dialogs/WalletRestoreDialogContainer.tsx index 2a8109287e..c26e4aca0a 100644 --- a/source/renderer/app/containers/wallet/dialogs/WalletRestoreDialogContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/WalletRestoreDialogContainer.tsx @@ -29,8 +29,10 @@ class WalletRestoreContainer extends Component { render() { const { stores, actions } = this.props; - const { restoreWalletStep, restoreWalletShowAbortConfirmation } = - stores.wallets; + const { + restoreWalletStep, + restoreWalletShowAbortConfirmation, + } = stores.wallets; const { restoreWalletClose, restoreWalletCancelClose, diff --git a/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/InstructionsDialogContainer.tsx b/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/InstructionsDialogContainer.tsx index ab0d4c7990..14badd20dc 100644 --- a/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/InstructionsDialogContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/InstructionsDialogContainer.tsx @@ -20,8 +20,10 @@ class InstructionsDialogContainer extends Component { onClose: () => {}, }; onPrint = async () => { - const { currentDateFormat, currentTimeFormatShort } = - this.props.stores.profile; + const { + currentDateFormat, + currentTimeFormatShort, + } = this.props.stores.profile; const date = moment(); const formattedDate = date.format(currentDateFormat); const formattedTime = date.format(currentTimeFormatShort); diff --git a/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/VerificationDialogContainer.tsx b/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/VerificationDialogContainer.tsx index 8118117629..2df67f190c 100644 --- a/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/VerificationDialogContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/paper-wallet-certificate/VerificationDialogContainer.tsx @@ -21,8 +21,10 @@ class VerificationDialogContainer extends Component { render() { const { wallets } = this.props.stores; - const { walletCertificateRecoveryPhrase, additionalMnemonicWords } = - wallets; + const { + walletCertificateRecoveryPhrase, + additionalMnemonicWords, + } = wallets; if (!walletCertificateRecoveryPhrase || !additionalMnemonicWords) { throw new Error( diff --git a/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.tsx b/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.tsx index 0e08884ae5..17a496dccc 100644 --- a/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/settings/UndelegateWalletDialogContainer.tsx @@ -94,8 +94,13 @@ class UndelegateWalletDialogContainer extends Component { render() { const { actions, stores, onExternalLinkClick } = this.props; - const { wallets, staking, networkStatus, profile, hardwareWallets } = - stores; + const { + wallets, + staking, + networkStatus, + profile, + hardwareWallets, + } = stores; const { futureEpoch } = networkStatus; const { currentLocale } = profile; const { @@ -116,8 +121,10 @@ class UndelegateWalletDialogContainer extends Component { if (!walletToBeUndelegated) return null; const isTrezor = checkIsTrezorByWalletId(walletToBeUndelegated.id); const { name: walletName } = walletToBeUndelegated; - const { lastDelegatedStakePoolId, delegatedStakePoolId } = - walletToBeUndelegated; + const { + lastDelegatedStakePoolId, + delegatedStakePoolId, + } = walletToBeUndelegated; const stakePoolId = lastDelegatedStakePoolId || delegatedStakePoolId || ''; if ( diff --git a/source/renderer/app/containers/wallet/dialogs/wallet-import/WalletSelectImportStepContainer.tsx b/source/renderer/app/containers/wallet/dialogs/wallet-import/WalletSelectImportStepContainer.tsx index dcb73500a9..b870981099 100644 --- a/source/renderer/app/containers/wallet/dialogs/wallet-import/WalletSelectImportStepContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/wallet-import/WalletSelectImportStepContainer.tsx @@ -33,8 +33,11 @@ class WalletSelectImportStepContainer extends Component { render() { const { onClose, onContinue, stores } = this.props; const { walletMigration, app } = stores; - const { exportedWallets, pendingImportWalletsCount, isRestorationRunning } = - walletMigration; + const { + exportedWallets, + pendingImportWalletsCount, + isRestorationRunning, + } = walletMigration; const { openExternalLink } = app; let walletsCount = this.state.existingWalletsCount + pendingImportWalletsCount; diff --git a/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.tsx b/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.tsx index a2f0573bb7..c74e0699ee 100644 --- a/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.tsx +++ b/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.tsx @@ -25,10 +25,15 @@ class ConfigurationDialogContainer extends Component { const { wallets, profile } = stores; const { currentLocale } = profile; const { error } = wallets.restoreRequest; - const { walletName, spendingPassword, repeatPassword, isRestoring } = - wallets; - const { error: certificateError } = - stores.wallets.getWalletRecoveryPhraseFromCertificateRequest; + const { + walletName, + spendingPassword, + repeatPassword, + isRestoring, + } = wallets; + const { + error: certificateError, + } = stores.wallets.getWalletRecoveryPhraseFromCertificateRequest; return ( { // @ts-ignore ts-migrate(2322) FIXME: Type 'Promise' is not assignable to type ... Remove this comment to see the full error message this.openInDiscreetMode = isDiscreetModeEnabled; diff --git a/source/renderer/app/features/discreet-mode/replacers/defaultReplacer.ts b/source/renderer/app/features/discreet-mode/replacers/defaultReplacer.ts index 9b863829ac..d9d48fd191 100644 --- a/source/renderer/app/features/discreet-mode/replacers/defaultReplacer.ts +++ b/source/renderer/app/features/discreet-mode/replacers/defaultReplacer.ts @@ -1,6 +1,8 @@ import type { ReplacerFn } from '../types'; export type DefaultReplacer = () => ReplacerFn; -export const defaultReplacer: DefaultReplacer = - () => (isDiscreetMode, symbol, value) => - isDiscreetMode ? symbol : value; +export const defaultReplacer: DefaultReplacer = () => ( + isDiscreetMode, + symbol, + value +) => (isDiscreetMode ? symbol : value); diff --git a/source/renderer/app/features/discreet-mode/replacers/discreetWalletAmount.ts b/source/renderer/app/features/discreet-mode/replacers/discreetWalletAmount.ts index 59fe21811c..b4442fa0c0 100644 --- a/source/renderer/app/features/discreet-mode/replacers/discreetWalletAmount.ts +++ b/source/renderer/app/features/discreet-mode/replacers/discreetWalletAmount.ts @@ -8,21 +8,19 @@ export type DiscreetWalletAmountProps = { withCurrency?: boolean; long?: boolean; }; -export const discreetWalletAmount: DiscreetValueReplacer = - ({ - amount, - withCurrency = true, - long = true, - currency = 'ADA', - }: DiscreetWalletAmountProps) => - (isDiscreetMode, replacement) => { - if (!isDiscreetMode) { - return formattedWalletAmount(amount, withCurrency, long, currency); - } +export const discreetWalletAmount: DiscreetValueReplacer = ({ + amount, + withCurrency = true, + long = true, + currency = 'ADA', +}: DiscreetWalletAmountProps) => (isDiscreetMode, replacement) => { + if (!isDiscreetMode) { + return formattedWalletAmount(amount, withCurrency, long, currency); + } - if (!withCurrency) { - return replacement; - } + if (!withCurrency) { + return replacement; + } - return `${replacement} ${currency}`; - }; + return `${replacement} ${currency}`; +}; diff --git a/source/renderer/app/features/discreet-mode/replacers/discreetWalletTokenAmount.ts b/source/renderer/app/features/discreet-mode/replacers/discreetWalletTokenAmount.ts index 106dd0dc2b..28133f9d59 100644 --- a/source/renderer/app/features/discreet-mode/replacers/discreetWalletTokenAmount.ts +++ b/source/renderer/app/features/discreet-mode/replacers/discreetWalletTokenAmount.ts @@ -9,18 +9,21 @@ export type DiscreetWalletTokenAmountProps = { decimals: number | null | undefined; isShort?: boolean; }; -export const discreetWalletTokenAmount: DiscreetValueReplacer = - ({ amount, metadata, decimals, isShort }: DiscreetWalletTokenAmountProps) => - (isDiscreetMode, replacement) => { - if (!isDiscreetMode) { - return formattedTokenWalletAmount(amount, metadata, decimals, isShort); - } +export const discreetWalletTokenAmount: DiscreetValueReplacer = ({ + amount, + metadata, + decimals, + isShort, +}: DiscreetWalletTokenAmountProps) => (isDiscreetMode, replacement) => { + if (!isDiscreetMode) { + return formattedTokenWalletAmount(amount, metadata, decimals, isShort); + } - const { ticker } = metadata || {}; + const { ticker } = metadata || {}; - if (!ticker) { - return replacement; - } + if (!ticker) { + return replacement; + } - return `${replacement} ${ticker}`; - }; + return `${replacement} ${ticker}`; +}; diff --git a/source/renderer/app/ipc/cardano.ipc.ts b/source/renderer/app/ipc/cardano.ipc.ts index af45dce2be..3c939ee69e 100644 --- a/source/renderer/app/ipc/cardano.ipc.ts +++ b/source/renderer/app/ipc/cardano.ipc.ts @@ -25,14 +25,18 @@ export const cardanoTlsConfigChannel: RendererIpcChannel< CardanoTlsConfigMainResponse, CardanoTlsConfigRendererRequest > = new RendererIpcChannel(CARDANO_TLS_CONFIG_CHANNEL); -export const restartCardanoNodeChannel: RendererIpcChannel = - new RendererIpcChannel(CARDANO_RESTART_CHANNEL); +export const restartCardanoNodeChannel: RendererIpcChannel< + void, + void +> = new RendererIpcChannel(CARDANO_RESTART_CHANNEL); export const cardanoStateChangeChannel: RendererIpcChannel< CardanoNodeState, void > = new RendererIpcChannel(CARDANO_STATE_CHANNEL); -export const awaitUpdateChannel: RendererIpcChannel = - new RendererIpcChannel(CARDANO_AWAIT_UPDATE_CHANNEL); +export const awaitUpdateChannel: RendererIpcChannel< + void, + void +> = new RendererIpcChannel(CARDANO_AWAIT_UPDATE_CHANNEL); export const cardanoFaultInjectionChannel: RendererIpcChannel< void, FaultInjectionIpcRequest diff --git a/source/renderer/app/ipc/downloadManagerChannel.ts b/source/renderer/app/ipc/downloadManagerChannel.ts index c68b40aac9..72174c26ca 100644 --- a/source/renderer/app/ipc/downloadManagerChannel.ts +++ b/source/renderer/app/ipc/downloadManagerChannel.ts @@ -26,11 +26,15 @@ import type { import { RendererIpcChannel } from './lib/RendererIpcChannel'; export const requestDownloadChannel: // IpcChannel -RendererIpcChannel = - new RendererIpcChannel(REQUEST_DOWNLOAD); +RendererIpcChannel< + DownloadMainResponse, + DownloadRendererRequest +> = new RendererIpcChannel(REQUEST_DOWNLOAD); export const requestResumeDownloadChannel: // IpcChannel -RendererIpcChannel = - new RendererIpcChannel(RESUME_DOWNLOAD); +RendererIpcChannel< + ResumeDownloadMainResponse, + ResumeDownloadRendererRequest +> = new RendererIpcChannel(RESUME_DOWNLOAD); export const deleteDownloadedFile: // IpcChannel RendererIpcChannel< DeleteDownloadedFileMainResponse, diff --git a/source/renderer/app/ipc/generateCsvChannel.ts b/source/renderer/app/ipc/generateCsvChannel.ts index 485b847837..bccab8ddb7 100644 --- a/source/renderer/app/ipc/generateCsvChannel.ts +++ b/source/renderer/app/ipc/generateCsvChannel.ts @@ -6,5 +6,7 @@ import type { import { RendererIpcChannel } from './lib/RendererIpcChannel'; export const generateCsvChannel: // IpcChannel -RendererIpcChannel = - new RendererIpcChannel(GENERATE_CSV_CHANNEL); +RendererIpcChannel< + GenerateCsvMainResponse, + GenerateCsvRendererRequest +> = new RendererIpcChannel(GENERATE_CSV_CHANNEL); diff --git a/source/renderer/app/ipc/saveQRCodeImageChannel.ts b/source/renderer/app/ipc/saveQRCodeImageChannel.ts index fbbb210054..ffd0e2eac8 100644 --- a/source/renderer/app/ipc/saveQRCodeImageChannel.ts +++ b/source/renderer/app/ipc/saveQRCodeImageChannel.ts @@ -6,5 +6,7 @@ import type { import { RendererIpcChannel } from './lib/RendererIpcChannel'; export const saveQRCodeImageChannel: // IpcChannel -RendererIpcChannel = - new RendererIpcChannel(GENERATE_QRCODE_CHANNEL); +RendererIpcChannel< + GenerateQRCodeMainResponse, + GenerateQRCodeRendererRequest +> = new RendererIpcChannel(GENERATE_QRCODE_CHANNEL); diff --git a/source/renderer/app/ipc/show-file-dialog-channels.ts b/source/renderer/app/ipc/show-file-dialog-channels.ts index 1c0cb81406..0a6bd437ff 100644 --- a/source/renderer/app/ipc/show-file-dialog-channels.ts +++ b/source/renderer/app/ipc/show-file-dialog-channels.ts @@ -11,8 +11,12 @@ import type { } from '../../../common/ipc/api'; export const showOpenDialogChannel: // IpcChannel -RendererIpcChannel = - new RendererIpcChannel(SHOW_OPEN_DIALOG_CHANNEL); +RendererIpcChannel< + ShowOpenDialogMainResponse, + ShowOpenDialogRendererRequest +> = new RendererIpcChannel(SHOW_OPEN_DIALOG_CHANNEL); export const showSaveDialogChannel: // IpcChannel -RendererIpcChannel = - new RendererIpcChannel(SHOW_SAVE_DIALOG_CHANNEL); +RendererIpcChannel< + ShowSaveDialogMainResponse, + ShowSaveDialogRendererRequest +> = new RendererIpcChannel(SHOW_SAVE_DIALOG_CHANNEL); diff --git a/source/renderer/app/stores/AddressesStore.ts b/source/renderer/app/stores/AddressesStore.ts index 3be55407ea..dae6e46214 100644 --- a/source/renderer/app/stores/AddressesStore.ts +++ b/source/renderer/app/stores/AddressesStore.ts @@ -45,12 +45,13 @@ export default class AddressesStore extends Store { const { walletId, passphrase } = params; const accountIndex = await this.getAccountIndexByWalletId(walletId); // @ts-ignore ts-migrate(2739) FIXME: Type 'Address' is missing the following properties... Remove this comment to see the full error message - const address: WalletAddress = - await this.createByronWalletAddressRequest.execute({ + const address: WalletAddress = await this.createByronWalletAddressRequest.execute( + { addressIndex: accountIndex, passphrase, walletId, - }).promise; + } + ).promise; if (address != null) { this._refreshAddresses(); diff --git a/source/renderer/app/stores/AppUpdateStore.ts b/source/renderer/app/stores/AppUpdateStore.ts index 74747d2a59..13ff813613 100644 --- a/source/renderer/app/stores/AppUpdateStore.ts +++ b/source/renderer/app/stores/AppUpdateStore.ts @@ -273,11 +273,12 @@ export default class AppUpdateStore extends Store { id: APP_UPDATE_DOWNLOAD_ID, }); }; - _getUpdateDownloadLocalData = - async (): Promise => - getDownloadLocalDataChannel.request({ - id: APP_UPDATE_DOWNLOAD_ID, - }); + _getUpdateDownloadLocalData = async (): Promise< + DownloadLocalDataMainResponse + > => + getDownloadLocalDataChannel.request({ + id: APP_UPDATE_DOWNLOAD_ID, + }); _checkFileExists = async (): Promise => checkFileExistsChannel.request({ id: APP_UPDATE_DOWNLOAD_ID, diff --git a/source/renderer/app/stores/HardwareWalletsStore.ts b/source/renderer/app/stores/HardwareWalletsStore.ts index e030709968..f5ad5387a5 100644 --- a/source/renderer/app/stores/HardwareWalletsStore.ts +++ b/source/renderer/app/stores/HardwareWalletsStore.ts @@ -169,13 +169,13 @@ export default class HardwareWalletsStore extends Store { this.api.ada.constructAddress ); @observable - hardwareWalletsLocalDataRequest: Request = new Request( - this.api.localStorage.getHardwareWalletsLocalData - ); + hardwareWalletsLocalDataRequest: Request< + HardwareWalletsLocalData + > = new Request(this.api.localStorage.getHardwareWalletsLocalData); @observable - setHardwareWalletLocalDataRequest: Request = new Request( - this.api.localStorage.setHardwareWalletLocalData - ); + setHardwareWalletLocalDataRequest: Request< + HardwareWalletLocalData + > = new Request(this.api.localStorage.setHardwareWalletLocalData); @observable unsetHardwareWalletLocalDataRequest: Request = new Request( this.api.localStorage.unsetHardwareWalletLocalData @@ -185,25 +185,25 @@ export default class HardwareWalletsStore extends Store { this.api.localStorage.getHardwareWalletDevices ); @observable - setHardwareWalletDeviceRequest: Request = new Request( - this.api.localStorage.setHardwareWalletDevice - ); + setHardwareWalletDeviceRequest: Request< + HardwareWalletLocalData + > = new Request(this.api.localStorage.setHardwareWalletDevice); @observable - overrideHardwareWalletDevicesRequest: Request = new Request( - this.api.localStorage.overrideHardwareWalletDevices - ); + overrideHardwareWalletDevicesRequest: Request< + HardwareWalletDevicesType + > = new Request(this.api.localStorage.overrideHardwareWalletDevices); @observable - unsetHardwareWalletDeviceRequest: Request = new Request( - this.api.localStorage.unsetHardwareWalletDevice - ); + unsetHardwareWalletDeviceRequest: Request< + HardwareWalletLocalData + > = new Request(this.api.localStorage.unsetHardwareWalletDevice); @observable unsetHardwareWalletDevicesAllRequest: Request = new Request( this.api.localStorage.unsetHardwareWalletDevicesAll ); @observable - unsetHardwareWalletLocalDataAllRequest: Request = new Request( - this.api.localStorage.unsetHardwareWalletLocalDataAll - ); + unsetHardwareWalletLocalDataAllRequest: Request< + HardwareWalletLocalData + > = new Request(this.api.localStorage.unsetHardwareWalletLocalDataAll); @observable hwDeviceStatus: HwDeviceStatus = HwDeviceStatuses.CONNECTING; @observable @@ -438,11 +438,15 @@ export default class HardwareWalletsStore extends Store { walletId: string; isVotingRegistrationTransaction: boolean; }) => { - const { transactionId, walletId, isVotingRegistrationTransaction } = - request; + const { + transactionId, + walletId, + isVotingRegistrationTransaction, + } = request; - const recentTransactionsResponse = - this.stores.transactions._getTransactionsRecentRequest(walletId).result; + const recentTransactionsResponse = this.stores.transactions._getTransactionsRecentRequest( + walletId + ).result; const recentTransactions = recentTransactionsResponse ? recentTransactionsResponse.transactions @@ -1843,10 +1847,11 @@ export default class HardwareWalletsStore extends Store { const outputsData = []; for (const output of outputs) { - const { address_style: addressStyle } = - await this.stores.addresses._inspectAddress({ - addressId: output.address, - }); + const { + address_style: addressStyle, + } = await this.stores.addresses._inspectAddress({ + addressId: output.address, + }); const shelleyTxOutput = ShelleyTxOutput(output, addressStyle); unsignedTxOutputs.push(shelleyTxOutput); const ledgerOutput = prepareTrezorOutput(output); @@ -2164,10 +2169,11 @@ export default class HardwareWalletsStore extends Store { const outputsData = []; for (const output of outputs) { - const { address_style: addressStyle } = - await this.stores.addresses._inspectAddress({ - addressId: output.address, - }); + const { + address_style: addressStyle, + } = await this.stores.addresses._inspectAddress({ + addressId: output.address, + }); const shelleyTxOutput = ShelleyTxOutput(output, addressStyle); unsignedTxOutputs.push(shelleyTxOutput); const ledgerOutput = prepareLedgerOutput(output, addressStyle); diff --git a/source/renderer/app/stores/NetworkStatusStore.ts b/source/renderer/app/stores/NetworkStatusStore.ts index 794b9b4a0a..441b53bede 100644 --- a/source/renderer/app/stores/NetworkStatusStore.ts +++ b/source/renderer/app/stores/NetworkStatusStore.ts @@ -139,9 +139,9 @@ export default class NetworkStatusStore extends Store { this.api.ada.getNetworkClock ); @observable - getNetworkParametersRequest: Request = new Request( - this.api.ada.getNetworkParameters - ); + getNetworkParametersRequest: Request< + GetNetworkParametersResponse + > = new Request(this.api.ada.getNetworkParameters); @observable isNotEnoughDiskSpace = false; @observable @@ -488,10 +488,11 @@ export default class NetworkStatusStore extends Store { }); try { - const networkClock: GetNetworkClockResponse = - await this.getNetworkClockRequest.execute({ + const networkClock: GetNetworkClockResponse = await this.getNetworkClockRequest.execute( + { isForceCheck, - }).promise; + } + ).promise; // System time is correct if local time difference is below allowed threshold runInAction('update localTimeDifference and isNodeTimeCorrect', () => { // Update localTimeDifference only in case NTP check status is not still pending @@ -520,8 +521,8 @@ export default class NetworkStatusStore extends Store { const wasConnected = this.isConnected; try { - const networkStatus: GetNetworkInfoResponse = - await this.getNetworkInfoRequest.execute().promise; + const networkStatus: GetNetworkInfoResponse = await this.getNetworkInfoRequest.execute() + .promise; // In case we no longer have TLS config we ignore all API call responses // as this means we are in the Cardano shutdown (stopping|exiting|updating) sequence @@ -682,8 +683,8 @@ export default class NetworkStatusStore extends Store { if (!this.isNodeResponding) return; try { - const networkParameters: GetNetworkParametersResponse = - await this.getNetworkParametersRequest.execute().promise; + const networkParameters: GetNetworkParametersResponse = await this.getNetworkParametersRequest.execute() + .promise; let { isShelleyActivated, isShelleyPending, diff --git a/source/renderer/app/stores/ProfileStore.ts b/source/renderer/app/stores/ProfileStore.ts index 8421ec100a..9f9f675054 100644 --- a/source/renderer/app/stores/ProfileStore.ts +++ b/source/renderer/app/stores/ProfileStore.ts @@ -470,8 +470,9 @@ export default class ProfileStore extends Store { } }; _compressLogs = action(async ({ logs }) => { - const { fileName = generateFileNameWithTimestamp() } = - this.compressedLogsStatus; + const { + fileName = generateFileNameWithTimestamp(), + } = this.compressedLogsStatus; try { const outputPath = await compressLogsChannel.request({ diff --git a/source/renderer/app/stores/SidebarStore.ts b/source/renderer/app/stores/SidebarStore.ts index 36e40f0b75..8a462b13c0 100644 --- a/source/renderer/app/stores/SidebarStore.ts +++ b/source/renderer/app/stores/SidebarStore.ts @@ -34,8 +34,12 @@ export default class SidebarStore extends Store { // https://alexhisen.gitbooks.io/mobx-recipes/content/use-computedstruct-for-computed-objects.html @computed.struct get wallets(): Array { - const { networkStatus, wallets, walletSettings, hardwareWallets } = - this.stores; + const { + networkStatus, + wallets, + walletSettings, + hardwareWallets, + } = this.stores; const { hardwareWalletsConnectionData } = hardwareWallets; return wallets.all.map((wallet) => { const isHardwareWalletDisconnected = get( @@ -43,8 +47,9 @@ export default class SidebarStore extends Store { [wallet.id, 'disconnected'], true ); - const { hasNotification } = - walletSettings.getWalletsRecoveryPhraseVerificationData(wallet.id); + const { + hasNotification, + } = walletSettings.getWalletsRecoveryPhraseVerificationData(wallet.id); return { id: wallet.id, title: wallet.name, @@ -69,8 +74,10 @@ export default class SidebarStore extends Store { // @ts-ignore ts-migrate(2339) FIXME: Property 'environment' does not exist on type 'typ... Remove this comment to see the full error message environment: { isDev, isMainnet }, } = global; - const { CATEGORIES_BY_NAME: categories, CATEGORIES_LIST: list } = - sidebarConfig; + const { + CATEGORIES_BY_NAME: categories, + CATEGORIES_LIST: list, + } = sidebarConfig; const categoryValidation: Record< string, boolean | ((...args: Array) => any) diff --git a/source/renderer/app/stores/StakingStore.ts b/source/renderer/app/stores/StakingStore.ts index 39d2ecc357..d80b506816 100644 --- a/source/renderer/app/stores/StakingStore.ts +++ b/source/renderer/app/stores/StakingStore.ts @@ -101,8 +101,10 @@ export default class StakingStore extends Store { _delegationFeeCalculationWalletId: string | null | undefined = null; setup() { - const { staking: stakingActions, networkStatus: networkStatusActions } = - this.actions; + const { + staking: stakingActions, + networkStatus: networkStatusActions, + } = this.actions; this.refreshPolling = setInterval( this.getStakePoolsData, STAKE_POOLS_FAST_INTERVAL @@ -157,9 +159,9 @@ export default class StakingStore extends Store { this.api.ada.getStakePools ); @observable - calculateDelegationFeeRequest: Request = new Request( - this.api.ada.calculateDelegationFee - ); + calculateDelegationFeeRequest: Request< + DelegationCalculateFeeResponse + > = new Request(this.api.ada.calculateDelegationFee); // @REDEEM TODO: Proper type it when the API endpoint is implemented. @observable getRedeemItnRewardsFeeRequest: Request = new Request( @@ -267,8 +269,7 @@ export default class StakingStore extends Store { }; @action _getStakingInfoWasOpen = async () => { - const stakingInfoWasOpen = - await this.api.localStorage.getStakingInfoWasOpen(); + const stakingInfoWasOpen = await this.api.localStorage.getStakingInfoWasOpen(); runInAction(() => { this.stakingInfoWasOpen = stakingInfoWasOpen; }); @@ -400,8 +401,9 @@ export default class StakingStore extends Store { }) => { const { transactionId, walletId } = request; - const recentTransactionsResponse = - this.stores.transactions._getTransactionsRecentRequest(walletId).result; + const recentTransactionsResponse = this.stores.transactions._getTransactionsRecentRequest( + walletId + ).result; const recentTransactions = recentTransactionsResponse ? recentTransactionsResponse.transactions @@ -485,10 +487,11 @@ export default class StakingStore extends Store { } try { - const delegationFee: DelegationCalculateFeeResponse = - await this.calculateDelegationFeeRequest.execute({ + const delegationFee: DelegationCalculateFeeResponse = await this.calculateDelegationFeeRequest.execute( + { ...delegationFeeRequest, - }).promise; + } + ).promise; if (this._delegationFeeCalculationWalletId !== walletId) { return null; @@ -574,8 +577,11 @@ export default class StakingStore extends Store { @action getStakePoolsData = async (isSmash?: boolean) => { - const { isConnected, isSynced, isShelleyActivated } = - this.stores.networkStatus; + const { + isConnected, + isSynced, + isShelleyActivated, + } = this.stores.networkStatus; if (!isShelleyActivated || !isConnected || !isSynced) { this._resetIsRanking(); diff --git a/source/renderer/app/stores/TransactionsStore.ts b/source/renderer/app/stores/TransactionsStore.ts index dd6fca7cf3..8f003da4f6 100644 --- a/source/renderer/app/stores/TransactionsStore.ts +++ b/source/renderer/app/stores/TransactionsStore.ts @@ -94,14 +94,15 @@ export default class TransactionsStore extends Store { this.api.ada.deleteTransaction ); @observable - createExternalTransactionRequest: Request = - new Request(this.api.ada.createExternalTransaction); + createExternalTransactionRequest: Request< + CreateExternalTransactionRequest + > = new Request(this.api.ada.createExternalTransaction); @observable _filterOptionsForWallets = {}; @observable - calculateTransactionFeeRequest: Request = new Request( - this.api.ada.calculateTransactionFee - ); + calculateTransactionFeeRequest: Request< + GetTransactionFeeRequest + > = new Request(this.api.ada.calculateTransactionFee); setup() { const { diff --git a/source/renderer/app/stores/UiNotificationsStore.ts b/source/renderer/app/stores/UiNotificationsStore.ts index 6640aba242..4457b76221 100644 --- a/source/renderer/app/stores/UiNotificationsStore.ts +++ b/source/renderer/app/stores/UiNotificationsStore.ts @@ -30,8 +30,11 @@ export default class UiNotificationsStore extends Store { isOpen = (id: NotificationId): boolean => !!this.activeNotifications[id]; @action _registerNotification = (notificationConfig: NotificationConfig) => { - const { id, actionToListenAndOpen, actionToListenAndClose } = - notificationConfig; + const { + id, + actionToListenAndOpen, + actionToListenAndClose, + } = notificationConfig; actionToListenAndOpen.listen((labelValues?: Record) => this._openNotification(notificationConfig, labelValues) ); diff --git a/source/renderer/app/stores/VotingStore.ts b/source/renderer/app/stores/VotingStore.ts index 2a36b31bfb..ed53867c80 100644 --- a/source/renderer/app/stores/VotingStore.ts +++ b/source/renderer/app/stores/VotingStore.ts @@ -98,9 +98,9 @@ export default class VotingStore extends Store { this.api.ada.getWalletPublicKey ); @observable - createVotingRegistrationTransactionRequest: Request = new Request( - this.api.ada.createVotingRegistrationTransaction - ); + createVotingRegistrationTransactionRequest: Request< + WalletTransaction + > = new Request(this.api.ada.createVotingRegistrationTransaction); @observable signMetadataRequest: Request = new Request( this.api.ada.createWalletSignature @@ -320,8 +320,13 @@ export default class VotingStore extends Store { const votingData = await this.prepareVotingData({ walletId, }); - const { stakeAddressHex, votingKey, stakeKey, role, index } = - votingData; + const { + stakeAddressHex, + votingKey, + stakeKey, + role, + index, + } = votingData; // @ts-ignore ts-migrate(1320) FIXME: Type of 'await' operand must either be a valid pro... Remove this comment to see the full error message const signature = await this.signMetadataRequest.execute({ addressHex: stakeAddressHex, @@ -396,8 +401,11 @@ export default class VotingStore extends Store { if (!selectedWallet) return; const { name: walletName } = selectedWallet; const { desktopDirectoryPath } = this.stores.profile; - const { currentLocale, currentDateFormat, currentTimeFormat } = - this.stores.profile; + const { + currentLocale, + currentDateFormat, + currentTimeFormat, + } = this.stores.profile; const nextVotingFundNumber = NEXT_VOTING_FUND_NUMBER; const { network, isMainnet } = this.environment; const intl = i18nContext(currentLocale); diff --git a/source/renderer/app/stores/WalletMigrationStore.ts b/source/renderer/app/stores/WalletMigrationStore.ts index 487c40ad7f..a593f1e5e7 100644 --- a/source/renderer/app/stores/WalletMigrationStore.ts +++ b/source/renderer/app/stores/WalletMigrationStore.ts @@ -232,11 +232,13 @@ export default class WalletMigrationStore extends Store { // @ts-ignore ts-migrate(2554) FIXME: Expected 2 arguments, but got 1. logger.debug('WalletMigrationStore: Starting wallet export...'); this.isExportRunning = true; - const { wallets, errors }: ExportWalletsMainResponse = - await exportWalletsChannel.request({ - exportSourcePath: this.exportSourcePath || this.defaultExportSourcePath, - locale: this.stores.profile.currentLocale, - }); + const { + wallets, + errors, + }: ExportWalletsMainResponse = await exportWalletsChannel.request({ + exportSourcePath: this.exportSourcePath || this.defaultExportSourcePath, + locale: this.stores.profile.currentLocale, + }); runInAction('update exportedWallets and exportErrors', () => { this.exportedWallets = orderBy( wallets.map((wallet) => { @@ -367,8 +369,8 @@ export default class WalletMigrationStore extends Store { }; @action _generateMigrationReport = async () => { - const finalMigrationStatus = - await this.getWalletMigrationStatusRequest.execute().promise; + const finalMigrationStatus = await this.getWalletMigrationStatusRequest.execute() + .promise; const walletMigrationReportData: WalletMigrationReportData = { exportedWalletsData: this.exportedWalletsData, exportedWalletsCount: this.exportedWalletsCount, @@ -409,8 +411,8 @@ export default class WalletMigrationStore extends Store { // Reset migration data this._resetMigration(); - const walletMigrationStatus = - await this.getWalletMigrationStatusRequest.execute().promise; + const walletMigrationStatus = await this.getWalletMigrationStatusRequest.execute() + .promise; if (walletMigrationStatus === WalletMigrationStatuses.UNSTARTED) { // Wait for wallets to load as we need to match existing and exported wallets @@ -501,8 +503,8 @@ export default class WalletMigrationStore extends Store { this.actions.dialogs.closeActiveDialog.trigger(); } - const walletMigrationStatus = - await this.getWalletMigrationStatusRequest.execute().promise; + const walletMigrationStatus = await this.getWalletMigrationStatusRequest.execute() + .promise; if (walletMigrationStatus === WalletMigrationStatuses.RUNNING) { // Update migration status diff --git a/source/renderer/app/stores/WalletSettingsStore.ts b/source/renderer/app/stores/WalletSettingsStore.ts index 23e1b9266c..7a0c407278 100644 --- a/source/renderer/app/stores/WalletSettingsStore.ts +++ b/source/renderer/app/stores/WalletSettingsStore.ts @@ -39,8 +39,10 @@ export default class WalletSettingsStore extends Store { pollingApiInterval: IntervalID | null | undefined = null; setup() { - const { walletSettings: walletSettingsActions, sidebar: sidebarActions } = - this.actions; + const { + walletSettings: walletSettingsActions, + sidebar: sidebarActions, + } = this.actions; walletSettingsActions.startEditingWalletField.listen( this._startEditingWalletField ); @@ -303,8 +305,12 @@ export default class WalletSettingsStore extends Store { throw new Error( 'Active wallet required before checking show used addresses statuses.' ); - const localWalletData: WalletLocalData | null | undefined = - this.getLocalWalletDataById(activeWallet ? activeWallet.id : ''); + const localWalletData: + | WalletLocalData + | null + | undefined = this.getLocalWalletDataById( + activeWallet ? activeWallet.id : '' + ); const { showUsedAddresses } = localWalletData || {}; await this.actions.walletsLocal.setWalletLocalData.trigger({ walletId: activeWallet.id, diff --git a/source/renderer/app/stores/WalletsStore.ts b/source/renderer/app/stores/WalletsStore.ts index 235f4b336b..546c6fa5ba 100644 --- a/source/renderer/app/stores/WalletsStore.ts +++ b/source/renderer/app/stores/WalletsStore.ts @@ -67,8 +67,10 @@ import { NetworkMagics } from '../../../common/types/cardano-node.types'; export default class WalletsStore extends Store { WALLET_REFRESH_INTERVAL = 5000; - @observable undelegateWalletSubmissionSuccess: boolean | null | undefined = - null; + @observable undelegateWalletSubmissionSuccess: + | boolean + | null + | undefined = null; @observable isAddressFromSameWallet = false; @@ -98,8 +100,9 @@ export default class WalletsStore extends Store { @observable sendMoneyRequest: Request = new Request( this.api.ada.createTransaction ); - @observable getWalletRecoveryPhraseRequest: Request> = - new Request(this.api.ada.getWalletRecoveryPhrase); + @observable getWalletRecoveryPhraseRequest: Request< + Array + > = new Request(this.api.ada.getWalletRecoveryPhrase); @observable getWalletCertificateAdditionalMnemonicsRequest: Request< Array > = new Request(this.api.ada.getWalletCertificateAdditionalMnemonics); @@ -128,8 +131,9 @@ export default class WalletsStore extends Store { this.api.ada.restoreByronLedgerWallet ); @observable - transferFundsCalculateFeeRequest: Request = - new Request(this.api.ada.transferFundsCalculateFee); + transferFundsCalculateFeeRequest: Request< + TransferFundsCalculateFeeRequest + > = new Request(this.api.ada.transferFundsCalculateFee); @observable transferFundsRequest: Request = new Request( this.api.ada.transferFunds ); @@ -182,11 +186,15 @@ export default class WalletsStore extends Store { @observable walletCertificateAddress = null; @observable walletCertificateRecoveryPhrase = null; @observable generatingCertificateInProgress = false; - @observable generatingCertificateError: LocalizableError | null | undefined = - null; + @observable generatingCertificateError: + | LocalizableError + | null + | undefined = null; @observable generatingRewardsCsvInProgress = false; - @observable generatingRewardsCsvError: LocalizableError | null | undefined = - null; + @observable generatingRewardsCsvError: + | LocalizableError + | null + | undefined = null; @observable certificateStep = null; @observable certificateTemplate = null; @observable additionalMnemonicWords = null; @@ -359,8 +367,11 @@ export default class WalletsStore extends Store { _create = async (params: { name: string; spendingPassword: string }) => { Object.assign(this._newWalletDetails, params); try { - const recoveryPhrase: Array | null | undefined = - await this.getWalletRecoveryPhraseRequest.execute().promise; + const recoveryPhrase: + | Array + | null + | undefined = await this.getWalletRecoveryPhraseRequest.execute() + .promise; if (recoveryPhrase != null) { this.actions.walletBackup.initiateWalletBackup.trigger({ recoveryPhrase, @@ -571,8 +582,9 @@ export default class WalletsStore extends Store { }; _finishWalletBackup = async () => { - this._newWalletDetails.mnemonic = - this.stores.walletBackup.recoveryPhrase.join(' '); + this._newWalletDetails.mnemonic = this.stores.walletBackup.recoveryPhrase.join( + ' ' + ); const wallet = await this.createWalletRequest.execute( this._newWalletDetails ).promise; @@ -666,11 +678,12 @@ export default class WalletsStore extends Store { const { passphrase, scrambledInput } = getScrambledInput(mnemonics); // Unscramble 18-word wallet certificate mnemonic to 12-word mnemonic - const unscrambledRecoveryPhrase: Array = - await this.getWalletRecoveryPhraseFromCertificateRequest.execute({ + const unscrambledRecoveryPhrase: Array = await this.getWalletRecoveryPhraseFromCertificateRequest.execute( + { passphrase, scrambledInput, - }).promise; + } + ).promise; this.getWalletRecoveryPhraseFromCertificateRequest.reset(); @@ -1122,12 +1135,15 @@ export default class WalletsStore extends Store { this.stores.transactions.transactionsRequests = walletIds.map( (walletId) => ({ walletId, - recentRequest: - this.stores.transactions._getTransactionsRecentRequest(walletId), - allRequest: - this.stores.transactions._getTransactionsAllRequest(walletId), - withdrawalsRequest: - this.stores.transactions._getWithdrawalsRequest(walletId), + recentRequest: this.stores.transactions._getTransactionsRecentRequest( + walletId + ), + allRequest: this.stores.transactions._getTransactionsAllRequest( + walletId + ), + withdrawalsRequest: this.stores.transactions._getWithdrawalsRequest( + walletId + ), }) ); this.stores.transactions._refreshTransactionData(); @@ -1187,8 +1203,9 @@ export default class WalletsStore extends Store { // @ts-ignore ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'BigNumber... Remove this comment to see the full error message this.activeValue = formattedWalletAmount(this.active.amount); if (this.active && this.active.isHardwareWallet) { - const { hardwareWalletsConnectionData } = - this.stores.hardwareWallets; + const { + hardwareWalletsConnectionData, + } = this.stores.hardwareWallets; const hardwareWalletConnectionData = get( hardwareWalletsConnectionData, this.active.id @@ -1273,13 +1290,12 @@ export default class WalletsStore extends Store { this._updateCertificateCreationState(true); // Generate wallet recovery phrase - const recoveryPhrase: Array = - yield this.getWalletRecoveryPhraseRequest.execute().promise; + const recoveryPhrase: Array = yield this.getWalletRecoveryPhraseRequest.execute() + .promise; // Generate 9-words (additional) mnemonic - const additionalMnemonicWords: Array = - yield this.getWalletCertificateAdditionalMnemonicsRequest.execute() - .promise; + const additionalMnemonicWords: Array = yield this.getWalletCertificateAdditionalMnemonicsRequest.execute() + .promise; this.additionalMnemonicWords = additionalMnemonicWords.join(' '); // Generate spending password from 9-word mnemonic and save to store @@ -1288,13 +1304,15 @@ export default class WalletsStore extends Store { this.walletCertificatePassword = spendingPassword; // Generate paper wallet scrambled mnemonic - const walletCertificateRecoveryPhrase: Array = - yield this.getWalletCertificateRecoveryPhraseRequest.execute({ + const walletCertificateRecoveryPhrase: Array = yield this.getWalletCertificateRecoveryPhraseRequest.execute( + { passphrase: spendingPassword, input: recoveryPhrase.join(' '), - }).promise; - this.walletCertificateRecoveryPhrase = - walletCertificateRecoveryPhrase.join(' '); + } + ).promise; + this.walletCertificateRecoveryPhrase = walletCertificateRecoveryPhrase.join( + ' ' + ); // Create temporary wallet const walletData = { @@ -1379,8 +1397,11 @@ export default class WalletsStore extends Store { address: string; filePath: string; }) => { - const { currentLocale, currentDateFormat, currentTimeFormat } = - this.stores.profile; + const { + currentLocale, + currentDateFormat, + currentTimeFormat, + } = this.stores.profile; const { network, isMainnet } = this.environment; const intl = i18nContext(currentLocale); try { diff --git a/source/renderer/app/stores/index.ts b/source/renderer/app/stores/index.ts index d1b37943e2..25469a4d45 100644 --- a/source/renderer/app/stores/index.ts +++ b/source/renderer/app/stores/index.ts @@ -81,43 +81,47 @@ function executeOnEveryStore(fn: (store: Store) => void) { }); } // Set up and return the stores for this app -> also used to reset all stores to defaults -export default action((api, actions, router): StoresMap => { - function createStoreInstanceOf(StoreSubClass: Class): T { - return new StoreSubClass(api, actions); - } +export default action( + (api, actions, router): StoresMap => { + function createStoreInstanceOf( + StoreSubClass: Class + ): T { + return new StoreSubClass(api, actions); + } - // Teardown existing stores - if (stores) executeOnEveryStore((store) => store.teardown()); - // Create fresh instances of all stores - // @ts-ignore ts-migrate(2322) FIXME: Type '{ addresses: Store; app: Store; assets: Stor... Remove this comment to see the full error message - stores = observable({ - addresses: createStoreInstanceOf(AddressesStore), - app: createStoreInstanceOf(AppStore), - assets: createStoreInstanceOf(AssetsStore), - currency: createStoreInstanceOf(CurrencyStore), - appUpdate: createStoreInstanceOf(AppUpdateStore), - hardwareWallets: createStoreInstanceOf(HardwareWalletsStore), - networkStatus: createStoreInstanceOf(NetworkStatusStore), - newsFeed: createStoreInstanceOf(NewsFeedStore), - profile: createStoreInstanceOf(ProfileStore), - router, - sidebar: createStoreInstanceOf(SidebarStore), - staking: createStoreInstanceOf(StakingStore), - transactions: createStoreInstanceOf(TransactionsStore), - uiDialogs: createStoreInstanceOf(UiDialogsStore), - uiNotifications: createStoreInstanceOf(UiNotificationsStore), - voting: createStoreInstanceOf(VotingStore), - wallets: createStoreInstanceOf(WalletsStore), - walletsLocal: createStoreInstanceOf(WalletsLocalStore), - walletBackup: createStoreInstanceOf(WalletBackupStore), - walletMigration: createStoreInstanceOf(WalletMigrationStore), - walletSettings: createStoreInstanceOf(WalletSettingsStore), - window: createStoreInstanceOf(WindowStore), - }); - // Configure and initialize all stores - executeOnEveryStore((store) => { - if (stores) store.configure(stores); - }); - executeOnEveryStore((store) => store.initialize()); - return stores; -}); + // Teardown existing stores + if (stores) executeOnEveryStore((store) => store.teardown()); + // Create fresh instances of all stores + // @ts-ignore ts-migrate(2322) FIXME: Type '{ addresses: Store; app: Store; assets: Stor... Remove this comment to see the full error message + stores = observable({ + addresses: createStoreInstanceOf(AddressesStore), + app: createStoreInstanceOf(AppStore), + assets: createStoreInstanceOf(AssetsStore), + currency: createStoreInstanceOf(CurrencyStore), + appUpdate: createStoreInstanceOf(AppUpdateStore), + hardwareWallets: createStoreInstanceOf(HardwareWalletsStore), + networkStatus: createStoreInstanceOf(NetworkStatusStore), + newsFeed: createStoreInstanceOf(NewsFeedStore), + profile: createStoreInstanceOf(ProfileStore), + router, + sidebar: createStoreInstanceOf(SidebarStore), + staking: createStoreInstanceOf(StakingStore), + transactions: createStoreInstanceOf(TransactionsStore), + uiDialogs: createStoreInstanceOf(UiDialogsStore), + uiNotifications: createStoreInstanceOf(UiNotificationsStore), + voting: createStoreInstanceOf(VotingStore), + wallets: createStoreInstanceOf(WalletsStore), + walletsLocal: createStoreInstanceOf(WalletsLocalStore), + walletBackup: createStoreInstanceOf(WalletBackupStore), + walletMigration: createStoreInstanceOf(WalletMigrationStore), + walletSettings: createStoreInstanceOf(WalletSettingsStore), + window: createStoreInstanceOf(WindowStore), + }); + // Configure and initialize all stores + executeOnEveryStore((store) => { + if (stores) store.configure(stores); + }); + executeOnEveryStore((store) => store.initialize()); + return stores; + } +); diff --git a/source/renderer/app/utils/assets.ts b/source/renderer/app/utils/assets.ts index 23e424163b..49a26c0b53 100644 --- a/source/renderer/app/utils/assets.ts +++ b/source/renderer/app/utils/assets.ts @@ -148,63 +148,64 @@ export const getNonZeroAssetTokens = ( * @param sortBy - sorting parameter * @param sortDirection - should it sort in ascending or descending direction */ -export const sortAssets = - (sortBy: SortBy, sortDirection: SortDirection) => - (asset1: AssetToken, asset2: AssetToken) => { - const { - quantity: unformattedQuantity1, - fingerprint: fingerprint1, - metadata: metadata1, - decimals: decimals1, - } = asset1; - const quantity1 = formattedTokenDecimals(unformattedQuantity1, decimals1); - const { name: name1 } = metadata1 || {}; - const { - quantity: unformattedQuantity2, - fingerprint: fingerprint2, - metadata: metadata2, - decimals: decimals2, - } = asset2; - const quantity2 = formattedTokenDecimals(unformattedQuantity2, decimals2); - const { name: name2 } = metadata2 || {}; - - if (sortBy === 'token') { - if (name1 && !name2) return -1; - if (!name1 && name2) return 1; - - if (name1 && name2) { - if (sortDirection === 'asc') { - return name1.localeCompare(name2); - } +export const sortAssets = (sortBy: SortBy, sortDirection: SortDirection) => ( + asset1: AssetToken, + asset2: AssetToken +) => { + const { + quantity: unformattedQuantity1, + fingerprint: fingerprint1, + metadata: metadata1, + decimals: decimals1, + } = asset1; + const quantity1 = formattedTokenDecimals(unformattedQuantity1, decimals1); + const { name: name1 } = metadata1 || {}; + const { + quantity: unformattedQuantity2, + fingerprint: fingerprint2, + metadata: metadata2, + decimals: decimals2, + } = asset2; + const quantity2 = formattedTokenDecimals(unformattedQuantity2, decimals2); + const { name: name2 } = metadata2 || {}; - return name2.localeCompare(name1); - } + if (sortBy === 'token') { + if (name1 && !name2) return -1; + if (!name1 && name2) return 1; + if (name1 && name2) { if (sortDirection === 'asc') { - return fingerprint1.localeCompare(fingerprint2); + return name1.localeCompare(name2); } - return fingerprint2.localeCompare(fingerprint1); + return name2.localeCompare(name1); } - if (sortBy === 'fingerprint') { - if (sortDirection === 'asc') { - return fingerprint1.localeCompare(fingerprint2); - } + if (sortDirection === 'asc') { + return fingerprint1.localeCompare(fingerprint2); + } + + return fingerprint2.localeCompare(fingerprint1); + } - return fingerprint2.localeCompare(fingerprint1); + if (sortBy === 'fingerprint') { + if (sortDirection === 'asc') { + return fingerprint1.localeCompare(fingerprint2); } - if (sortBy === 'quantity') { - if (sortDirection === 'asc') { - return quantity1.isLessThan(quantity2) ? -1 : 1; - } + return fingerprint2.localeCompare(fingerprint1); + } - return quantity1.isLessThan(quantity2) ? 1 : -1; + if (sortBy === 'quantity') { + if (sortDirection === 'asc') { + return quantity1.isLessThan(quantity2) ? -1 : 1; } - return 0; - }; + return quantity1.isLessThan(quantity2) ? 1 : -1; + } + + return 0; +}; /** * Check if after the transactions your wallet has some assets left diff --git a/source/renderer/app/utils/hardwareWalletUtils.ts b/source/renderer/app/utils/hardwareWalletUtils.ts index f506e7cabc..867abd4578 100644 --- a/source/renderer/app/utils/hardwareWalletUtils.ts +++ b/source/renderer/app/utils/hardwareWalletUtils.ts @@ -37,7 +37,15 @@ export const KEY_PREFIXES = { // Helpers const receiverAddressTypes: Set = new Set([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, ]); export const isReceiverAddressType = (addressType: AddressType) => diff --git a/source/renderer/app/utils/logging.ts b/source/renderer/app/utils/logging.ts index 7b194b762f..0587a45412 100644 --- a/source/renderer/app/utils/logging.ts +++ b/source/renderer/app/utils/logging.ts @@ -23,19 +23,20 @@ const environmentData = { version, }; -const logToLevel = - (level: LoggingLevel) => - (message: string, data: Record | null | undefined) => { - const args = [ - formatContext({ ...messageContext, level }), - { - message, - data, - environmentData, - }, - ]; - electronLog[level](...args); - }; +const logToLevel = (level: LoggingLevel) => ( + message: string, + data: Record | null | undefined +) => { + const args = [ + formatContext({ ...messageContext, level }), + { + message, + data, + environmentData, + }, + ]; + electronLog[level](...args); +}; export const logger: Logger = { debug: logToLevel('debug'), diff --git a/storybook/stories/_support/utils.ts b/storybook/stories/_support/utils.ts index d6203a6d92..a2cea5f81d 100644 --- a/storybook/stories/_support/utils.ts +++ b/storybook/stories/_support/utils.ts @@ -236,13 +236,11 @@ export const generateAddress = (used = false): WalletAddress => used, spendingPath: "1852'/1815'/0'/0/19", }); -export const promise = - (returnValue: any): (() => Promise) => - () => - new Promise((resolve) => { - setTimeout(() => { - resolve(returnValue); - }, 2000); - }); +export const promise = (returnValue: any): (() => Promise) => () => + new Promise((resolve) => { + setTimeout(() => { + resolve(returnValue); + }, 2000); + }); export const isShelleyTestnetTheme = (currentTheme: string) => currentTheme === 'shelley-testnet'; diff --git a/storybook/stories/news/_utils/fakeDataUpdate.ts b/storybook/stories/news/_utils/fakeDataUpdate.ts index c8c4092d5c..bca564264e 100644 --- a/storybook/stories/news/_utils/fakeDataUpdate.ts +++ b/storybook/stories/news/_utils/fakeDataUpdate.ts @@ -15,17 +15,20 @@ const commonUpdateData = { darwin: { version: availableAppVersion, hash: '97d336d45b022b0390446497dbe8b43bb6174436df12d43c4fc2b953ce22b703', - url: 'https://update-cardano-mainnet.iohk.io/daedalus-2.0.0-mainnet-13980.pkg', + url: + 'https://update-cardano-mainnet.iohk.io/daedalus-2.0.0-mainnet-13980.pkg', }, win32: { version: availableAppVersion, hash: '97d336d45b022b0390446497dbe8b43bb6174436df12d43c4fc2b953ce22b703', - url: 'https://update-cardano-mainnet.iohk.io/daedalus-2.0.0-mainnet-13980.exe', + url: + 'https://update-cardano-mainnet.iohk.io/daedalus-2.0.0-mainnet-13980.exe', }, linux: { version: availableAppVersion, hash: '97d336d45b022b0390446497dbe8b43bb6174436df12d43c4fc2b953ce22b703', - url: 'https://update-cardano-mainnet.iohk.io/daedalus-2.0.0-mainnet-13980.bin', + url: + 'https://update-cardano-mainnet.iohk.io/daedalus-2.0.0-mainnet-13980.bin', }, }, type: 'software-update', diff --git a/storybook/stories/wallets/import/WalletImportFile.stories.tsx b/storybook/stories/wallets/import/WalletImportFile.stories.tsx index 37bff74542..2fc453489e 100644 --- a/storybook/stories/wallets/import/WalletImportFile.stories.tsx +++ b/storybook/stories/wallets/import/WalletImportFile.stories.tsx @@ -57,9 +57,9 @@ storiesOf('Wallets/Import File', module) // @ts-ignore ts-migrate(2345) FIXME: Argument of type 'string' is not assignable to par... Remove this comment to see the full error message (x, index: number) => getWallet(index, true, statusSelect) ); - const unnamedWallets = [...Array(number('Wallets with no name', 5))].map( - (x, index: number) => getWallet(index, false) - ); + const unnamedWallets = [ + ...Array(number('Wallets with no name', 5)), + ].map((x, index: number) => getWallet(index, false)); return (