> ## 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/Withdrawal

> Auto-generated API documentation

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

***

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

# primitives/Withdrawal

## Type Aliases

### WithdrawalType

> **WithdrawalType** = `object`

Defined in: [src/primitives/Withdrawal/WithdrawalType.ts:16](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Withdrawal/WithdrawalType.ts#L16)

Withdrawal type - represents Ethereum withdrawal (post-merge)

Post-merge (Shanghai/Capella upgrade) withdrawal from beacon chain
validators to execution layer accounts

#### See

* [https://voltaire.tevm.sh/primitives/withdrawal](https://voltaire.tevm.sh/primitives/withdrawal) for Withdrawal documentation
* [https://eips.ethereum.org/EIPS/eip-4895](https://eips.ethereum.org/EIPS/eip-4895) for EIP-4895 specification

#### Since

0.0.0

#### Properties

##### address

> `readonly` **address**: [`AddressType`](Address.mdx#addresstype)

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

Address receiving withdrawal

##### amount

> `readonly` **amount**: [`GweiType`](../index/namespaces/BrandedGwei.mdx#gweitype)

Defined in: [src/primitives/Withdrawal/WithdrawalType.ts:24](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Withdrawal/WithdrawalType.ts#L24)

Amount in Gwei

##### index

> `readonly` **index**: [`WithdrawalIndexType`](WithdrawalIndex.mdx#withdrawalindextype)

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

Withdrawal index (monotonically increasing)

##### validatorIndex

> `readonly` **validatorIndex**: [`ValidatorIndexType`](ValidatorIndex.mdx#validatorindextype)

Defined in: [src/primitives/Withdrawal/WithdrawalType.ts:20](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Withdrawal/WithdrawalType.ts#L20)

Validator index on beacon chain

## Variables

### Withdrawal

> `const` **Withdrawal**: `object`

Defined in: [src/primitives/Withdrawal/index.ts:8](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Withdrawal/index.ts#L8)

#### Type Declaration

##### equals()

> **equals**: (`a`, `b`) => `boolean`

Check if Withdrawal values are equal

###### Parameters

###### a

[`WithdrawalType`](#withdrawaltype)

First withdrawal

###### b

[`WithdrawalType`](#withdrawaltype)

Second withdrawal

###### Returns

`boolean`

true if equal

###### See

[https://voltaire.tevm.sh/primitives/withdrawal](https://voltaire.tevm.sh/primitives/withdrawal) for Withdrawal documentation

###### Since

0.0.0

###### Throws

###### Example

```javascript theme={null}
import * as Withdrawal from './primitives/Withdrawal/index.js';
const a = Withdrawal.from({ index: 1n, validatorIndex: 1, address: "0x...", amount: 100n });
const b = Withdrawal.from({ index: 1n, validatorIndex: 1, address: "0x...", amount: 100n });
const result = Withdrawal.equals(a, b); // true
```

##### from()

> **from**: (`params`) => [`WithdrawalType`](#withdrawaltype)

Create Withdrawal from components

###### Parameters

###### params

Withdrawal parameters

###### address

`string` | `Uint8Array`\<`ArrayBufferLike`> | [`AddressType`](Address.mdx#addresstype)

Withdrawal recipient address

###### amount

`string` | `number` | `bigint` | [`GweiType`](../index/namespaces/BrandedGwei.mdx#gweitype)

Amount in Gwei

###### index

`string` | `number` | `bigint` | [`WithdrawalIndexType`](WithdrawalIndex.mdx#withdrawalindextype)

Global withdrawal counter

###### validatorIndex

`string` | `number` | `bigint` | [`ValidatorIndexType`](ValidatorIndex.mdx#validatorindextype)

Validator index

###### Returns

[`WithdrawalType`](#withdrawaltype)

Withdrawal

###### See

[https://voltaire.tevm.sh/primitives/withdrawal](https://voltaire.tevm.sh/primitives/withdrawal) for Withdrawal documentation

###### Since

0.0.0

###### Throws

If any parameter is invalid

###### Example

```javascript theme={null}
import * as Withdrawal from './primitives/Withdrawal/index.js';
const withdrawal = Withdrawal.from({
  index: 1000000n,
  validatorIndex: 123456,
  address: "0x742d35Cc6634C0532925a3b844Bc9e7595f251e3",
  amount: 32000000000n, // 32 ETH in Gwei
});
```

## Functions

### equals()

> **equals**(`a`, `b`): `boolean`

Defined in: [src/primitives/Withdrawal/equals.js:21](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Withdrawal/equals.js#L21)

Check if Withdrawal values are equal

#### Parameters

##### a

[`WithdrawalType`](#withdrawaltype)

First withdrawal

##### b

[`WithdrawalType`](#withdrawaltype)

Second withdrawal

#### Returns

`boolean`

true if equal

#### See

[https://voltaire.tevm.sh/primitives/withdrawal](https://voltaire.tevm.sh/primitives/withdrawal) for Withdrawal documentation

#### Since

0.0.0

#### Throws

#### Example

```javascript theme={null}
import * as Withdrawal from './primitives/Withdrawal/index.js';
const a = Withdrawal.from({ index: 1n, validatorIndex: 1, address: "0x...", amount: 100n });
const b = Withdrawal.from({ index: 1n, validatorIndex: 1, address: "0x...", amount: 100n });
const result = Withdrawal.equals(a, b); // true
```

***

### from()

> **from**(`params`): [`WithdrawalType`](#withdrawaltype)

Defined in: [src/primitives/Withdrawal/from.js:29](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/Withdrawal/from.js#L29)

Create Withdrawal from components

#### Parameters

##### params

Withdrawal parameters

###### address

`string` | `Uint8Array`\<`ArrayBufferLike`> | [`AddressType`](Address.mdx#addresstype)

Withdrawal recipient address

###### amount

`string` | `number` | `bigint` | [`GweiType`](../index/namespaces/BrandedGwei.mdx#gweitype)

Amount in Gwei

###### index

`string` | `number` | `bigint` | [`WithdrawalIndexType`](WithdrawalIndex.mdx#withdrawalindextype)

Global withdrawal counter

###### validatorIndex

`string` | `number` | `bigint` | [`ValidatorIndexType`](ValidatorIndex.mdx#validatorindextype)

Validator index

#### Returns

[`WithdrawalType`](#withdrawaltype)

Withdrawal

#### See

[https://voltaire.tevm.sh/primitives/withdrawal](https://voltaire.tevm.sh/primitives/withdrawal) for Withdrawal documentation

#### Since

0.0.0

#### Throws

If any parameter is invalid

#### Example

```javascript theme={null}
import * as Withdrawal from './primitives/Withdrawal/index.js';
const withdrawal = Withdrawal.from({
  index: 1000000n,
  validatorIndex: 123456,
  address: "0x742d35Cc6634C0532925a3b844Bc9e7595f251e3",
  amount: 32000000000n, // 32 ETH in Gwei
});
```
