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

# Send Sync Transactions

Send transactions and wait for the final result in a single call. Sync methods are ideal for fast chains where you want immediate confirmation feedback.

## Getting Started

<Steps>
  <Step title="Import Dependencies">
    ```typescript theme={null}
    import { createGelatoEvmRelayerClient } from '@gelatocloud/gasless';
    ```
  </Step>

  <Step title="Create Relayer Client">
    To create an API Key, visit the [Gelato App](https://app.gelato.cloud/) and navigate to `Relayer > API Keys`.

    ```typescript theme={null}
    const relayer = createGelatoEvmRelayerClient({
      apiKey: process.env.GELATO_API_KEY,
      testnet: true // Use false for mainnet
    });
    ```
  </Step>

  <Step title="Send Sync Transaction">
    Submit a transaction and wait for the final result:

    ```typescript theme={null}
    const receipt = await relayer.sendTransactionSync({
      chainId: 84532,
      to: '0xContractAddress',
      data: '0xCalldata',

      timeout: 30000  // Required: max wait time in ms
    });

    console.log('TX hash:', receipt.transactionHash);
    ```
  </Step>
</Steps>

## Parameters

| Parameter           | Type              | Required | Description                             |
| ------------------- | ----------------- | -------- | --------------------------------------- |
| `chainId`           | `number`          | Yes      | Target chain ID                         |
| `to`                | `Address`         | Yes      | Target contract address                 |
| `data`              | `Hex`             | Yes      | Transaction calldata                    |
| `authorizationList` | `Authorization[]` | No       | EIP-7702 authorizations                 |
| `context`           | `unknown`         | No       | Optional context (e.g., from fee quote) |
| `timeout`           | `number`          | Yes      | Max wait time in milliseconds           |

## Return Type

The sync method returns a `TransactionReceipt` directly on success, or throws an error on failure:

```typescript theme={null}
const receipt = await relayer.sendTransactionSync({
  chainId: 84532,
  to: '0xContractAddress',
  data: '0xCalldata',
  timeout: 30000
});

// receipt contains:
// - transactionHash: Hex
// - blockNumber: bigint
// - gasUsed: bigint
// - ... other receipt fields
```

## Async vs Sync Comparison

<Tabs>
  <Tab title="Async (sendTransaction)">
    ```typescript theme={null}
    // Returns immediately with task ID
    const taskId = await relayer.sendTransaction({
      chainId: 84532,
      to: '0xContract',
      data: '0xCalldata',
    });

    // Wait for receipt
    try {
      const receipt = await relayer.waitForReceipt({ id: taskId });
      console.log(`Transaction hash: ${receipt.transactionHash}`);
    } catch (error) {
      console.log(`Transaction failed: ${error.message}`);
    }
    ```
  </Tab>

  <Tab title="Sync (sendTransactionSync)">
    ```typescript theme={null}
    // Waits and returns receipt directly
    const receipt = await relayer.sendTransactionSync({
      chainId: 84532,
      to: '0xContract',
      data: '0xCalldata',

      timeout: 30000
    });
    ```
  </Tab>
</Tabs>

## Additional Resources

* [Sync Methods Overview](/gasless-with-relay/gasless-transactions-evm/sync-methods) - Feature overview
* [Payment Methods](/gasless-with-relay/gasless-transactions-evm/payment-methods) - Available payment options
* [Tracking Requests](/gasless-with-relay/how-to-guides/tracking-gelato-request) - How to track transaction status
