mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-05-05 09:17:52 +00:00
fixes
This commit is contained in:
parent
32143fd623
commit
6b091a9e64
@ -3316,12 +3316,14 @@ function App() {
|
||||
>
|
||||
{messageQortalRequestExtension?.text3}
|
||||
</TextP>
|
||||
<Spacer height="15px" />
|
||||
|
||||
</Box>
|
||||
<Spacer height="15px" />
|
||||
</>
|
||||
)}
|
||||
|
||||
{messageQortalRequestExtension?.text4 && (
|
||||
<>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
@ -3339,6 +3341,8 @@ function App() {
|
||||
{messageQortalRequestExtension?.text4}
|
||||
</TextP>
|
||||
</Box>
|
||||
<Spacer height="15px" />
|
||||
</>
|
||||
)}
|
||||
|
||||
{messageQortalRequestExtension?.html && (
|
||||
|
@ -2321,6 +2321,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) {
|
||||
@ -2343,11 +2348,18 @@ 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
|
||||
@ -2459,7 +2471,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}`,
|
||||
@ -2535,7 +2547,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}`,
|
||||
@ -2610,7 +2622,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}`,
|
||||
@ -3131,7 +3143,7 @@ const getBuyingFees = async (foreignBlockchain) => {
|
||||
unlock: {
|
||||
sats: unlockFee,
|
||||
fee: unlockFee / QORT_DECIMALS,
|
||||
byteFee300: calculateFeeFromRate(+unlockFee, 300) / QORT_DECIMALS,
|
||||
feePerKb: +calculateRateFromFee(+unlockFee, 300) / QORT_DECIMALS,
|
||||
},
|
||||
};
|
||||
};
|
||||
@ -3215,11 +3227,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