Skip to main content

Overview

The Bitcoin wallet provider supports Unisat, Leather, Xverse, and other Bitcoin wallets using the Bigmi library.

Installation

yarn add @layerswap/wallet-bitcoin @bigmi/client @bigmi/core @bigmi/react @tanstack/react-query
Bigmi is modular TypeScript library that provides reactive primitives for building Bitcoin applications. TanStack Query is an async state manager that handles fetching, caching, synchronizing and more.

Basic Usage

The Bitcoin provider requires no configuration:
import { LayerswapProvider, Swap } from "@layerswap/widget"
import { createBitcoinProvider } from "@layerswap/wallet-bitcoin"
import "@layerswap/widget/index.css"

export const App = () => {
  const bitcoinProvider = createBitcoinProvider()

  return (
    <LayerswapProvider
      walletProviders={[bitcoinProvider]}
    >
      <Swap />
    </LayerswapProvider>
  )
}