Skip to content

Commit

Permalink
created dynamic wrapped GasPriceDropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Nov 8, 2024
1 parent c4ce911 commit b34d009
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import CryptoProviders from 'apps/web/app/CryptoProviders';
import Card from 'apps/web/src/components/base-org/Card';
import { Icon } from 'apps/web/src/components/Icon/Icon';
import { base, mainnet } from 'viem/chains';
import { useGasPrice } from 'wagmi';
import { DynamicCryptoProviders } from 'apps/web/app/CryptoProviders.dynamic';
import Card from 'apps/web/src/components/base-org/Card';
import { Icon } from 'apps/web/src/components/Icon/Icon';

const convertWeiToMwei = (weiValue: bigint): number => {
// 1 mwei = 10^6 wei
const mweiValue = Number(weiValue) / 1_000_000;
return Number(mweiValue.toFixed(2)); // Round to 2 decimal places
};

export function WrappedGasPriceDropdown() {
export function DynamicWrappedGasPriceDropdown() {
return (
<CryptoProviders>
<DynamicCryptoProviders>
<GasPriceDropdown />
</CryptoProviders>
</DynamicCryptoProviders>
);
}

function GasPriceDropdown() {
export function GasPriceDropdown() {
const { data: baseGasPriceInWei } = useGasPrice({
chainId: base.id,
query: {
Expand Down

0 comments on commit b34d009

Please sign in to comment.