Here you can find instructions explaining how to use the SDK in your own project.
// Import SDK entrypoint component.
import { TBTC } from "@keep-network/tbtc-v2.ts"
// Create an instance of ethers signer.
const signer = (...)
// Initialize the SDK for Ethereum only.
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.(...)
Here is a brief example demonstrating the use of the SDK in some L2, e.g. Arbitrum:
// Import SDK entrypoint component.
import { TBTC } from "@keep-network/tbtc-v2.ts"
// Create an instance of ethers provider.
const ethProvider = (...)
// Create an instance of ethers signer.
const arbitrumSigner = (...)
// Initialize the SDK for Ethereum only.
const sdk = await TBTC.initializeMainnet(ethProvider, true)
// Initialize it for any L2 (E.g., Arbitrum)
await sdk.initializeCrossChain("Arbitrum", arbitrumSigner);
// Access SDK features.
sdk.deposits.(...)
sdk.redemptions.(...)
// Access tBTC smart contracts directly.
sdk.tbtcContracts.(...)
// Access Bitcoin client directly.
sdk.bitcoinClient.(...)