Skip to main content

Documentation Index

Fetch the complete documentation index at: https://dynamic-docs-feat-sidebar-revamp.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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.
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { isBitcoinWallet } from '@dynamic-labs/bitcoin';

const SendRawTransaction = () => {
  const { primaryWallet } = useDynamicContext();

  const signMessage = async () => {
    if (!primaryWallet || !isBitcoinWallet(primaryWallet)) return;

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

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

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