# get_transaction_logs

Returns logs from a transaction receipt, optionally filtered by emitter or indexed topics. Supply an event signature or JSON ABI to append typed decoded fields.

Canonical HTML: <https://determica.com/docs/functions/get_transaction_logs>

- Kind: table function
- Category: [Chain reads](/docs/category/chain-reads.md)
- Tags: RPC

Returns logs from a transaction receipt, optionally filtered by emitter or indexed topics. Supply an event signature or JSON ABI to append typed decoded fields.

## Overload 1: get_transaction_logs(CLIENT, BYTES32, VARCHAR)

```sql
get_transaction_logs(CLIENT, BYTES32, VARCHAR)
```

Accepts a human-readable event signature and appends its decoded event parameters.

- Kind: table
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: Zero Or More
- Determinism: External State
- Return shape: Table
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT for the chain where the transaction exists.
- `tx_hash` (BYTES32; required; positional) — Chain-scoped transaction hash as BYTES32 or a 0x-prefixed 64-digit hexadecimal VARCHAR.
- `event_signature` (VARCHAR; required; positional) — Human-readable event signature or JSON event ABI, depending on the selected overload. It filters matching logs and defines the appended decoded columns.
- `address` (ADDRESS or ADDRESS[]; optional; named) — Return only logs emitted by this address, or by any address in the list.
- `topic2` (BYTES32 or list; optional; named) — Exact value or OR-list for the second indexed parameter; a constant or a column read per row.
- `topic0` (BYTES32 or BYTES32[]; optional; named) — Exact value or OR-list; the event selector for non-anonymous events.
- `topic3` (BYTES32 or list; optional; named) — Exact value or OR-list for the third indexed parameter; a constant or a column read per row.
- `topic1` (BYTES32 or list; optional; named) — Exact value or OR-list for the first indexed parameter; a constant or a column read per row.

### Result columns

Receipt log columns plus decoded event columns

Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

- `address` (ADDRESS) — Log emitter.
- `block_hash` (BYTES32) — Containing block hash.
- `block_number` (BLOCK_NUMBER) — Containing block height.
- `block_timestamp` (TIMESTAMP) — Containing block time in UTC from the receipt's log; NULL when the provider omits it.
- `transaction_hash` (BYTES32) — Emitting transaction hash.
- `transaction_index` (INTEGER) — Transaction position in the block.
- `log_index` (INTEGER) — Log position in the block.
- `data` (BYTES) — Encoded non-indexed parameters.
- `removed` (BOOLEAN) — Whether a reorganization removed the log.
- `topics` (BYTES32[]) — Ordered indexed event topics.
- `...` (ABI-derived columns; dynamic) — Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

### Dynamic columns

- Source: event_signature or event_abi
- Names: Event parameter names
- Types: Mapped from each event parameter type
- Description: Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

Receipt log columns plus decoded event columns. Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

### Examples

_Named parameters · Needs RPC · RPC required_

```sql
-- WETH Transfer events emitted by one transaction
SELECT
  transaction_hash,
  log_index,
  "from" AS sender,
  "to" AS recipient,
  format_units(value, 18) AS weth_amount
FROM get_transaction_logs(
  $client,
  '0x9517e2bc102ae3cde3963c2d2811b64402c3ddaa562206a42a0a1472aadd93a4'::BYTES32,
  'event Transfer(address indexed from, address indexed to, uint256 value)',
  address := '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'::ADDRESS
);
```

## Overload 2: get_transaction_logs(CLIENT, VARCHAR, VARCHAR)

```sql
get_transaction_logs(CLIENT, VARCHAR, VARCHAR)
```

Accepts a human-readable event signature and appends its decoded event parameters.

