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

# signAndSendTransaction

> Sign and send transaction with a Solana wallet using the signAndSendTransaction method.

### SDK methods

Learn more about sending transactions using our SDKs [here](/wallets/using-wallets/solana/send-a-transaction).

<RequestExample>
  ```sh cURL theme={"system"}
  curl --request POST \
    --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
    --header 'Authorization: Basic <encoded-value>' \
    --header 'Content-Type: application/json' \
    --header 'privy-app-id: <privy-app-id>' \
    --data '{
    "method": "signAndSendTransaction",
    "caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
    "sponsor": true,
    "params": {
      "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
      "encoding": "base64"
    }
  }
  '
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "method": "signAndSendTransaction",
    "data": {
      "hash": "22VS6wqrbeaN21ku3pjEjfnrWgk1deiFBSB1kZzS8ivr2G8wYmpdnV3W7oxpjFPGkt5bhvZvK1QBzuCfUPUYYFQq",
      "signed_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
      "caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
      "transaction_id": "nyorsf87s9d08jimesv3n8yq"
    }
  }
  ```
</ResponseExample>

### Headers

<ParamField header="privy-app-id" type="string" required>
  ID of your Privy app.
</ParamField>

<ParamField header="privy-authorization-signature" type="string">
  Request authorization signature. If multiple signatures are required, they should be comma
  separated.
</ParamField>

<ParamField header="privy-request-expiry" type="string">
  Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the
  request must be processed.
</ParamField>

### Path Parameters

<ParamField path="wallet_id" type="string" required>
  ID of the wallet to get.
</ParamField>

### Body

<ParamField body="method" type="string" defaultValue="signAndSendTransaction" required>
  Available options: `signAndSendTransaction`
</ParamField>

<ParamField body="caip2" type="string" initialValue="eip155:11155111" required>
  Available options: `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` (Solana Mainnet),
  `solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1` (Solana Devnet),
  `solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z` (Solana Testnet)
</ParamField>

<ParamField body="params" type="object" required>
  <Expandable title="child attributes" defaultOpen="true">
    <ParamField body="transaction" type="string">
      Base64 encoded serialized transaction to sign.
    </ParamField>

    <ParamField body="encoding" type="string">
      Available options: `base64`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="sponsor" type="boolean">
  Optional parameter to enable gas sponsorship for this transaction. [Learn
  more.](/wallets/gas-and-asset-management/gas/overview)
</ParamField>

<ParamField body="reference_id" type="string">
  Optional developer-provided reference ID for transaction reconciliation. Must be unique per
  transaction and up to 64 characters. Use this to correlate transactions with your own internal
  records. The `reference_id` is included in [transaction
  webhook](/api-reference/webhooks/transaction/broadcasted) payloads and can be used to [look up
  transactions](/api-reference/transactions/external-id).
</ParamField>

<ParamField body="optimistic_broadcast" type="boolean">
  Optional. If set to true, the signed transaction will be immediately returned after the enclave
  signs, and submission to the network will happen asynchronously. Useful if you want to minimize
  E2E latency, or if you want to submit to multiple endpoints to get the best transaction landing
  time possible. Note that enabling this option also disables network preflight checks to minimize
  latency, which means an invalid transaction will not return an error in the API response and will
  not fire webhooks. You are responsible for rebroadcasting and validating the transaction, which
  can be done against a Solana RPC endpoint using the `signed_transaction` from the response.

  <Tip>
    **Lowest latency configuration**: For minimum E2E latency, combine `optimistic_broadcast` with
    the `x-privy-skip-simulation: true` request header. This skips both simulation and broadcast
    confirmation, returning the signed transaction as fast as possible. Your application is then
    responsible for simulating (if desired) and broadcasting the transaction independently.
  </Tip>
</ParamField>

### Returns

<ResponseField name="method" type="enum<string>" required>
  Available options: `signAndSendTransaction`
</ResponseField>

<ResponseField name="data" type="object" required>
  <Expandable title="child attributes" defaultOpen="true">
    <ResponseField name="hash" type="string" required>
      Transaction hash of the signed and sent transaction.
    </ResponseField>

    <ResponseField name="caip2" type="string" required>
      CAIP-2 chain ID of the network where the transaction was sent.
    </ResponseField>

    <ResponseField name="transaction_id" type="string">
      Optional Privy-assigned transaction ID.
    </ResponseField>

    <ResponseField name="reference_id" type="string | null">
      The developer-provided reference ID, if one was provided in the request.
    </ResponseField>

    <ResponseField name="signed_transaction" type="string">
      The signed transaction payload, base64-encoded. This can be used to verify the signature or to
      rebroadcast the transaction via your own RPC endpoint.
    </ResponseField>
  </Expandable>
</ResponseField>
