@tevm/voltaire / primitives/WithdrawalIndex
primitives/WithdrawalIndex
Type Aliases
WithdrawalIndexType
WithdrawalIndexType =Defined in: src/primitives/WithdrawalIndex/WithdrawalIndexType.ts:13 WithdrawalIndex type Represents the global withdrawal counter in the beacon chain (EIP-4895). This counter increments monotonically for each withdrawal processed.bigint&object
Type Declaration
[brand]
readonly[brand]:"WithdrawalIndex"
See
- https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentation
- https://eips.ethereum.org/EIPS/eip-4895 for EIP-4895 specification
Since
0.0.0Variables
WithdrawalIndex
Defined in: src/primitives/WithdrawalIndex/index.ts:10constWithdrawalIndex:object
Type Declaration
equals()
equals: (Check if WithdrawalIndex values are equala,b) =>boolean
Parameters
a
WithdrawalIndexType
First withdrawal index
b
WithdrawalIndexType
Second withdrawal index
Returns
boolean
true if equal
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
Example
from()
from: (Create WithdrawalIndex from number, bigint, or stringvalue) =>WithdrawalIndexType
Parameters
value
Withdrawal index (number, bigint, or decimal/hex string)string | number | bigint
Returns
WithdrawalIndexType
WithdrawalIndex value
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
If value is negative or invalidExample
toBigInt()
toBigInt: (Convert WithdrawalIndex to bigintindex) =>bigint
Parameters
index
WithdrawalIndexType
WithdrawalIndex value
Returns
bigint
BigInt representation
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
Example
toNumber()
toNumber: (Convert WithdrawalIndex to numberindex) =>number
Parameters
index
WithdrawalIndexType
WithdrawalIndex value
Returns
number
Number representation
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
If index exceeds safe integer rangeExample
Functions
equals()
equals(Defined in: src/primitives/WithdrawalIndex/equals.js:18 Check if WithdrawalIndex values are equala,b):boolean
Parameters
a
WithdrawalIndexType
First withdrawal index
b
WithdrawalIndexType
Second withdrawal index
Returns
boolean
true if equal
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
Example
from()
from(Defined in: src/primitives/WithdrawalIndex/from.js:17 Create WithdrawalIndex from number, bigint, or stringvalue):WithdrawalIndexType
Parameters
value
Withdrawal index (number, bigint, or decimal/hex string)string | number | bigint
Returns
WithdrawalIndexType
WithdrawalIndex value
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
If value is negative or invalidExample
toBigInt()
toBigInt(Defined in: src/primitives/WithdrawalIndex/toBigInt.js:16 Convert WithdrawalIndex to bigintindex):bigint
Parameters
index
WithdrawalIndexType
WithdrawalIndex value
Returns
bigint
BigInt representation
See
https://voltaire.tevm.sh/primitives/withdrawal-index for WithdrawalIndex documentationSince
0.0.0Throws
Example
toNumber()
toNumber(Defined in: src/primitives/WithdrawalIndex/toNumber.js:16 Convert WithdrawalIndex to numberindex):number
Parameters
index
WithdrawalIndexType
WithdrawalIndex value
Returns
number
Number representation

