# Intro

> A JavaScript sdk for chakra btc settlement script builder

## Usage


### Install

```bash
npm install @chakrachain/btc-settlement-sdk
```

or

```bash
yarn add @chakrachain/btc-settlement-sdk
```

### Prerequisites

:::tip

Before using the sdk, configure the supported projects and chains to [ChakraBTCSettlement-ProjectsConfig](https://github.com/Generative-Labs/ChakraBTCSettlement-ProjectsConfig)

:::

### buildTransferPsbt() :  build Psbt for chakra btc settlement

#### Params :
1. amount:`number`, Required field,  Amount to be settled.
1. network: `string` Required field, sMainnet or signet.
1. address:  `string` Required field, BTC wallet address,
1. pubkey:  `string` Required field,  BTC wallet public key.
1. targetChainReceiverAddress:  `string` Required field, Target address for settlement.
1. targetChainId:  `string` Required field,   Target chainId for settlement, Please make sure the chainid is configured in the [chains.json](https://github.com/Generative-Labs/ChakraBTCSettlement-ProjectsConfig/blob/main/chains.json) first.
1. projectName:  `string` Required field,  Settlement project name,  Please make sure the project is configured in the [projects.json](https://github.com/Generative-Labs/ChakraBTCSettlement-ProjectsConfig/blob/main/projects.json) first.
1. feeRate:  `number` Required field,  Network fee rate.
1. skipVault:  `boolean` Optional field,  Skip Vault Contract transfer to Stake Contracts

#### Response : Promise: Psbt

#### Usage Examples

```tsx
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
)
```