Sending Bitcoin with Leather Wallet
Using Leather's web wallet, we can easily initiate a simple Bitcoin transaction using only a few lines of code.
You'll need to be authenticated with the Leather wallet for this to work, which you can see how to do in the Authentication with Stacks.js tutorial.
Once you have the wallet hooked up, you can use the Leather wallet API to initiate a simple Bitcoin transaction in your JS app like this.
Then all we would do is hook up our button to call this sendBitcoin
function.
You can take a look at the Verifying a transaction on the BTC chain recipe to see a more complex user flow of verifying a transaction was mined using this returned ID as a starting point.
You can take a look at a bit more info about this simple API on the wallet developer docs.
Last updated