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

# useSendWalletTransaction

> Hook to send a transaction via the embedded wallet popup.

## Import

```tsx theme={null}
import { useSendWalletTransaction } from '@0xsequence/connect'
```

## Usage

```tsx theme={null}
import { useSendWalletTransaction } from '@0xsequence/connect'

function App() {
  const {
    sendTransactionAsync,
    isLoading,
    error,
    data,
    reset
  } = useSendWalletTransaction()

  const send = async () => {
    const hash = await sendTransactionAsync({
      chainId: 42161,
      transaction: {
        to: '0x0000000000000000000000000000000000000000',
        data: '0x'
      }
    })
    console.log('tx hash', hash)
  }

  return (
    <div>
      <button onClick={send}>Send via wallet popup</button>
      {isLoading && <div>Sending...</div>}
      {error && <div>Error: {error.message}</div>}
      {data && <div>Hash: {data}</div>}
      <button onClick={reset}>Reset</button>
    </div>
  )
}
```

## Parameters

```tsx theme={null}
type SendWalletTransactionParams = {
  chainId: number
  transaction: TransactionRequest
}
```

<Note>
  `transaction.to` is required.
</Note>

## Return Type

```tsx theme={null}
type UseSendWalletTransactionReturnType = {
  isLoading: boolean
  error: Error | null
  data: string | undefined
  sendTransaction: (params: SendWalletTransactionParams) => void
  sendTransactionAsync: (params: SendWalletTransactionParams) => Promise<string>
  reset: () => void
}
```

This hook opens the wallet popup for user approval before submitting the transaction.
