After adding option to prevent users to send money without any control1
This commit is contained in:
parent
e3b109a988
commit
977d7a8e43
@ -17,7 +17,7 @@ import {
|
||||
formatUsdtRawHuman,
|
||||
getTransferMinRemainingRaw,
|
||||
} from '../utils/withdrawalFee';
|
||||
import { voidUserAdminStatsRefresh } from './userAdminStatsService';
|
||||
import { queueUserAdminStatsRefresh } from './userAdminStatsService';
|
||||
|
||||
/**
|
||||
* Transfers balance from one user to another identified by email.
|
||||
@ -115,8 +115,8 @@ export async function requestTransfer(
|
||||
metadata: { amount: amountRaw.toString(), from_user_id: userId },
|
||||
});
|
||||
|
||||
voidUserAdminStatsRefresh(userId);
|
||||
voidUserAdminStatsRefresh(recipient.id);
|
||||
queueUserAdminStatsRefresh(userId);
|
||||
queueUserAdminStatsRefresh(recipient.id);
|
||||
|
||||
return { transactionId: senderTx.id, status: 'completed' };
|
||||
}
|
||||
|
||||
@ -346,6 +346,8 @@ class _TransferScreenState extends State<TransferScreen> {
|
||||
],
|
||||
);
|
||||
}
|
||||
// Non-null local so closures (e.g. Builder) keep promotion.
|
||||
final ledgerType = selectedType;
|
||||
final busy = _submitting || _confirming;
|
||||
|
||||
return RefreshIndicator(
|
||||
@ -493,20 +495,20 @@ class _TransferScreenState extends State<TransferScreen> {
|
||||
final minRemaining =
|
||||
CoinDisplay.scaleWithdrawalFeeRaw(
|
||||
_transferMinRemainingRaw,
|
||||
selectedType.decimals,
|
||||
ledgerType.decimals,
|
||||
);
|
||||
final maxRaw = available > minRemaining
|
||||
? available - minRemaining
|
||||
: BigInt.zero;
|
||||
final label = minRemaining > BigInt.zero
|
||||
? s.transferMaxWithMinRemaining(
|
||||
'${rawAmountToHuman(maxRaw.toString(), selectedType.decimals)} USDT',
|
||||
'${rawAmountToHuman(minRemaining.toString(), selectedType.decimals)} USDT',
|
||||
'${rawAmountToHuman(maxRaw.toString(), ledgerType.decimals)} USDT',
|
||||
'${rawAmountToHuman(minRemaining.toString(), ledgerType.decimals)} USDT',
|
||||
)
|
||||
: s.availableAsset(
|
||||
rawAmountToHuman(
|
||||
availableRaw,
|
||||
selectedType.decimals,
|
||||
ledgerType.decimals,
|
||||
),
|
||||
'USDT',
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user