@hellobtu/sdk
v0.1.1
Published
_description_
Readme
@hellobtu/sdk
Hello BTU Library
A TypeScript library for HelloBTU protocol.
Usage
Installation
npm install @hellobtu/sdk
# or
yarn add @hellobtu/sdkPreparation
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
