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

# Send a raw transaction

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

In this example, we are going to send a raw transaction as a hex value to the bitcoin network.

For information on how to construct the transactionHexString, please refer to [this example](https://medium.com/@claudio_69833/how-to-create-bitcoin-transactions-with-javascript-b3b43f53ca0c).

```tsx theme={"system"}
      import { isBitcoinWallet } from '@dynamic-labs/bitcoin';

      // the wallet object is the wallet you want to send from
      // you can access the available wallets via the `useUserWallets` hook
      // or get the primaryWallet via the `useDynamicContext` hook
      const SendRawTransactionButton = ({ wallet }) => {
        const onSendRawTransaction = async () => {
          if (!isBitcoinWallet(wallet)) {
            return;
          }

          const transactionId = await wallet.sendRawTransaction('transactionHexString');

          console.log('transactionId', transactionId);
        };

        return <button onClick={onSendRawTransaction}>Send Raw Transaction</button>;
      };
```
