> For the complete documentation index, see [llms.txt](https://spire-docs.gitbook.io/spire/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spire-docs.gitbook.io/spire/preconf-rpc/query-request-status.md).

# Query Request Status

{% hint style="warning" %}
A non-preconf request is not stored therefore an error / no data is returned if queried.
{% endhint %}

## Query request status

Once a **preconf request** has been submitted you may use the hash to query its status to see if it has finished processing and if it has succeeded or failed. Here's an example request querying against the holesky network and using the transaction hash from the [Submit Request](/spire/preconf-rpc/submit-request.md) results:

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X POST 'https://preconf.holesky.spire.dev/v0/' \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "transaction",
    "params": { "tx_hash": "0xYOUR_TX_HASH" }
  }'

```

{% endtab %}

{% tab title="Cast" %}

```bash
cast rpc --rpc-url https://preconf.holesky.spire.dev/v0/ \
  transaction '{"tx_hash":"0xYOUR_TX_HASH"}'

```

{% endtab %}

{% tab title="Rust/Alloy" %}

```rust
use alloy::providers::{Provider, ProviderBuilder};
use alloy::rpc::types::Params;
use alloy::transport::http::Http;

let provider = ProviderBuilder::new().connect_http("https://preconf.holesky.spire.dev/v0/")?;

let tx_hash = "0xYOUR_TX_HASH";
let tx_status = provider.request("transaction", Params::Array(vec![serde_json::json!({ "tx_hash": tx_hash })])).await?;

println!("Transaction status: {:?}", tx_status);

```

{% endtab %}

{% tab title="Go" %}

```go
client, err := ethclient.Dial("https://preconf.holesky.spire.dev/v0/")
if err != nil {
    log.Fatal(err)
}

// ---- Query Status ----
var statusResult map[string]interface{}
err = client.CallContext(context.Background(), &statusResult, "transaction", map[string]string{
	"tx_hash": txHash,
})
if err != nil {
	log.Fatalf("Error calling transaction: %v", err)
}
fmt.Println("Status:", statusResult)
```

{% endtab %}

{% tab title="JS/Ethers" %}

```javascript
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider(
  "https://preconf.holesky.spire.dev/v0/"
);

const txHash = "0xYOUR_TX_HASH";

const status = await provider.send("transaction", [{ tx_hash: txHash }]);
console.log("Status:", status);
```

{% endtab %}

{% tab title="Python/Web3" %}

```python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider(
    "https://preconf.holesky.spire.dev/v0/"
))

tx_hash = "0xYOUR_TX_HASH"

# Query status
status = w3.manager.request_blocking("transaction", [{"tx_hash": tx_hash}])
print("Status:", status)
```

{% endtab %}
{% endtabs %}

A valid request that successfully received a preconf commitment will respond with something like:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tx_hash": "0x...",
    "query": {"deadline":3,"fallback":true,"preconf":true},
    "status": "Success",
    "timestamp_unix_seconds": "1749219302",
    "request_id": 1
  }
}
```

The request result status has four possible values:

* **`Submitted`** - Initial value when the router stores the request
* **`Pending`** - Awaiting a response from preconf providers
* **`Success`** - a pre-confirmation commitment was received within the `deadline` or in the case that the request had the `fallback` parameter set to `true` the request was forwarded as a standard request
* **`Failure`** - Any other scenario

## Query commitment

If in the previous stage the `status` contained `Success` then we may attempt to query the commitment.

{% hint style="warning" %}
A request may have a `Success` status if it failed to gain a commitment but successfully forwarded the request to an RPC provider. In this case querying for a commitment will result in an error response.
{% endhint %}

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X POST 'https://preconf.holesky.spire.dev/v0/' \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "commitment",
    "params": { "tx_hash": "0xYOUR_TX_HASH" }
  }'

```

{% endtab %}

{% tab title="Cast" %}

```bash
cast rpc --rpc-url https://preconf.holesky.spire.dev/v0/ \
  commitment '{"tx_hash":"0xYOUR_TX_HASH"}'

```

{% endtab %}

{% tab title="Rust/Alloy" %}

```rust
use alloy::providers::{Provider, ProviderBuilder};
use alloy::rpc::types::Params;
use alloy::transport::http::Http;

let provider = ProviderBuilder::new().connect_http("https://preconf.holesky.spire.dev/v0/")?;

let tx_hash = "0xYOUR_TX_HASH";
let commitment = provider.request("commitment", Params::Array(vec![serde_json::json!({ "tx_hash": tx_hash })])).await?;

println!("Commitment: {:?}", commitment);
```

{% endtab %}

{% tab title="Go" %}

```go
client, err := ethclient.Dial("https://preconf.holesky.spire.dev/v0/")
if err != nil {
    log.Fatal(err)
}

// ---- Query Commitment ----
var commitmentResult map[string]interface{}
err = client.CallContext(context.Background(), &commitmentResult, "commitment", map[string]string{
	"tx_hash": txHash,
})
if err != nil {
	log.Printf("Commitment query failed (might be no commitment): %v", err)
} else {
	fmt.Println("Commitment:", commitmentResult)
}
```

{% endtab %}

{% tab title="JS/Ethers" %}

```javascript
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider(
  "https://preconf.holesky.spire.dev/v0/"
);

const txHash = "0xYOUR_TX_HASH";

const commitment = await provider.send("commitment", [{ tx_hash: txHash }]);
console.log("Commitment:", commitment);
```

{% endtab %}

{% tab title="Python/Web3" %}

```python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider(
    "https://preconf.holesky.spire.dev/v0/"
))

tx_hash = "0xYOUR_TX_HASH"

# Query status
commitment = w3.manager.request_blocking("commitment", [{"tx_hash": tx_hash}])
print("Commitment:", commitment)
```

{% endtab %}
{% endtabs %}

If a commitment has been acquired then a valid request will respond with something like

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tx_hash": "0x...",
    "signature": "0x...",
    "slot": 42,
    "preconfer": "uuid",
    "timestamp_unix_seconds": "1749219302"
  }
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://spire-docs.gitbook.io/spire/preconf-rpc/query-request-status.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
