Bitcoin Provider

Using the BTC Provider API

Once you connect the wallet, you can use the following way to interact with the connected wallet:

import {
  useTomoProviders,
  useTomoModalControl,
  useTomoWalletConnect,
  useTomoWalletState,
  useWalletList
} from '@tomo-inc/wallet-connect-sdk'

// Open BTC connection modal
const tomoModal = useTomoModalControl();
tomoModal.open("bitcoin"); 
// tomoModal.open('cosmos'); to open Cosmos wallets connection modal

// Check wallet connection status
const tomowalletState = useTomoWalletState();
const connected = tomowalletState.isConnected;

// Check all the supported wallets
const supportedWallets = useWalletList();

// Get provider
const providers = useTomoProviders();
const provider = providers.bitcoinProvider;

// Disconnect
const tomoWalletConnect = useTomoWalletConnect();
tomoWalletConnect.disconnect();

All the provider APIs are as follows:

Last updated