Skip to content

Arch-Network/arch-agent-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arch Agent Kit

Connect AI agents to Arch Network. A plugin-based toolkit that exposes on-chain Arch actions (wallet, Runes, prediction markets, and more) as LLM tools for frameworks like the Vercel AI SDK, OpenAI function calling, and ElizaOS.

Inspired by Solana Agent Kit, adapted for Arch's Bitcoin-native runtime.

Install

npm install arch-agent-kit

Quick start

import {
  ArchAgentKit,
  KeypairSigner,
  walletPlugin,
  runesPlugin,
  dataPlugin,
  createVercelAITools,
} from 'arch-agent-kit';

const agent = new ArchAgentKit({
  rpcUrl: 'https://rpc.testnet.arch.network',
  titanUrl: 'https://titan.testnet.saturnbtc.io',
  signer: KeypairSigner.fromPrivateKeyHex(process.env.AGENT_PRIVKEY!),
  safety: {
    // Guardrails for autonomous operation.
    maxTransferBaseUnits: 10_000_000n,
    maxInstructionsPerTx: 6,
    // dryRun: true, // validate + build but never broadcast
  },
})
  .use(walletPlugin())
  .use(runesPlugin())
  .use(dataPlugin());

// Call an action directly...
const bal = await agent.run('get_token_balance', { mint: '<mint-hex>' });

// ...or hand the whole tool set to an LLM.
const tools = createVercelAITools(agent);

Concepts

  • Signer — authorizes transactions. KeypairSigner for full autonomy (BIP340 Schnorr, x-only pubkeys); WalletHubSigner to delegate signing to a remote/Turnkey service so the agent never holds raw keys.
  • Plugin — bundles related Actions. Each action has a Zod schema and a handler, and is surfaced to LLMs as a tool.
  • SafetyGuard — applied before every broadcast: program allowlist, max instructions per tx, per-transfer caps, and a global dry-run switch.

Built-in plugins

  • walletPlugin() — native ARCH + APL token balances and transfers.
  • runesPlugin() — read-only Bitcoin/Runes data via Titan (requires titanUrl).
  • dataPlugin() — generic Arch account / chain-tip reads.

More plugins (prediction markets, the agent launchpad) are added as the on-chain surfaces land.

Framework adapters

  • createVercelAITools(agent) — tool set for the Vercel AI SDK.
  • createOpenAITools(agent) + executeTool(agent, name, args) — OpenAI function-calling specs and dispatch.

Development

npm install
npm test          # vitest
npm run typecheck # tsc --noEmit
npm run build     # tsup -> dist (cjs + esm + d.ts)

License

MIT

About

Connect AI agents to Arch Network: a plugin-based toolkit of on-chain actions (wallet, Runes, data) exposed as LLM tools.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors