> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# BrandedEther

> Auto-generated API documentation

[**@tevm/voltaire**](../../index.mdx)

***

[@tevm/voltaire](../../index.mdx) / [index](../index.mdx) / BrandedEther

# BrandedEther

## Type Aliases

### BrandedEther

> **BrandedEther** = [`EtherType`](#ethertype)

Defined in: [src/primitives/Denomination/EtherType.ts:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/EtherType.ts#L12)

***

### EtherType

> **EtherType** = `string` & `object`

Defined in: [src/primitives/Denomination/EtherType.ts:9](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/EtherType.ts#L9)

Branded Ether type - represents Ethereum amounts in ether (10^18 wei)

Uses string to support decimal values like "1.5" or "0.001"
For whole number wei amounts, use WeiType (bigint)

#### Type Declaration

##### \[brand]

> `readonly` **\[brand]**: `"Ether"`

## Variables

### Ether

> `const` **Ether**: `object`

Defined in: [src/primitives/Denomination/ether-index.ts:19](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-index.ts#L19)

#### Type Declaration

##### from()

> **from**: (`value`) => [`EtherType`](#ethertype)

Create Ether from bigint, number, or string

Ether is a string type to support decimal values like "1.5" or "0.001"

###### Parameters

###### value

Value to convert (bigint, number, or string)

`string` | `number` | `bigint`

###### Returns

[`EtherType`](#ethertype)

Ether amount as branded string

###### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

###### Since

0.0.0

###### Throws

If value is not a valid number

###### Example

```typescript theme={null}
const ether1 = Ether.from(1n);        // "1"
const ether2 = Ether.from(1.5);       // "1.5"
const ether3 = Ether.from("1.5");     // "1.5"
const ether4 = Ether.from("0.001");   // "0.001"
```

##### fromGwei()

> **fromGwei**: (`gwei`) => [`EtherType`](#ethertype)

Convert Gwei to Ether

Converts gwei string to ether string (divides by 10^9).
Alias for Gwei.toEther().

###### Parameters

###### gwei

[`GweiType`](BrandedGwei.mdx#gweitype)

Amount in Gwei (string)

###### Returns

[`EtherType`](#ethertype)

Amount in Ether (string)

###### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

###### Since

0.0.0

###### Throws

###### Example

```typescript theme={null}
const ether1 = Ether.fromGwei(Gwei.from("1000000000")); // "1"
const ether2 = Ether.fromGwei(Gwei.from("1500000000")); // "1.5"
```

##### fromWei()

> **fromWei**: (`wei`) => [`EtherType`](#ethertype)

Convert Wei to Ether

Converts bigint wei to decimal string ether value.
Alias for Wei.toEther().

###### Parameters

###### wei

[`WeiType`](BrandedWei.mdx#weitype)

Amount in Wei (bigint)

###### Returns

[`EtherType`](#ethertype)

Amount in Ether (string with decimal precision)

###### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

###### Since

0.0.0

###### Throws

###### Example

```typescript theme={null}
const ether1 = Ether.fromWei(Wei.from(1000000000000000000n)); // "1"
const ether2 = Ether.fromWei(Wei.from(1500000000000000000n)); // "1.5"
```

##### toGwei()

> **toGwei**: (`ether`) => [`GweiType`](BrandedGwei.mdx#gweitype)

Convert Ether to Gwei

Converts ether string to gwei string (multiplies by 10^9).

###### Parameters

###### ether

[`EtherType`](#ethertype)

Amount in Ether (string)

###### Returns

[`GweiType`](BrandedGwei.mdx#gweitype)

Amount in Gwei (string)

###### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

###### Since

0.0.0

###### Throws

###### Example

```typescript theme={null}
const gwei1 = Ether.toGwei(Ether.from("1"));   // "1000000000"
const gwei2 = Ether.toGwei(Ether.from("1.5")); // "1500000000"
const gwei3 = Ether.toGwei(Ether.from("0.000000001")); // "1"
```

##### toU256()

> **toU256**: (`ether`) => [`Type`](../../primitives/Uint.mdx#type)

Convert Ether to Uint256 (in Wei)

Converts ether string to wei bigint, then returns as Uint256.

###### Parameters

###### ether

[`EtherType`](#ethertype)

Amount in Ether (string)

###### Returns

[`Type`](../../primitives/Uint.mdx#type)

Uint256 value in Wei

###### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

###### Since

0.0.0

###### Throws

If ether value has more than 18 decimal places

###### Example

```typescript theme={null}
const u256_1 = Ether.toU256(Ether.from("1"));   // 1000000000000000000n
const u256_2 = Ether.toU256(Ether.from("1.5")); // 1500000000000000000n
```

##### toWei()

> **toWei**: (`ether`) => [`WeiType`](BrandedWei.mdx#weitype)

Convert Ether to Wei

Parses decimal string and converts to bigint wei value.

###### Parameters

###### ether

[`EtherType`](#ethertype)

Amount in Ether (string, supports decimals like "1.5")

###### Returns

[`WeiType`](BrandedWei.mdx#weitype)

Amount in Wei (bigint)

###### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

###### Since

0.0.0

###### Throws

If ether value has more than 18 decimal places

###### Example

```typescript theme={null}
const wei1 = Ether.toWei(Ether.from("1"));     // 1000000000000000000n
const wei2 = Ether.toWei(Ether.from("1.5"));   // 1500000000000000000n
const wei3 = Ether.toWei(Ether.from("0.001")); // 1000000000000000n
```

***

### GWEI\_PER\_ETHER

> `const` **GWEI\_PER\_ETHER**: `1000000000n` = `1_000_000_000n`

Defined in: [src/primitives/Denomination/ether-constants.ts:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-constants.ts#L15)

Number of Gwei in one Ether (10^9)

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

***

### WEI\_PER\_ETHER

> `const` **WEI\_PER\_ETHER**: `1000000000000000000n` = `1_000_000_000_000_000_000n`

Defined in: [src/primitives/Denomination/ether-constants.ts:7](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-constants.ts#L7)

Number of Wei in one Ether (10^18)

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

## Functions

### from()

> **from**(`value`): [`EtherType`](#ethertype)

Defined in: [src/primitives/Denomination/ether-from.ts:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-from.ts#L21)

Create Ether from bigint, number, or string

Ether is a string type to support decimal values like "1.5" or "0.001"

#### Parameters

##### value

Value to convert (bigint, number, or string)

`string` | `number` | `bigint`

#### Returns

[`EtherType`](#ethertype)

Ether amount as branded string

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

#### Throws

If value is not a valid number

#### Example

```typescript theme={null}
const ether1 = Ether.from(1n);        // "1"
const ether2 = Ether.from(1.5);       // "1.5"
const ether3 = Ether.from("1.5");     // "1.5"
const ether4 = Ether.from("0.001");   // "0.001"
```

***

### fromGwei()

> **fromGwei**(`gwei`): [`EtherType`](#ethertype)

Defined in: [src/primitives/Denomination/ether-fromGwei.ts:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-fromGwei.ts#L22)

Convert Gwei to Ether

Converts gwei string to ether string (divides by 10^9).
Alias for Gwei.toEther().

#### Parameters

##### gwei

[`GweiType`](BrandedGwei.mdx#gweitype)

Amount in Gwei (string)

#### Returns

[`EtherType`](#ethertype)

Amount in Ether (string)

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

#### Throws

#### Example

```typescript theme={null}
const ether1 = Ether.fromGwei(Gwei.from("1000000000")); // "1"
const ether2 = Ether.fromGwei(Gwei.from("1500000000")); // "1.5"
```

***

### fromWei()

> **fromWei**(`wei`): [`EtherType`](#ethertype)

Defined in: [src/primitives/Denomination/ether-fromWei.ts:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-fromWei.ts#L22)

Convert Wei to Ether

Converts bigint wei to decimal string ether value.
Alias for Wei.toEther().

#### Parameters

##### wei

[`WeiType`](BrandedWei.mdx#weitype)

Amount in Wei (bigint)

#### Returns

[`EtherType`](#ethertype)

Amount in Ether (string with decimal precision)

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

#### Throws

#### Example

```typescript theme={null}
const ether1 = Ether.fromWei(Wei.from(1000000000000000000n)); // "1"
const ether2 = Ether.fromWei(Wei.from(1500000000000000000n)); // "1.5"
```

***

### toGwei()

> **toGwei**(`ether`): [`GweiType`](BrandedGwei.mdx#gweitype)

Defined in: [src/primitives/Denomination/ether-toGwei.ts:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-toGwei.ts#L23)

Convert Ether to Gwei

Converts ether string to gwei string (multiplies by 10^9).

#### Parameters

##### ether

[`EtherType`](#ethertype)

Amount in Ether (string)

#### Returns

[`GweiType`](BrandedGwei.mdx#gweitype)

Amount in Gwei (string)

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

#### Throws

#### Example

```typescript theme={null}
const gwei1 = Ether.toGwei(Ether.from("1"));   // "1000000000"
const gwei2 = Ether.toGwei(Ether.from("1.5")); // "1500000000"
const gwei3 = Ether.toGwei(Ether.from("0.000000001")); // "1"
```

***

### toU256()

> **toU256**(`ether`): [`Type`](../../primitives/Uint.mdx#type)

Defined in: [src/primitives/Denomination/ether-toU256.ts:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-toU256.ts#L21)

Convert Ether to Uint256 (in Wei)

Converts ether string to wei bigint, then returns as Uint256.

#### Parameters

##### ether

[`EtherType`](#ethertype)

Amount in Ether (string)

#### Returns

[`Type`](../../primitives/Uint.mdx#type)

Uint256 value in Wei

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

#### Throws

If ether value has more than 18 decimal places

#### Example

```typescript theme={null}
const u256_1 = Ether.toU256(Ether.from("1"));   // 1000000000000000000n
const u256_2 = Ether.toU256(Ether.from("1.5")); // 1500000000000000000n
```

***

### toWei()

> **toWei**(`ether`): [`WeiType`](BrandedWei.mdx#weitype)

Defined in: [src/primitives/Denomination/ether-toWei.ts:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Denomination/ether-toWei.ts#L23)

Convert Ether to Wei

Parses decimal string and converts to bigint wei value.

#### Parameters

##### ether

[`EtherType`](#ethertype)

Amount in Ether (string, supports decimals like "1.5")

#### Returns

[`WeiType`](BrandedWei.mdx#weitype)

Amount in Wei (bigint)

#### See

[https://voltaire.tevm.sh/primitives/denomination](https://voltaire.tevm.sh/primitives/denomination) for Denomination documentation

#### Since

0.0.0

#### Throws

If ether value has more than 18 decimal places

#### Example

```typescript theme={null}
const wei1 = Ether.toWei(Ether.from("1"));     // 1000000000000000000n
const wei2 = Ether.toWei(Ether.from("1.5"));   // 1500000000000000000n
const wei3 = Ether.toWei(Ether.from("0.001")); // 1000000000000000n
```