- Kind: table
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: Zero Or More
- Determinism: External State
- Return shape: Table
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT for the chain where the transaction exists.
- `tx_hash` (VARCHAR; required; positional) — Chain-scoped transaction hash as BYTES32 or a 0x-prefixed 64-digit hexadecimal VARCHAR.
- `event_signature` (VARCHAR; required; positional) — Human-readable event signature or JSON event ABI, depending on the selected overload. It filters matching logs and defines the appended decoded columns.
- `address` (ADDRESS or ADDRESS[]; optional; named) — Return only logs emitted by this address, or by any address in the list.
- `topic2` (BYTES32 or list; optional; named) — Exact value or OR-list for the second indexed parameter; a constant or a column read per row.
- `topic0` (BYTES32 or BYTES32[]; optional; named) — Exact value or OR-list; the event selector for non-anonymous events.
- `topic3` (BYTES32 or list; optional; named) — Exact value or OR-list for the third indexed parameter; a constant or a column read per row.
- `topic1` (BYTES32 or list; optional; named) — Exact value or OR-list for the first indexed parameter; a constant or a column read per row.

### Result columns

Receipt log columns plus decoded event columns

Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

- `address` (ADDRESS) — Log emitter.
- `block_hash` (BYTES32) — Containing block hash.
- `block_number` (BLOCK_NUMBER) — Containing block height.
- `block_timestamp` (TIMESTAMP) — Containing block time in UTC from the receipt's log; NULL when the provider omits it.
- `transaction_hash` (BYTES32) — Emitting transaction hash.
- `transaction_index` (INTEGER) — Transaction position in the block.
- `log_index` (INTEGER) — Log position in the block.
- `data` (BYTES) — Encoded non-indexed parameters.
- `removed` (BOOLEAN) — Whether a reorganization removed the log.
- `topics` (BYTES32[]) — Ordered indexed event topics.
- `...` (ABI-derived columns; dynamic) — Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

### Dynamic columns

- Source: event_signature or event_abi
- Names: Event parameter names
- Types: Mapped from each event parameter type
- Description: Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

Receipt log columns plus decoded event columns. Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

## Overload 3: get_transaction_logs(CLIENT, BYTES32)

```sql
get_transaction_logs(CLIENT, BYTES32)
```

Returns receipt log metadata, topics, and data without adding decoded event columns.

- Kind: table
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: Zero Or More
- Determinism: External State
- Return shape: Table
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT for the chain where the transaction exists.
- `tx_hash` (BYTES32; required; positional) — Chain-scoped transaction hash as BYTES32 or a 0x-prefixed 64-digit hexadecimal VARCHAR.
- `address` (ADDRESS or ADDRESS[]; optional; named) — Return only logs emitted by this address, or by any address in the list.
- `topic2` (BYTES32 or list; optional; named) — Exact value or OR-list for the second indexed parameter; a constant or a column read per row.
- `topic0` (BYTES32 or BYTES32[]; optional; named) — Exact value or OR-list; the event selector for non-anonymous events.
- `topic3` (BYTES32 or list; optional; named) — Exact value or OR-list for the third indexed parameter; a constant or a column read per row.
- `topic1` (BYTES32 or list; optional; named) — Exact value or OR-list for the first indexed parameter; a constant or a column read per row.

### Result columns

Receipt log columns

Returns raw receipt log metadata, topics, and data without ABI-decoded fields.

- `address` (ADDRESS) — Log emitter.
- `block_hash` (BYTES32) — Containing block hash.
- `block_number` (BLOCK_NUMBER) — Containing block height.
- `block_timestamp` (TIMESTAMP) — Containing block time in UTC from the receipt's log; NULL when the provider omits it.
- `transaction_hash` (BYTES32) — Emitting transaction hash.
- `transaction_index` (INTEGER) — Transaction position in the block.
- `log_index` (INTEGER) — Log position in the block.
- `data` (BYTES) — Encoded non-indexed parameters.
- `removed` (BOOLEAN) — Whether a reorganization removed the log.
- `topics` (BYTES32[]) — Ordered indexed event topics.

Receipt log columns. Returns raw receipt log metadata, topics, and data without ABI-decoded fields.

### Examples

_Named parameters · Needs RPC · RPC required_

