🚀 Stablecoin Accounts are live! Learn more
Getting Started
Core Features
- Authentication & Login
- Chains & Networks
- Wallets
- Users & Verified Credentials
- Design & Customization
- Money & Funding
Feature Guides
- Interacting with Wallets
- Headless Mode
- Global Identity
Developer Dashboard
Wallets & Chains Integration
Bitcoin
Send Bitcoin
In this example, we are going to send bitcoin using the wallet connector.
Copy
Ask AI
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { isBitcoinWallet } from '@dynamic-labs/bitcoin';
const SendBitcoinButton = () => {
const { primaryWallet } = useDynamicContext();
const sendBitcoin = async () => {
if (!primaryWallet || !isBitcoinWallet(primaryWallet)) return;
// The first argument is the address you are sending to, the second argument is the amount of BTC in satoshis
const transactionId = await primaryWallet.sendBitcoin('<bitcoin payment address>', 1);
console.log('transactionId', transactionId);
};
return <button onClick={sendBitcoin}>Send Bitcoin</button>;
};
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.