@tevm/voltaire / primitives/StateDiff
primitives/StateDiff
Type Aliases
AccountDiff
AccountDiff = object
Defined in: src/primitives/StateDiff/StateDiffType.ts:37
Account state changes during transaction execution
Captures all state modifications for a single account.
Used extensively by debug_traceTransaction with prestateTracer.
Properties
balance?
Defined in: src/primitives/StateDiff/StateDiffType.ts:38readonlyoptionalbalance:BalanceChange
code?
Defined in: src/primitives/StateDiff/StateDiffType.ts:40readonlyoptionalcode:CodeChange
nonce?
Defined in: src/primitives/StateDiff/StateDiffType.ts:39readonlyoptionalnonce:NonceChange
storage?
Defined in: src/primitives/StateDiff/StateDiffType.ts:41readonlyoptionalstorage:ReadonlyMap<StorageKeyType, {from:StorageValueType|null;to:StorageValueType|null; }>
BalanceChange
BalanceChange = object
Defined in: src/primitives/StateDiff/StateDiffType.ts:10
Balance change (before/after)
Properties
from
Defined in: src/primitives/StateDiff/StateDiffType.ts:11readonlyfrom:WeiType|null
to
Defined in: src/primitives/StateDiff/StateDiffType.ts:12readonlyto:WeiType|null
CodeChange
CodeChange = object
Defined in: src/primitives/StateDiff/StateDiffType.ts:26
Code change (before/after)
Properties
from
Defined in: src/primitives/StateDiff/StateDiffType.ts:27readonlyfrom:Uint8Array|null
to
Defined in: src/primitives/StateDiff/StateDiffType.ts:28readonlyto:Uint8Array|null
NonceChange
NonceChange = object
Defined in: src/primitives/StateDiff/StateDiffType.ts:18
Nonce change (before/after)
Properties
from
Defined in: src/primitives/StateDiff/StateDiffType.ts:19readonlyfrom:NonceType|null
to
Defined in: src/primitives/StateDiff/StateDiffType.ts:20readonlyto:NonceType|null
StateDiffType
StateDiffType = object
Defined in: src/primitives/StateDiff/StateDiffType.ts:71
Complete state changes across all accounts
Represents full state diff from debug_traceTransaction prestateTracer.
Maps addresses to their account-level changes.
Example
Properties
accounts
Defined in: src/primitives/StateDiff/StateDiffType.ts:75 Map of account addresses to their state changesreadonlyaccounts:ReadonlyMap<AddressType,AccountDiff>
Variables
StateDiff
Defined in: src/primitives/StateDiff/index.ts:59constStateDiff:object
Type Declaration
from()
from: (Create StateDiff from account changesvalue) =>StateDiffType=_from
Parameters
value
Account changes map, array, or objectMap<AddressType, AccountDiff> | [AddressType, AccountDiff][] | { accounts: Map<AddressType, AccountDiff>; }
Returns
StateDiffType
StateDiff
Example
getAccount()
getAccount: (diff,address) =>AccountDiff|undefined
Parameters
diff
StateDiffType | Map<AddressType, AccountDiff>
address
AddressType
Returns
AccountDiff | undefined
getAddresses()
getAddresses: (diff) =>AddressType[]
Parameters
diff
StateDiffType | Map<AddressType, AccountDiff>
Returns
AddressType[]
isEmpty()
isEmpty: (diff) =>boolean
Parameters
diff
StateDiffType | Map<AddressType, AccountDiff>
Returns
boolean
Functions
_getAccount()
_getAccount(Defined in: src/primitives/StateDiff/getAccount.js:16 Get account diff for a specific addressdiff,address):AccountDiff|undefined
Parameters
diff
StateDiffType
State diff
address
AddressType
Address to look up
Returns
AccountDiff | undefined
Account diff or undefined
Example
_getAddresses()
_getAddresses(Defined in: src/primitives/StateDiff/getAddresses.js:15 Get all addresses with state changesdiff):AddressType[]
Parameters
diff
StateDiffType
State diff
Returns
AddressType[]
Array of addresses
Example
_isEmpty()
_isEmpty(Defined in: src/primitives/StateDiff/isEmpty.js:14 Check if state diff has any changesdiff):boolean
Parameters
diff
StateDiffType
State diff
Returns
boolean
True if no accounts have changes
Example
from()
from(Defined in: src/primitives/StateDiff/from.js:14 Create StateDiff from account changesvalue):StateDiffType
Parameters
value
Account changes map, array, or objectMap<AddressType, AccountDiff> | [AddressType, AccountDiff][] | { accounts: Map<AddressType, AccountDiff>; }
Returns
StateDiffType
StateDiff
Example
getAccount()
getAccount(Defined in: src/primitives/StateDiff/index.ts:18diff,address):AccountDiff|undefined
Parameters
diff
StateDiffType | Map<AddressType, AccountDiff>
address
AddressType
Returns
AccountDiff | undefined
getAddresses()
getAddresses(Defined in: src/primitives/StateDiff/index.ts:31diff):AddressType[]
Parameters
diff
StateDiffType | Map<AddressType, AccountDiff>
Returns
AddressType[]
isEmpty()
isEmpty(Defined in: src/primitives/StateDiff/index.ts:43diff):boolean
Parameters
diff
StateDiffType | Map<AddressType, AccountDiff>
Returns
boolean
