Skip to content

Commit

Permalink
Merge branch 'master' into fix/balance
Browse files Browse the repository at this point in the history
Signed-off-by: kulwindersingh-ant <[email protected]>
  • Loading branch information
kulwindersingh-ant authored May 14, 2024
2 parents c56103c + ff8d908 commit e6286a2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 47 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/dependabot-scans.yml

This file was deleted.

16 changes: 8 additions & 8 deletions src/Components/BalanceDetails/BalanceDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,15 @@ function BalanceDetails({ mt0 }) {
{
value: NETWORK.TEST_NETWORK,
label: <span className="flexedItemSelect">{NETWORK.TEST_NETWORK}</span>
},
{
value: NETWORK.UAT,
label: <span className="flexedItemSelect">{NETWORK.UAT}</span>
},
{
value: NETWORK.QA_NETWORK,
label: <span className="flexedItemSelect">{NETWORK.QA_NETWORK}</span>
}
// {
// value: NETWORK.UAT,
// label: <span className="flexedItemSelect">{NETWORK.UAT}</span>
// },
// {
// value: NETWORK.QA_NETWORK,
// label: <span className="flexedItemSelect">{NETWORK.QA_NETWORK}</span>
// }
]}
/>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/Constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const CONNECTION_NAME = "5IRE_EXT";
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.0001;
export const WINDOW_WIDTH = 400;
export const DECIMALS = 10 ** 18;
Expand Down
20 changes: 9 additions & 11 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,15 +434,13 @@ 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 e6286a2

Please sign in to comment.