Quickstart

Here you can find instructions explaining how to use the SDK in your own project.

Installation

To install the tBTC SDK in your project, run:

yarn add @keep-network/tbtc-v2.ts

Please note that you will also need to install the ethers v5 library to initialize a signer or provider. To do so, invoke:

yarn add ethers@legacy-v5
The SDK depends on ethers v5. Proper support for newer ethers versions is 
not guaranteed right now.

Usage

Here is a short example demonstrating SDK usage:

// Import SDK entrypoint component.
import { TBTC } from "@keep-network/tbtc-v2.ts"

// Create an instance of ethers signer.
const signer = (...)

// Initialize the SDK.
const sdk = await TBTC.initializeMainnet(signer)

// Access SDK features.
sdk.deposits.(...)
sdk.redemptions.(...)

// Access tBTC smart contracts directly.
sdk.tbtcContracts.(...)

// Access Bitcoin client directly.
sdk.bitcoinClient.(...)

Last updated