> 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/submit-request.md).

# Submit Request

## Submit a preconf request

To submit a preconf request fill in the following `curl` template for `eth_sendRawTransaction` with the `params` containing your raw transaction.

The endpoint to send the request to is listed in [Networks](/spire/preconf-rpc/networks.md) and the query parameters to constrain your request are listed below.

| Parameter | Type    | Description                                                                                                                        |
| --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| deadline  | uint64  | Number of seconds to attempt to gain a preconf commitment                                                                          |
| fallback  | boolean | Upon failure to gain a commitment, or any other failure, should the preconf request be forwarded as a standard/non-preconf request |
| preconf   | boolean | Whether the request is a standard request or a preconf request                                                                     |

An example request to the holesky network:

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

```sh
curl -X POST \
  'https://preconf.holesky.spire.dev/v0/?deadline=3&fallback=true&preconf=true' \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc":"2.0",
    "method":"eth_sendRawTransaction",
    "params":["0xRAW_TX_HERE"],
    "id":1
  }'

```

{% endtab %}

{% tab title="Cast" %}

```bash
cast rpc \
  --rpc-url "https://preconf.holesky.spire.dev/v0/?deadline=3&fallback=true&preconf=true" \
  eth_sendRawTransaction "0xRAW_TX_HERE"
```

{% endtab %}

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

```rust
use alloy::providers::{Provider, ProviderBuilder};
use alloy::rpc::types::eth::RawTransactionRequest;
use alloy::transport::http::Http;
use alloy::primitives::Bytes;

#[tokio::main]
async fn main() -> eyre::Result<()> {
    let url = "https://preconf.holesky.spire.dev/v0/?deadline=3&fallback=true&preconf=true";
    let provider = ProviderBuilder::new().connect_http(url)?;

    let raw_tx: Bytes = "0xRAW_TX_HERE".parse()?;
    let tx_hash = provider.send_raw_transaction(raw_tx).await?;

    println!("tx hash: {:?}", tx_hash);
    Ok(())
}
```

{% endtab %}

{% tab title="Go" %}

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

rawTx := common.FromHex("0xRAW_TX_HERE")
txHash, err := client.SendRawTransaction(context.Background(), rawTx)
if err != nil {
    log.Fatal(err)
}

fmt.Println("tx hash:", txHash.Hex())

```

{% endtab %}

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

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

const provider = new ethers.JsonRpcProvider(
  "https://preconf.holesky.spire.dev/v0/?deadline=3&fallback=true&preconf=true"
);

const rawTx = "0xRAW_TX_HERE";

(async () => {
  const txHash = await provider.send("eth_sendRawTransaction", [rawTx]);
  console.log("tx hash:", txHash);
})();

```

{% endtab %}

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

```python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider(
    "https://preconf.holesky.spire.dev/v0/?deadline=3&fallback=true&preconf=true"
))

raw_tx = "0xRAW_TX_HERE"
tx_hash = w3.eth.send_raw_transaction(raw_tx)

print("tx hash:", tx_hash.hex())

```

{% endtab %}
{% endtabs %}

The router will respond with the hash of your transaction but that transaction may not appear in any block explorer until a preconfer has submitted it to the mempool or the router failed to get a commitment and forwarded the request to a standard RPC provider.

The hash is used as a parameter to query so save it for the next step.

```json
{
  "id":1,
  "jsonrpc":"2.0",
  "result":"0x..."
}
```

## Submit a standard request

To submit a non-preconf request i.e. use the router to forward your request to a RPC provider either change the method (and the rest of the body) to not be `eth_sendRawTransaction` or in the url specify the `preconf=false` parameter.


---

# 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/submit-request.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.
