mirror of
https://github.com/Qortal/qortal-mobile.git
synced 2025-05-08 02:37:59 +00:00
fixes
This commit is contained in:
parent
8c98fcbcdf
commit
93305b8dc4
@ -3125,12 +3125,14 @@ function App() {
|
||||
>
|
||||
{messageQortalRequestExtension?.text3}
|
||||
</TextP>
|
||||
<Spacer height="15px" />
|
||||
|
||||
</Box>
|
||||
<Spacer height="15px" />
|
||||
</>
|
||||
)}
|
||||
|
||||
{messageQortalRequestExtension?.text4 && (
|
||||
<>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
@ -3148,6 +3150,8 @@ function App() {
|
||||
{messageQortalRequestExtension?.text4}
|
||||
</TextP>
|
||||
</Box>
|
||||
<Spacer height="15px" />
|
||||
</>
|
||||
)}
|
||||
|
||||
{messageQortalRequestExtension?.html && (
|
||||
|
@ -2377,6 +2377,11 @@ export const getTxActivitySummary = async (data) => {
|
||||
}
|
||||
};
|
||||
|
||||
function calculateRateFromFee(totalFee, sizeInBytes) {
|
||||
const fee = (totalFee / sizeInBytes) * 1000;
|
||||
return fee.toFixed(0);
|
||||
}
|
||||
|
||||
export const updateForeignFee = async (data, isFromExtension) => {
|
||||
const isGateway = await isRunningGateway();
|
||||
if (isGateway) {
|
||||
@ -2399,11 +2404,19 @@ export const getTxActivitySummary = async (data) => {
|
||||
|
||||
const { coin, type, value } = data;
|
||||
|
||||
const text3 =
|
||||
type === 'feerequired' ? `${value} sats` : `${value} sats per kb`;
|
||||
const text4 =
|
||||
type === 'feerequired'
|
||||
? `*The ${value} sats fee is derived from ${calculateRateFromFee(value, 300)} sats per kb, for a transaction that is approximately 300 bytes in size.`
|
||||
: '';
|
||||
|
||||
const resPermission = await getUserPermission(
|
||||
{
|
||||
text1: `Do you give this application to update foreign fees on your node?`,
|
||||
text1: `Do you give this application permission to update foreign fees on your node?`,
|
||||
text2: `type: ${type === 'feerequired' ? 'unlocking' : 'locking'}`,
|
||||
text3: `value: ${value}`,
|
||||
text3: `value: ${text3}`,
|
||||
text4,
|
||||
highlightedText: `Coin: ${coin}`,
|
||||
},
|
||||
isFromExtension
|
||||
@ -2515,7 +2528,7 @@ export const getTxActivitySummary = async (data) => {
|
||||
|
||||
const resPermission = await getUserPermission(
|
||||
{
|
||||
text1: `Do you give this application to set the current server?`,
|
||||
text1: `Do you give this application permission to set the current server?`,
|
||||
text2: `type: ${type}`,
|
||||
text3: `host: ${host}`,
|
||||
highlightedText: `Coin: ${coin}`,
|
||||
@ -2590,7 +2603,7 @@ export const getTxActivitySummary = async (data) => {
|
||||
|
||||
const resPermission = await getUserPermission(
|
||||
{
|
||||
text1: `Do you give this application to add a server?`,
|
||||
text1: `Do you give this application permission to add a server?`,
|
||||
text2: `type: ${type}`,
|
||||
text3: `host: ${host}`,
|
||||
highlightedText: `Coin: ${coin}`,
|
||||
@ -2665,7 +2678,7 @@ export const getTxActivitySummary = async (data) => {
|
||||
|
||||
const resPermission = await getUserPermission(
|
||||
{
|
||||
text1: `Do you give this application to remove a server?`,
|
||||
text1: `Do you give this application permission to remove a server?`,
|
||||
text2: `type: ${type}`,
|
||||
text3: `host: ${host}`,
|
||||
highlightedText: `Coin: ${coin}`,
|
||||
@ -3191,7 +3204,7 @@ const getBuyingFees = async (foreignBlockchain) => {
|
||||
unlock: {
|
||||
sats: unlockFee,
|
||||
fee: unlockFee / QORT_DECIMALS,
|
||||
byteFee300: calculateFeeFromRate(+unlockFee, 300) / QORT_DECIMALS,
|
||||
feePerKb: +calculateRateFromFee(+unlockFee, 300) / QORT_DECIMALS,
|
||||
},
|
||||
};
|
||||
};
|
||||
@ -3278,10 +3291,10 @@ const crosschainAtInfo = await Promise.all(atPromises);
|
||||
|
||||
<div class="fee-container">
|
||||
<div class="fee-label">Total Unlocking Fee:</div>
|
||||
<div>${(+buyingFees?.unlock?.byteFee300 * atAddresses?.length)?.toFixed(8)} ${buyingFees.ticker}</div>
|
||||
<div class="fee-description">
|
||||
This fee is an estimate based on ${atAddresses?.length} ${atAddresses?.length > 1 ? 'orders' : 'order'} at a 300 byte cost of ${buyingFees?.unlock?.byteFee300?.toFixed(8)}
|
||||
</div>
|
||||
<div>${(+buyingFees?.unlock?.fee * atAddresses?.length)?.toFixed(8)} ${buyingFees.ticker}</div>
|
||||
<div class="fee-description">
|
||||
This fee is an estimate based on ${atAddresses?.length} ${atAddresses?.length > 1 ? 'orders' : 'order'}, assuming a 300-byte size at a rate of ${buyingFees?.unlock?.feePerKb?.toFixed(8)} ${buyingFees.ticker} per KB.
|
||||
</div>
|
||||
|
||||
<div class="fee-label">Total Locking Fee:</div>
|
||||
<div>${+buyingFees?.unlock.fee.toFixed(8)} ${buyingFees.ticker} per kb</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user