```sql
-- Every raw log in one transaction receipt
SELECT address, log_index, topics, data
FROM get_transaction_logs(
  $client,
  '0x9517e2bc102ae3cde3963c2d2811b64402c3ddaa562206a42a0a1472aadd93a4'::BYTES32
);
```

## Overload 4: get_transaction_logs(CLIENT, VARCHAR)

```sql
get_transaction_logs(CLIENT, VARCHAR)
```

Returns receipt log metadata, topics, and data without adding decoded event columns.

- Kind: table
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: Zero Or More
- Determinism: External State
- Return shape: Table
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT for the chain where the transaction exists.
- `tx_hash` (VARCHAR; required; positional) — Chain-scoped transaction hash as BYTES32 or a 0x-prefixed 64-digit hexadecimal VARCHAR.
- `address` (ADDRESS or ADDRESS[]; optional; named) — Return only logs emitted by this address, or by any address in the list.
- `topic2` (BYTES32 or list; optional; named) — Exact value or OR-list for the second indexed parameter; a constant or a column read per row.
- `topic0` (BYTES32 or BYTES32[]; optional; named) — Exact value or OR-list; the event selector for non-anonymous events.
- `topic3` (BYTES32 or list; optional; named) — Exact value or OR-list for the third indexed parameter; a constant or a column read per row.
- `topic1` (BYTES32 or list; optional; named) — Exact value or OR-list for the first indexed parameter; a constant or a column read per row.

### Result columns

Receipt log columns

Returns raw receipt log metadata, topics, and data without ABI-decoded fields.

- `address` (ADDRESS) — Log emitter.
- `block_hash` (BYTES32) — Containing block hash.
- `block_number` (BLOCK_NUMBER) — Containing block height.
- `block_timestamp` (TIMESTAMP) — Containing block time in UTC from the receipt's log; NULL when the provider omits it.
- `transaction_hash` (BYTES32) — Emitting transaction hash.
- `transaction_index` (INTEGER) — Transaction position in the block.
- `log_index` (INTEGER) — Log position in the block.
- `data` (BYTES) — Encoded non-indexed parameters.
- `removed` (BOOLEAN) — Whether a reorganization removed the log.
- `topics` (BYTES32[]) — Ordered indexed event topics.

Receipt log columns. Returns raw receipt log metadata, topics, and data without ABI-decoded fields.

## Overload 5: get_transaction_logs(CLIENT, BYTES32, JSON)

```sql
get_transaction_logs(CLIENT, BYTES32, JSON)
```

Accepts a JSON event ABI fragment and appends its decoded event parameters.

- Kind: table
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: Zero Or More
- Determinism: External State
- Return shape: Table
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT for the chain where the transaction exists.
- `tx_hash` (BYTES32; required; positional) — Chain-scoped transaction hash as BYTES32 or a 0x-prefixed 64-digit hexadecimal VARCHAR.
- `event_abi` (JSON; required; positional) — Human-readable event signature or JSON event ABI, depending on the selected overload. It filters matching logs and defines the appended decoded columns.
- `address` (ADDRESS or ADDRESS[]; optional; named) — Return only logs emitted by this address, or by any address in the list.
- `topic2` (BYTES32 or list; optional; named) — Exact value or OR-list for the second indexed parameter; a constant or a column read per row.
- `topic0` (BYTES32 or BYTES32[]; optional; named) — Exact value or OR-list; the event selector for non-anonymous events.
- `topic3` (BYTES32 or list; optional; named) — Exact value or OR-list for the third indexed parameter; a constant or a column read per row.
- `topic1` (BYTES32 or list; optional; named) — Exact value or OR-list for the first indexed parameter; a constant or a column read per row.

### Result columns

Receipt log columns plus decoded event columns

Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

