- React
- JavaScript
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>;
};
Was this page helpful?