Bitcoin Integrations

The BitcoinProvider defined in Tomo Connect SDK contains all the necessary functions to interact with the Bitcoin chain. Core functions are:

Get Wallet Address

async getAddress(): Promise<string>

Get Wallet Public Key

async getPublicKeyHex(): Promise<string>

Change Address Type

// supported types are P2PKH, P2WPKH, P2TR, P2SH
changeAddressType(addressType: string)

Get All Wallet Types and Addreses

export interface AddressInfo {
  value: AddressType;
  label: string;
  name: string;
  displayName?: string;
  hdPath: string;
  address?: string;
}

export const addressInfos: AddressInfo[] = [
  {
    value: AddressType.P2PKH,
    label: "P2PKH",
    name: "Legacy (P2PKH)",
    displayName: "Legacy",
    hdPath: "m/44'/0'/0'/0",
  },
  {
    value: AddressType.P2WPKH,
    label: "P2WPKH",
    name: "Native Segwit (P2WPKH)",
    displayName: "Native Segwit",
    hdPath: "m/84'/0'/0'/0",
  },
  {
    value: AddressType.P2TR,
    label: "P2TR",
    name: "Taproot (P2TR)",
    displayName: "Taproot",
    hdPath: "m/86'/0'/0'/0",
  },
  {
    value: AddressType.P2SH_P2WPKH,
    label: "P2SH",
    name: "Nested Segwit (P2SH-P2WPKH)",
    displayName: "Nested Segwit",
    hdPath: "m/49'/0'/0'/0",
  }
];

async getAllAddresses(): Promise<AddressInfo[]>

Send Bitcoin

Sign Psbt

Sign Message

Switch Network

Get Balance

Get Network Fees

Get UTXOs

Get Latest Height

Get inscription data

Last updated