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

> Auto-generated API documentation

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

***

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

# primitives/StructLog

## Type Aliases

### StructLogType

> **StructLogType** = `object`

Defined in: [src/primitives/StructLog/StructLogType.ts:11](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/StructLogType.ts#L11)

Geth-style structured execution log entry
Each entry represents one opcode execution with human-readable formatting

#### See

[https://voltaire.tevm.sh/primitives/struct-log](https://voltaire.tevm.sh/primitives/struct-log) for StructLog documentation

#### Since

0.0.0

#### Properties

##### \[brand]

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

Defined in: [src/primitives/StructLog/StructLogType.ts:12](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/StructLogType.ts#L12)

##### depth

> `readonly` **depth**: `number`

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

Call depth (0 for top-level call)

##### error?

> `readonly` `optional` **error**: `string`

Defined in: [src/primitives/StructLog/StructLogType.ts:32](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/StructLogType.ts#L32)

Error message if operation failed

##### gas

> `readonly` **gas**: [`Type`](Uint.mdx#type)

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

Remaining gas before this operation

##### gasCost

> `readonly` **gasCost**: [`Type`](Uint.mdx#type)

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

Gas cost for this operation

##### memory?

> `readonly` `optional` **memory**: readonly `string`\[]

Defined in: [src/primitives/StructLog/StructLogType.ts:26](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/StructLogType.ts#L26)

Memory contents as 32-byte hex chunks

##### op

> `readonly` **op**: `string`

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

Opcode name (e.g., "PUSH1", "ADD", "SSTORE")

##### pc

> `readonly` **pc**: `number`

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

Program counter

##### refund?

> `readonly` `optional` **refund**: [`Type`](Uint.mdx#type)

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

Gas refund counter

##### stack

> `readonly` **stack**: readonly `string`\[]

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

Stack contents as hex strings (top to bottom)

##### storage?

> `readonly` `optional` **storage**: `Record`\<`string`, `string`>

Defined in: [src/primitives/StructLog/StructLogType.ts:28](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/StructLogType.ts#L28)

Storage changes (hex key -> hex value)

## Functions

### \_from()

> **\_from**(`data`): [`StructLogType`](#structlogtype)

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

Creates a StructLog from raw data

#### Parameters

##### data

StructLog data

###### depth

`number`

Call depth

###### error?

`string`

Error message

###### gas

[`Type`](Uint.mdx#type)

Remaining gas

###### gasCost

[`Type`](Uint.mdx#type)

Gas cost

###### memory?

readonly `string`\[]

Memory as hex chunks

###### op

`string`

Opcode name

###### pc

`number`

Program counter

###### refund?

[`Type`](Uint.mdx#type)

Gas refund

###### stack

readonly `string`\[]

Stack as hex strings

###### storage?

`Record`\<`string`, `string`>

Storage changes

#### Returns

[`StructLogType`](#structlogtype)

StructLog instance

#### Example

```javascript theme={null}
import { from } from './from.js';
const log = from({
  pc: 0,
  op: "PUSH1",
  gas: 1000000n,
  gasCost: 3n,
  depth: 0,
  stack: ["0x60"]
});
```

***

### \_toOpStep()

> **\_toOpStep**(`log`): [`OpStepType`](OpStep.mdx#opsteptype)

Defined in: [src/primitives/StructLog/toOpStep.js:13](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/toOpStep.js#L13)

Converts a StructLog to an OpStep
Parses hex strings back to typed values

#### Parameters

##### log

[`StructLogType`](#structlogtype)

StructLog to convert

#### Returns

[`OpStepType`](OpStep.mdx#opsteptype)

OpStep instance

#### Example

```javascript theme={null}
import { toOpStep } from './toOpStep.js';
const step = toOpStep(structLog);
```

***

### from()

> **from**(`data`): [`StructLogType`](#structlogtype)

Defined in: [src/primitives/StructLog/index.ts:23](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/index.ts#L23)

Creates a StructLog from raw data

#### Parameters

##### data

`Omit`\<[`StructLogType`](#structlogtype), `brand`>

StructLog data

#### Returns

[`StructLogType`](#structlogtype)

StructLog instance

#### See

[https://voltaire.tevm.sh/primitives/struct-log](https://voltaire.tevm.sh/primitives/struct-log) for StructLog documentation

#### Since

0.0.0

#### Example

```typescript theme={null}
import { StructLog } from './primitives/StructLog/index.js';
const log = StructLog.from({ pc: 0, op: "PUSH1", gas: 1000000n, gasCost: 3n, depth: 0, stack: [] });
```

***

### toOpStep()

> **toOpStep**(`log`): [`OpStepType`](OpStep.mdx#opsteptype)

Defined in: [src/primitives/StructLog/index.ts:40](https://github.com/evmts/voltaire/blob/bd6ec34405c15ad8cd51d11579d495dc53813482/src/primitives/StructLog/index.ts#L40)

Converts a StructLog to an OpStep

#### Parameters

##### log

[`StructLogType`](#structlogtype)

StructLog to convert

#### Returns

[`OpStepType`](OpStep.mdx#opsteptype)

OpStep instance

#### Example

```typescript theme={null}
import { StructLog } from './primitives/StructLog/index.js';
const step = StructLog.toOpStep(log);
```
