@chakrachain/btc-settlement-sdk
v1.0.0-beta.3
Published
> A JavaScript sdk for chakra btc settlement script builder
Downloads
199
Readme
Intro
A JavaScript sdk for chakra btc settlement script builder
Usage
Install
npm install @chakrachain/btc-settlement-sdk
or
yarn add @chakrachain/btc-settlement-sdk
Prerequisites
:::tip
Before using the sdk, configure the supported projects and chains to ChakraBTCSettlement-ProjectsConfig
:::
buildTransferPsbt() : build Psbt for chakra btc settlement
Params :
- amount:
number
, Required field, Amount to be settled. - network:
string
Required field, sMainnet or signet. - address:
string
Required field, BTC wallet address, - pubkey:
string
Required field, BTC wallet public key. - targetChainReceiverAddress:
string
Required field, Target address for settlement. - targetChainId:
string
Required field, Target chainId for settlement, Please make sure the chainid is configured in the chains.json first. - projectName:
string
Required field, Settlement project name, Please make sure the project is configured in the projects.json first. - feeRate:
number
Required field, Network fee rate. - skipVault:
boolean
Optional field, Skip Vault Contract transfer to Stake Contracts
Response : Promise: Psbt
Usage Examples
import { useEffect } from "react";
const psbt = await buildTransferPsbt(
100000,
'mainnet',
'tb1*****', // YOUR BTC WALLET ADDRESS
'*****', // YOUR BTC WALLET PUBLIC KEY
"0x1234567889", // RECEIVER ADDRESS
'67', // RECEIVER CHAIN ID
"Pendle", // or Lombard
300
)