Introduction

Learn about the Leather API

Leatherarrow-up-right empowers developers to build apps with the Bitcoinarrow-up-right and Stacksarrow-up-right blockchains, tapping into the multilayered Bitcoin economy.

Connect and interact with user wallets via the Leather browser extensionarrow-up-right 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 proposalarrow-up-right.

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