diff --git a/packages/extension/src/providers/ethereum/networks/arb-nova.ts b/packages/extension/src/providers/ethereum/networks/arb-nova.ts index 527404a5..7c299eb0 100644 --- a/packages/extension/src/providers/ethereum/networks/arb-nova.ts +++ b/packages/extension/src/providers/ethereum/networks/arb-nova.ts @@ -3,6 +3,7 @@ import { CoingeckoPlatform, NetworkNames } from '@enkryptcom/types'; import { EvmNetwork, EvmNetworkOptions } from '../types/evm-network'; import assetsInfoHandler from '@/providers/ethereum/libs/assets-handlers/assetinfo-mew'; import shNFTHandler from '@/libs/nft-handlers/simplehash'; +import wrapActivityHandler from '@/libs/activity-state/wrap-activity-handler'; const arbNovaOptions: EvmNetworkOptions = { name: NetworkNames.ArbitrumNova, @@ -20,7 +21,7 @@ const arbNovaOptions: EvmNetworkOptions = { coingeckoPlatform: CoingeckoPlatform.ArbitrumNova, assetsInfoHandler, NFTHandler: shNFTHandler, - activityHandler: () => Promise.resolve([]), + activityHandler: wrapActivityHandler(() => Promise.resolve([])), }; const arb = new EvmNetwork(arbNovaOptions); diff --git a/packages/extension/src/providers/ethereum/networks/bsc.ts b/packages/extension/src/providers/ethereum/networks/bsc.ts index 1c39b730..7eaebd53 100644 --- a/packages/extension/src/providers/ethereum/networks/bsc.ts +++ b/packages/extension/src/providers/ethereum/networks/bsc.ts @@ -23,7 +23,7 @@ const bscOptions: EvmNetworkOptions = { basePath: "m/44'/714'", NFTHandler: shNFTHandler, assetsInfoHandler, - activityHandler: wrapActivityHandler(EtherscanActivity), + activityHandler: wrapActivityHandler(() => Promise.resolve([])), }; const bsc = new EvmNetwork(bscOptions); diff --git a/packages/extension/src/providers/ethereum/networks/holesky.ts b/packages/extension/src/providers/ethereum/networks/holesky.ts index f15cb90c..cf5eac09 100644 --- a/packages/extension/src/providers/ethereum/networks/holesky.ts +++ b/packages/extension/src/providers/ethereum/networks/holesky.ts @@ -1,6 +1,7 @@ import icon from './icons/eth.svg'; import { NetworkNames } from '@enkryptcom/types'; import { EvmNetwork, EvmNetworkOptions } from '../types/evm-network'; +import wrapActivityHandler from '@/libs/activity-state/wrap-activity-handler'; const holeskyOptions: EvmNetworkOptions = { name: NetworkNames.Holesky, @@ -14,7 +15,7 @@ const holeskyOptions: EvmNetworkOptions = { currencyNameLong: 'Holesky', node: 'wss://nodes.mewapi.io/ws/holesky', icon, - activityHandler: () => Promise.resolve([]), + activityHandler: wrapActivityHandler(() => Promise.resolve([])), }; const holesky = new EvmNetwork(holeskyOptions); diff --git a/packages/extension/src/providers/ethereum/networks/op-bnb.ts b/packages/extension/src/providers/ethereum/networks/op-bnb.ts index 330ad7a6..a76288ba 100644 --- a/packages/extension/src/providers/ethereum/networks/op-bnb.ts +++ b/packages/extension/src/providers/ethereum/networks/op-bnb.ts @@ -3,6 +3,7 @@ import { CoingeckoPlatform, NetworkNames } from '@enkryptcom/types'; import { EvmNetwork, EvmNetworkOptions } from '../types/evm-network'; import assetsInfoHandler from '@/providers/ethereum/libs/assets-handlers/assetinfo-mew'; import shNFTHandler from '@/libs/nft-handlers/simplehash'; +import wrapActivityHandler from '@/libs/activity-state/wrap-activity-handler'; const opBnbOptions: EvmNetworkOptions = { name: NetworkNames.OpBNB, @@ -20,7 +21,7 @@ const opBnbOptions: EvmNetworkOptions = { coingeckoPlatform: CoingeckoPlatform.OpBNB, assetsInfoHandler, NFTHandler: shNFTHandler, - activityHandler: () => Promise.resolve([]), + activityHandler: wrapActivityHandler(() => Promise.resolve([])), }; const op = new EvmNetwork(opBnbOptions); diff --git a/packages/extension/src/providers/ethereum/networks/palm.ts b/packages/extension/src/providers/ethereum/networks/palm.ts index 9b3e66fc..12f2d37c 100644 --- a/packages/extension/src/providers/ethereum/networks/palm.ts +++ b/packages/extension/src/providers/ethereum/networks/palm.ts @@ -2,6 +2,7 @@ import icon from './icons/palm.svg'; import { NetworkNames } from '@enkryptcom/types'; import { EvmNetwork, EvmNetworkOptions } from '../types/evm-network'; import shNFTHandler from '@/libs/nft-handlers/simplehash'; +import wrapActivityHandler from '@/libs/activity-state/wrap-activity-handler'; // Palm network has an API but it seems broken (DNS won't resolve) // @see https://palm.chainlens.com/api/swagger-ui/index.html @@ -20,7 +21,7 @@ const palmNetworkOptions: EvmNetworkOptions = { icon, coingeckoID: 'palm-ai', NFTHandler: shNFTHandler, - activityHandler: () => Promise.resolve([]), + activityHandler: wrapActivityHandler(() => Promise.resolve([])), }; const palmNetwork = new EvmNetwork(palmNetworkOptions); diff --git a/packages/extension/src/providers/ethereum/ui/send-transaction/index.vue b/packages/extension/src/providers/ethereum/ui/send-transaction/index.vue index 4fd40a1f..7f870d95 100644 --- a/packages/extension/src/providers/ethereum/ui/send-transaction/index.vue +++ b/packages/extension/src/providers/ethereum/ui/send-transaction/index.vue @@ -225,6 +225,18 @@ const hasEnoughBalance = computed(() => { return false; } + // check if user has enough balance for fees + if ( + toBN( + toBase( + gasCostValues.value[selectedFee.value].nativeValue, + props.network.decimals, + ), + ).gt(toBN(nativeBalance.value)) + ) { + return false; + } + return toBN(selectedAsset.value.balance ?? '0').gte( toBN(toBase(sendAmount.value ?? '0', selectedAsset.value.decimals!)), ); @@ -562,8 +574,8 @@ const isInputsValid = computed(() => { if (!isSendToken.value && !selectedNft.value.id) { return false; } - const sendAmountBigNumber = new BigNumber(sendAmount.value) - if (sendAmountBigNumber.isNaN()) return false + const sendAmountBigNumber = new BigNumber(sendAmount.value); + if (sendAmountBigNumber.isNaN()) return false; if (sendAmountBigNumber.gt(assetMaxValue.value)) return false; if (gasCostValues.value.REGULAR.nativeValue === '0') return false; if (!isNumericPositive(sendAmount.value)) return false;