Skip to content

Commit

Permalink
fix: adds extra
Browse files Browse the repository at this point in the history
Signed-off-by: kulwindersingh-ant <[email protected]>
  • Loading branch information
kulwindersingh-ant committed May 11, 2024
1 parent 3e08b0f commit ce7be17
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const PORT_NAME = "WEBEXT_REDUX_TEST";
export const UI_CONNECTION_NAME = "5IRE_EXT_UI";
export const RESTRICTED_FOR_CONTENT_SCRIPT = "chrome-extension://";

export const EXTRA_FEE = 0;
export const EXTRA_FEE = 0.0001;
export const WINDOW_WIDTH = 400;
export const DECIMALS = 10 ** 18;
export const WINDOW_HEIGHT = 620;
Expand Down
20 changes: 11 additions & 9 deletions src/Pages/Send/Send.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function Send() {
if (
Number(data.amount) + Number(estimatedGas) + (isEd ? edValue : 0) >
Number(balance?.evmBalance) -
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].evm
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].evm
) {
updateEstimatedGas(null);
setErr((p) => ({
Expand Down Expand Up @@ -145,8 +145,8 @@ function Send() {
} else if (
Number(data.amount) + Number(estimatedGas) + (isEd ? edValue : 0) >
Number(balance?.nativeBalance) -
pendingTransactionBalance[currentAccount?.evmAddress][currentNetwork.toLowerCase()]
.native
pendingTransactionBalance[currentAccount?.evmAddress][currentNetwork.toLowerCase()]
.native
) {
updateEstimatedGas(null);
setErr((p) => ({ ...p, amount: ERROR_MESSAGES.INSUFFICENT_BALANCE }));
Expand Down Expand Up @@ -192,7 +192,7 @@ function Send() {
else if (
Number(data.amount) >=
Number(balance?.evmBalance) -
pendingTransactionBalance[currentAccount?.evmAddress][currentNetwork.toLowerCase()].evm
pendingTransactionBalance[currentAccount?.evmAddress][currentNetwork.toLowerCase()].evm
)
setErr((p) => ({ ...p, amount: ERROR_MESSAGES.INSUFFICENT_BALANCE }));
else setErr((p) => ({ ...p, amount: "" }));
Expand All @@ -202,7 +202,7 @@ function Send() {
else if (
Number(data.amount) >=
Number(balance?.nativeBalance) -
pendingTransactionBalance[currentAccount?.evmAddress][currentNetwork.toLowerCase()].native
pendingTransactionBalance[currentAccount?.evmAddress][currentNetwork.toLowerCase()].native
)
setErr((p) => ({ ...p, amount: ERROR_MESSAGES.INSUFFICENT_BALANCE }));
else setErr((p) => ({ ...p, amount: "" }));
Expand Down Expand Up @@ -434,13 +434,15 @@ function Send() {
<button
onClick={activeSend}
name={EVM}
className={`${style.sendSec__sendSwapbtn__buttons} ${activeTab === EVM && style.sendSec__sendSwapbtn__buttons__active
}`}>
className={`${style.sendSec__sendSwapbtn__buttons} ${
activeTab === EVM && style.sendSec__sendSwapbtn__buttons__active
}`}>
EVM
</button>
<div
className={`${activeTab === NATIVE && style.activeFirst} ${activeTab === EVM && style.activeSecond
} ${style.animations}`}></div>
className={`${activeTab === NATIVE && style.activeFirst} ${
activeTab === EVM && style.activeSecond
} ${style.animations}`}></div>
</div>
</div>
<div className={style.sendSec__inputInnerSec}>
Expand Down
10 changes: 5 additions & 5 deletions src/Pages/Swap/Swap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Swap() {
} else if (
Number(amount) + Number(estimatedGas) + (isEd ? edValue : 0) >
Number(balance?.evmBalance) -
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].evm
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].evm
) {
setDisable(true);
updateEstimatedGas(null);
Expand Down Expand Up @@ -138,8 +138,8 @@ function Swap() {
if (
Number(amount) + Number(estimatedGas) + (isEd ? edValue : 0) >
Number(balance?.nativeBalance) -
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()]
.native
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()]
.native
) {
setDisable(true);
updateEstimatedGas(null);
Expand Down Expand Up @@ -167,15 +167,15 @@ function Swap() {
if (
Number(amount) >=
Number(balance?.evmBalance) -
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].evm
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].evm
)
setError(ERROR_MESSAGES.INSUFFICENT_BALANCE);
else setError("");
} else if (toFrom.from.toLowerCase() === NATIVE.toLowerCase()) {
if (
Number(amount) >=
Number(balance?.nativeBalance) -
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].native
pendingTransactionBalance[currentAccount.evmAddress][currentNetwork.toLowerCase()].native
)
setError(ERROR_MESSAGES.INSUFFICENT_BALANCE);
else setError("");
Expand Down

0 comments on commit ce7be17

Please sign in to comment.