> ## 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.

# primitives/Nonce

> Auto-generated API documentation

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

***

[@tevm/voltaire](../index.mdx) / primitives/Nonce

# primitives/Nonce

## Type Aliases

### NonceType

> **NonceType** = `bigint` & `object`

Defined in: [src/primitives/Nonce/NonceType.ts:7](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/NonceType.ts#L7)

Branded Nonce type - prevents nonce reuse/confusion
Represents a transaction nonce as a branded bigint

#### Type Declaration

##### \[brand]

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

## Variables

### Nonce

> `const` **Nonce**: (`value`) => [`NonceType`](#noncetype) & `object`

Defined in: [src/primitives/Nonce/index.ts:30](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/index.ts#L30)

#### Type Declaration

##### from()

> **from**: (`value`) => [`NonceType`](#noncetype)

Create Nonce from number, bigint, or hex string

###### Parameters

###### value

Value to convert

`string` | `number` | `bigint`

###### Returns

[`NonceType`](#noncetype)

Nonce

###### Example

```typescript theme={null}
const nonce1 = Nonce.from(0);
const nonce2 = Nonce.from(42n);
const nonce3 = Nonce.from("0x2a");
```

##### increment()

> **increment**: (`nonce`) => [`NonceType`](#noncetype)

###### Parameters

###### nonce

`string` | `number` | `bigint`

###### Returns

[`NonceType`](#noncetype)

##### toBigInt()

> **toBigInt**: (`nonce`) => `bigint`

###### Parameters

###### nonce

`string` | `number` | `bigint`

###### Returns

`bigint`

##### toNumber()

> **toNumber**: (`nonce`) => `number`

###### Parameters

###### nonce

`string` | `number` | `bigint`

###### Returns

`number`

## Functions

### \_increment()

> **\_increment**(`this`): [`NonceType`](#noncetype)

Defined in: [src/primitives/Nonce/increment.js:14](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/increment.js#L14)

Increment nonce by 1

#### Parameters

##### this

[`NonceType`](#noncetype)

#### Returns

[`NonceType`](#noncetype)

New nonce incremented by 1

#### Example

```typescript theme={null}
const next = Nonce._increment.call(nonce);
```

***

### \_toBigInt()

> **\_toBigInt**(`this`): `bigint`

Defined in: [src/primitives/Nonce/toBigInt.js:14](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/toBigInt.js#L14)

Convert Nonce to bigint

#### Parameters

##### this

[`NonceType`](#noncetype)

#### Returns

`bigint`

BigInt

#### Example

```typescript theme={null}
const n = Nonce._toBigInt.call(nonce);
```

***

### \_toNumber()

> **\_toNumber**(`this`): `number`

Defined in: [src/primitives/Nonce/toNumber.js:15](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/toNumber.js#L15)

Convert Nonce to number

#### Parameters

##### this

[`NonceType`](#noncetype)

#### Returns

`number`

Number

#### Throws

If nonce exceeds safe integer range

#### Example

```typescript theme={null}
const n = Nonce._toNumber.call(nonce);
```

***

### from()

> **from**(`value`): [`NonceType`](#noncetype)

Defined in: [src/primitives/Nonce/from.js:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/from.js#L16)

Create Nonce from number, bigint, or hex string

#### Parameters

##### value

Value to convert

`string` | `number` | `bigint`

#### Returns

[`NonceType`](#noncetype)

Nonce

#### Example

```typescript theme={null}
const nonce1 = Nonce.from(0);
const nonce2 = Nonce.from(42n);
const nonce3 = Nonce.from("0x2a");
```

***

### increment()

> **increment**(`nonce`): [`NonceType`](#noncetype)

Defined in: [src/primitives/Nonce/index.ts:22](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/index.ts#L22)

#### Parameters

##### nonce

`string` | `number` | `bigint`

#### Returns

[`NonceType`](#noncetype)

***

### toBigInt()

> **toBigInt**(`nonce`): `bigint`

Defined in: [src/primitives/Nonce/index.ts:18](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/index.ts#L18)

#### Parameters

##### nonce

`string` | `number` | `bigint`

#### Returns

`bigint`

***

### toNumber()

> **toNumber**(`nonce`): `number`

Defined in: [src/primitives/Nonce/index.ts:14](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Nonce/index.ts#L14)

#### Parameters

##### nonce

`string` | `number` | `bigint`

#### Returns

`number`
