
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
clarity-bitcoin-client
Advanced tools
Clarity Bitcoin Client is an open-source TypeScript library for interacting with the **[Clarity-Bitcoin-V5](https://explorer.hiro.so/txid/SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v5?chain=mainnet) contract** on the Stacks blockchain.
Clarity Bitcoin Client is an open-source TypeScript library for interacting with the Clarity-Bitcoin-V5 contract on the Stacks blockchain.
Given a bitcoin txid the library fetches the block and transaction data necessary to build the merkle proofs to submit to the clarity-bitcoin-lib-v5 contract.
npm install clarity-bitcoin-client
import { fetchApiData, extractProofInfo, parseWTx, type TxForClarityBitcoin } from "clarity-bitcoin-client";
const data: ProofRequest = await getProofData(req.params.txid, blockHash, getRpcParams());
const pgd: ProofGenerationData = getProofGenerationData(data);
const proof: TransactionProofSet = extractProofInfo(pgd, data);
The bitcoin connection parameters are expected;
{
rpcHost: CONFIG.rpcHost,
rpcPort: CONFIG.rpcPort,
rpcPass: CONFIG.rpcPass,
rpcUser: CONFIG.rpcUser
}
A hosted service is avaliable here
A svelte app using this lib is available here.
Clone the repository and install dependencies:
git clone https://github.com/BigMarketDao/clarity-bitcoin-client.git
cd clarity-bitcoin-client
npm install
npm run build # Compile to dist/
npm test # Run tests
npm run build
npm publish
MIT
Open to contributions! Feel free to submit a PR. 🚀
FAQs
Clarity Bitcoin Client is an open-source TypeScript library for interacting with the **[Clarity-Bitcoin-V5](https://explorer.hiro.so/txid/SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.clarity-bitcoin-lib-v5?chain=mainnet) contract** on the Stacks blockchain.
We found that clarity-bitcoin-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.