diff --git a/backend/src/services/shareCardService.ts b/backend/src/services/shareCardService.ts index efd2426a..5f80beb9 100644 --- a/backend/src/services/shareCardService.ts +++ b/backend/src/services/shareCardService.ts @@ -319,7 +319,6 @@ async function buildWalletOpCardPayload( const decimals = ledgerWt?.decimals ?? STAKE_DECIMALS; const amountRaw = BigInt(tx.amount); - const feeRaw = BigInt(tx.fee || '0'); const amountDisplay = rawToDisplay(amountRaw, decimals); const assetCode = displayWt?.code ?? ledgerWt?.code ?? 'USDT'; const assetSymbol = shortAssetSymbol(assetCode); @@ -337,16 +336,13 @@ async function buildWalletOpCardPayload( ? buildReferralRegisterLink(opts.referralCode) : `${getPublicWebBaseUrl()}/register`; - let signedDisplay: string; - if (tx.type === 'withdrawal') { - const totalDisplay = - feeRaw > 0n ? rawToDisplay(amountRaw + feeRaw, decimals) : amountDisplay; - signedDisplay = `-${totalDisplay}`; - } else if (tx.type === 'transfer') { - signedDisplay = amountDisplay; - } else { - signedDisplay = `+${amountDisplay}`; - } + // Share cards are marketing-facing: show received/sent principal only (no platform fee). + const signedDisplay = + tx.type === 'withdrawal' + ? `-${amountDisplay}` + : tx.type === 'transfer' + ? amountDisplay + : `+${amountDisplay}`; return { kind: 'wallet' as const, @@ -356,7 +352,7 @@ async function buildWalletOpCardPayload( amountRaw: tx.amount, amountDisplay, amountSignedDisplay: signedDisplay, - feeRaw: tx.fee, + feeRaw: '0', assetCode, assetSymbol, assetName: displayWt?.name ?? assetCode, diff --git a/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart b/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart index 3cd0a9a4..f3fbb7fb 100644 --- a/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart +++ b/prediqo_mobile/lib/features/share_cards/presentation/share_result_widgets.dart @@ -292,18 +292,6 @@ class _WalletCard extends StatelessWidget { _KV(s.t('Asset', 'Actif'), payload.assetName ?? payload.assetSymbol ?? ''), if ((payload.network ?? '').isNotEmpty) _KV(s.t('Network', 'Réseau'), payload.network!), - if (payload.operationType == 'withdrawal' && - (payload.feeRaw ?? '0') != '0' && - (payload.feeRaw ?? '').isNotEmpty) ...[ - _KV( - s.t('Withdrawn', 'Retiré'), - '${payload.amountDisplay ?? ''} ${payload.assetSymbol ?? ''}'.trim(), - ), - _KV( - s.t('Fee', 'Frais'), - '${_formatMicroUsdt(payload.feeRaw!)} ${payload.assetSymbol ?? ''}'.trim(), - ), - ], if (created != null) _KV(s.t('Date', 'Date'), _fmt(created)), ], verifyUrl: payload.verifyUrl, @@ -311,16 +299,6 @@ class _WalletCard extends StatelessWidget { } } -String _formatMicroUsdt(String raw, {int decimals = 6}) { - final n = BigInt.tryParse(raw.trim()) ?? BigInt.zero; - final base = BigInt.from(10).pow(decimals); - final whole = n ~/ base; - final frac = n % base; - if (frac == BigInt.zero) return whole.toString(); - final fracStr = frac.toString().padLeft(decimals, '0').replaceAll(RegExp(r'0+$'), ''); - return '$whole.$fracStr'; -} - class _CardShell extends StatelessWidget { const _CardShell({ required this.title, diff --git a/prediqo_web/src/features/share-cards/ShareResultCard.tsx b/prediqo_web/src/features/share-cards/ShareResultCard.tsx index 229f40be..233ec619 100644 --- a/prediqo_web/src/features/share-cards/ShareResultCard.tsx +++ b/prediqo_web/src/features/share-cards/ShareResultCard.tsx @@ -96,19 +96,6 @@ function PredictionCard({ ); } -function formatMicroUsdt(raw: string, decimals = 6): string { - try { - const n = BigInt(raw); - const base = 10n ** BigInt(decimals); - const whole = n / base; - const frac = n % base; - if (frac === 0n) return whole.toString(); - return `${whole.toString()}.${frac.toString().padStart(decimals, '0').replace(/0+$/, '')}`; - } catch { - return raw; - } -} - function WalletOpCard({ payload, cardRef, @@ -149,22 +136,6 @@ function WalletOpCard({ /> {payload.network ? : null} - {payload.operationType === 'withdrawal' && - payload.feeRaw && - payload.feeRaw !== '0' ? ( - - ) : null} - {payload.operationType === 'withdrawal' && - payload.feeRaw && - payload.feeRaw !== '0' ? ( - - ) : null}