Socket
Book a DemoInstallSign in
Socket

@hellobtu/sdk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hellobtu/sdk

_description_

0.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

@hellobtu/sdk

npm version npm downloads bundle License

Hello BTU Library

A TypeScript library for HelloBTU protocol.

Usage

Installation

npm install @hellobtu/sdk
# or
yarn add @hellobtu/sdk

Preparation

Downloads secp256k1.wasm to public/

Fetch channel info

import { getProInfo } from '@hellobtu/sdk'

const info = await getProInfo('bitcoin_testnet', 'tb1...')

Upgrade to PRO

import { getProInfo } from '@hellobtu/sdk'

const info = await upgradeToPro('bitcoin_testnet', 'tb1...')

Stake Bitcoin

import { stakeBitcoin } from '@hellobtu/sdk'

const stakeProps = {
  address: 'your-bitcoin-address',
  pubkey: 'your-public-key',
  committee: 'committee-address',
  amount: '1000000', // amount in satoshis
  feeRate: 5, // in sat/vB
  chainId: 11155111, // destination chain ID
  recipient: 'recipient-address',
  signer: 'your-wallet-provider, with signPsbt implemented'
}

// Stake Bitcoin
const txHash = await stakeBitcoin('bitcoin_testnet', stakeProps)
console.log('Transaction Hash:', txHash)

License

MIT

FAQs

Package last updated on 09 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.