Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

style: apply prettier formatting fixes

iamrhnce89c1831f5c
diff --git a/app/src/components/settings/panels/RecoveryPhraseReplaceConfirm.tsx b/app/src/components/settings/panels/RecoveryPhraseReplaceConfirm.tsx
index 0265fb3309..1e56b99498 100644
--- a/app/src/components/settings/panels/RecoveryPhraseReplaceConfirm.tsx
+++ b/app/src/components/settings/panels/RecoveryPhraseReplaceConfirm.tsx
@@ -1,7 +1,7 @@
import { useT } from '../../../lib/i18n/I18nContext';
+import { WarningIcon } from '../../ui';
import { Alert } from '../../ui/Alert';
import Button from '../../ui/Button';
-import { WarningIcon } from '../../ui';
export interface RecoveryPhraseReplaceConfirmProps {
onConfirm: () => void;
diff --git a/app/src/components/settings/panels/WalletBalancesPanel.tsx b/app/src/components/settings/panels/WalletBalancesPanel.tsx
index d5dd264e4d..7a7a9bc0b5 100644
--- a/app/src/components/settings/panels/WalletBalancesPanel.tsx
+++ b/app/src/components/settings/panels/WalletBalancesPanel.tsx
@@ -67,13 +67,7 @@ export const NETWORK_MODAL_ICONS: Record<string, string> = {
tron: networkTronIcon,
};
-export function ChainIcon({
- chain,
- evmNetwork,
-}: {
- chain: WalletChain;
- evmNetwork?: EvmNetwork;
-}) {
+export function ChainIcon({ chain, evmNetwork }: { chain: WalletChain; evmNetwork?: EvmNetwork }) {
const key = evmNetwork || chain;
const src = CHAIN_ICONS[key];
if (!src) return null;
@@ -474,7 +468,11 @@ const WalletBalancesPanel = () => {
const selectedNetworkLabel =
NETWORK_FILTERS.find(f => f.id === selectedNetwork)?.label ?? 'All networks';
- const filterRows = <T extends { chain: WalletChain; evmNetwork?: EvmNetwork; assetSymbol: string }>(rows: T[]) => {
+ const filterRows = <
+ T extends { chain: WalletChain; evmNetwork?: EvmNetwork; assetSymbol: string },
+ >(
+ rows: T[]
+ ) => {
return rows.filter(row => {
const networkId = row.chain === 'evm' ? row.evmNetwork : row.chain;
const bKey = balanceKey(row);
@@ -632,7 +630,7 @@ const WalletBalancesPanel = () => {
if (balances && balances.length > 0) {
const visibleRows = filterRows(balances);
-
+
if (visibleRows.length === 0) {
return (
<div className="px-4 py-8 text-center">
diff --git a/app/src/components/settings/panels/wallet/ManageTokensModal.tsx b/app/src/components/settings/panels/wallet/ManageTokensModal.tsx
index 7aa0a2dd70..3ec02b796a 100644
--- a/app/src/components/settings/panels/wallet/ManageTokensModal.tsx
+++ b/app/src/components/settings/panels/wallet/ManageTokensModal.tsx
@@ -1,7 +1,11 @@
import { Dialog as DialogPrimitive } from 'radix-ui';
import { useDispatch, useSelector } from 'react-redux';
-import { balanceAssetName, balanceKey, formatDisplayBalance } from '../../../../features/wallet/walletDisplay';
+import {
+ balanceAssetName,
+ balanceKey,
+ formatDisplayBalance,
+} from '../../../../features/wallet/walletDisplay';
import { type EvmNetwork, type WalletChain } from '../../../../services/walletApi';
import { type RootState } from '../../../../store';
import { toggleTokenHidden } from '../../../../store/walletPreferencesSlice';
diff --git a/app/src/components/settings/panels/wallet/SendCryptoModal.tsx b/app/src/components/settings/panels/wallet/SendCryptoModal.tsx
index f212dbb094..58ceae0417 100644
--- a/app/src/components/settings/panels/wallet/SendCryptoModal.tsx
+++ b/app/src/components/settings/panels/wallet/SendCryptoModal.tsx
@@ -14,9 +14,9 @@ import {
type PreparedTransaction,
prepareTransfer,
} from '../../../../services/walletApi';
+import { CheckIcon, Spinner } from '../../../ui';
import { Alert, AlertDescription } from '../../../ui/Alert';
import Button from '../../../ui/Button';
-import { CheckIcon, Spinner } from '../../../ui';
import { InputGroupAddon, InputGroupInput, InputGroupRoot } from '../../../ui/InputGroup';
import Label from '../../../ui/Label';
import TextField from '../../../ui/TextField';
diff --git a/app/src/features/wallet/walletDisplay.ts b/app/src/features/wallet/walletDisplay.ts
index c825a85938..408171839a 100644
--- a/app/src/features/wallet/walletDisplay.ts
+++ b/app/src/features/wallet/walletDisplay.ts
@@ -90,7 +90,7 @@ export function balanceAssetName(assetSymbol: string): string {
export function toSmallestUnit(human: string | number, decimals: number): string {
let humanStr = String(human).trim();
if (humanStr === '' || humanStr === '.') throw new Error('invalid_amount');
-
+
// Convert scientific notation to plain decimal string to avoid BigInt parsing errors
if (humanStr.includes('e') || humanStr.includes('E')) {
const num = Number(humanStr);
@@ -120,7 +120,7 @@ export function toSmallestUnit(human: string | number, decimals: number): string
if (frac.length > decimals) {
throw new Error('too_many_decimals');
}
-
+
try {
const wholeBig = BigInt(whole || '0');
const multiplier = 10n ** BigInt(decimals);
@@ -143,7 +143,10 @@ export function toSmallestUnit(human: string | number, decimals: number): string
export function fromSmallestUnit(raw: string | number | bigint, decimals: number): string {
let value: bigint;
try {
- if (typeof raw === 'number' || (typeof raw === 'string' && raw.toString().toLowerCase().includes('e'))) {
+ if (
+ typeof raw === 'number' ||
+ (typeof raw === 'string' && raw.toString().toLowerCase().includes('e'))
+ ) {
value = BigInt(Math.floor(Number(raw)));
} else {
value = BigInt(raw);
@@ -151,15 +154,15 @@ export function fromSmallestUnit(raw: string | number | bigint, decimals: number
} catch {
return String(raw);
}
-
+
if (decimals === 0) return value.toString();
-
+
const divisor = 10n ** BigInt(decimals);
const whole = value / divisor;
const frac = value % divisor;
-
+
if (frac === 0n) return whole.toString();
-
+
const fracStr = frac.toString().padStart(decimals, '0').replace(/0+$/, '');
return `${whole.toString()}.${fracStr}`;
}
@@ -186,11 +189,11 @@ export function formatDisplayBalance(formatted: string | number): string {
if (normalized.startsWith('0.') && normalized !== '0.0') {
const fracPart = normalized.split('.')[1] || '';
if (fracPart.length >= 8 && /^0{7,}/.test(fracPart)) {
- // if it's less than 0.00000001
- const num = Number(normalized);
- if (num > 0 && num < 0.00000001) {
- return '<0.00000001';
- }
+ // if it's less than 0.00000001
+ const num = Number(normalized);
+ if (num > 0 && num < 0.00000001) {
+ return '<0.00000001';
+ }
}
}