- `address` (ADDRESS) — Log emitter.
- `block_hash` (BYTES32) — Containing block hash.
- `block_number` (BLOCK_NUMBER) — Containing block height.
- `block_timestamp` (TIMESTAMP) — Containing block time in UTC from the receipt's log; NULL when the provider omits it.
- `transaction_hash` (BYTES32) — Emitting transaction hash.
- `transaction_index` (INTEGER) — Transaction position in the block.
- `log_index` (INTEGER) — Log position in the block.
- `data` (BYTES) — Encoded non-indexed parameters.
- `removed` (BOOLEAN) — Whether a reorganization removed the log.
- `topics` (BYTES32[]) — Ordered indexed event topics.
- `...` (ABI-derived columns; dynamic) — Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

### Dynamic columns

- Source: event_signature or event_abi
- Names: Event parameter names
- Types: Mapped from each event parameter type
- Description: Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

Receipt log columns plus decoded event columns. Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

## Overload 6: get_transaction_logs(CLIENT, VARCHAR, JSON)

```sql
get_transaction_logs(CLIENT, VARCHAR, JSON)
```

Accepts a JSON event ABI fragment and appends its decoded event parameters.

- Kind: table
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: Zero Or More
- Determinism: External State
- Return shape: Table
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT for the chain where the transaction exists.
- `tx_hash` (VARCHAR; required; positional) — Chain-scoped transaction hash as BYTES32 or a 0x-prefixed 64-digit hexadecimal VARCHAR.
- `event_abi` (JSON; required; positional) — Human-readable event signature or JSON event ABI, depending on the selected overload. It filters matching logs and defines the appended decoded columns.
- `address` (ADDRESS or ADDRESS[]; optional; named) — Return only logs emitted by this address, or by any address in the list.
- `topic2` (BYTES32 or list; optional; named) — Exact value or OR-list for the second indexed parameter; a constant or a column read per row.
- `topic0` (BYTES32 or BYTES32[]; optional; named) — Exact value or OR-list; the event selector for non-anonymous events.
- `topic3` (BYTES32 or list; optional; named) — Exact value or OR-list for the third indexed parameter; a constant or a column read per row.
- `topic1` (BYTES32 or list; optional; named) — Exact value or OR-list for the first indexed parameter; a constant or a column read per row.

### Result columns

Receipt log columns plus decoded event columns

Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

- `address` (ADDRESS) — Log emitter.
- `block_hash` (BYTES32) — Containing block hash.
- `block_number` (BLOCK_NUMBER) — Containing block height.
- `block_timestamp` (TIMESTAMP) — Containing block time in UTC from the receipt's log; NULL when the provider omits it.
- `transaction_hash` (BYTES32) — Emitting transaction hash.
- `transaction_index` (INTEGER) — Transaction position in the block.
- `log_index` (INTEGER) — Log position in the block.
- `data` (BYTES) — Encoded non-indexed parameters.
- `removed` (BOOLEAN) — Whether a reorganization removed the log.
- `topics` (BYTES32[]) — Ordered indexed event topics.
- `...` (ABI-derived columns; dynamic) — Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

### Dynamic columns

- Source: event_signature or event_abi
- Names: Event parameter names
- Types: Mapped from each event parameter type
- Description: Additional columns are appended from the supplied event_signature or event_abi. Exact names and SQL types are determined during planning.

Receipt log columns plus decoded event columns. Returns receipt log metadata and appends decoded event fields from the supplied signature or ABI.

## Guidance

### Use a matching client

Transaction hashes are chain-scoped. If the client points to another chain, the provider returns no receipt and the function raises; an RPC error raises too, so zero rows means a receipt with no matching logs.

Use the raw overload first when the event definition or emitting contract is not yet known.

### Filter and decode receipt logs

The provider returns the full transaction receipt; emitter and topic filters are applied to its logs after that single fetch.

Address filters match the log emitter. Topic filters match encoded indexed values.

Signature and JSON ABI overloads append one typed column per event parameter.

- For non-anonymous events, topic0 is the event selector.
- topic1, topic2, and topic3 are the first three indexed parameters.
- Use BYTES32[] to match any of several values at one topic position.

## Related functions

- [event_signature](/docs/functions/event_signature.md) — Usually After
- [event_decode_json](/docs/functions/event_decode_json.md) — Usually Before
- [block_range](/docs/functions/block_range.md) — Usually After
