Skip to content

Value.fromGwei

Parses a string representation of Gwei to a bigint Value (default: wei).

Imports

Named
import { Value } from 'ox'

Examples

import { Value } from 'ox'
 
Value.fromGwei('420')
420000000000n

Definition

function fromGwei(
  gwei: string,
  unit?: 'wei',
): bigint

Source: src/Value.ts

Parameters

gwei

  • Type: string

String representation of Gwei.

unit

  • Type: 'wei'
  • Optional

The unit to parse to.

Return Type

A bigint Value.

bigint