# How to index transactions? (DEPRECATED)

**URL:** <https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651>\
**Category:** General\
**Created:** [May 18, 2023, 7:08pm UTC](https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651 "2023-05-18T19:08:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpoplavkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/mpoplavkov/32/399_2.png) [@mpoplavkov](https://forum.fuel.network/u/mpoplavkov)\
**Post date:** [May 18, 2023, 7:08pm UTC](https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651/1 "2023-05-18T19:08:08Z")

</div>

I’ve tried to add `TransactionData` as a function parameter to my indexer as the [doc](https://fuellabs.github.io/fuel-indexer/master/reference-guide/indexing/blocks-and-transactions.html) says, but I get the following error when building the code:

```auto
$ cargo build

error: Type with ident 'Ident { ident: "TransactionData", span: #0 bytes(1290..1305) }' not defined in the ABI.

```

Am I doing something wrong? Everything works on my side if I change `TransactionData` to `BlockData` though.

```auto
active toolchain
-----------------
beta-3-aarch64-apple-darwin (default)
  forc : 0.37.3
    - forc-client
      - forc-deploy : 0.37.3
      - forc-run : 0.37.3
    - forc-doc : 0.37.3
    - forc-explore : 0.28.1
    - forc-fmt : 0.37.3
    - forc-index : 0.11.2
    - forc-lsp : 0.37.3
    - forc-tx : 0.37.3
    - forc-wallet : 0.2.2
  fuel-core : 0.17.11
  fuel-indexer : 0.11.2

fuels versions
---------------
forc : 0.39

```

---

<div class="post-metadata">

**Author:** ![kern](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@kern](https://forum.fuel.network/u/kern)\
**Post date:** [May 18, 2023, 7:12pm UTC](https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651/2 "2023-05-18T19:12:16Z")

</div>

Can you share your indexer code?

---

<div class="post-metadata">

**Author:** ![mpoplavkov](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/mpoplavkov/32/399_2.png) [@mpoplavkov](https://forum.fuel.network/u/mpoplavkov)\
**Post date:** [May 19, 2023, 8:00am UTC](https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651/3 "2023-05-19T08:00:45Z")

</div>

Sure

```auto
extern crate alloc;
use fuel_indexer_macros::indexer;
use fuel_indexer_plugin::prelude::*;

#[indexer(manifest = "my_indexer.manifest.yaml")]
pub mod my_indexer_index_mod {
    fn handle_tx(tx: TransactionData) {
      Logger::info(format!("Tx data: {}", tx.id).as_str());
    }
}

```

Manifest:

```auto
---
namespace: my_namespace
abi: ~
identifier: my_indexer
fuel_client: "beta-3.fuel.network:80"
graphql_schema: schema/my_indexer.schema.graphql
module:
  wasm: target/wasm32-unknown-unknown/release/my_indexer.wasm
metrics: ~
contract_id: ~
start_block: 480000
resumable: true

```

---

<div class="post-metadata">

**Author:** ![kern](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@kern](https://forum.fuel.network/u/kern)\
**Post date:** [May 24, 2023, 2:29pm UTC](https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651/4 "2023-05-24T14:29:06Z")

</div>

I don’t think that we’ve added this as an explicit warning, but indexer functions are triggered when struct objects are received from the Fuel node; the `TransactionData` struct is not sent on its own from the node and is actually part of the `BlockData` struct. If you’d like to handle a transaction, you can grab the transactions from `BlockData` and do the desired work then.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [June 14, 2023, 10:29am UTC](https://forum.fuel.network/t/how-to-index-transactions-deprecated/2651/5 "2023-06-14T10:29:36Z")

</div>

Closed on June 14, 2023, 10:29am UTC

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
