Function parseEther

  • Converts a string representation of ether to numerical wei.

    Parameters

    • ether: string
    • Optionalunit: "wei" | "gwei"

    Returns bigint

    import { parseEther } from 'viem'

    parseEther('420')
    // 420000000000000000000n