Introduction

Learn about the Leather API

Leather empowers developers to build apps with the Bitcoin and Stacks blockchains, tapping into the multilayered Bitcoin economy.

Connect and interact with user wallets via the Leather browser extension using our suite of simple JavaScript methods.

Provider object

The Leather extension injects a global object that can be used to call its API.

Look for the presence of LeatherProvider to see if the Leather is installed:

if (window.LeatherProvider) // Leather is installed šŸŽ‰

This object implements the .request method standard from Modern Wallet APIs proposal.

Simply provide the method name and any necessary parameters, such as sendTransfer for sending Bitcoin:

const response = await window.LeatherProvider?.request("sendTransfer", {
  recipients: [
    {
      address: "tb1qkzvk9hr7uvas23hspvsgqfvyc8h4nngeqjqtnj",
      amount: "10000",
    }
  ]);

Methods

Last updated