A collection of TypeScript tools for interacting with Bitcoin and Stacks.
This package provides utilities for wallet management, smart contract interactions, and blockchain operations.
bun add @aibtc/agent-tools
We recommend using Bun as the preferred package manager for best performance and compatibility.
Alternatively, you can use npm or yarn:
npm install @aibtc/agent-tools
# or
yarn add @aibtc/agent-tools
Create an .env
file in your project root with the following variables:
# Network selection: 'testnet' or 'mainnet'
NETWORK=testnet
# Wallet seed phrase (keep this safe and never share it)
MNEMONIC=your twelve or twenty-four word seed phrase
# Account index to use (first account = 0)
ACCOUNT_INDEX=0
# Bitflow API configuration (get keys from Bitflow Discord)
BITFLOW_API_HOST=
BITFLOW_API_KEY=
BITFLOW_STACKS_API_HOST=https://api.hiro.so/
BITFLOW_READONLY_CALL_API_HOST=
# Jing API configuration
JING_API_URL=https://backend-neon-ecru.vercel.app/api
JING_API_KEY=dev-api-token
# Hiro API key
HIRO_API_KEY=your-api-key
# AIBTC configuration
AIBTC_DEFAULT_FEE=100000 # in uSTX (0.1 STX)
AIBTC_FAKTORY_API_KEY=your-api-key
AIBTC_CORE_API_KEY=your-api-key
Here's a basic example of how to import and use the package in your project:
import { createWallet } from '@aibtc/agent-tools';
const wallet = createWallet(process.env.MNEMONIC!, Number(process.env.ACCOUNT_INDEX || 0));
console.log('Wallet address:', wallet.address);
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Discord: Join our community
- Twitter: @aibtcdev
- Docs: AIBTC docs
You can build and run this project using Docker with Bun for a consistent and fast development or production environment.
docker build --pull -t aibtc-agent-tools .
You can run any Bun-based CLI tool or script from this project inside the container. For example, to run a script called my-tool.ts
:
docker run --rm -it aibtc-agent-tools src/my-tool.ts
- Replace
src/my-tool.ts
with the path to the tool or script you want to run. - You can pass additional arguments after the script name as needed, e.g.:
docker run --rm -it aibtc-agent-tools src/my-tool.ts --help
- The container does not expose any ports by default, as this project is not a server.
- Edit the
Dockerfile
and.dockerignore
as needed for your deployment or development needs. - Make sure to set up your
.env
file for environment variables (see Configuration section above).