diff --git a/mobile-app/app/api/transaction/dfi_converter.ts b/mobile-app/app/api/transaction/dfi_converter.ts index 53521a02f8..ab2b10648a 100644 --- a/mobile-app/app/api/transaction/dfi_converter.ts +++ b/mobile-app/app/api/transaction/dfi_converter.ts @@ -11,7 +11,7 @@ import { ConvertDirection } from "@screens/enum"; export async function dfiConversionSigner( account: WhaleWalletAccount, amount: BigNumber, - mode: ConvertDirection + mode: ConvertDirection, ): Promise { const script = await account.getScript(); const builder = account.withTransactionBuilder(); @@ -31,7 +31,7 @@ export async function dfiConversionSigner( }, ], }, - script + script, ); } else { signed = await builder.account.accountToUtxos( @@ -45,7 +45,7 @@ export async function dfiConversionSigner( ], mintingOutputsStart: 2, // 0: DfTx, 1: change, 2: minted utxos (mandated by jellyfish-tx) }, - script + script, ); } return new CTransactionSegWit(signed); @@ -56,7 +56,7 @@ export function dfiConversionCrafter( convertDirection: ConvertDirection, onBroadcast: () => any, onConfirmation: () => void, - submitButtonLabel?: string + submitButtonLabel?: string, ): DfTxSigner { if ( ![ @@ -81,7 +81,7 @@ export function dfiConversionCrafter( amount: amount.toFixed(8), symbolA, symbolB, - } + }, ), drawerMessages: { preparing: translate("screens/OceanInterface", "Preparing to convert…"), @@ -92,7 +92,7 @@ export function dfiConversionCrafter( symbolA: symbolA, symbolB: symbolB, amount: amount.toFixed(8), - } + }, ), complete: translate( "screens/OceanInterface", @@ -101,7 +101,7 @@ export function dfiConversionCrafter( symbolA, symbolB, amount: amount.toFixed(8), - } + }, ), }, onBroadcast, diff --git a/mobile-app/app/api/transaction/transfer_domain.ts b/mobile-app/app/api/transaction/transfer_domain.ts index 0e0a860982..5c40380784 100644 --- a/mobile-app/app/api/transaction/transfer_domain.ts +++ b/mobile-app/app/api/transaction/transfer_domain.ts @@ -25,7 +25,7 @@ export async function transferDomainSigner( sourceTokenId: string, targetTokenId: string, amount: BigNumber, - convertDirection: ConvertDirection + convertDirection: ConvertDirection, ): Promise { const dvmScript = await account.getScript(); const evmScript = await account.getEvmScript(); @@ -64,7 +64,7 @@ export async function transferDomainSigner( }, ], }, - dvmScript + dvmScript, ); return new CTransactionSegWit(signed); @@ -77,11 +77,11 @@ export function transferDomainCrafter( targetToken: TransferDomainToken, onBroadcast: () => any, onConfirmation: () => void, - submitButtonLabel?: string + submitButtonLabel?: string, ): DfTxSigner { if ( ![ConvertDirection.evmToDvm, ConvertDirection.dvmToEvm].includes( - convertDirection + convertDirection, ) ) { throw new Error("Unexpected transfer domain"); @@ -99,7 +99,7 @@ export function transferDomainCrafter( sourceToken.tokenId, targetToken.tokenId, amount, - convertDirection + convertDirection, ), title: translate( "screens/ConvertConfirmScreen", @@ -108,7 +108,7 @@ export function transferDomainCrafter( amount: amount.toFixed(8), symbolA, symbolB, - } + }, ), drawerMessages: { preparing: translate("screens/OceanInterface", "Preparing to convert…"), @@ -119,7 +119,7 @@ export function transferDomainCrafter( symbolA: symbolA, symbolB: symbolB, amount: amount.toFixed(8), - } + }, ), complete: translate( "screens/OceanInterface", @@ -128,7 +128,7 @@ export function transferDomainCrafter( symbolA: symbolA, symbolB: symbolB, amount: amount.toFixed(8), - } + }, ), }, onBroadcast, diff --git a/mobile-app/app/components/DomainSwitch.tsx b/mobile-app/app/components/DomainSwitch.tsx index a202df9675..1b14ba1553 100644 --- a/mobile-app/app/components/DomainSwitch.tsx +++ b/mobile-app/app/components/DomainSwitch.tsx @@ -15,7 +15,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element { const toggleDomain = async () => { await setDomain( - domain === DomainType.DVM ? DomainType.EVM : DomainType.DVM + domain === DomainType.DVM ? DomainType.EVM : DomainType.DVM, ); }; return ( @@ -30,7 +30,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element { {domain === DomainType.DVM && ( @@ -78,7 +78,7 @@ export function DomainSwitch({ testID }: { testID: string }): JSX.Element { diff --git a/mobile-app/app/components/WalletAddressRow.test.tsx b/mobile-app/app/components/WalletAddressRow.test.tsx index 9b87686c2d..99bc6c4f0f 100644 --- a/mobile-app/app/components/WalletAddressRow.test.tsx +++ b/mobile-app/app/components/WalletAddressRow.test.tsx @@ -37,7 +37,7 @@ describe("Wallet Address Row", () => { const rendered = render( - + , ); expect(rendered.toJSON()).toMatchSnapshot(); }); diff --git a/mobile-app/app/contexts/DomainContext.tsx b/mobile-app/app/contexts/DomainContext.tsx index b715fc0cfe..bb2aeccd6b 100644 --- a/mobile-app/app/contexts/DomainContext.tsx +++ b/mobile-app/app/contexts/DomainContext.tsx @@ -62,7 +62,7 @@ export function useDomainContext(): Domain { } export function DomainProvider( - props: DomainContextI & PropsWithChildren + props: DomainContextI & PropsWithChildren, ): JSX.Element | null { const { api } = props; const { domain } = useDomain({ api }); diff --git a/mobile-app/app/hooks/useAddressBook.ts b/mobile-app/app/hooks/useAddressBook.ts index d578676ef1..ef3b69470e 100644 --- a/mobile-app/app/hooks/useAddressBook.ts +++ b/mobile-app/app/hooks/useAddressBook.ts @@ -9,7 +9,7 @@ export function useAddressBook(): { } { const { network } = useNetworkContext(); const userPreferences = useSelector( - (state: RootState) => state.userPreferences + (state: RootState) => state.userPreferences, ); const dispatch = useAppDispatch(); const clearAddressBook = (): void => { @@ -24,7 +24,7 @@ export function useAddressBook(): { ...userPreferences, addressBook: emptyAddressBook, }, - }) + }), ); }); }; diff --git a/mobile-app/app/hooks/useAddressLabel.ts b/mobile-app/app/hooks/useAddressLabel.ts index 878130fd29..f86669c376 100644 --- a/mobile-app/app/hooks/useAddressLabel.ts +++ b/mobile-app/app/hooks/useAddressLabel.ts @@ -4,7 +4,7 @@ import { selectAllLabeledWalletAddress } from "@store/userPreferences"; export function useAddressLabel(address: string): string | null { const addresses = useSelector((state: RootState) => - selectAllLabeledWalletAddress(state.userPreferences) + selectAllLabeledWalletAddress(state.userPreferences), ); let label = null; if (addresses?.[address] != null) { diff --git a/mobile-app/app/hooks/wallet/Conversion.ts b/mobile-app/app/hooks/wallet/Conversion.ts index e9aec4ddd6..d0da4047f9 100644 --- a/mobile-app/app/hooks/wallet/Conversion.ts +++ b/mobile-app/app/hooks/wallet/Conversion.ts @@ -34,13 +34,13 @@ export function useConversion(props: useConversionProps): ConversionResult { const [isConversionRequired, setIsConversionRequired] = useState(false); const [conversionAmount, setConversionAmount] = useState(new BigNumber("0")); const DFIUnified = useSelector((state: RootState) => - unifiedDFISelector(state.wallet) + unifiedDFISelector(state.wallet), ); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const unifiedAmount = new BigNumber(DFIUnified.amount); const reservedDFI = 0.1; @@ -61,7 +61,7 @@ export function useConversion(props: useConversionProps): ConversionResult { setConversionAmount( amount .minus(type === "utxo" ? DFIUtxo.amount : DFIToken.amount) - .plus(type === "utxo" ? reservedDFI : 0) + .plus(type === "utxo" ? reservedDFI : 0), ); setIsConversionRequired(true); } else { @@ -80,7 +80,7 @@ export function queueConvertTransaction( dispatch: Dispatch, onBroadcast: () => void, logger: NativeLoggingProps, - onConfirmation: () => void = () => {} + onConfirmation: () => void = () => {}, ): void { try { dispatch( @@ -90,9 +90,9 @@ export function queueConvertTransaction( mode, onBroadcast, onConfirmation, - "CONVERTING" - ) - ) + "CONVERTING", + ), + ), ); } catch (e) { logger.error(e); diff --git a/mobile-app/app/screens/AppNavigator/BottomTabNavigator.tsx b/mobile-app/app/screens/AppNavigator/BottomTabNavigator.tsx index 12a4c9e164..f45ca3ab37 100644 --- a/mobile-app/app/screens/AppNavigator/BottomTabNavigator.tsx +++ b/mobile-app/app/screens/AppNavigator/BottomTabNavigator.tsx @@ -57,7 +57,7 @@ export function BottomTabNavigator(): JSX.Element { { "bg-mono-light-v2-00 border-mono-light-v2-100": isLight }, { "bg-mono-dark-v2-00 border-mono-dark-v2-100": !isLight }, { "pt-1 pb-4 h-24": Platform.OS === "ios" }, - { hidden: domain !== DomainType.DVM } + { hidden: domain !== DomainType.DVM }, ), tabBarActiveTintColor: getColor("brand-v2-500"), tabBarInactiveTintColor: isLight diff --git a/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/CompositeSwapScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/CompositeSwapScreen.tsx index face95bfd3..012d4b0584 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/CompositeSwapScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/CompositeSwapScreen.tsx @@ -123,19 +123,19 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const blockCount = useSelector((state: RootState) => state.block.count ?? 0); const pairs = useSelector((state: RootState) => state.wallet.poolpairs); const tokens = useSelector((state: RootState) => - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const reservedDfi = 0.1; @@ -153,7 +153,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const [estimatedLessFeesAfterSlippage, setEstimatedLessFeesAfterSlippage] = useState(undefined); const [activeButtonGroup, setActiveButtonGroup] = useState( - ButtonGroupTabKey.InstantSwap + ButtonGroupTabKey.InstantSwap, ); const [isFutureSwap, setIsFutureSwap] = useState(false); const [bestPathEstimatedReturn, setBestPathEstimatedReturn] = useState< @@ -162,24 +162,24 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const [oraclePriceMessage, setOraclePriceMessage] = useState( translate( "screens/CompositeSwapScreen", - "Future swap uses the oracle price of the selected token on the settlement block" - ) + "Future swap uses the oracle price of the selected token on the settlement block", + ), ); const [hasShownInputFocusBefore, setHasShownInputFocusBefore] = useState(false); const executionBlock = useSelector( - (state: RootState) => state.futureSwaps.executionBlock + (state: RootState) => state.futureSwaps.executionBlock, ); const { timeRemaining, transactionDate, isEnded } = useFutureSwapDate( executionBlock, - blockCount + blockCount, ); const { fromTokens, toTokens } = useSwappableTokens( selectedTokenA?.id, selectedTokenA?.displaySymbol, selectedTokenA?.symbol, - activeButtonGroup === ButtonGroupTabKey.FutureSwap + activeButtonGroup === ButtonGroupTabKey.FutureSwap, ); const { isFutureSwapOptionEnabled, @@ -243,7 +243,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const { tokenA, tokenB } = watch(); const isReservedUtxoUsed = getDisplayUtxoWarningStatus( new BigNumber(tokenA), - selectedTokenA?.displaySymbol ?? "" + selectedTokenA?.displaySymbol ?? "", ); const { isConversionRequired, conversionAmount } = useConversion({ @@ -261,7 +261,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const maxAmount = BigNumber.max( new BigNumber(token.amount).minus(reservedDfi), - 0 + 0, ); return maxAmount.isLessThanOrEqualTo(0) ? new BigNumber(0).toFixed(8) @@ -270,7 +270,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const onTokenSelect = ( { tokenId, reserve, token: { displaySymbol, symbol } }: BottomSheetToken, - direction: "FROM" | "TO" + direction: "FROM" | "TO", ): void => { if ( (selectedTokenA?.displaySymbol === displaySymbol && @@ -387,7 +387,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { name: route.params.fromToken.name, }, }, - "FROM" + "FROM", ); return; @@ -409,7 +409,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { }, reserve: pair.data.tokenA.reserve, }, - "FROM" + "FROM", ); } if (tokenSelectOption.to.isPreselected) { @@ -424,7 +424,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { }, reserve: pair.data.tokenB.reserve, }, - "TO" + "TO", ); } }, [ @@ -452,7 +452,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { if (selectedTokenA !== undefined && selectedTokenB !== undefined) { const poolPairs = await getArbitraryPoolPair( selectedTokenA.id, - selectedTokenB.id + selectedTokenB.id, ); setSelectedPoolPairs(poolPairs); } @@ -473,7 +473,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { await calculatePriceRates( selectedTokenA.id, selectedTokenB.id, - new BigNumber(tokenA) + new BigNumber(tokenA), ); // Find the selected reserve in case it's null. From Token Detail Screen, reserve does not exist due to pair not existing @@ -486,10 +486,10 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { ? selectedTokenA.reserve : selectedReserve; const slippage = new BigNumber(1).minus( - new BigNumber(tokenA).div(tokenAReserve) + new BigNumber(tokenA).div(tokenAReserve), ); setEstimatedLessFeesAfterSlippage( - new BigNumber(estimatedLessDexFees).multipliedBy(slippage) + new BigNumber(estimatedLessDexFees).multipliedBy(slippage), ); setPriceRates([ @@ -523,7 +523,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { useEffect(() => { setIsFutureSwap( activeButtonGroup === ButtonGroupTabKey.FutureSwap && - isFutureSwapOptionEnabled + isFutureSwapOptionEnabled, ); }, [activeButtonGroup, isFutureSwapOptionEnabled]); @@ -535,7 +535,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { const fetchBestPath = async () => { const bestPath = await getBestPath( selectedTokenA.id === "0_unified" ? "0" : selectedTokenA.id, - selectedTokenB.id === "0_unified" ? "0" : selectedTokenB.id + selectedTokenB.id === "0_unified" ? "0" : selectedTokenB.id, ); setBestPathEstimatedReturn({ estimatedReturn: bestPath.estimatedReturn, @@ -560,38 +560,38 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { dexFeesInTokenBUnit = Burn fees + commission fee of 1 tokenA */ const dexFeesInTokenBUnit = new BigNumber( - bestPathEstimatedReturn?.estimatedReturn ?? 0 + bestPathEstimatedReturn?.estimatedReturn ?? 0, ) .minus( - new BigNumber(bestPathEstimatedReturn?.estimatedReturnLessDexFees ?? 0) + new BigNumber(bestPathEstimatedReturn?.estimatedReturnLessDexFees ?? 0), ) .multipliedBy(tokenA); /* Transaction fee + DEX fees */ return getPrecisedCurrencyValue( getTokenPrice("DFI", fee).plus( - getTokenPrice(selectedTokenB.symbol, dexFeesInTokenBUnit) - ) + getTokenPrice(selectedTokenB.symbol, dexFeesInTokenBUnit), + ), ); }, [priceRates, selectedTokenB, tokenA, bestPathEstimatedReturn, fee]); useEffect(() => { let message = translate( "screens/CompositeSwapScreen", - "Future swap uses the oracle price of the selected token on the settlement block" + "Future swap uses the oracle price of the selected token on the settlement block", ); if (selectedTokenA !== undefined) { if (selectedTokenA.displaySymbol === "DUSD") { if (selectedTokenB === undefined) { message = translate( "screens/CompositeSwapScreen", - "You are buying dTokens at 5% more than the oracle price at settlement block." + "You are buying dTokens at 5% more than the oracle price at settlement block.", ); } else { message = translate( "screens/CompositeSwapScreen", "You are buying {{displaySymbol}} at 5% more than the oracle price at settlement block.", - { displaySymbol: selectedTokenB.displaySymbol } + { displaySymbol: selectedTokenB.displaySymbol }, ); } } else { @@ -600,7 +600,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { "You are selling your {{displaySymbol}} at 5% less than the oracle price at settlement block.", { displaySymbol: selectedTokenA.displaySymbol, - } + }, ); } } @@ -743,7 +743,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { params, merge: true, }); - } + }, ); } else { navigation.navigate("ConfirmCompositeSwapScreen", params); @@ -776,7 +776,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { return getTokenPrice(token.symbol, new BigNumber(tokenAmount)); }, - [] + [], ); const isBothTokensSelected = (): boolean => { @@ -785,7 +785,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { async function onPercentagePress( amount: string, - type: AmountButtonTypes + type: AmountButtonTypes, ): Promise { setValue("tokenA", amount); await trigger("tokenA"); @@ -812,7 +812,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { type: "wallet_toast", placement: "top", duration: TOAST_DURATION, - } + }, ); } @@ -859,7 +859,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { @@ -881,7 +881,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { @@ -934,7 +934,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { }} placeholder="0.00" placeholderTextColor={getColor( - isLight ? "mono-light-v2-900" : "mono-dark-v2-900" + isLight ? "mono-light-v2-900" : "mono-dark-v2-900", )} ref={amountInputRef} testID="text_input_tokenA" @@ -948,7 +948,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { validate: { greaterThanZero: (value: string) => new BigNumber( - value !== undefined && value !== "" ? value : 0 + value !== undefined && value !== "" ? value : 0, ).isGreaterThan(0), }, }} @@ -956,7 +956,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { {translate( "screens/CompositeSwapScreen", - "Select a token first" + "Select a token first", )} )} @@ -1001,7 +1001,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { > {translate( "screens/CompositeSwapScreen", - "Insufficient balance" + "Insufficient balance", )} )} @@ -1016,7 +1016,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { > {translate( "screens/CompositeSwapScreen", - "A small amount of UTXO is reserved for fees" + "A small amount of UTXO is reserved for fees", )} )} @@ -1084,7 +1084,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { isBothTokensSelected() && priceRates !== undefined && activeButtonGroup === ButtonGroupTabKey.InstantSwap, - } + }, )} light={tailwind("border-mono-light-v2-300")} dark={tailwind("border-mono-dark-v2-300")} @@ -1097,7 +1097,7 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { tokenAmount={new BigNumber(tokenB).toFixed(8)} tokenUsdAmount={getAmountInUSDValue( selectedTokenB ?? undefined, - tokenB + tokenB, )} /> )} @@ -1165,11 +1165,11 @@ export function CompositeSwapScreen({ route }: Props): JSX.Element { {isConversionRequired ? translate( "screens/CompositeSwapScreen", - "By continuing, the required amount of DFI will be converted" + "By continuing, the required amount of DFI will be converted", ) : translate( "screens/CompositeSwapScreen", - "Review full details in the next screen" + "Review full details in the next screen", )} )} diff --git a/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/SwapTokenSelectionScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/SwapTokenSelectionScreen.tsx index 9a7bec10b1..8b293bb553 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/SwapTokenSelectionScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Dex/CompositeSwap/SwapTokenSelectionScreen.tsx @@ -111,7 +111,7 @@ export function SwapTokenSelectionScreen({ route }: Props): JSX.Element { showClearButton={debouncedSearchTerm !== ""} placeholder={translate( "screens/SwapTokenSelectionScreen", - "Search token" + "Search token", )} containerStyle={tailwind([ "border-0.5", @@ -153,7 +153,7 @@ export function SwapTokenSelectionScreen({ route }: Props): JSX.Element { ? "AVAILABLE FOR CONVERT" : isFutureSwap ? "AVAILABLE FOR FUTURE SWAP" - : "AVAILABLE FOR SWAP" + : "AVAILABLE FOR SWAP", )} ) : ( @@ -166,7 +166,7 @@ export function SwapTokenSelectionScreen({ route }: Props): JSX.Element { {translate( "screens/SwapTokenSelectionScreen", getEmptyResultText(), - { searchTerm: debouncedSearchTerm } + { searchTerm: debouncedSearchTerm }, )} )} @@ -179,7 +179,7 @@ export function SwapTokenSelectionScreen({ route }: Props): JSX.Element { type TokenPrice = ( symbol: string, amount: BigNumber, - isLPS?: boolean | undefined + isLPS?: boolean | undefined, ) => BigNumber; interface TokenItemProps { @@ -203,13 +203,13 @@ function TokenItem({ const activePriceUSDT = getTokenPrice( item.token.symbol, new BigNumber("1"), - item.token.isLPS + item.token.isLPS, ); return ( ( @@ -256,7 +256,7 @@ function TokenItem({ {listType === TokenListType.From ? ( ( [t.token.displaySymbol, t.token.name].some((searchItem) => - searchItem.toLowerCase().includes(searchTerm.trim().toLowerCase()) - ) + searchItem.toLowerCase().includes(searchTerm.trim().toLowerCase()), + ), ); } diff --git a/mobile-app/app/screens/AppNavigator/screens/Dex/DexAddLiquidity.tsx b/mobile-app/app/screens/AppNavigator/screens/Dex/DexAddLiquidity.tsx index 2f399e59f4..648f02ab14 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Dex/DexAddLiquidity.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Dex/DexAddLiquidity.tsx @@ -64,20 +64,20 @@ export function AddLiquidityScreen(props: Props): JSX.Element { const navigation = useNavigation>(); const dispatch = useAppDispatch(); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const pairs = useSelector((state: RootState) => state.wallet.poolpairs); const tokens = useSelector((state: RootState) => - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); const { getTokenPrice } = useTokenPrice(); const { pair: pairData, pairInfo, originScreen } = props.route.params; @@ -107,7 +107,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { const [tokenAAmount, setTokenAAmount] = useState(""); const [tokenBAmount, setTokenBAmount] = useState(""); const [sharePercentage, setSharePercentage] = useState( - new BigNumber(0) + new BigNumber(0), ); const [canContinue, setCanContinue] = useState(false); @@ -119,7 +119,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { inputToken: { type: "token", amount: new BigNumber( - pair?.tokenA.id === "0" ? tokenAAmount : tokenBAmount + pair?.tokenA.id === "0" ? tokenAAmount : tokenBAmount, ), }, deps: [pair, tokenAAmount, tokenBAmount, balanceA, balanceB], @@ -176,11 +176,11 @@ export function AddLiquidityScreen(props: Props): JSX.Element { setSharePercentage(refAmount.div(pair.tokenB.reserve)); } }, - [pair] + [pair], ); const getAddressTokenById = ( - poolpairTokenId: string + poolpairTokenId: string, ): WalletToken | undefined => { return tokens.find((token) => { if (poolpairTokenId === "0" || poolpairTokenId === "0_utxo") { @@ -208,7 +208,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { _amount: string, type: AmountButtonTypes, displaySymbolA: string, - displaySymbolB: string + displaySymbolB: string, ): void { showToast(type, displaySymbolA, displaySymbolB); } @@ -283,7 +283,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { }, merge: true, }); - } + }, ); } else { navigation.navigate({ @@ -310,7 +310,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { function showToast( type: AmountButtonTypes, displaySymbolA: string, - displaySymbolB: string + displaySymbolB: string, ): void { if (displaySymbolA === undefined || displaySymbolB === undefined) { return; @@ -355,7 +355,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { pair !== undefined && getDisplayUtxoWarningStatus( new BigNumber(tokenAAmount), - pair?.tokenA.displaySymbol + pair?.tokenA.displaySymbol, ) && new BigNumber(tokenAAmount).isGreaterThan(0) ) { @@ -370,7 +370,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { pair !== undefined && getDisplayUtxoWarningStatus( new BigNumber(tokenBAmount), - pair?.tokenB.displaySymbol + pair?.tokenB.displaySymbol, ) && new BigNumber(tokenBAmount).isGreaterThan(0) ) { @@ -404,14 +404,14 @@ export function AddLiquidityScreen(props: Props): JSX.Element { ? TransactionCardStatus.Error : isInputAFocus ? TransactionCardStatus.Active - : undefined + : undefined, ); setTokenBTransactionCardStatus( hasBError ? TransactionCardStatus.Error : isInputBFocus ? TransactionCardStatus.Active - : undefined + : undefined, ); }, [hasAError, hasBError, isInputAFocus, isInputBFocus]); @@ -425,8 +425,8 @@ export function AddLiquidityScreen(props: Props): JSX.Element { new BigNumber(tokenAAmount), new BigNumber(tokenBAmount), balanceA, - balanceB - ) + balanceB, + ), ); }, [pair, tokenAAmount, tokenBAmount, balanceA, balanceB]); @@ -446,10 +446,10 @@ export function AddLiquidityScreen(props: Props): JSX.Element { aSymbol, bSymbol, aToBRate: new BigNumber(poolpair.tokenB.reserve).div( - poolpair.tokenA.reserve + poolpair.tokenA.reserve, ), bToARate: new BigNumber(poolpair.tokenA.reserve).div( - poolpair.tokenB.reserve + poolpair.tokenB.reserve, ), }); if (addressTokenA !== undefined) { @@ -457,9 +457,9 @@ export function AddLiquidityScreen(props: Props): JSX.Element { addressTokenA.id === "0_unified" ? BigNumber.max( new BigNumber(addressTokenA.amount).minus(reservedDfi), - 0 + 0, ) - : new BigNumber(addressTokenA.amount) + : new BigNumber(addressTokenA.amount), ); } if (addressTokenB !== undefined) { @@ -467,9 +467,9 @@ export function AddLiquidityScreen(props: Props): JSX.Element { addressTokenB.id === "0_unified" ? BigNumber.max( new BigNumber(addressTokenB.amount).minus(reservedDfi), - 0 + 0, ) - : new BigNumber(addressTokenB.amount) + : new BigNumber(addressTokenB.amount), ); } } @@ -515,7 +515,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { amount, type, pair.tokenA.displaySymbol, - pair.tokenB.displaySymbol + pair.tokenB.displaySymbol, ); }} symbol={pair.tokenA.displaySymbol} @@ -538,7 +538,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { amount, type, pair.tokenA.displaySymbol, - pair.tokenB.displaySymbol + pair.tokenB.displaySymbol, ); }} symbol={pair.tokenB.displaySymbol} @@ -576,7 +576,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element { resultingLplhs={{ value: translate( "screens/AddLiquidity", - "LP Tokens to receive" + "LP Tokens to receive", ), testID: "lp_tokens_to_receive", themedProps: { @@ -591,9 +591,9 @@ export function AddLiquidityScreen(props: Props): JSX.Element { testID: "lp_tokens_to_receive_value", usdAmount: getTokenPrice( pair.aSymbol, - new BigNumber(tokenAAmount) + new BigNumber(tokenAAmount), ).plus( - getTokenPrice(pair.bSymbol, new BigNumber(tokenBAmount)) + getTokenPrice(pair.bSymbol, new BigNumber(tokenBAmount)), ), themedProps: { style: tailwind("font-semibold-v2 text-sm"), @@ -611,11 +611,11 @@ export function AddLiquidityScreen(props: Props): JSX.Element { {isConversionRequired ? translate( "screens/AddLiquidity", - "By continuing, the required amount of DFI will be converted" + "By continuing, the required amount of DFI will be converted", ) : translate( "screens/AddLiquidity", - "Review full details in the next screen" + "Review full details in the next screen", )} @@ -669,7 +669,7 @@ function canAddLiquidity( tokenAAmount: BigNumber, tokenBAmount: BigNumber, balanceA: BigNumber | undefined, - balanceB: BigNumber | undefined + balanceB: BigNumber | undefined, ): boolean { if (tokenAAmount.isNaN() || tokenBAmount.isNaN()) { // empty string, use still input-ing diff --git a/mobile-app/app/screens/AppNavigator/screens/Dex/components/PoolPairCards/PoolPairCards.tsx b/mobile-app/app/screens/AppNavigator/screens/Dex/components/PoolPairCards/PoolPairCards.tsx index 215afc86ac..5b213fcc32 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Dex/components/PoolPairCards/PoolPairCards.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Dex/components/PoolPairCards/PoolPairCards.tsx @@ -78,7 +78,7 @@ export function PoolPairCards({ useFavouritePoolpairContext(); const sortedPairs = sortPoolpairsByFavourite( availablePairs, - isFavouritePoolpair + isFavouritePoolpair, ); const { tvl } = useSelector((state: RootState) => state.block); const [filteredYourPairs, setFilteredYourPairs] = @@ -89,7 +89,7 @@ export function PoolPairCards({ const pairSortingFn = ( pairA: DexItem, - pairB: DexItem + pairB: DexItem, ): number => availablePairs.findIndex((x) => x.data.id === pairA.data.id) - availablePairs.findIndex((x) => x.data.id === pairB.data.id); @@ -109,9 +109,9 @@ export function PoolPairCards({ .filter((pair) => pair.data.displaySymbol .toLowerCase() - .includes(debouncedSearchTerm.trim().toLowerCase()) + .includes(debouncedSearchTerm.trim().toLowerCase()), ) - .sort(pairSortingFn) + .sort(pairSortingFn), ); } else { setFilteredYourPairs([]); @@ -166,7 +166,7 @@ export function PoolPairCards({ title={translate("screens/DexScreen", "No favorites added")} subtitle={translate( "screens/DexScreen", - "Tap the star icon to add your favorite pools here" + "Tap the star icon to add your favorite pools here", )} /> )} @@ -198,7 +198,7 @@ export function PoolPairCards({ dark={tailwind("text-mono-dark-v2-500")} light={tailwind("text-mono-light-v2-500")} style={tailwind( - "font-normal-v2 text-xs uppercase pl-10 mb-2" + "font-normal-v2 text-xs uppercase pl-10 mb-2", )} > {translate("screens/DexScreen", "Available pairs")} @@ -243,7 +243,7 @@ function PoolCard({ const isFavoritePair = isFavouritePoolpair(yourPair.id); const poolPairData = pairs.find( - (pr) => pr.data.symbol === (yourPair as AddressToken).symbol + (pr) => pr.data.symbol === (yourPair as AddressToken).symbol, ); const mappedPair = poolPairData?.data; @@ -291,7 +291,7 @@ function PoolCard({ walletTokenPrice={getTokenPrice( yourPair.symbol, new BigNumber((yourPair as WalletToken).amount), - true + true, )} /> )} @@ -353,7 +353,7 @@ function AvailablePool(props: AvailablePoolProps): JSX.Element { isFavouritePair={props.isFavouritePair} onPress={() => { showToast( - props.isFavouritePair ? "UNSET_FAVOURITE" : "SET_FAVOURITE" + props.isFavouritePair ? "UNSET_FAVOURITE" : "SET_FAVOURITE", ); props.setFavouritePoolpair(props.pair.id); }} @@ -381,7 +381,7 @@ function AvailablePool(props: AvailablePoolProps): JSX.Element { label={translate("screens/DexScreen", "APR")} value={{ text: new BigNumber( - isNaN(props.pair.apr.total) ? 0 : props.pair.apr.total + isNaN(props.pair.apr.total) ? 0 : props.pair.apr.total, ) .times(100) .toFixed(2), @@ -445,7 +445,9 @@ function YourPoolPair(props: YourPoolPairProps): JSX.Element { label={translate("screens/DexScreen", "APR")} value={{ text: new BigNumber( - isNaN(props.poolPair.apr.total) ? 0 : props.poolPair.apr.total + isNaN(props.poolPair.apr.total) + ? 0 + : props.poolPair.apr.total, ) .times(100) .toFixed(2), @@ -499,7 +501,7 @@ function getSortedPriceRates({ function sortPoolpairsByFavourite( pairs: Array>, - isFavouritePair: (id: string) => boolean + isFavouritePair: (id: string) => boolean, ): Array> { return pairs.slice().sort((firstPair, secondPair) => { if (isFavouritePair(firstPair.data.id)) { @@ -566,7 +568,7 @@ function NewPoolsSection({ onActionPress={() => onActionPress( pairItem.data as PoolPairData, - pairItem.data as WalletToken + pairItem.data as WalletToken, ) } onPress={() => onPress(pairItem.data.id)} diff --git a/mobile-app/app/screens/AppNavigator/screens/Loans/screens/AddOrRemoveCollateralScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Loans/screens/AddOrRemoveCollateralScreen.tsx index 35898ee751..89adcb46ca 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Loans/screens/AddOrRemoveCollateralScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Loans/screens/AddOrRemoveCollateralScreen.tsx @@ -97,17 +97,17 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { const dispatch = useAppDispatch(); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const navigation = useNavigation>(); @@ -131,7 +131,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { isAdd && selectedCollateralItem.token.id === "0" ? new BigNumber(collateralAmount).isGreaterThan(DFIToken.amount) && new BigNumber(collateralAmount).isLessThanOrEqualTo( - selectedCollateralItem.available + selectedCollateralItem.available, ) : false; @@ -140,7 +140,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { : collateralAmount; const collateralInputValue = getCollateralValue( new BigNumber(collateralInputAmount), - selectedCollateralItem + selectedCollateralItem, ); // Vault collaterals value @@ -150,26 +150,26 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { ? new BigNumber(currentVaultCollateralValue).plus(collateralInputValue) : new BigNumber(currentVaultCollateralValue).minus(collateralInputValue); const totalVaultCollateralValueInUSD = new BigNumber( - getPrecisedTokenValue(totalVaultCollateralValue) + getPrecisedTokenValue(totalVaultCollateralValue), ); // Collateral value for selected token const currentTokenBalance = vault?.collateralAmounts?.find( - (c) => c.id === selectedCollateralItem?.token.id + (c) => c.id === selectedCollateralItem?.token.id, )?.amount ?? "0"; const totalTokenBalance = isAdd ? new BigNumber(currentTokenBalance)?.plus(collateralInputAmount) : BigNumber.max( 0, - new BigNumber(currentTokenBalance)?.minus(collateralInputAmount) + new BigNumber(currentTokenBalance)?.minus(collateralInputAmount), ); const tokenCollateralValue = getCollateralValue( totalTokenBalance, - selectedCollateralItem + selectedCollateralItem, ); const totalTokenValueInUSD = new BigNumber( - getPrecisedTokenValue(tokenCollateralValue) + getPrecisedTokenValue(tokenCollateralValue), ); const activePrice = new BigNumber( @@ -178,8 +178,8 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { selectedCollateralItem.activePrice, selectedCollateralItem.factor, "ACTIVE", - "COLLATERAL" - ) + "COLLATERAL", + ), ); const collateralVaultShare = getVaultShare(totalTokenBalance, activePrice, totalVaultCollateralValue) ?? @@ -198,7 +198,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { totalVaultCollateralValue, new BigNumber(vault.loanValue), selectedCollateralItem.token.id, - totalTokenBalance + totalTokenBalance, ); const getUpdatedCollateralAmounts = (): LoanVaultTokenAmount[] => { @@ -212,11 +212,11 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { activePrice: selectedCollateralItem.activePrice, }; const collateralExists = vault.collateralAmounts.find( - (col) => col.id === selectedCollateralItem.token.id + (col) => col.id === selectedCollateralItem.token.id, ); if (collateralExists) { const updatedCollateralAmounts = vault.collateralAmounts.map((col) => - col.id === collateralAmountToUpdate.id ? collateralAmountToUpdate : col + col.id === collateralAmountToUpdate.id ? collateralAmountToUpdate : col, ); return updatedCollateralAmounts; } else { @@ -240,7 +240,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { async function onPercentageChange( amount: string, - type: AmountButtonTypes + type: AmountButtonTypes, ): Promise { setValue("collateralAmount", amount); await trigger("collateralAmount"); @@ -273,18 +273,18 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { translate( "screens/AddOrRemoveCollateralScreen", isAdd ? toastOptionsOnAdd.message : toastOptionsOnRemove.message, - isAdd ? toastOptionsOnAdd.params : toastOptionsOnRemove.params + isAdd ? toastOptionsOnAdd.params : toastOptionsOnRemove.params, ), { type: "wallet_toast", placement: "top", duration: TOAST_DURATION, - } + }, ); } const onAddCollateral = async ( - props: LoanParamList["ConfirmEditCollateralScreen"] + props: LoanParamList["ConfirmEditCollateralScreen"], ): Promise => { const initialParams = { name: "ConfirmEditCollateralScreen", @@ -296,7 +296,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { }; if (isConversionRequired) { const conversionAmount = new BigNumber(props.amount).minus( - DFIToken.amount + DFIToken.amount, ); initialParams.params.conversion = { DFIUtxo, @@ -313,7 +313,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { () => { navigation.navigate(initialParams); }, - logger + logger, ); } else { navigation.navigate(initialParams); @@ -321,7 +321,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { }; const onRemoveCollateral = async ( - props: LoanParamList["ConfirmEditCollateralScreen"] + props: LoanParamList["ConfirmEditCollateralScreen"], ): Promise => { navigation.navigate({ name: "ConfirmEditCollateralScreen", @@ -335,7 +335,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { const handleEditCollateral = async (): Promise => { const collateralItem = collateralTokens.find( - (col) => col.token.id === selectedCollateralItem.token.id + (col) => col.token.id === selectedCollateralItem.token.id, ); if (vault === undefined || collateralItem === undefined) { return; @@ -398,7 +398,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { new BigNumber(vault.loanValue) .multipliedBy(vault.loanScheme.minColRatio) .dividedBy(100) - .dividedBy(2) + .dividedBy(2), ); if (isDFILessThanHalfOfRequiredCollateral) { return { @@ -434,7 +434,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { style={tailwind("flex-col flex-1")} testID="add_remove_collateral_screen" contentContainerStyle={tailwind( - "flex-grow justify-between pt-8 px-5 pb-14" + "flex-grow justify-between pt-8 px-5 pb-14", )} > @@ -447,7 +447,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { > {translate( "screens/AddOrRemoveCollateralScreen", - isAdd ? "I WANT TO ADD" : "I WANT TO REMOVE" + isAdd ? "I WANT TO ADD" : "I WANT TO REMOVE", )} @@ -476,7 +476,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { > @@ -541,7 +541,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { @@ -578,7 +578,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { { amount: selectedCollateralItem.available.toFixed(8), symbol: selectedCollateralItem.token.displaySymbol, - } + }, ) : translate( "screens/AddOrRemoveCollateralScreen", @@ -586,7 +586,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { { amount: currentTokenBalance, symbol: selectedCollateralItem.token.displaySymbol, - } + }, )} )} @@ -601,7 +601,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { > {translate( "screens/AddOrRemoveCollateralScreen", - "A small amount of UTXO is reserved for fees" + "A small amount of UTXO is reserved for fees", )} )} @@ -617,7 +617,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { > {translate( "screens/AddOrRemoveCollateralScreen", - "Insufficient Balance" + "Insufficient Balance", )} )} @@ -632,7 +632,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { > {translate( "screens/AddOrRemoveCollateralScreen", - removeCollateralError.message + removeCollateralError.message, )} )} @@ -656,7 +656,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { lhs={{ value: translate( "screens/AddOrRemoveCollateralScreen", - "Vault ID" + "Vault ID", ), testID: "add_remove_collateral_vault_id_label", themedProps: lhsThemedProps, @@ -685,7 +685,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { lhs={{ value: translate( "screens/AddOrRemoveCollateralScreen", - "Vault share" + "Vault share", ), testID: "add_remove_collateral_vault_share", themedProps: lhsThemedProps, @@ -715,7 +715,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { lhs={{ value: translate( "screens/AddOrRemoveCollateralScreen", - "Max loan amount" + "Max loan amount", ), testID: "add_remove_collateral_max_loan", themedProps: lhsThemedProps, @@ -757,7 +757,7 @@ export function AddOrRemoveCollateralScreen({ route }: Props): JSX.Element { "screens/AddOrRemoveCollateralScreen", isConversionRequired ? "By continuing, the required amount of DFI will be converted" - : "Review full details in the next screen" + : "Review full details in the next screen", )} )} @@ -827,7 +827,7 @@ function TotalTokenCollateralRow(props: { > {translate( "screens/AddOrRemoveCollateralScreen", - "Total collateral" + "Total collateral", )} diff --git a/mobile-app/app/screens/AppNavigator/screens/Loans/screens/CreateVaultScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Loans/screens/CreateVaultScreen.tsx index 6049a43d1a..2c11aef1a5 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Loans/screens/CreateVaultScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Loans/screens/CreateVaultScreen.tsx @@ -49,20 +49,20 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { const { network } = useNetworkContext(); const { address } = useWalletContext(); const loanSchemes = useSelector((state: RootState) => - ascColRatioLoanScheme(state.loans) + ascColRatioLoanScheme(state.loans), ); const hasFetchedLoanSchemes = useSelector( - (state: RootState) => state.loans.hasFetchedLoanSchemes + (state: RootState) => state.loans.hasFetchedLoanSchemes, ); const logger = useLogger(); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const RESERVE_AMOUNT = 2.1; @@ -73,7 +73,7 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { const [conversionStatus, setConversionStatus] = useState( new BigNumber(RESERVE_AMOUNT).gt(DFIUtxo.amount) ? ConversionStatus.Required - : ConversionStatus.Not_Required + : ConversionStatus.Not_Required, ); const [conversionAmount, setConversionAmount] = useState< BigNumber | undefined @@ -85,7 +85,7 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { network === EnvironmentNetwork.TestNet || network === EnvironmentNetwork.DevNet ? 2 - : 1 + : 1, ); const onSubmit = async (): Promise => { @@ -112,7 +112,7 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { logger, () => { setConversionStatus(ConversionStatus.Completed); - } + }, ); } else { if (hasPendingJob || hasPendingBroadcastJob) { @@ -132,10 +132,10 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { fetchVaults({ address, client, - }) + }), ); }, - logger + logger, ); } }; @@ -168,7 +168,7 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { const needsConvert = new BigNumber(RESERVE_AMOUNT).gt(DFIUtxo.amount); setConversionStatus( - needsConvert ? ConversionStatus.Required : ConversionStatus.Not_Required + needsConvert ? ConversionStatus.Required : ConversionStatus.Not_Required, ); if (needsConvert) { setConversionAmount(undefined); @@ -185,7 +185,7 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { > {translate( "screens/CreateVaultScreen", - "Select a loan scheme for your vault." + "Select a loan scheme for your vault.", )} @@ -223,7 +223,7 @@ export function CreateVaultScreen({ navigation, route }: Props): JSX.Element { "screens/CreateVaultScreen", conversionStatus === ConversionStatus.Required ? "Continue" - : "Create vault" + : "Create vault", )} onPress={onSubmit} styleProps="mt-0 mx-7" @@ -250,7 +250,7 @@ function ButtonActionMessage(props: { "screens/CreateVaultScreen", props.isConversionRequired ? "By continuing, the required amount of DFI will be converted" - : "Monitor your vault’s collateralization to prevent liquidation." + : "Monitor your vault’s collateralization to prevent liquidation.", )} )} @@ -268,11 +268,11 @@ async function createVault( dispatch: Dispatch, onBroadcast: () => void, onConfirmation: () => void, - logger: NativeLoggingProps + logger: NativeLoggingProps, ): Promise { try { const signer = async ( - account: WhaleWalletAccount + account: WhaleWalletAccount, ): Promise => { const script = await account.getScript(); const builder = account.withTransactionBuilder(); @@ -281,7 +281,7 @@ async function createVault( ownerAddress: script, schemeId: loanScheme.id, }, - script + script, ); return new CTransactionSegWit(signed); }; @@ -293,14 +293,14 @@ async function createVault( drawerMessages: { preparing: translate( "screens/OceanInterface", - "Preparing to create vault…" + "Preparing to create vault…", ), waiting: translate("screens/OceanInterface", "Creating vault"), complete: translate("screens/OceanInterface", "Vault created"), }, onBroadcast, onConfirmation, - }) + }), ); } catch (e) { logger.error(e); diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioNavigator.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioNavigator.tsx index bae636f5b7..8eb5fe5918 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioNavigator.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioNavigator.tsx @@ -235,7 +235,7 @@ export function PortfolioNavigator(): JSX.Element { headerLeft: () => ( @@ -500,7 +500,7 @@ export function PortfolioNavigator(): JSX.Element { ), @@ -539,7 +539,7 @@ export function PortfolioNavigator(): JSX.Element { ...screenOptions, headerTitle: translate( "screens/WithdrawFutureSwapScreen", - "Withdraw" + "Withdraw", ), headerRight: () => ( @@ -580,7 +580,7 @@ export function PortfolioNavigator(): JSX.Element { ...screenOptions, headerTitle: translate( "screens/ConfirmWithdrawFutureSwapScreen", - "Confirm" + "Confirm", ), headerRight: () => ( @@ -623,7 +623,7 @@ export function PortfolioNavigator(): JSX.Element { ), headerTitle: translate( "screens/TransactionDetailScreen", - "Transaction" + "Transaction", ), }} /> @@ -634,7 +634,7 @@ export function PortfolioNavigator(): JSX.Element { ...screenOptions, headerTitle: translate( "components/UtxoVsTokenFaq", - "About UTXO And Tokens" + "About UTXO And Tokens", ), }} /> diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioScreen.tsx index 720858f4d7..cfe1ab0344 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/PortfolioScreen.tsx @@ -111,7 +111,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { const { getTokenPrice } = useTokenPrice(denominationCurrency); const prices = useSelector((state: RootState) => - dexPricesSelectorByDenomination(state.wallet, denominationCurrency) + dexPricesSelectorByDenomination(state.wallet, denominationCurrency), ); const { wallets } = useWalletPersistenceContext(); const lockedTokens = useTokenLockedBalance({ denominationCurrency }) as Map< @@ -124,14 +124,14 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { } = useDisplayBalancesContext(); const blockCount = useSelector((state: RootState) => state.block.count); const vaults = useSelector((state: RootState) => - activeVaultsSelector(state.loans) + activeVaultsSelector(state.loans), ); const dispatch = useAppDispatch(); const [refreshing, setRefreshing] = useState(false); const [isZeroBalance, setIsZeroBalance] = useState(true); const { hasFetchedToken, allTokens } = useSelector( - (state: RootState) => state.wallet + (state: RootState) => state.wallet, ); const ref = useRef(null); const logger = useLogger(); @@ -148,7 +148,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { fetchFutureSwaps({ client: whaleRpcClient, address, - }) + }), ); dispatch(fetchExecutionBlock({ client: whaleRpcClient })); }); @@ -169,13 +169,13 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { fetchTokens({ client, address, - }) + }), ); dispatch( fetchVaults({ client, address, - }) + }), ); }); }; @@ -187,7 +187,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { fetchDexPrice({ client, denomination: denominationCurrency, - }) + }), ); }, [blockCount, denominationCurrency]); @@ -198,7 +198,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { }, [address, client, dispatch]); const tokens = useSelector((state: RootState) => - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); const { totalAvailableValue, dstTokens } = useMemo(() => { return tokens.reduce( @@ -207,12 +207,12 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { totalAvailableValue, dstTokens, }: { totalAvailableValue: BigNumber; dstTokens: PortfolioRowToken[] }, - token + token, ) => { const usdAmount = getTokenPrice( token.symbol, new BigNumber(token.amount), - token.isLPS + token.isLPS, ); if (token.symbol === "DFI") { return { @@ -226,7 +226,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { } return { totalAvailableValue: totalAvailableValue.plus( - usdAmount.isNaN() ? 0 : usdAmount + usdAmount.isNaN() ? 0 : usdAmount, ), dstTokens: [ ...dstTokens, @@ -240,7 +240,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { { totalAvailableValue: new BigNumber(0), dstTokens: [], - } + }, ); }, [prices, tokens]); @@ -283,7 +283,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { const [filteredTokens, setFilteredTokens] = useState(combinedTokens); // portfolio tab items const onPortfolioButtonGroupChange = ( - portfolioButtonGroupTabKey: PortfolioButtonGroupTabKey + portfolioButtonGroupTabKey: PortfolioButtonGroupTabKey, ): void => { setDenominationCurrency(portfolioButtonGroupTabKey); }; @@ -329,7 +329,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { // Asset sort bottom sheet list const [assetSortType, setAssetSortType] = useState( - PortfolioSortType.HighestDenominationValue + PortfolioSortType.HighestDenominationValue, ); // to display selected sorted type text const [isSorted, setIsSorted] = useState(false); // to display acsending/descending icon const [showAssetSortBottomSheet, setShowAssetSortBottomSheet] = @@ -338,7 +338,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { (assetSortType: PortfolioSortType): PortfolioRowToken[] => { let sortTokensFunc: ( a: PortfolioRowToken, - b: PortfolioRowToken + b: PortfolioRowToken, ) => number; switch (assetSortType) { case PortfolioSortType.HighestDenominationValue: @@ -367,7 +367,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { return filteredTokens.sort(sortTokensFunc); }, - [filteredTokens, assetSortType, denominationCurrency] + [filteredTokens, assetSortType, denominationCurrency], ); useEffect(() => { @@ -376,7 +376,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { // token tab items const [activeButtonGroup, setActiveButtonGroup] = useState( - ButtonGroupTabKey.AllTokens + ButtonGroupTabKey.AllTokens, ); const handleButtonFilter = useCallback( (buttonGroupTabKey: ButtonGroupTabKey) => { @@ -395,7 +395,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { }); setFilteredTokens(filterTokens); }, - [combinedTokens] + [combinedTokens], ); const totalLockedValue = useMemo(() => { @@ -405,7 +405,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { return [...lockedTokens.values()].reduce( (totalLockedValue: BigNumber, value: LockedBalance) => totalLockedValue.plus(value.tokenValue.isNaN() ? 0 : value.tokenValue), - new BigNumber(0) + new BigNumber(0), ); }, [lockedTokens, prices]); @@ -419,19 +419,21 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { (totalVaultLoansValue, loanToken) => { const tokenValue = getTokenPrice( loanToken.symbol, - new BigNumber(loanToken.amount) + new BigNumber(loanToken.amount), ); return totalVaultLoansValue.plus( - new BigNumber(tokenValue).isNaN() ? 0 : tokenValue + new BigNumber(tokenValue).isNaN() ? 0 : tokenValue, ); }, - new BigNumber(0) + new BigNumber(0), ); return totalLoansValue.plus( - new BigNumber(totalVaultLoansValue).isNaN() ? 0 : totalVaultLoansValue + new BigNumber(totalVaultLoansValue).isNaN() + ? 0 + : totalVaultLoansValue, ); }, - new BigNumber(0) + new BigNumber(0), ); }, [prices, vaults]); @@ -442,7 +444,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { useEffect(() => { setIsZeroBalance( - !tokens.some((token) => new BigNumber(token.amount).isGreaterThan(0)) + !tokens.some((token) => new BigNumber(token.amount).isGreaterThan(0)), ); }, [tokens]); @@ -527,7 +529,7 @@ export function PortfolioScreen({ navigation }: Props): JSX.Element { dark={tailwind("bg-mono-dark-v2-00 border-mono-dark-v2-200")} light={tailwind("bg-mono-light-v2-00 border-mono-light-v2-200")} style={tailwind( - "flex flex-row items-center rounded-2xl border-0.5 px-4 py-2" + "flex flex-row items-center rounded-2xl border-0.5 px-4 py-2", )} > { if (text === PortfolioSortType.HighestDenominationValue) { @@ -792,7 +794,7 @@ function AssetSortRow(props: { "screens/PortfolioScreen", props.isSorted ? getDisplayedSortText(props.assetSortType) - : "Sort by" + : "Sort by", )} { - + , ); expect(rendered.toJSON()).toMatchSnapshot(); }); diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/ActionButtons.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/ActionButtons.tsx index 742298788c..e926df04b5 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/ActionButtons.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/ActionButtons.tsx @@ -49,14 +49,14 @@ export function ActionButtons(): JSX.Element { const { dvmTokens, evmTokens } = useTokenBalance(); const navigation = useNavigation>(); const futureSwaps = useSelector((state: RootState) => - futureSwapSelector(state) + futureSwapSelector(state), ); const { hasFetchedToken } = useSelector((state: RootState) => state.wallet); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const hasDFIBalance = hasFetchedToken && @@ -93,12 +93,12 @@ export function ActionButtons(): JSX.Element { } else if (domain === DomainType.EVM) { // If EVM -> choose DVM equivalent targetToken = dvmTokens.find( - (token) => token.tokenId === item.tokenId.replace("-EVM", "") + (token) => token.tokenId === item.tokenId.replace("-EVM", ""), ); } else if (domain === DomainType.DVM) { // If DVM -> choose EVM equivalent targetToken = evmTokens.find( - (token) => token.tokenId === `${item.tokenId}-EVM` + (token) => token.tokenId === `${item.tokenId}-EVM`, ); } @@ -122,7 +122,7 @@ export function ActionButtons(): JSX.Element { ) : ( @@ -245,7 +245,7 @@ function ActionButton(props: ActionButtonsProps): JSX.Element { width={props.iconSize} height={props.iconSize} color={getColor( - isLight ? "mono-light-v2-900" : "mono-dark-v2-900" + isLight ? "mono-light-v2-900" : "mono-dark-v2-900", )} /> )} @@ -263,7 +263,7 @@ function ActionButton(props: ActionButtonsProps): JSX.Element { {props.badge !== undefined && ( { const rendered = render( - + , ); expect(rendered.toJSON()).toMatchSnapshot(); diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressRow.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressRow.tsx index bc8e219dcd..8ce9d1bf2c 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressRow.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressRow.tsx @@ -49,7 +49,7 @@ export function AddressRow({ title: string; address: string; onMatchedAddress?: ( - matchedAddress?: LocalAddress | WhitelistedAddress + matchedAddress?: LocalAddress | WhitelistedAddress, ) => void; onAddressType?: (addressType?: AddressType) => void; showQrButton?: boolean; @@ -60,10 +60,10 @@ export function AddressRow({ const defaultValue = ""; const addressBook = useSelector( - (state: RootState) => state.userPreferences.addressBook + (state: RootState) => state.userPreferences.addressBook, ); const walletAddress = useSelector((state: RootState) => - selectAllLabeledWalletAddress(state.userPreferences) + selectAllLabeledWalletAddress(state.userPreferences), ); const [jellyfishWalletAddress, setJellyfishWalletAddresses] = useState< @@ -100,7 +100,7 @@ export function AddressRow({ setAddressType(AddressType.WalletAddress); } else { const addressObj = jellyfishWalletAddress.find( - (e: WalletAddressI) => e.dvm === address || e.evm === address + (e: WalletAddressI) => e.dvm === address || e.evm === address, ); if (address !== undefined && addressObj) { // wallet address that does not have a label @@ -118,7 +118,7 @@ export function AddressRow({ setAddressType( fromAddress(address, networkName) !== undefined ? AddressType.OthersButValid - : undefined + : undefined, ); } } @@ -131,7 +131,7 @@ export function AddressRow({ useEffect(() => { fetchWalletAddresses().then((walletAddresses) => - setJellyfishWalletAddresses(walletAddresses) + setJellyfishWalletAddresses(walletAddresses), ); }, [fetchWalletAddresses]); @@ -225,7 +225,7 @@ export function AddressRow({ > {translate( "screens/SendScreen", - "Invalid address. Make sure the address is correct to avoid irrecoverable losses" + "Invalid address. Make sure the address is correct to avoid irrecoverable losses", )} )} @@ -273,7 +273,7 @@ export function AddressRow({ { "px-1": addressType === AddressType.WalletAddress, "px-2": addressType === AddressType.Whitelisted, - } + }, )} light={tailwind("bg-mono-light-v2-200")} dark={tailwind("bg-mono-dark-v2-200")} diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressSelectionButton.test.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressSelectionButton.test.tsx index 5800479cef..2866c4a36a 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressSelectionButton.test.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/AddressSelectionButton.test.tsx @@ -40,7 +40,7 @@ describe("Address Selection Button", () => { onPress={onPress} hasCount /> - + , ); expect(rendered.toJSON()).toMatchSnapshot(); diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/BottomSheetAddressDetailV2.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/BottomSheetAddressDetailV2.tsx index 506bc6d0ec..25c808a1ac 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/BottomSheetAddressDetailV2.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/BottomSheetAddressDetailV2.tsx @@ -57,7 +57,7 @@ interface BottomSheetAddressDetailProps { } export const BottomSheetAddressDetailV2 = ( - props: BottomSheetAddressDetailProps + props: BottomSheetAddressDetailProps, ): React.MemoExoticComponent<() => JSX.Element> => memo(() => { const { isLight } = useThemeContext(); @@ -89,16 +89,16 @@ export const BottomSheetAddressDetailV2 = ( const { domain } = useDomainContext(); const blockCount = useSelector((state: RootState) => state.block.count); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const navigation = useNavigation>(); const { network } = useNetworkContext(); const userPreferences = useSelector( - (state: RootState) => state.userPreferences + (state: RootState) => state.userPreferences, ); const labeledAddresses = userPreferences.addresses; const activeLabel = useAddressLabel(props.address); @@ -112,7 +112,7 @@ export const BottomSheetAddressDetailV2 = ( setShowToast(true); setTimeout(() => setShowToast(false), TOAST_DURATION); }, 500), - [showToast] + [showToast], ); useEffect(() => { @@ -168,7 +168,7 @@ export const BottomSheetAddressDetailV2 = ( > {translate( "components/BottomSheetAddressDetail", - "Create wallet address" + "Create wallet address", )} @@ -209,7 +209,7 @@ export const BottomSheetAddressDetailV2 = ( ); }, - [labeledAddresses, domain] + [labeledAddresses, domain], ); const AddressDetailHeader = useCallback(() => { const activeAddress = availableAddresses.find( - ({ dvm }) => dvm === props.address + ({ dvm }) => dvm === props.address, ); return ( diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/CreateOrEditAddressLabelForm.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/CreateOrEditAddressLabelForm.tsx index 41868c177a..f0bf08b989 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/CreateOrEditAddressLabelForm.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/CreateOrEditAddressLabelForm.tsx @@ -36,7 +36,7 @@ export const CreateOrEditAddressLabelForm = memo( const [walletAddress, setWalletAddress] = useState([]); const { fetchWalletAddresses } = useWalletAddress(); const walletAddressFromStore = useSelector( - (state: RootState) => state.userPreferences.addresses + (state: RootState) => state.userPreferences.addresses, ); const [labelInput, setLabelInput] = useState(addressLabel?.label); const bottomSheetComponents = { @@ -160,7 +160,7 @@ export const CreateOrEditAddressLabelForm = memo( }} placeholder={translate( "components/CreateOrEditAddressLabelForm", - "Enter label" + "Enter label", )} style={tailwind("h-9 w-6/12 flex-grow")} hasBottomSheet @@ -169,7 +169,7 @@ export const CreateOrEditAddressLabelForm = memo( type: "error", text: translate( "components/CreateOrEditAddressLabelForm", - labelInputErrorMessage + labelInputErrorMessage, ), }} testID="address_book_label_input" @@ -183,7 +183,7 @@ export const CreateOrEditAddressLabelForm = memo( {translate( "components/CreateOrEditAddressLabelForm", "{{length}}/40 characters", - { length: labelInputLength.toString() } + { length: labelInputLength.toString() }, )} )} @@ -194,7 +194,7 @@ export const CreateOrEditAddressLabelForm = memo( isCancelDisabled={false} label={translate( "components/CreateOrEditAddressLabelForm", - "Save changes" + "Save changes", )} onCancel={() => navigation.goBack()} onSubmit={handleEditSubmit} @@ -204,7 +204,7 @@ export const CreateOrEditAddressLabelForm = memo( ); - } + }, ); function AddressDisplay({ @@ -220,7 +220,7 @@ function AddressDisplay({ {label} diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/PortfolioCard.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/PortfolioCard.tsx index b2cc4eb728..24f46c2934 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/PortfolioCard.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/PortfolioCard.tsx @@ -45,7 +45,7 @@ export function PortfolioCard({ if (isZeroBalance) { const screenDetails = getEmptyScreenDetails( ButtonGroupTabKey.AllTokens, - domain + domain, ); return ; } @@ -58,7 +58,7 @@ export function PortfolioCard({ ) { const screenDetails = getEmptyScreenDetails( buttonGroupOptions?.activeButtonGroup, - domain + domain, ); return ; } @@ -130,7 +130,7 @@ function PortfolioItemRow({ function getEmptyScreenDetails( type?: ButtonGroupTabKey, - domain?: string + domain?: string, ): { icon: () => JSX.Element; title: string; @@ -143,7 +143,7 @@ function getEmptyScreenDetails( title: translate("components/EmptyPortfolio", "No crypto found"), subtitle: translate( "components/EmptyPortfolio", - "Add crypto to get started" + "Add crypto to get started", ), }; case ButtonGroupTabKey.LPTokens: @@ -152,7 +152,7 @@ function getEmptyScreenDetails( title: translate("components/EmptyPortfolio", "No LP tokens found"), subtitle: translate( "components/EmptyPortfolio", - "Add liquidity to get started" + "Add liquidity to get started", ), }; case ButtonGroupTabKey.dTokens: @@ -161,7 +161,7 @@ function getEmptyScreenDetails( title: translate("components/EmptyPortfolio", "No dTokens found"), subtitle: translate( "components/EmptyPortfolio", - "Mint dTokens to get started" + "Mint dTokens to get started", ), }; case ButtonGroupTabKey.AllTokens: @@ -176,11 +176,11 @@ function getEmptyScreenDetails( domain === DomainType.DVM ? translate( "components/EmptyPortfolio", - "Add DFI and other tokens to get started" + "Add DFI and other tokens to get started", ) : translate( "components/EmptyPortfolio", - "Add to your balance by converting DFI to the EVM layer" + "Add to your balance by converting DFI to the EVM layer", ), }; } diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/TotalPortfolio.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/TotalPortfolio.tsx index b40db5e9aa..35862a3312 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/TotalPortfolio.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/components/TotalPortfolio.tsx @@ -46,7 +46,7 @@ export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element { const { hasFetchedToken } = useSelector((state: RootState) => state.wallet); const { domain } = useDomainContext(); const { hasFetchedVaultsData } = useSelector( - (state: RootState) => state.loans + (state: RootState) => state.loans, ); const [isExpanded, setIsExpanded] = useState(false); const denominationCurrency = props.denominationCurrency; // for 'BTC' or 'DFI' denomination @@ -54,13 +54,13 @@ export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element { 0, new BigNumber(props.totalAvailableValue) .plus(props.totalLockedValue) - .minus(props.totalLoansValue) + .minus(props.totalLoansValue), ); const [activeButtonGroup, setActiveButtonGroup] = useState(); const onCurrencySwitch = (): void => { const activeIndex = props.portfolioButtonGroup.findIndex( - (tab) => tab.id === props.denominationCurrency + (tab) => tab.id === props.denominationCurrency, ); let nextIndex = activeIndex + 1; if (activeIndex === props.portfolioButtonGroup.length - 1) { @@ -72,8 +72,8 @@ export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element { useEffect(() => { setActiveButtonGroup( props.portfolioButtonGroup.find( - (button) => button.id === props.denominationCurrency - ) + (button) => button.id === props.denominationCurrency, + ), ); }, [props.denominationCurrency]); @@ -103,7 +103,7 @@ export function TotalPortfolio(props: TotalPortfolioProps): JSX.Element { - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); const prices = useSelector((state: RootState) => - dexPricesSelectorByDenomination(state.wallet, denominationCurrency) + dexPricesSelectorByDenomination(state.wallet, denominationCurrency), ); const { dvmTokens, evmTokens } = useMemo(() => { @@ -44,7 +44,7 @@ export function useTokenBalance(): { dvmTokens, evmTokens, }: { dvmTokens: DomainToken[]; evmTokens: DomainToken[] }, - token + token, ): { dvmTokens: DomainToken[]; evmTokens: DomainToken[] } => { if (token.isLPS || token.id === "0_unified") { return { dvmTokens, evmTokens }; @@ -57,7 +57,7 @@ export function useTokenBalance(): { tokenId: token.id, available: getConvertibleAmount( token.id === "0_utxo", - new BigNumber(token.amount) + new BigNumber(token.amount), ), token: { name: token.name, @@ -96,7 +96,7 @@ export function useTokenBalance(): { { dvmTokens: [], evmTokens: [], - } + }, ); }, [prices, tokens]); diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddOrEditAddressBookScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddOrEditAddressBookScreen.tsx index ed0f9e43e9..cb218b7706 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddOrEditAddressBookScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/AddOrEditAddressBookScreen.tsx @@ -50,7 +50,7 @@ export function AddOrEditAddressBookScreen({ const [isEditable, setIsEditable] = useState(isAddNew); const { networkName } = useNetworkContext(); const addressBook = useSelector( - (state: RootState) => state.userPreferences.addressBook + (state: RootState) => state.userPreferences.addressBook, ); const [labelInputErrorMessage, setLabelInputErrorMessage] = useState(""); const [addressInputErrorMessage, setAddressInputErrorMessage] = useState(""); @@ -70,7 +70,7 @@ export function AddOrEditAddressBookScreen({ ]; const [selectedAddressDomainType, setSelectedAddressDomainType] = useState( - addressDomainType ?? DomainType.DVM + addressDomainType ?? DomainType.DVM, ); const validateLabelInput = (input: string): boolean => { @@ -79,7 +79,7 @@ export function AddOrEditAddressBookScreen({ (input !== undefined && input.trim().length > 40) ) { setLabelInputErrorMessage( - "Required field. Please enter a label. Maximum of 40 characters." + "Required field. Please enter a label. Maximum of 40 characters.", ); return false; } @@ -120,7 +120,7 @@ export function AddOrEditAddressBookScreen({ // check for unique address when adding new, or only when new address is different from current during edit // or when address exists in local address setAddressInputErrorMessage( - "This address already exists in your address book, please enter a different address" + "This address already exists in your address book, please enter a different address", ); return false; } @@ -196,18 +196,18 @@ export function AddOrEditAddressBookScreen({ isAddNew ? "Add address to address book?\n{{address}}" : "Update address label for\n{{address}}", - { address: addressInput } + { address: addressInput }, ), message: translate("screens/Settings", "Enter passcode to continue"), loading: translate( "screens/AddOrEditAddressBookScreen", isAddNew ? "It may take a few seconds to save" - : "It may take a few seconds to update" + : "It may take a few seconds to update", ), successMessage: translate( "screens/AddOrEditAddressBookScreen", - isAddNew ? "Address saved!" : "Address label updated!" + isAddNew ? "Address saved!" : "Address label updated!", ), }; dispatch(authentication.actions.prompt(auth)); @@ -227,21 +227,21 @@ export function AddOrEditAddressBookScreen({ onError: (e) => logger.error(e), title: translate( "screens/AddOrEditAddressBookScreen", - "Are you sure you want to delete the address?" + "Are you sure you want to delete the address?", ), message: translate("screens/Settings", "Enter passcode to continue"), loading: translate( "screens/AddOrEditAddressBookScreen", - "It may take a few seconds to delete" + "It may take a few seconds to delete", ), successMessage: translate( "screens/AddOrEditAddressBookScreen", - "Address deleted!" + "Address deleted!", ), }; dispatch(authentication.actions.prompt(auth)); }, - [navigation, dispatch, isEncrypted] + [navigation, dispatch, isEncrypted], ); useLayoutEffect(() => { @@ -266,7 +266,7 @@ export function AddOrEditAddressBookScreen({ (allAddress: string[], each: WalletAddressI) => { return [...allAddress, ...Object.values(each)]; }, - [] + [], ); setWalletAddress(allWalletAddresses); } @@ -320,10 +320,10 @@ export function AddOrEditAddressBookScreen({ size={20} name={isChecked ? "check-circle" : "radio-button-off"} light={tailwind( - isChecked ? "text-green-v2 " : "text-mono-light-v2-700" + isChecked ? "text-green-v2 " : "text-mono-light-v2-700", )} dark={tailwind( - isChecked ? "text-green-v2" : "text-mono-dark-v2-700" + isChecked ? "text-green-v2" : "text-mono-dark-v2-700", )} iconType="MaterialIcons" testID="address_book_address_type_header" @@ -331,7 +331,7 @@ export function AddOrEditAddressBookScreen({ {translate( "screens/AddOrEditAddressBookScreen", - addressDomain.label + addressDomain.label, )} @@ -360,7 +360,7 @@ export function AddOrEditAddressBookScreen({ title={translate("screens/AddOrEditAddressBookScreen", "ADDRESS")} placeholder={translate( "screens/AddOrEditAddressBookScreen", - "Enter address" + "Enter address", )} style={tailwind("font-normal-v2 py-2.5 flex-1")} valid={addressInputErrorMessage === ""} @@ -369,7 +369,7 @@ export function AddOrEditAddressBookScreen({ type: "error", text: translate( "screens/AddOrEditAddressBookScreen", - addressInputErrorMessage + addressInputErrorMessage, ), style: tailwind("px-5"), }} @@ -413,7 +413,7 @@ export function AddOrEditAddressBookScreen({ inputContainerStyle={tailwind("px-5")} placeholder={translate( "screens/AddOrEditAddressBookScreen", - "Enter label" + "Enter label", )} style={tailwind("font-normal-v2 flex-1 py-2.5")} title={translate("screens/AddOrEditAddressBookScreen", "LABEL")} @@ -422,7 +422,7 @@ export function AddOrEditAddressBookScreen({ type: "error", text: translate( "screens/AddOrEditAddressBookScreen", - labelInputErrorMessage + labelInputErrorMessage, ), style: tailwind("px-5"), }} @@ -454,7 +454,7 @@ export function AddOrEditAddressBookScreen({ > {translate( "screens/AddOrEditAddressBookScreen", - "Maximum of 40 characters." + "Maximum of 40 characters.", )} )} @@ -464,7 +464,7 @@ export function AddOrEditAddressBookScreen({ light={tailwind("bg-mono-light-v2-00")} dark={tailwind("bg-mono-dark-v2-00 ")} style={tailwind( - "border-0 p-4.5 flex-row justify-center rounded-lg-v2 mt-6" + "border-0 p-4.5 flex-row justify-center rounded-lg-v2 mt-6", )} testID="delete_address" onPress={async () => await onDelete(address)} @@ -472,7 +472,7 @@ export function AddOrEditAddressBookScreen({ {translate( "screens/AddOrEditAddressBookScreen", - "Delete address" + "Delete address", )} @@ -483,7 +483,7 @@ export function AddOrEditAddressBookScreen({ > {translate( "screens/ServiceProviderScreen", - "This will delete the whitelisted address\nfrom your address book." + "This will delete the whitelisted address\nfrom your address book.", )} @@ -492,7 +492,7 @@ export function AddOrEditAddressBookScreen({ disabled={isSaveDisabled()} label={translate( "screens/AddOrEditAddressBookScreen", - isAddNew ? "Save address" : "Save changes" + isAddNew ? "Save address" : "Save changes", )} onPress={handleSubmit} testID="save_address_label" @@ -517,7 +517,7 @@ function CopyAddressComponent(props: { address: string }): JSX.Element { setShowToast(true); setTimeout(() => setShowToast(false), TOAST_DURATION); }, 500), - [showToast] + [showToast], ); useEffect(() => { @@ -548,7 +548,7 @@ function CopyAddressComponent(props: { address: string }): JSX.Element { > state.userPreferences + (state: RootState) => state.userPreferences, ); const addressBook: WhitelistedAddress[] = useSelector((state: RootState) => - selectAddressBookArray(state.userPreferences) + selectAddressBookArray(state.userPreferences), ); const walletAddressFromStore: LocalAddress[] = useSelector( - (state: RootState) => selectLocalWalletAddressArray(state.userPreferences) + (state: RootState) => selectLocalWalletAddressArray(state.userPreferences), ); // not all wallet address are stored in userPreference const [walletAddress, setWalletAddress] = useState( - walletAddressFromStore + walletAddressFromStore, ); // combine labeled wallet address with jellyfish's api wallet const [isSearchFocus, setIsSearchFocus] = useState(false); const { headerStyle }: StackNavigationOptions = useNavigatorScreenOptions(); @@ -116,7 +116,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { const [activeButtonGroup, setActiveButtonGroup] = useState( disabledTab === ButtonGroupTabKey.Whitelisted ? ButtonGroupTabKey.YourAddress - : ButtonGroupTabKey.Whitelisted + : ButtonGroupTabKey.Whitelisted, ); useEffect(() => { @@ -127,7 +127,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { const addresses: LocalAddress[] = []; walletAddresses.forEach((address: WalletAddressI) => { const storedWalletAddress = walletAddressFromStore.find( - (a) => a.address === address.dvm + (a) => a.address === address.dvm, ); if (selectedAddress === address.dvm) { @@ -166,8 +166,8 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { address.label .toLowerCase() .includes(searchString?.trim().toLowerCase()) || - address.address.includes(searchString?.trim().toLowerCase()) - ) + address.address.includes(searchString?.trim().toLowerCase()), + ), ); setFilteredWalletAddress( walletAddress.filter( @@ -176,16 +176,16 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { .toLowerCase() .includes(searchString?.trim().toLowerCase()) || address.address.includes(searchString?.trim().toLowerCase()) || - address.evmAddress.includes(searchString?.trim().toLowerCase()) - ) as LocalAddress[] + address.evmAddress.includes(searchString?.trim().toLowerCase()), + ) as LocalAddress[], ); }, 200), - [addressBook, walletAddress, searchString, activeButtonGroup] + [addressBook, walletAddress, searchString, activeButtonGroup], ); // Favourite const onFavouriteAddress = async ( - localAddress: WhitelistedAddress + localAddress: WhitelistedAddress, ): Promise => { const labeledAddress = { [localAddress.address]: { @@ -200,7 +200,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { }; const sortByFavourite = ( - localAddresses: WhitelistedAddress[] + localAddresses: WhitelistedAddress[], ): WhitelistedAddress[] => { return [...localAddresses] .sort((curr, next) => { @@ -236,7 +236,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { setUserPreferences({ network, preferences: userPreferencesFromStore, - }) + }), ); }; updateLocalStorage().catch(Logging.error); @@ -292,7 +292,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { ); const onChangeAddress = ( - addressDetail: LocalAddress | WhitelistedAddress + addressDetail: LocalAddress | WhitelistedAddress, ): void => { if (onAddressSelect) { // for whitelisted address @@ -303,7 +303,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { onAddressSelect( addressDomainType === DomainType.EVM ? (addressDetail as LocalAddress).evmAddress - : addressDetail.address + : addressDetail.address, ); } } @@ -407,7 +407,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { EVM @@ -435,7 +435,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { disabled={enableAddressSelect} onClick={async () => { await openURL( - getAddressUrl((item as LocalAddress).evmAddress) + getAddressUrl((item as LocalAddress).evmAddress), ); }} /> @@ -462,7 +462,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { ); }, - [filteredAddressBook, filteredWalletAddress, activeButtonGroup] + [filteredAddressBook, filteredWalletAddress, activeButtonGroup], ); const goToAddAddressForm = (): void => { @@ -488,7 +488,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { light={tailwind("bg-mono-light-v2-00 border-mono-light-v2-100")} dark={tailwind("bg-mono-dark-v2-00 border-mono-dark-v2-100")} style={tailwind( - "flex flex-col items-center pt-1 rounded-b-2xl border-b" + "flex flex-col items-center pt-1 rounded-b-2xl border-b", )} > @@ -521,7 +521,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { : { "border-mono-light-v2-00": isLight, "border-mono-dark-v2-00": !isLight, - } + }, ), ]} inputStyle={{ @@ -530,7 +530,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { }} placeholder={translate( "screens/AddressBookScreen", - "Search address book" + "Search address book", )} showClearButton={searchString !== ""} onClearInput={() => { @@ -557,7 +557,7 @@ export function AddressBookScreen({ route, navigation }: Props): JSX.Element { dark={tailwind("bg-mono-dark-v2-900")} testID="add_new_address" style={tailwind( - "flex h-10 w-10 flex-row items-center justify-center rounded-full" + "flex h-10 w-10 flex-row items-center justify-center rounded-full", )} > @@ -660,7 +660,7 @@ function EmptyDisplay({ onPress }: { onPress: () => void }): JSX.Element { > {translate( "screens/AddressBookScreen", - "Add your preferred / commonly-used address." + "Add your preferred / commonly-used address.", )} - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const dispatch = useAppDispatch(); const [isSubmitting, setIsSubmitting] = useState(false); @@ -68,15 +68,15 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { const [fromLhs, toLhs] = useMemo(() => { const dvmText = translate( "screens/ConvertConfirmScreen", - "Resulting Tokens" + "Resulting Tokens", ); const utxoText = translate( "screens/ConvertConfirmScreen", - "Resulting UTXO" + "Resulting UTXO", ); const evmText = translate( "screens/ConvertConfirmScreen", - "Resulting Tokens (EVM)" + "Resulting Tokens (EVM)", ); switch (convertDirection) { @@ -114,7 +114,7 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { () => { onTransactionBroadcast(isOnPage, navigation.dispatch); }, - logger + logger, ); } else { await constructSignedTransferDomain( @@ -128,7 +128,7 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { () => { onTransactionBroadcast(isOnPage, navigation.dispatch); }, - logger + logger, ); } @@ -141,7 +141,7 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { title: translate("screens/Settings", "Cancel transaction"), message: translate( "screens/Settings", - "By cancelling, you will lose any changes you made for your transaction." + "By cancelling, you will lose any changes you made for your transaction.", ), buttons: [ { @@ -155,7 +155,7 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { navigation.navigate( originScreen === ScreenName.DEX_screen ? ScreenName.DEX_screen - : ScreenName.PORTFOLIO_screen + : ScreenName.PORTFOLIO_screen, ); }, }, @@ -176,9 +176,9 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { "screens/ConvertScreen", `${targetToken.displayTextSymbol}${ convertDirection === ConvertDirection.dvmToEvm ? "-EVM" : "" - }` + }`, ), - } + }, )} amount={amount} testID="text_convert_amount" @@ -189,7 +189,7 @@ export function ConvertConfirmationScreen({ route }: Props): JSX.Element { , onBroadcast: () => void, - logger: NativeLoggingProps + logger: NativeLoggingProps, ): Promise { try { dispatch( transactionQueue.actions.push( - dfiConversionCrafter(amount, convertDirection, onBroadcast, () => {}) - ) + dfiConversionCrafter(amount, convertDirection, onBroadcast, () => {}), + ), ); } catch (e) { logger.error(e); @@ -344,7 +344,7 @@ async function constructSignedTransferDomain( }, dispatch: Dispatch, onBroadcast: () => void, - logger: NativeLoggingProps + logger: NativeLoggingProps, ): Promise { try { dispatch( @@ -355,9 +355,9 @@ async function constructSignedTransferDomain( sourceToken, targetToken, onBroadcast, - () => {} - ) - ) + () => {}, + ), + ), ); } catch (e) { logger.error(e); @@ -375,9 +375,9 @@ function getResultingValue({ }): string { return BigNumber.max( balance.minus( - convertDirection === ConvertDirection.accountToUtxos ? fee : 0 + convertDirection === ConvertDirection.accountToUtxos ? fee : 0, ), - 0 + 0, ).toFixed(8); } diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx index 3c4ebc6221..11901610fb 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/ConvertScreen.tsx @@ -61,34 +61,34 @@ export function ConvertScreen(props: Props): JSX.Element { const client = useWhaleApiClient(); const logger = useLogger(); const tokens = useSelector((state: RootState) => - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); const toast = useToast(); const TOAST_DURATION = 2000; // global state const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const navigation = useNavigation>(); const [convertDirection, setConvertDirection] = useState( - props.route.params.convertDirection + props.route.params.convertDirection, ); const [sourceToken, setSourceToken] = useState( - props.route.params.sourceToken + props.route.params.sourceToken, ); const [targetToken, setTargetToken] = useState( - props.route.params.targetToken + props.route.params.targetToken, ); const [convAmount, setConvAmount] = useState("0"); const [fee, setFee] = useState(new BigNumber(0.0001)); const [amount, setAmount] = useState(""); const [inlineTextStatus, setInlineTextStatus] = useState( - InlineTextStatus.Default + InlineTextStatus.Default, ); const { dvmTokens, evmTokens } = useTokenBalance(); @@ -164,7 +164,7 @@ export function ConvertScreen(props: Props): JSX.Element { displaySymbol: sourceToken.token.displaySymbol, balance: BigNumber.maximum( new BigNumber(sourceToken.available).minus(convAmount), - 0 + 0, ), displayTextSymbol: sourceToken.token.displayTextSymbol, }, @@ -173,7 +173,7 @@ export function ConvertScreen(props: Props): JSX.Element { displaySymbol: targetToken.token.displaySymbol, balance: BigNumber.maximum( new BigNumber(targetToken.available).plus(convAmount), - 0 + 0, ), displayTextSymbol: targetToken.token.displayTextSymbol, }, @@ -202,7 +202,7 @@ export function ConvertScreen(props: Props): JSX.Element { "screens/ConvertScreen", `${sourceToken.token.displayTextSymbol}${ domain === DomainType.EVM ? "-EVM" : "" - }` + }`, ), percent: type, }; @@ -274,12 +274,12 @@ export function ConvertScreen(props: Props): JSX.Element { } else if (domain === DomainType.EVM) { // If EVM -> choose DVM equivalent updatedTargetToken = dvmTokens.find( - (token) => token.tokenId === item.tokenId.replace("-EVM", "") + (token) => token.tokenId === item.tokenId.replace("-EVM", ""), ); } else if (domain === DomainType.DVM) { // If DVM -> choose EVM equivalent updatedTargetToken = evmTokens.find( - (token) => token.tokenId === `${item.tokenId}-EVM` + (token) => token.tokenId === `${item.tokenId}-EVM`, ); } /* End of what will be moved into a hook */ @@ -319,7 +319,7 @@ export function ConvertScreen(props: Props): JSX.Element { @@ -371,14 +371,14 @@ export function ConvertScreen(props: Props): JSX.Element { onChangeText={setAmount} placeholder="0.00" placeholderTextColor={getColor( - isLight ? "mono-light-v2-900" : "mono-dark-v2-900" + isLight ? "mono-light-v2-900" : "mono-dark-v2-900", )} testID="convert_input" /> @@ -460,12 +460,12 @@ export function ConvertScreen(props: Props): JSX.Element { dark={tailwind("text-mono-dark-v2-500")} testID="tokenB_displaySymbol" > - {translate("screens/ConvertScreen", "TO RECEIVE")} + {translate("screens/ConvertScreen", "TO CONVERT")} @@ -494,9 +494,9 @@ export function ConvertScreen(props: Props): JSX.Element { ? 0 : getTokenPrice( targetToken.token.symbol, - BigNumber(convAmount) + BigNumber(convAmount), ), - 2 + 2, )} thousandSeparator displayType="text" @@ -544,7 +544,7 @@ export function ConvertScreen(props: Props): JSX.Element { amount !== "" ? BigNumber.maximum( targetToken.available.plus(convAmount), - 0 + 0, ).toFixed(8) : "-" } @@ -557,7 +557,7 @@ export function ConvertScreen(props: Props): JSX.Element { > {translate( "screens/ConvertScreen", - "Review full details in the next screen" + "Review full details in the next screen", )} )} diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/CFPDetailScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/CFPDetailScreen.tsx index 56830dfb17..d1d2bf4ca5 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/CFPDetailScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/CFPDetailScreen.tsx @@ -49,16 +49,16 @@ export function CFPDetailScreen(): JSX.Element { const [isUrlValid, setUrlValid] = useState(false); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const { isConversionRequired, conversionAmount } = useConversion({ @@ -109,7 +109,7 @@ export function CFPDetailScreen(): JSX.Element { navigation.goBack(); await trigger("address"); }, - [navigation] + [navigation], ); function onContinuePress() { @@ -159,7 +159,7 @@ export function CFPDetailScreen(): JSX.Element { params, merge: true, }); - } + }, ); } else { navigation.navigate("OCGConfirmScreen", params); @@ -185,7 +185,7 @@ export function CFPDetailScreen(): JSX.Element { @@ -209,7 +209,7 @@ export function CFPDetailScreen(): JSX.Element { "screens/OCGDetailScreen", titleStatus.shouldShowError ? "Title exceeds max character limit of 128." - : "Make sure that the name added here is the same as from the one posted in GitHub or Reddit." + : "Make sure that the name added here is the same as from the one posted in GitHub or Reddit.", ), style: tailwind("pl-5", { "text-red-v2": titleStatus.shouldShowError, @@ -228,7 +228,7 @@ export function CFPDetailScreen(): JSX.Element { onChangeText={setAmount} title={translate( "screens/OCGDetailScreen", - "AMOUNT REQUESTED IN DFI" + "AMOUNT REQUESTED IN DFI", )} placeholder="0.00 DFI" inputContainerStyle={tailwind("py-4.5")} @@ -281,7 +281,7 @@ export function CFPDetailScreen(): JSX.Element { > {translate( "screens/OCGDetailScreen", - "Review full proposal details in the next screen" + "Review full proposal details in the next screen", )} setCycle( - Math.min(Math.floor(Number(cycle) + 1), maxCycle).toString() + Math.min(Math.floor(Number(cycle) + 1), maxCycle).toString(), ) } onRemove={() => setCycle( - Math.max(Math.floor(Number(cycle) - 1), minCycle).toString() + Math.max(Math.floor(Number(cycle) - 1), minCycle).toString(), ) } leftDisabled={Number(cycle) <= minCycle} @@ -386,6 +386,6 @@ function getCFPFee(requestedAmount?: BigNumber): BigNumber { const CFP_MIN_FEE = 10; const amount = requestedAmount ?? new BigNumber(0); return new BigNumber( - Math.max(amount.multipliedBy(0.01).toNumber(), CFP_MIN_FEE) + Math.max(amount.multipliedBy(0.01).toNumber(), CFP_MIN_FEE), ); } diff --git a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/DFIPDetailScreen.tsx b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/DFIPDetailScreen.tsx index c86affe994..94b0e6a50a 100644 --- a/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/DFIPDetailScreen.tsx +++ b/mobile-app/app/screens/AppNavigator/screens/Portfolio/screens/OCG/DFIPDetailScreen.tsx @@ -41,16 +41,16 @@ export function DFIPDetailScreen(): JSX.Element { const proposalFee = getDFIPFee(network); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const { isConversionRequired, conversionAmount } = useConversion({ inputToken: { @@ -130,7 +130,7 @@ export function DFIPDetailScreen(): JSX.Element { params, merge: true, }); - } + }, ); } else { navigation.navigate("OCGConfirmScreen", params); @@ -158,7 +158,7 @@ export function DFIPDetailScreen(): JSX.Element { "screens/OCGDetailScreen", titleStatus.shouldShowError ? "Title exceeds max character limit of 128." - : "Make sure that the name added here is the same as from the one posted in GitHub or Reddit." + : "Make sure that the name added here is the same as from the one posted in GitHub or Reddit.", ), style: tailwind("pl-5", { "text-red-v2": titleStatus.shouldShowError, @@ -185,7 +185,7 @@ export function DFIPDetailScreen(): JSX.Element { > {translate( "screens/OCGDetailScreen", - "Review full proposal details in the next screen" + "Review full proposal details in the next screen", )} - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); const hasPendingJob = useSelector((state: RootState) => - hasTxQueued(state.transactionQueue) + hasTxQueued(state.transactionQueue), ); const hasPendingBroadcastJob = useSelector((state: RootState) => - hasOceanTXQueued(state.ocean) + hasOceanTXQueued(state.ocean), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const [token, setToken] = useState(route.params?.token); @@ -99,7 +99,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { >(); const [fee, setFee] = useState(new BigNumber(0.0001)); const [transactionCardStatus, setTransactionCardStatus] = useState( - TransactionCardStatus.Default + TransactionCardStatus.Default, ); // form @@ -121,7 +121,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { const reservedDFI = 0.1; const isReservedUtxoUsed = getDisplayUtxoWarningStatus( new BigNumber(amountToSend), - token?.displaySymbol ?? "" + token?.displaySymbol ?? "", ); const amountInputRef = useRef(); @@ -208,7 +208,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { t.displaySymbol === "DFI" ? BigNumber.max( new BigNumber(t.amount).minus(reservedDFI), - 0 + 0, ).toFixed(8) : t.amount, }); @@ -242,7 +242,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { navigation.goBack(); await trigger("address"); }, - [navigation] + [navigation], ); async function onSubmit(): Promise { @@ -300,7 +300,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { params, merge: true, }); - } + }, ); } else { navigation.navigate({ @@ -322,7 +322,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { contentContainerStyle={tailwind("pt-6 pb-8")} testID="send_screen" style={tailwind( - `${isLight ? "bg-mono-light-v2-100" : "bg-mono-dark-v2-100"}` + `${isLight ? "bg-mono-light-v2-100" : "bg-mono-dark-v2-100"}`, )} extraScrollHeight={-BOTTOM_NAV_HEIGHT - bottomInset} > @@ -330,7 +330,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { {translate( "screens/SendScreen", - "Select a token you want to send to get started" + "Select a token you want to send to get started", )} )} @@ -345,7 +345,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { render={({ field: { onChange, value } }) => ( new BigNumber( - value !== undefined && value !== "" ? value : 0 + value !== undefined && value !== "" ? value : 0, ).isGreaterThan(0), }, }} @@ -393,7 +393,7 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { }} onAmountChange={async ( amount: string, - type: AmountButtonTypes + type: AmountButtonTypes, ) => { showToast(type); setValue("amount", amount, { shouldDirty: true }); @@ -459,11 +459,11 @@ export function SendScreen({ route, navigation }: Props): JSX.Element { {isConversionRequired ? translate( "screens/SendScreen", - "By continuing, the required amount of DFI will be converted" + "By continuing, the required amount of DFI will be converted", ) : translate( "screens/SendScreen", - "Review full details in the next screen" + "Review full details in the next screen", )} )} @@ -519,7 +519,7 @@ function AmountCard({ > ; const usePoolPairToken = ( - tokenParam: WalletToken + tokenParam: WalletToken, ): { pair?: PoolPairData; token: WalletToken; @@ -59,7 +59,7 @@ const usePoolPairToken = ( } => { const pairs = useSelector((state: RootState) => state.wallet.poolpairs); const tokens = useSelector((state: RootState) => - tokensSelector(state.wallet) + tokensSelector(state.wallet), ); // state @@ -108,20 +108,20 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element { const { hasFetchedToken } = useSelector((state: RootState) => state.wallet); const { getTokenPrice } = useTokenPrice(denominationCurrency); // input based on selected denomination from portfolio tab const DFIUnified = useSelector((state: RootState) => - unifiedDFISelector(state.wallet) + unifiedDFISelector(state.wallet), ); const availableValue = getTokenPrice( DFIUnified.symbol, - new BigNumber(DFIUnified.amount) + new BigNumber(DFIUnified.amount), ); const DFIToken = useSelector((state: RootState) => - DFITokenSelector(state.wallet) + DFITokenSelector(state.wallet), ); const DFIUtxo = useSelector((state: RootState) => - DFIUtxoSelector(state.wallet) + DFIUtxoSelector(state.wallet), ); const { pair, token, swapTokenDisplaySymbol } = usePoolPairToken( - route.params.token + route.params.token, ); const { dvmTokens } = useTokenBalance(); @@ -242,7 +242,7 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element { testID="send_button" title={translate( "screens/TokenDetailScreen", - "Send to other wallet" + "Send to other wallet", )} /> @@ -268,10 +268,10 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element { : ConvertDirection.accountToUtxos; const utxoToken = dvmTokens.find( - (token) => token.tokenId === "0_utxo" + (token) => token.tokenId === "0_utxo", ); const dfiToken = dvmTokens.find( - (token) => token.tokenId === "0" + (token) => token.tokenId === "0", ); const [sourceToken, targetToken] = convertDirection === ConvertDirection.utxosToAccount @@ -292,7 +292,7 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element { title={translate( "screens/TokenDetailScreen", "Convert to {{symbol}}", - { symbol: `${token.id === "0_utxo" ? "Token" : "UTXO"}` } + { symbol: `${token.id === "0_utxo" ? "Token" : "UTXO"}` }, )} /> )} @@ -310,7 +310,7 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element { testID="remove_liquidity_button" title={translate( "screens/TokenDetailScreen", - "Remove liquidity" + "Remove liquidity", )} /> )} @@ -346,7 +346,7 @@ export function TokenDetailScreen({ route, navigation }: Props): JSX.Element { testID="add_liquidity_button" label={translate( "screens/TokenDetailScreen", - "Add liquidity" + "Add liquidity", )} /> @@ -404,13 +404,13 @@ function TokenSummary(props: { }; const DFIUnified = useSelector((state: RootState) => - unifiedDFISelector(state.wallet) + unifiedDFISelector(state.wallet), ); const { getTokenPrice } = useTokenPrice(denominationCurrency); // input based on selected denomination from portfolio tab const dfiUsdAmount = getTokenPrice( DFIUnified.symbol, new BigNumber(DFIUnified.amount), - DFIUnified.isLPS + DFIUnified.isLPS, ); return ( @@ -487,7 +487,7 @@ function TokenSummary(props: { renderText={(value) => ( @@ -234,7 +234,7 @@ export function SettingsNavigator(): JSX.Element { options={{ headerTitle: translate( "components/RecoveryWordFaq", - "About Recovery Words" + "About Recovery Words", ), }} /> @@ -253,7 +253,7 @@ export function SettingsNavigator(): JSX.Element { options={{ headerTitle: translate( "components/LiquidityMiningFaq", - "About Liquidity Mining" + "About Liquidity Mining", ), }} /> @@ -264,7 +264,7 @@ export function SettingsNavigator(): JSX.Element { options={{ headerTitle: translate( "components/UtxoVsTokenFaq", - "About UTXO And Tokens" + "About UTXO And Tokens", ), }} /> @@ -275,7 +275,7 @@ export function SettingsNavigator(): JSX.Element { options={{ headerTitle: translate( "components/CfpDfipProposalsFaq", - "About Governance" + "About Governance", ), }} /> diff --git a/mobile-app/app/screens/TransactionAuthorization/PasscodePrompt.tsx b/mobile-app/app/screens/TransactionAuthorization/PasscodePrompt.tsx index fbc24aa90e..b2ab16996e 100644 --- a/mobile-app/app/screens/TransactionAuthorization/PasscodePrompt.tsx +++ b/mobile-app/app/screens/TransactionAuthorization/PasscodePrompt.tsx @@ -59,7 +59,7 @@ const PromptContent = React.memo((props: PasscodePromptProps): JSX.Element => { style={tailwind("items-end pt-5 px-5 rounded-t-xl-v2")} testID="cancel_authorization" disabled={[TransactionStatus.BLOCK, TransactionStatus.SIGNING].includes( - props.status + props.status, )} > { )} {([TransactionStatus.SIGNING, TransactionStatus.AUTHORIZED].includes( - props.status + props.status, ) || (props.status === TransactionStatus.PIN && !props.isRetry)) && ( { ? "Incorrect passcode.\n{{attemptsRemaining}} attempts remaining" : "{{attemptsRemaining}} attempts remaining" }`, - { attemptsRemaining: props.attemptsRemaining } + { attemptsRemaining: props.attemptsRemaining }, )} ) @@ -251,7 +251,7 @@ export const PasscodePrompt = React.memo( ); - } + }, ); function EmptyHandleComponent(): JSX.Element { diff --git a/mobile-app/cypress/e2e/functional/wallet/portfolio/addresses.spec.ts b/mobile-app/cypress/e2e/functional/wallet/portfolio/addresses.spec.ts index 24ae110036..ceb45d7770 100644 --- a/mobile-app/cypress/e2e/functional/wallet/portfolio/addresses.spec.ts +++ b/mobile-app/cypress/e2e/functional/wallet/portfolio/addresses.spec.ts @@ -56,10 +56,14 @@ context("Wallet - Addresses", () => { it("should not present create new address when wallet is freshly setup", () => { const network: string = localStorage.getItem("Development.NETWORK"); expect( - localStorage.getItem(`Development.${network}.WALLET_ADDRESS.INDEX.active`) + localStorage.getItem( + `Development.${network}.WALLET_ADDRESS.INDEX.active`, + ), ).to.eq(null); expect( - localStorage.getItem(`Development.${network}.WALLET_ADDRESS.INDEX.length`) + localStorage.getItem( + `Development.${network}.WALLET_ADDRESS.INDEX.length`, + ), ).to.eq(null); cy.getByTestID("address_row_text_0") .invoke("text") @@ -108,13 +112,13 @@ context("Wallet - Addresses", () => { const network: string = localStorage.getItem("Development.NETWORK"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.active` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.active`, + ), ).to.eq("1"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.length` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.length`, + ), ).to.eq("1"); }); cy.wait(3000); @@ -149,7 +153,7 @@ context("Wallet - Addresses", () => { .click() .wait(1000); cy.getByTestID(`address_active_indicator_${activeAddress}`).should( - "exist" + "exist", ); cy.getByTestID("close_bottom_sheet_button").click(); cy.getByTestID("receive_balance_button").click(); @@ -174,17 +178,17 @@ context("Wallet - Addresses", () => { .click() .should(() => { const network: string = localStorage.getItem( - "Development.NETWORK" + "Development.NETWORK", ); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.active` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.active`, + ), ).to.eq("0"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.length` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.length`, + ), ).to.eq("1"); }); cy.getByTestID("dfi_total_balance_amount").contains("10.00000000"); @@ -195,7 +199,7 @@ context("Wallet - Addresses", () => { cy.getByTestID("amount_input").clear().type("1"); cy.getByTestID("button_confirm_send_continue").should( "not.have.attr", - "disabled" + "disabled", ); cy.getByTestID("button_confirm_send_continue").click(); cy.getByTestID("confirm_title").contains("You are sending"); @@ -228,13 +232,13 @@ context("Wallet - Addresses", () => { const network: string = localStorage.getItem("Development.NETWORK"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.active` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.active`, + ), ).to.eq("1"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.length` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.length`, + ), ).to.eq("1"); }); cy.getByTestID("dfi_total_balance_amount").contains("1.00000000"); @@ -296,20 +300,20 @@ context( const network: string = localStorage.getItem("Development.NETWORK"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.active` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.active`, + ), ).to.eq("0"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.length` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.length`, + ), ).to.eq("0"); }); cy.getByTestID("address_row_0").should("exist"); cy.getByTestID("address_row_text_0").contains(address); cy.getByTestID(`address_active_indicator_${address}`).should("exist"); }); - } + }, ); context( @@ -347,10 +351,10 @@ context( .should(() => { const network: string = localStorage.getItem("Development.NETWORK"); maxAddress = localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.length` + `Development.${network}.WALLET_ADDRESS.INDEX.length`, ); const activeAddress = localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.active` + `Development.${network}.WALLET_ADDRESS.INDEX.active`, ); expect(activeAddress).to.eq("1"); expect(maxAddress).to.eq("1"); @@ -389,13 +393,13 @@ context( const network: string = localStorage.getItem("Development.NETWORK"); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.active` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.active`, + ), ).to.eq(null); expect( localStorage.getItem( - `Development.${network}.WALLET_ADDRESS.INDEX.length` - ) + `Development.${network}.WALLET_ADDRESS.INDEX.length`, + ), ).to.eq(maxAddress); }); addresses.forEach((address, index) => { @@ -403,10 +407,10 @@ context( cy.getByTestID(`address_row_text_${index}`).contains(address); }); cy.getByTestID(`address_active_indicator_${addresses[0]}`).should( - "exist" + "exist", ); }); - } + }, ); context("Wallet - Addresses should able to create maximum 10 addresses", () => { @@ -486,7 +490,7 @@ context("Wallet - should be able to discover Wallet Addresses", () => { cy.getByTestID("amount_input").clear().type("1"); cy.getByTestID("button_confirm_send_continue").should( "not.have.attr", - "disabled" + "disabled", ); cy.getByTestID("button_confirm_send_continue").click(); cy.getByTestID("button_confirm_send").click().wait(3000); @@ -505,13 +509,13 @@ context("Wallet - Address Label", () => { if (shouldAllow) { cy.getByTestID("button_confirm_save_address_label").should( "not.have.attr", - "aria-disabled" + "aria-disabled", ); cy.getByTestID("address_book_label_input_error").should("not.exist"); } else { cy.getByTestID("button_confirm_save_address_label").should( "have.attr", - "aria-disabled" + "aria-disabled", ); cy.getByTestID("address_book_label_input_error").should("exist"); } @@ -527,7 +531,7 @@ context("Wallet - Address Label", () => { cy.getByTestID("address_book_label_input").clear().type(label); cy.getByTestID("button_confirm_save_address_label").should( "not.have.attr", - "aria-disabled" + "aria-disabled", ); cy.getByTestID("button_confirm_save_address_label").click().wait(1000); cy.getByTestID(`list_address_label_${address}`).contains(label); @@ -568,7 +572,7 @@ context("Wallet - Address Label", () => { validateLabel("abcdefghijklmnopqrstuvwxyz12345678910ABCD", false); // block >40 char validateLabel( "😀🙌👶👩🏻‍💻🐶🌵🌝🍏🥨⚽️🪂🚗⌚😀🙌👶👩🏻‍💻🐶🌵🌝🍏🥨⚽️🪂🚗⌚😀🙌👶👩🏻‍💻️ ", - false + false, ); // not all emoji equivalent to 1 char // allow validateLabel("abcdefghijklmnopqrstuvwxyz1234", true); @@ -604,7 +608,7 @@ context("Wallet - Address Label", () => { cy.getByTestID("address_book_label_input").clear().type(inputLabel); cy.getByTestID("button_confirm_save_address_label").should( "not.have.attr", - "aria-disabled" + "aria-disabled", ); cy.getByTestID("button_confirm_save_address_label").click(); cy.getByTestID(`list_address_label_${address}`).contains(trimmedLabel); diff --git a/mobile-app/cypress/e2e/functional/wallet/settings/addressBook.spec.ts b/mobile-app/cypress/e2e/functional/wallet/settings/addressBook.spec.ts index e96d631554..4831e5ebf1 100644 --- a/mobile-app/cypress/e2e/functional/wallet/settings/addressBook.spec.ts +++ b/mobile-app/cypress/e2e/functional/wallet/settings/addressBook.spec.ts @@ -33,10 +33,10 @@ context("Wallet - Settings - Address Book", () => { cy.getByTestID("save_address_label").click().wait(1000); cy.getByTestID("pin_authorize").type("000000").wait(2000); cy.getByTestID(`address_row_label_${index}_WHITELISTED`).contains( - labels[index] + labels[index], ); cy.getByTestID(`address_row_text_${index}_WHITELISTED`).contains( - addresses[index] + addresses[index], ); }); } @@ -66,7 +66,7 @@ context("Wallet - Settings - Address Book", () => { cy.getByTestID("address_button_group_WHITELISTED").click(); cy.getByTestID("add_new_address").click(); cy.getByTestID("address_book_address_type_DFI_checked").should( - "exist" + "exist", ); // check for DFI address cy.getByTestID("address_book_address_input") @@ -74,7 +74,7 @@ context("Wallet - Settings - Address Book", () => { .type(walletDFIAddress) .blur(); cy.getByTestID("address_book_address_input_error").contains( - "This address already exists in your address book, please enter a different address" + "This address already exists in your address book, please enter a different address", ); // check for evm address cy.getByTestID("address_book_address_input") @@ -82,12 +82,12 @@ context("Wallet - Settings - Address Book", () => { .type(walletETHAddress) .blur(); cy.getByTestID("address_book_address_input_error").contains( - "Please enter a valid address" + "Please enter a valid address", ); // change domain type cy.getByTestID("address_book_address_type_EVM").click(); cy.getByTestID("address_book_address_input_error").contains( - "This address already exists in your address book, please enter a different address" + "This address already exists in your address book, please enter a different address", ); }); }); @@ -127,7 +127,7 @@ context("Wallet - Settings - Address Book", () => { cy.getByTestID("search_title").contains(`Search results for “${label}`); cy.getByTestID("address_row_label_0_WHITELISTED").contains(label); cy.getByTestID("address_row_text_0_WHITELISTED").contains( - addresses[index] + addresses[index], ); cy.getByTestID("address_search_input").clear(); cy.getByTestID("search_title").contains("Search with label or address"); @@ -162,10 +162,10 @@ context("Wallet - Settings - Address Book", () => { cy.getByTestID("pin_authorize").type("000000").wait(2000); cy.wrap(modifiedLabels).each((_v, index: number) => { cy.getByTestID(`address_row_label_${index}_WHITELISTED`).contains( - modifiedLabels[index] + modifiedLabels[index], ); cy.getByTestID(`address_row_text_${index}_WHITELISTED`).contains( - addresses[index] + addresses[index], ); }); }); diff --git a/shared/store/userPreferences.ts b/shared/store/userPreferences.ts index 734d5f1831..81fd802636 100644 --- a/shared/store/userPreferences.ts +++ b/shared/store/userPreferences.ts @@ -41,7 +41,7 @@ export const fetchUserPreferences = createAsyncThunk( const { addresses, addressBook } = await LocalStorageProvider.getUserPreferences(network); return { addresses, addressBook: prePopulateWhitelistedField(addressBook) }; - } + }, ); export const setUserPreferences = createAsyncThunk( @@ -54,21 +54,21 @@ export const setUserPreferences = createAsyncThunk( preferences: UserPreferences; }) => { await LocalStorageProvider.setUserPreferences(network, preferences); - } + }, ); export const setAddresses = createAsyncThunk( "userPreferences/setAddresses", async (addresses: LabeledAddress) => { return addresses; - } + }, ); export const setAddressBook = createAsyncThunk( "userPreferences/setAddressBook", async (addressBook: LabeledAddress) => { return addressBook; - } + }, ); export const userPreferences = createSlice({ @@ -92,21 +92,21 @@ export const userPreferences = createSlice({ (state, action: PayloadAction) => { state = action.payload; return state; - } + }, ); builder.addCase( setAddresses.fulfilled, (state, action: PayloadAction) => { state.addresses = action.payload; return state; - } + }, ); builder.addCase( setAddressBook.fulfilled, (state, action: PayloadAction) => { state.addressBook = action.payload; return state; - } + }, ); }, }); @@ -115,14 +115,14 @@ export const selectAddressBookArray = createSelector( (state: UserPreferences) => state.addressBook, (addressBook): WhitelistedAddress[] => { return prePopulateField(addressBook) as WhitelistedAddress[]; - } + }, ); export const selectLocalWalletAddressArray = createSelector( (state: UserPreferences) => state.addresses, (walletAddress): LocalAddress[] => { return prePopulateField(walletAddress) as LocalAddress[]; - } + }, ); // to get wallet label for saved all (DFI and EVM) wallet address, adding all relevant address type in object @@ -137,13 +137,13 @@ export const selectAllLabeledWalletAddress = createSelector( [each.evmAddress]: each, }; }, - {} + {}, ); - } + }, ); const prePopulateField = ( - addresses: LabeledAddress + addresses: LabeledAddress, ): (LocalAddress | WhitelistedAddress)[] => { const _addresses: LabeledAddress = { ...addresses }; @@ -162,7 +162,7 @@ const prePopulateField = ( }; const prePopulateWhitelistedField = ( - addressBook: LabeledAddress + addressBook: LabeledAddress, ): LabeledAddress => { const address = Object.values(addressBook); return (address as WhitelistedAddress[]).reduce( @@ -177,6 +177,6 @@ const prePopulateWhitelistedField = ( }, }; }, - {} + {}, ); }; diff --git a/shared/translations/languages/de.json b/shared/translations/languages/de.json index 362ef8d19d..b7323ce892 100644 --- a/shared/translations/languages/de.json +++ b/shared/translations/languages/de.json @@ -328,6 +328,7 @@ "Available {{unit}}": "Verfügbare {{unit}}", "Resulting {{unit}}": "Resultierende {{unit}}", "TO RECEIVE": "ZU ERHALTEN", + "TO CONVERT": "UMWANDELN", "tokens": "Token" }, "screens/ConvertConfirmScreen": { @@ -347,11 +348,13 @@ "CONFIRM TRANSACTION": "TRANSAKTION BESTÄTIGEN", "You are converting to {{unit}}": "Du wandelst in {{unit}} um", "Transaction fee": "Transaktionsgebühren", + "Resulting Tokens (EVM)": "Resultierende Token (EVM)", "Resulting Tokens": "Resultierende Token", "Resulting UTXO": "Resultierende UTXO", "Convert {{amount}} DFI to {{target}}": "Wandle {{amount}} DFI in {{target}} um", "Converting": "Umwandeln", - "Converted": "Umgewandelt" + "Converted": "Umgewandelt", + "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens": "{{amount}} {{symbolA}}- in {{symbolB}}-Token umwandeln" }, "screens/SettingsNavigator": { "Settings": "Einstellungen" @@ -833,7 +836,9 @@ "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}": "Darlehensaufnahme von {{amount}} {{symbol}} mit Vault {{vaultId}}", "Borrowed {{amount}} {{symbol}}": "{{amount}} {{symbol}} ausgeliehen", "Requested amount is higher than available amount.": "Der beantragte Betrag ist höher als der verfügbare Betrag.", - "tokens": "Token" + "tokens": "Token", + "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens": "Umwandlung von {{amount}} {{symbolA}}- in {{symbolB}}-Token", + "{{amount}} {{symbolA}} converted to {{symbolB}} tokens": "{{amount}} {{symbolA}}- in {{symbolB}}-Token umgewandelt" }, "components/BarCodeScanner": { "Requesting for camera permission": "Kameranutzung erlauben", @@ -843,6 +848,10 @@ "HALF": "1/2", "MAX": "MAX" }, + "components/ConversionDetailsRow": { + "Resulting UTXO": "Resultierende UTXO", + "Resulting Tokens": "Resultierende Token" + }, "screens/common": { "CANCEL": "ABBRECHEN", "Cancel": "Abbrechen", @@ -2199,7 +2208,9 @@ "Swap": "Tausch", "Transactions": "Transaktionen", "Future swap": "Future Swap", - "Get DFI": "DFI erhalten" + "Get DFI": "DFI erhalten", + "Convert": "Umwandeln", + "Governance": "Governance" }, "screens/PoolPairDetailsScreen": { "{{poolPair}} Pool": "{{poolPair}}-Pool", diff --git a/shared/translations/languages/es.json b/shared/translations/languages/es.json index 1194478d65..f6884bf0ed 100644 --- a/shared/translations/languages/es.json +++ b/shared/translations/languages/es.json @@ -338,7 +338,8 @@ "Available {{unit}}": "Disponible {{unit}}", "Resulting {{unit}}": "Resultando {{unit}}", "TO RECEIVE": "A RECIBIR", - "tokens": "tokens" + "tokens": "tokens", + "TO CONVERT": "TO CONVERT" }, "screens/ConvertConfirmScreen": { "Confirm": "Confirmar", @@ -357,11 +358,13 @@ "CONFIRM TRANSACTION": "CONFIRMAR TRANSACCIÓN", "You are converting to {{unit}}": "Esta convirtiendo a {{unit}}", "Transaction fee": "Comisión de transacción", + "Resulting Tokens (EVM)": "Resultando Tokens (EVM)", "Resulting Tokens": "Resultando Tokens", "Resulting UTXO": "Resultando UTXO", "Convert {{amount}} DFI to {{target}}": "Convirtiendo {{amount}} DFI a {{target}}", "Converting": "Convirtiendo", - "Converted": "Convertido" + "Converted": "Convertido", + "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens": "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens" }, "screens/SettingsNavigator": { "Settings": "Configuración" @@ -852,7 +855,9 @@ "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}": "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}", "Borrowed {{amount}} {{symbol}}": "Borrowed {{amount}} {{symbol}}", "Requested amount is higher than available amount.": "Requested amount is higher than available amount.", - "tokens": "tokens" + "tokens": "tokens", + "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens": "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens", + "{{amount}} {{symbolA}} converted to {{symbolB}} tokens": "{{amount}} {{symbolA}} converted to {{symbolB}} tokens" }, "components/BarCodeScanner": { "Requesting for camera permission": "Pidiendo acceso a la cámara", @@ -2232,7 +2237,9 @@ "Swap": "Cambiar", "Transactions": "Transacciones", "Future swap": "Cambio a futuros", - "Get DFI": "Obtener DFI" + "Get DFI": "Obtener DFI", + "Convert": "Convertir", + "Governance": "Governance" }, "screens/PoolPairDetailsScreen": { "{{poolPair}} Pool": "{{poolPair}} Pool", @@ -2263,6 +2270,10 @@ "Search with token name": "Buscar por nombre de token", "Search results for “{{searchTerm}}”": "Buscar resultados para “{{searchTerm}}”" }, + "components/ConversionDetailsRow": { + "Resulting UTXO": "Resultando UTXO", + "Resulting Tokens": "Resultando Tokens" + }, "screens/OCGProposalsScreen": { "Governance": "Governance", "Community Funding Proposal": "Community Funding Proposal", diff --git a/shared/translations/languages/fr.json b/shared/translations/languages/fr.json index d488839a2e..3ffc0088e7 100644 --- a/shared/translations/languages/fr.json +++ b/shared/translations/languages/fr.json @@ -338,6 +338,7 @@ "Available {{unit}}": "{{unit}} Disponible", "Resulting {{unit}}": "{{unit}} Restants", "TO RECEIVE": "A RECEVOIR", + "TO CONVERT": "CONVERTIR", "tokens": "tokens" }, "screens/ConvertConfirmScreen": { @@ -357,11 +358,13 @@ "CONFIRM TRANSACTION": "VALIDEZ LA TRANSACTION", "You are converting to {{unit}}": "Vous convertissez en {{unit}}", "Transaction fee": "Frais de transaction", + "Resulting Tokens (EVM)": "Tokens restants (EVM)", "Resulting Tokens": "Tokens restants", "Resulting UTXO": "UTXO restants", "Convert {{amount}} DFI to {{target}}": "Conversion de {{amount}} DFI en {{target}}", "Converting": "Conversion", - "Converted": "Converti" + "Converted": "Converti", + "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens": "Convertir {{montant}} de tokens {{symbolA}} en {{symbolB}}" }, "screens/SettingsNavigator": { "Settings": "Paramètres" @@ -467,7 +470,7 @@ "Liquidity Mining": "Liquidity mining", "Liquidity mining": "Liquidity mining", "UTXO and Tokens": "UTXO et tokens", - "Governance": "Governance" + "Governance": "Gouvernance" }, "components/UtxoVsTokenFaq": { "About UTXO And Tokens": "UTXO et tokens", @@ -845,7 +848,9 @@ "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}": "Emprunt de {{amount}} {{symbol}} avec le vault {{vaultId}}", "Borrowed {{amount}} {{symbol}}": "{{amount}} {{symbol}} empruntés", "Requested amount is higher than available amount.": "Le montant demandé est supérieur au montant disponible.", - "tokens": "tokens" + "tokens": "tokens", + "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens": "Conversion de {{amount}} de tokens {{symbolA}} en {{symbolB}}", + "{{amount}} {{symbolA}} converted to {{symbolB}} tokens": "{{amount}} de tokens {{symbolA}} converti en {{symbolB}}" }, "components/BarCodeScanner": { "Requesting for camera permission": "Demande d'accès à votre caméra", @@ -2213,7 +2218,9 @@ "Swap": "Échanger", "Transactions": "Transactions", "Future swap": "Échange à terme", - "Get DFI": "Obtenir DFI" + "Get DFI": "Obtenir DFI", + "Convert": "Convertir", + "Governance": "Gouvernance" }, "screens/PoolPairDetailsScreen": { "{{poolPair}} Pool": "Pool {{poolPair}}", @@ -2244,8 +2251,12 @@ "Search with token name": "Recherche avec le nom du token", "Search results for “{{searchTerm}}”": "Résultats de la recherche pour “{{searchTerm}}”" }, + "components/ConversionDetailsRow": { + "Resulting UTXO": "UTXO restants", + "Resulting Tokens": "Tokens restants" + }, "screens/OCGProposalsScreen": { - "Governance": "Governance", + "Governance": "Gouvernance", "Community Funding Proposal": "Community Funding Proposal", "Proposal to build on top of the DeFiChain blockchain, and funded by the Community Development Fund.": "Proposition de construire sur la blockchain DeFiChain, et financée par le fonds de développement communautaire, le Community Development Fund.", "DeFiChain Improvement Proposal": "DeFiChain Improvement Proposal", diff --git a/shared/translations/languages/it.json b/shared/translations/languages/it.json index 601d1d42b2..290402aa00 100644 --- a/shared/translations/languages/it.json +++ b/shared/translations/languages/it.json @@ -339,6 +339,7 @@ "Available {{unit}}": "Disponibile {{unit}}", "Resulting {{unit}}": "Risultato {{unit}}", "TO RECEIVE": "TO RECEIVE", + "TO CONVERT": "TO CONVERT", "tokens": "tokens" }, "screens/ConvertConfirmScreen": { @@ -358,11 +359,13 @@ "CONFIRM TRANSACTION": "CONFERMA LA TRANSAZIONE", "You are converting to {{unit}}": "You are converting to {{unit}}", "Transaction fee": "Transaction fee", + "Resulting Tokens (EVM)": "Risultato Tokens (EVM)", "Resulting Tokens": "Risultato Tokens", "Resulting UTXO": "Risultato UTXO", "Convert {{amount}} DFI to {{target}}": "Conversione {{amount}} DFI in {{target}}", "Converting": "Conversione", - "Converted": "Converted" + "Converted": "Converted", + "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens": "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens" }, "screens/SettingsNavigator": { "Settings": "Impostazioni" @@ -851,7 +854,9 @@ "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}": "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}", "Borrowed {{amount}} {{symbol}}": "Borrowed {{amount}} {{symbol}}", "Requested amount is higher than available amount.": "Requested amount is higher than available amount.", - "tokens": "tokens" + "tokens": "tokens", + "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens": "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens", + "{{amount}} {{symbolA}} converted to {{symbolB}} tokens": "{{amount}} {{symbolA}} converted to {{symbolB}} tokens" }, "components/BarCodeScanner": { "Requesting for camera permission": "Richiesta di accesso alla fotocamera", @@ -2227,7 +2232,9 @@ "Swap": "Scambia", "Transactions": "Transazioni", "Future swap": "Future swap", - "Get DFI": "Get DFI" + "Get DFI": "Get DFI", + "Convert": "Converti", + "Governance": "Governance" }, "screens/PoolPairDetailsScreen": { "{{poolPair}} Pool": "{{poolPair}} Pool", @@ -2258,6 +2265,10 @@ "Search with token name": "Search with token name", "Search results for “{{searchTerm}}”": "Search results for “{{searchTerm}}”" }, + "components/ConversionDetailsRow": { + "Resulting UTXO": "Risultato UTXO", + "Resulting Tokens": "Risultato Tokens" + }, "screens/OCGProposalsScreen": { "Governance": "Governance", "Community Funding Proposal": "Community Funding Proposal", diff --git a/shared/translations/languages/zh-Hans.json b/shared/translations/languages/zh-Hans.json index ef44790567..99295b70c2 100644 --- a/shared/translations/languages/zh-Hans.json +++ b/shared/translations/languages/zh-Hans.json @@ -211,9 +211,9 @@ "Address saved!": "Address saved!", "Address label updated!": "Address label updated!", "Address deleted!": "Address deleted!", - "It may take a few seconds to delete": "It may take a few seconds to delete", - "It may take a few seconds to update": "It may take a few seconds to update", - "It may take a few seconds to save": "It may take a few seconds to save", + "It may take a few seconds to delete": "可能需要几秒钟进行删除", + "It may take a few seconds to update": "可能需要几秒钟进行更新", + "It may take a few seconds to save": "可能需要几秒钟进行保存", "ADDRESS TYPE": "地址类型" }, "screens/ReceiveScreen": { @@ -260,7 +260,7 @@ "SEND TO": "SEND TO", "Paste address": "Paste address", "I WANT TO SEND": "I WANT TO SEND", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Verified": "Verified", "{{percent}} of available {{unit}} entered": "{{percent}} of available {{unit}} entered", "Max available {{unit}} entered": "Max available {{unit}} entered", @@ -321,13 +321,14 @@ "I WANT TO CONVERT": "I WANT TO CONVERT", "Insufficient balance": "Insufficient balance", "Available: ": "可转换资金: ", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Max available {{unit}} entered": "Max available {{unit}} entered", "{{percent}} of available {{unit}} entered": "{{percent}} of available {{unit}} entered", "A small amount of UTXO is reserved for fees": "保留少量 UTXO 用于交易费用", "Available {{unit}}": "可转换资金 {{unit}}", "Resulting {{unit}}": "转换后 {{unit}}", "TO RECEIVE": "TO RECEIVE", + "TO CONVERT": "转换", "tokens": "代币" }, "screens/ConvertConfirmScreen": { @@ -345,13 +346,15 @@ "Convert": "转换", "{{token}} to receive": "{{token}} 将会收到", "CONFIRM TRANSACTION": "确认发出", - "You are converting to {{unit}}": "You are converting to {{unit}}", + "You are converting to {{unit}}": "您正在转换为 {{unit}}", "Transaction fee": "交易費用", + "Resulting Tokens (EVM)": "转换后 Tokens (EVM)", "Resulting Tokens": "转换后 Tokens", "Resulting UTXO": "转换后 UTXO", "Convert {{amount}} DFI to {{target}}": "转换 {{amount}} DFI 至 {{target}}", "Converting": "转换中", - "Converted": "Converted" + "Converted": "Converted", + "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens": "转换 {{amount}} {{symbolA}} 到 {{symbolB}} 代币" }, "screens/SettingsNavigator": { "Settings": "设置" @@ -415,7 +418,7 @@ "This will unlink your wallet from the app.": "这将取消您的钱包与应用程式的绑定。", "DISPLAY & LANGUAGE": "显示和语言", "Provide your passcode to\nview recovery words.": "Provide your passcode to\nview recovery words.", - "Passcode verified!": "Passcode verified!", + "Passcode verified!": "密码已验证!", "Provider": "Provider", "Custom": "Custom", "Default": "Default", @@ -836,7 +839,9 @@ "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}": "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}", "Borrowed {{amount}} {{symbol}}": "Borrowed {{amount}} {{symbol}}", "Requested amount is higher than available amount.": "您请求的金额高于可用金额。", - "tokens": "代币" + "tokens": "代币", + "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens": "正在转换 {{amount}} {{symbolA}} 到 {{symbolB}} 代币 ", + "{{amount}} {{symbolA}} converted to {{symbolB}} tokens": "{{amount}} {{symbolA}} 已经成功转换成 {{symbolB}}代币" }, "components/BarCodeScanner": { "Requesting for camera permission": "请许可程序使用相机", @@ -885,7 +890,7 @@ "Pooled {{symbol}}": "池中总 {{symbol}}", "View pool share": "View pool share", "View pool info": "View pool info", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Insufficient balance": "Insufficient balance", "APR": "APR", "Shares to add": "Shares to add", @@ -1069,9 +1074,9 @@ "You are buying dTokens at 5% more than the oracle price at settlement block.": "You are buying dTokens at 5% more than the oracle price at settlement block.", "You are buying {{displaySymbol}} at 5% more than the oracle price at settlement block.": "You are buying {{displaySymbol}} at 5% more than the oracle price at settlement block.", "You are selling your {{displaySymbol}} at 5% less than the oracle price at settlement block.": "You are selling your {{displaySymbol}} at 5% less than the oracle price at settlement block.", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "By continuing, the required amount of DFI will be converted": "By continuing, the required amount of DFI will be converted", - "I HAVE {{totalAmount}} {{token}}": "I HAVE {{totalAmount}} {{token}}", + "I HAVE {{totalAmount}} {{token}}": "我有 {{totalAmount}} {{token}}", "I WANT {{token}}": "I WANT {{token}}", "incl. stabilization fee ({{dexStabilizationFee}}%)": "incl. stabilization fee ({{dexStabilizationFee}}%)", "Total fees": "Total fees", @@ -1157,7 +1162,7 @@ "Sign to verify access": "签下以确认使用", "Success!": "成功!", "It may take a few seconds to verify": "It may take a few seconds to verify", - "Passcode verified!": "Passcode verified!", + "Passcode verified!": "密码已验证!", "Provide your passcode to view recovery words.": "Provide your passcode to view recovery words.", "Provide existing passcode to change passcode.": "Provide existing passcode to change passcode." }, @@ -1753,7 +1758,7 @@ "Insufficient DFI and/or DUSD in vault to maintain active loans": "Insufficient DFI and/or DUSD in vault to maintain active loans", "Active DUSD loans require 50% DFI collaterals": "Active DUSD loans require 50% DFI collaterals", "By continuing, the required amount of DFI will be converted": "By continuing, the required amount of DFI will be converted", - "Review full details in the next screen": "Review full details in the next screen" + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息" }, "screens/ConfirmEditCollateralScreen": { "You are adding collateral to": "向金库增加抵押品", @@ -1796,7 +1801,7 @@ "I WANT TO PAY": "I WANT TO PAY", "I WANT TO PAY WITH DUSD COLLATERAL": "I WANT TO PAY WITH DUSD COLLATERAL", "Available: ": "现有可使用: ", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Use your DUSD collaterals to fully pay off your DUSD loan.": "Use your DUSD collaterals to fully pay off your DUSD loan.", "Continue": "继续", "Max available {{unit}} entered": "Max available {{unit}} entered", @@ -1885,7 +1890,7 @@ "Amount entered may liquidate the vault. Proceed at your own risk.": "Amount entered may liquidate the vault. Proceed at your own risk.", "Insufficient DFI and/or DUSD in vault. Add more to start minting dTokens.": "Insufficient DFI and/or DUSD in vault. Add more to start minting dTokens.", "Insufficient DFI in vault. Add more to borrow DUSD.": "Insufficient DFI in vault. Add more to borrow DUSD.", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Max loan amount entered": "已输入最高贷款金额", "{{percent}} of max loan amount entered": "已输入最高贷款金额的 {{percent}}%", "SELECT VAULT FOR COLLATERAL": "选择金库抵押", @@ -1956,7 +1961,7 @@ "Continue": "继续", "Confirm your vault details in next screen": "在下一页确认金库的细行", "AVAILABLE SCHEMES": "AVAILABLE SCHEMES", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "VAULT DETAILS": "VAULT DETAILS", "{{interestRate}}% Interest": "{{interestRate}}% Interest", "min. ": "min. ", @@ -2053,7 +2058,7 @@ "The value of the tokens you are placing is considerably higher than the total auction value.": "您正要出的价钱比拍卖价值还高,请检查和确认", "Collateral for auction": "待拍賣的抵押品", "I HAVE {{ownedAmount}} {{symbol}}": "I HAVE {{ownedAmount}} {{symbol}}", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Transaction fee": "Transaction fee", "The minimum next bid is {{amount}} {{symbol}} (100%)": "The minimum next bid is {{amount}} {{symbol}} (100%)", "{{percent}} min bid entered": "{{percent}} 最低竞投出价输入", @@ -2082,7 +2087,7 @@ "Preparing placing {{amount}} {{token}} bid": "Preparing placing {{amount}} {{token}} bid", "Placed {{amount}} {{token}} bid": "Placed {{amount}} {{token}} bid", "It may take a few seconds to verify": "It may take a few seconds to verify", - "Passcode verified!": "Passcode verified!" + "Passcode verified!": "密码已验证!" }, "screens/WithdrawFutureSwapScreen": { "Withdraw": "Withdraw", @@ -2100,7 +2105,7 @@ "Withdraw from": "Withdraw from", "Insufficient Balance": "Insufficient Balance", "Transaction fee": "交易費用", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一个屏幕中查看完整详细信息", "Max available {{unit}} entered": "Max available {{unit}} entered", "{{percent}} of available {{unit}} entered": "{{percent}} of available {{unit}} entered", "Amount to swap": "Amount to swap", @@ -2209,7 +2214,9 @@ "Swap": "兑换", "Transactions": "交易纪录", "Future swap": "Future swap", - "Get DFI": "获取 DFI" + "Get DFI": "获取 DFI", + "Convert": "转换", + "Governance": "治理" }, "screens/PoolPairDetailsScreen": { "{{poolPair}} Pool": "Pool {{poolPair}}", @@ -2240,8 +2247,12 @@ "Search with token name": "使用代币名称搜索", "Search results for “{{searchTerm}}”": "Search results for “{{searchTerm}}”" }, + "components/ConversionDetailsRow": { + "Resulting UTXO": "转换后 UTXO", + "Resulting Tokens": "转换后 Tokens" + }, "screens/OCGProposalsScreen": { - "Governance": "Governance", + "Governance": "治理", "Community Funding Proposal": "社区资助提案 (CFP)", "Proposal to build on top of the DeFiChain blockchain, and funded by the Community Development Fund.": "该选项是用于搭建在DeFiChain区块链之上且由社区发展基金资助", "DeFiChain Improvement Proposal": "DeFiChain 改进提案 (DFIP)", diff --git a/shared/translations/languages/zh-Hant.json b/shared/translations/languages/zh-Hant.json index 42d861aa4b..d0a584f17d 100644 --- a/shared/translations/languages/zh-Hant.json +++ b/shared/translations/languages/zh-Hant.json @@ -211,9 +211,9 @@ "Address saved!": "Address saved!", "Address label updated!": "Address label updated!", "Address deleted!": "Address deleted!", - "It may take a few seconds to delete": "It may take a few seconds to delete", - "It may take a few seconds to update": "It may take a few seconds to update", - "It may take a few seconds to save": "It may take a few seconds to save", + "It may take a few seconds to delete": "可能需要幾秒鐘進行刪除", + "It may take a few seconds to update": "可能需要幾秒鐘進行更新", + "It may take a few seconds to save": "可能需要幾秒鐘進行保存", "ADDRESS TYPE": "地址類型" }, "screens/ReceiveScreen": { @@ -260,7 +260,7 @@ "SEND TO": "SEND TO", "Paste address": "Paste address", "I WANT TO SEND": "I WANT TO SEND", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Verified": "Verified", "{{percent}} of available {{unit}} entered": "{{percent}} of available {{unit}} entered", "Max available {{unit}} entered": "Max available {{unit}} entered", @@ -321,13 +321,14 @@ "I WANT TO CONVERT": "I WANT TO CONVERT", "Insufficient balance": "Insufficient balance", "Available: ": "可轉換資金: ", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Max available {{unit}} entered": "Max available {{unit}} entered", "{{percent}} of available {{unit}} entered": "{{percent}} of available {{unit}} entered", "A small amount of UTXO is reserved for fees": "保留少量 UTXO 用於交易費用", "Available {{unit}}": "可轉換資金 {{unit}}", "Resulting {{unit}}": "轉換後 {{unit}}", "TO RECEIVE": "TO RECEIVE", + "TO CONVERT": "轉換", "tokens": "代幣" }, "screens/ConvertConfirmScreen": { @@ -345,13 +346,15 @@ "Convert": "轉換", "{{token}} to receive": "{{token}} 將會收到", "CONFIRM TRANSACTION": "確認交易", - "You are converting to {{unit}}": "You are converting to {{unit}}", + "You are converting to {{unit}}": "您正在轉換為 {{unit}}", "Transaction fee": "交易費用", + "Resulting Tokens (EVM)": "轉換後 Tokens (EVM)", "Resulting Tokens": "轉換後 Tokens", "Resulting UTXO": "轉換後 UTXO", "Convert {{amount}} DFI to {{target}}": "轉換 {{amount}} DFI 至 {{target}}", "Converting": "轉換中", - "Converted": "Converted" + "Converted": "Converted", + "Convert {{amount}} {{symbolA}} to {{symbolB}} tokens": "轉換 {{amount}} {{symbolA}} 到 {{symbolB}} 代幣" }, "screens/SettingsNavigator": { "Settings": "設定" @@ -836,7 +839,9 @@ "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}": "Borrowing {{amount}} {{symbol}} with vault {{vaultId}}", "Borrowed {{amount}} {{symbol}}": "Borrowed {{amount}} {{symbol}}", "Requested amount is higher than available amount.": "您請求的金額高於可用金額。", - "tokens": "代幣" + "tokens": "代幣", + "Converting {{amount}} {{symbolA}} to {{symbolB}} tokens": "正在轉換 {{amount}} {{symbolA}} 到 {{symbolB}} 代幣", + "{{amount}} {{symbolA}} converted to {{symbolB}} tokens": "{{amount}} {{symbolA}} 已經成功轉換成 {{symbolB}}代幣" }, "components/BarCodeScanner": { "Requesting for camera permission": "請許可程序使用相機", @@ -885,7 +890,7 @@ "Pooled {{symbol}}": "池中總 {{symbol}}", "View pool share": "View pool share", "View pool info": " 查看流動池資料", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Insufficient balance": "Insufficient balance", "APR": "APR", "Shares to add": "要添加的股份", @@ -1069,9 +1074,9 @@ "You are buying dTokens at 5% more than the oracle price at settlement block.": "You are buying dTokens at 5% more than the oracle price at settlement block.", "You are buying {{displaySymbol}} at 5% more than the oracle price at settlement block.": "You are buying {{displaySymbol}} at 5% more than the oracle price at settlement block.", "You are selling your {{displaySymbol}} at 5% less than the oracle price at settlement block.": "You are selling your {{displaySymbol}} at 5% less than the oracle price at settlement block.", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "By continuing, the required amount of DFI will be converted": "By continuing, the required amount of DFI will be converted", - "I HAVE {{totalAmount}} {{token}}": "I HAVE {{totalAmount}} {{token}}", + "I HAVE {{totalAmount}} {{token}}": "我有 {{totalAmount}} {{token}}", "I WANT {{token}}": "I WANT {{token}}", "incl. stabilization fee ({{dexStabilizationFee}}%)": "incl. stabilization fee ({{dexStabilizationFee}}%)", "Total fees": "Total fees", @@ -1755,7 +1760,7 @@ "Insufficient DFI and/or DUSD in vault to maintain active loans": "Insufficient DFI and/or DUSD in vault to maintain active loans", "Active DUSD loans require 50% DFI collaterals": "Active DUSD loans require 50% DFI collaterals", "By continuing, the required amount of DFI will be converted": "By continuing, the required amount of DFI will be converted", - "Review full details in the next screen": "Review full details in the next screen" + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息" }, "screens/ConfirmEditCollateralScreen": { "You are adding collateral to": "您正在加入抵押到", @@ -1798,7 +1803,7 @@ "I WANT TO PAY": "I WANT TO PAY", "I WANT TO PAY WITH DUSD COLLATERAL": "I WANT TO PAY WITH DUSD COLLATERAL", "Available: ": "現有可使用: ", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Use your DUSD collaterals to fully pay off your DUSD loan.": "Use your DUSD collaterals to fully pay off your DUSD loan.", "Continue": "繼續", "Max available {{unit}} entered": "Max available {{unit}} entered", @@ -1887,7 +1892,7 @@ "Amount entered may liquidate the vault. Proceed at your own risk.": "Amount entered may liquidate the vault. Proceed at your own risk.", "Insufficient DFI and/or DUSD in vault. Add more to start minting dTokens.": "Insufficient DFI and/or DUSD in vault. Add more to start minting dTokens.", "Insufficient DFI in vault. Add more to borrow DUSD.": "Insufficient DFI in vault. Add more to borrow DUSD.", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Max loan amount entered": "已輸入最高貸款金額的", "{{percent}} of max loan amount entered": "已輸入最高貸款金額的 {{percent}}%", "SELECT VAULT FOR COLLATERAL": "選擇金庫抵押", @@ -1958,7 +1963,7 @@ "Continue": "繼續", "Confirm your vault details in next screen": "請在下一頁確認金庫細項", "AVAILABLE SCHEMES": "AVAILABLE SCHEMES", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "VAULT DETAILS": "VAULT DETAILS", "{{interestRate}}% Interest": "{{interestRate}}% Interest", "min. ": "min. ", @@ -2054,7 +2059,7 @@ "The value of the tokens you are placing is considerably higher than the total auction value.": "您正要出的價錢比拍賣價值還高,請檢查和確認", "Collateral for auction": "待拍賣的抵押品", "I HAVE {{ownedAmount}} {{symbol}}": "I HAVE {{ownedAmount}} {{symbol}}", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Transaction fee": "Transaction fee", "The minimum next bid is {{amount}} {{symbol}} (100%)": "The minimum next bid is {{amount}} {{symbol}} (100%)", "{{percent}} min bid entered": "{{percent}} 最低競投出價輸入", @@ -2101,7 +2106,7 @@ "Withdraw from": "Withdraw from", "Insufficient Balance": "Insufficient Balance", "Transaction fee": "交易費用", - "Review full details in the next screen": "Review full details in the next screen", + "Review full details in the next screen": "在下一個屏幕中查看完整詳細信息", "Max available {{unit}} entered": "Max available {{unit}} entered", "{{percent}} of available {{unit}} entered": "{{percent}} of available {{unit}} entered", "Amount to swap": "Amount to swap", @@ -2210,7 +2215,9 @@ "Swap": "兌換", "Transactions": "交易紀錄", "Future swap": "Future swap", - "Get DFI": "獲取 DFI" + "Get DFI": "獲取 DFI", + "Convert": "轉換", + "Governance": "治理" }, "screens/PoolPairDetailsScreen": { "{{poolPair}} Pool": "Pool {{poolPair}}", @@ -2241,8 +2248,12 @@ "Search with token name": "使用代幣名稱搜索", "Search results for “{{searchTerm}}”": "Search results for “{{searchTerm}}”" }, + "components/ConversionDetailsRow": { + "Resulting UTXO": "轉換後 UTXO", + "Resulting Tokens": "轉換後 Tokens" + }, "screens/OCGProposalsScreen": { - "Governance": "Governance", + "Governance": "治理", "Community Funding Proposal": "社區資助提案 (CFP)", "Proposal to build on top of the DeFiChain blockchain, and funded by the Community Development Fund.": "該選項是用於搭建在DeFiChain區塊鏈之上且由社區發展基金資助", "DeFiChain Improvement Proposal": "DeFiChain 改進提案 (DFIP)",