# How can I get the transaction ID from a contract call using rust sdk?

**URL:** <https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-contract-call-using-rust-sdk/2238>\
**Category:** Rust SDK\
**Created:** [April 4, 2023, 4:33pm UTC](https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-contract-call-using-rust-sdk/2238 "2023-04-04T16:33:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [April 4, 2023, 4:33pm UTC](https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-contract-call-using-rust-sdk/2238/1 "2023-04-04T16:33:16Z")

</div>

Hi guys  
Few times ago I answered on this question but it looks like not true because TxId cannot me like zero address

> [@How can I get the transaction ID from a test contract call?](https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-test-contract-call/106):
>
> How can I get the transaction ID from a test contract call?

---

<div class="post-metadata">

**Author:** ![sarah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sarah/32/13_2.png) [@sarah](https://forum.fuel.network/u/sarah)\
**Post date:** [April 5, 2023, 5:47pm UTC](https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-contract-call-using-rust-sdk/2238/2 "2023-04-05T17:47:02Z")

</div>

There is currently an open issue to add the tx ID to `FuelCallReponse`: [feat(contracts): add tx\_id to FuelCallResponse by Br1ght0ne · Pull Request #734 · FuelLabs/fuels-rs · GitHub](https://github.com/FuelLabs/fuels-rs/pull/734)

Meanwhile, a possible workaround is to get the transaction that would be executed by the contract call, read it’s id, and execute the call via the provider:

```rust
// build the tx
let tx = contract_instance
    .methods() .some_contract_method().build_tx().await.unwrap(); 

// get the tx_id
let id = tx.id();

// send the tx
provider.send_transaction(&tx);

```

You can see another example below:

```rust
let call_handler = contract_instance_launched.methods().some_contract_method();
let tx = call_handler.build_tx().await.unwrap();

dbg!(tx.id());

let receipts = provider.send_transaction(&tx).await.unwrap();
let response = call_handler.get_response(receipts).unwrap();

```

---

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [April 5, 2023, 6:11pm UTC](https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-contract-call-using-rust-sdk/2238/3 "2023-04-05T18:11:52Z")

</div>

Thank you a lot!!! ❤❤❤

---

<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:** [April 26, 2023, 2:12pm UTC](https://forum.fuel.network/t/how-can-i-get-the-transaction-id-from-a-contract-call-using-rust-sdk/2238/4 "2023-04-26T14:12:20Z")

</div>

Closed on April 26, 2023, 2:12pm UTC

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