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,
|
formatUsdtRawHuman,
|
||||||
getTransferMinRemainingRaw,
|
getTransferMinRemainingRaw,
|
||||||
} from '../utils/withdrawalFee';
|
} from '../utils/withdrawalFee';
|
||||||
import { voidUserAdminStatsRefresh } from './userAdminStatsService';
|
import { queueUserAdminStatsRefresh } from './userAdminStatsService';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transfers balance from one user to another identified by email.
|
* 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 },
|
metadata: { amount: amountRaw.toString(), from_user_id: userId },
|
||||||
});
|
});
|
||||||
|
|
||||||
voidUserAdminStatsRefresh(userId);
|
queueUserAdminStatsRefresh(userId);
|
||||||
voidUserAdminStatsRefresh(recipient.id);
|
queueUserAdminStatsRefresh(recipient.id);
|
||||||
|
|
||||||
return { transactionId: senderTx.id, status: 'completed' };
|
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;
|
final busy = _submitting || _confirming;
|
||||||
|
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
@ -493,20 +495,20 @@ class _TransferScreenState extends State<TransferScreen> {
|
|||||||
final minRemaining =
|
final minRemaining =
|
||||||
CoinDisplay.scaleWithdrawalFeeRaw(
|
CoinDisplay.scaleWithdrawalFeeRaw(
|
||||||
_transferMinRemainingRaw,
|
_transferMinRemainingRaw,
|
||||||
selectedType.decimals,
|
ledgerType.decimals,
|
||||||
);
|
);
|
||||||
final maxRaw = available > minRemaining
|
final maxRaw = available > minRemaining
|
||||||
? available - minRemaining
|
? available - minRemaining
|
||||||
: BigInt.zero;
|
: BigInt.zero;
|
||||||
final label = minRemaining > BigInt.zero
|
final label = minRemaining > BigInt.zero
|
||||||
? s.transferMaxWithMinRemaining(
|
? s.transferMaxWithMinRemaining(
|
||||||
'${rawAmountToHuman(maxRaw.toString(), selectedType.decimals)} USDT',
|
'${rawAmountToHuman(maxRaw.toString(), ledgerType.decimals)} USDT',
|
||||||
'${rawAmountToHuman(minRemaining.toString(), selectedType.decimals)} USDT',
|
'${rawAmountToHuman(minRemaining.toString(), ledgerType.decimals)} USDT',
|
||||||
)
|
)
|
||||||
: s.availableAsset(
|
: s.availableAsset(
|
||||||
rawAmountToHuman(
|
rawAmountToHuman(
|
||||||
availableRaw,
|
availableRaw,
|
||||||
selectedType.decimals,
|
ledgerType.decimals,
|
||||||
),
|
),
|
||||||
'USDT',
|
'USDT',
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user