# `Onchain.Transaction.Info`
[🔗](https://github.com/ZenHive/onchain-stack/blob/onchain-v0.16.0/packages/onchain/lib/onchain/transaction/info.ex#L1)

Inclusion metadata for an execution-apis transaction object, plus the typed
transaction.

`from_json/1` on each envelope drops `blockHash`, `blockNumber`,
`blockTimestamp`, `from`, `hash`, and `transactionIndex` (TransactionInfo in
execution-apis v1.0.0-beta.7, `src/schemas/transaction.yaml`). Those fields
live here. Block fields are `nil` when the transaction is pending.
`block_timestamp` is also `nil` when the node omits `blockTimestamp`.
Alchemy mainnet sometimes does that for mined transactions (observed
2026-10-01), even though the beta.7 schema lists the field as required.

# `t`

```elixir
@type t() :: %Onchain.Transaction.Info{
  block_hash: &lt;&lt;_::256&gt;&gt; | nil,
  block_number: non_neg_integer() | nil,
  block_timestamp: non_neg_integer() | nil,
  from: &lt;&lt;_::160&gt;&gt;,
  hash: &lt;&lt;_::256&gt;&gt;,
  transaction: transaction(),
  transaction_index: non_neg_integer() | nil
}
```

# `transaction`

```elixir
@type transaction() ::
  Onchain.Transaction.V1.t()
  | Onchain.Transaction.V_2930.t()
  | Onchain.Transaction.V2.t()
  | Onchain.Transaction.V3.t()
  | Onchain.Transaction.V4.t()
```

# `decode`

```elixir
@spec decode(term()) :: {:ok, t()} | {:error, term()}
```

Decodes a JSON-RPC transaction object into an envelope.

Returns `{:error, reason}` for a missing required field, an unknown `type`,
or a field the envelope decoder cannot read. Does not raise.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
