Skip to content

Latest commit

 

History

History
212 lines (122 loc) · 4.82 KB

Withdrawal.md

File metadata and controls

212 lines (122 loc) · 4.82 KB

@ethereumjs/util / Withdrawal

Class: Withdrawal

Representation of EIP-4895 withdrawal data

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Withdrawal(index, validatorIndex, address, amount)

This constructor assigns and validates the values. Use the static factory methods to assist in creating a Withdrawal object from varying data types. Its amount is in Gwei to match CL representation and for eventual ssz withdrawalsRoot

Parameters

Name Type Description
index bigint -
validatorIndex bigint -
address Address -
amount bigint withdrawal amount in Gwei to match the CL repesentation and eventually ssz withdrawalsRoot

Defined in

packages/util/src/withdrawal.ts:41

Properties

address

Readonly address: Address

Defined in

packages/util/src/withdrawal.ts:44


amount

Readonly amount: bigint

withdrawal amount in Gwei to match the CL repesentation and eventually ssz withdrawalsRoot

Defined in

packages/util/src/withdrawal.ts:48


index

Readonly index: bigint

Defined in

packages/util/src/withdrawal.ts:42


validatorIndex

Readonly validatorIndex: bigint

Defined in

packages/util/src/withdrawal.ts:43

Methods

raw

raw(): WithdrawalBytes

Returns

WithdrawalBytes

Defined in

packages/util/src/withdrawal.ts:100


toJSON

toJSON(): Object

Returns

Object

Name Type
address string
amount string
index string
validatorIndex string

Defined in

packages/util/src/withdrawal.ts:113


toValue

toValue(): Object

Returns

Object

Name Type
address Uint8Array
amount bigint
index bigint
validatorIndex bigint

Defined in

packages/util/src/withdrawal.ts:104


fromValuesArray

Static fromValuesArray(withdrawalArray): Withdrawal

Parameters

Name Type
withdrawalArray WithdrawalBytes

Returns

Withdrawal

Defined in

packages/util/src/withdrawal.ts:66


fromWithdrawalData

Static fromWithdrawalData(withdrawalData): Withdrawal

Parameters

Name Type
withdrawalData WithdrawalData

Returns

Withdrawal

Defined in

packages/util/src/withdrawal.ts:51


toBytesArray

Static toBytesArray(withdrawal): WithdrawalBytes

Convert a withdrawal to a buffer array

Parameters

Name Type Description
withdrawal WithdrawalData | Withdrawal the withdrawal to convert

Returns

WithdrawalBytes

buffer array of the withdrawal

Defined in

packages/util/src/withdrawal.ts:79