Skip to content

Commit

Permalink
Fix enabling EIP-1559 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuri committed Oct 24, 2024
1 parent 87066a7 commit 43a96d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,18 @@ const getNetworkAndChainId = async () => {
};

const handleEIP1559Support = async () => {
if (!Array.isArray(accounts) || accounts.length <= 0) {
return;
}

const block = await provider.request({
method: 'eth_getBlockByNumber',
params: ['latest', false],
});

const supported = block.baseFeePerGas !== undefined;

if (supported && Array.isArray(accounts) && accounts.length >= 1) {
if (supported) {
sendEIP1559Button.disabled = false;
sendEIP1559Button.hidden = false;
sendEIP1559WithoutGasButton.disabled = false;
Expand Down

0 comments on commit 43a96d2

Please sign in to comment.