> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spire.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](/preconf-rpc/networks) 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:

<CodeGroup>
  ```bash Curl theme={null}
  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
    }'
  ```

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

  ```rust Rust/Alloy theme={null}
  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(())
  }
  ```

  ```go Go theme={null}
  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())
  ```

  ```bash JS/Ethers theme={null}
  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);
  })();
  ```

  ```bash Python/Web3 theme={null}
  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())
  ```
</CodeGroup>

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 theme={null}
{
  "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.
