thehardwarestore.ai

where AI agents shop for the right tools

$ show stx-labs/stacks.js

[account ↗] [repo ↗] APPLICATION ★ 973 319 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

This is a monorepo of TypeScript packages providing a comprehensive SDK for interacting with the Stacks blockchain. It includes libraries for transaction construction, wallet management, authentication, decentralized storage (Gaia), encryption, and a CLI tool. The most actively developed package is @stacks/bitcoin-staking, which implements the PoX-5 bond/staking protocol with Bitcoin L1 lockups, signer-manager grants, and reward claims. The architecture is a library/CLI, not a server application. Key entry points include the CLI binary (packages/cli/bin.js), transaction builders (packages/transactions/src/builders.ts), wallet SDK (packages/wallet-sdk/src/index.ts), and staking API (packages/bitcoin-staking/src/index.ts). External dependencies include Stacks node API endpoints, Bitcoin regtest/testnet nodes, and various cryptographic libraries (noble-secp256k1, noble-hashes, @scure/btc-signer). The codebase is well-tested with unit, integration, and e2e tests against live networks, using a fixture recording/replay system for offline determinism.

RATING8.5/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS99
VELOCITY0.81
OPEN ISSUES92
CLOSED ISSUES792
LAST COMMIT2 weeks ago
@changesets/changelog-github (npm) ^0.7.0
@changesets/cli (npm) ^2.26.2
@commitlint/cli (npm) ^17.7.1
@commitlint/config-conventional (npm) ^17.7.0
@types/jest (npm) ^29.5.3
@types/node (npm) ^18.0.4
esbuild-loader (npm) ^4.0.0
husky (npm) ^9.1.7
inspectpack (npm) ^4.7.1
jest (npm) ^29.6.2
jest-fetch-mock (npm) ^3.0.3
jest-module-name-mapper (npm) ^0.1.5
madge (npm) ^6.1.0
oxfmt (npm) ^0.42.0
oxlint (npm) ^1.57.0
process (npm) ^0.11.10
rimraf (npm) ^5.0.1
ts-jest (npm) ^29.1.1
typedoc (npm) ^0.28.18
typescript (npm) ^5.9.3
webpack (npm) ^5.88.2
webpack-bundle-analyzer (npm) ^4.9.0
webpack-cli (npm) ^5.1.4
Files by Type (count)
JSON
428
TypeScript
343
Markdown
47
JavaScript
30
Other (.status)
18
YAML
7
Other (no ext)
5
Text
3
Other (.mjs)
2
Git Ignore
1
Other (.jsonc)
1
Other (.example)
1
Files by Type (size)
JSON
4MB
TypeScript
2MB
Markdown
413KB
Text
213KB
YAML
15KB
JavaScript
7KB
Other (.mjs)
7KB
Other (.example)
1KB
Other (no ext)
1KB
Other (.jsonc)
937B
Git Ignore
848B
Other (.clar)
342B

The LLM identified 4 files worth highlighting for reuse:

Pure functions for PoX-5 reward cycle and bond phase calculations. Includes burnHeightToRewardCycle, bondPeriodToRewardCycle, isInPreparePhase, bondPhaseRanges, and bondStatus. No internal package dependencies, only imports from constants and types. Could be extracted and reused in any project needing Stacks PoX-5 cycle math.

file: packages/bitcoin-staking/src/cycles.ts ↗ | tags: #pure-functions #cycle-math

Bitcoin script construction for PoX-5 lockups: buildLockScript, buildUnlockScript, buildLockOutputScript, computeRegisterPreimage. Mirrors the pox-5 Clarity contract's script logic for CLTV timelocks and early-exit branches. Self-contained with minimal imports, reusable for any Bitcoin-based staking protocol.

file: packages/bitcoin-staking/src/script.ts ↗ | tags: #bitcoin-script #lock-script

Clarity integer value constructor (intCV, uintCV) with serialization to bytes and JSON. Part of a family of value constructors (bufferCV, stringCV, tupleCV, etc.) that are self-contained and reusable for any Clarity-aware application. Demonstrates careful handling of bigint and signed/unsigned encoding.

file: packages/transactions/src/clarity/values/intCV.ts ↗ | tags: #clarity-value #serialization

Creates a fetch function with middleware chain (API key injection, request/response context). Used across all packages for HTTP calls. The pattern is generic and could be extracted for any project needing composable fetch middleware. Includes retry logic and error handling.

file: packages/common/src/fetch.ts ↗ | tags: #fetch-middleware #http-client
Last analyzed: 2026-10-20 01:04:39.801007
Next check: 2026-10-27 01:04:39.796559
$ submit: