Skip to content

Commit

Permalink
feat(bridge-ui): remove fee padding (#18546)
Browse files Browse the repository at this point in the history
  • Loading branch information
KorbinianK authored Dec 10, 2024
1 parent 0ef7fd6 commit 3966bb1
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 613 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
</span>

<span class="font-bold text-positive-sentiment">Waiting for transaction to be processed</span>
<span class="text-secondary-content">Depending on your direction, this can take up to 24hs</span>
<span class="text-secondary-content">Depending on your direction, this can take up to 4hs</span>
</div>

<div class="f-col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
: mobileContainerClasses;
$: commonColumnClasses = classNames(' relative items-end');
$: desktopColumnClasses = classNames(commonColumnClasses, 'w-1/6 f-row justify-center items-center');
$: desktopColumnClasses = classNames(commonColumnClasses, 'w-1/6 f-row justify-center md:justify-start items-center');
$: tabletColumnClasses = classNames(
commonColumnClasses,
'w-1/4 f-row text-left start items-center text-sm space-y-[10px]',
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"alerts": {
"not_enough_funds": "You do not have enough ETH to cover the processing fee and transaction fee. Please add more ETH to your wallet (>= 0.0015 ETH).",
"slow_bridging": "Please note: Bridging to L1 will take around 24hrs!",
"slow_bridging": "Please note: Bridging to L1 will take around 4hs!",
"smart_contract_wallet": "It seems you are using a smart contract wallet. Please double check that the recipient matches your wallet on the destination or change it accordingly.",
"wrapped_eth": "You are bridging wrapped ETH. Please be aware that un-wrapping will only work on the original chain of the token, <span class=\"font-bold\">NOT</span> on the destination."
},
Expand Down
28 changes: 14 additions & 14 deletions packages/bridge-ui/src/libs/fee/recommendProcessingFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ export async function recommendProcessingFee({
if (!estimatedMsgGaslimit) throw new Error('Unable to calculate fee');

// Initial fee multiplicator and add fallback
let feeMultiplicator: number = parseInt(PUBLIC_FEE_MULTIPLIER);

if (gasPrice <= parseGwei('0.05')) {
feeMultiplicator = 4;
log(`gasPrice {formatGwei(gasPrice)} is less than 0.5 gwei, setting feeMultiplicator to 4`);
} else if (gasPrice <= parseGwei('0.1') && gasPrice > parseGwei('0.05')) {
feeMultiplicator = 3;
log(
`gasPrice ${formatGwei(gasPrice)} is less than 0.1 gwei and more than 0.05 gwei, setting feeMultiplicator to 3`,
);
} else {
feeMultiplicator = 2;
log(`gasPrice ${formatGwei(gasPrice)} is more than 0.1 gwei, setting feeMultiplicator to 2`);
}
const feeMultiplicator: number = parseInt(PUBLIC_FEE_MULTIPLIER) || 1;

// if (gasPrice <= parseGwei('0.05')) {
// feeMultiplicator = 4;
// log(`gasPrice {formatGwei(gasPrice)} is less than 0.5 gwei, setting feeMultiplicator to 4`);
// } else if (gasPrice <= parseGwei('0.1') && gasPrice > parseGwei('0.05')) {
// feeMultiplicator = 3;
// log(
// `gasPrice ${formatGwei(gasPrice)} is less than 0.1 gwei and more than 0.05 gwei, setting feeMultiplicator to 3`,
// );
// } else {
// feeMultiplicator = 2;
// log(`gasPrice ${formatGwei(gasPrice)} is more than 0.1 gwei, setting feeMultiplicator to 2`);
// }

const fee = estimatedMsgGaslimit * Number(gasPrice) * feeMultiplicator;
return BigInt(fee);
Expand Down
Loading

0 comments on commit 3966bb1

Please sign in to comment.