@calldatasdk/claude
v1.0.0
Published
Tiny, AI-friendly helper SDK for Calldata Network. Lets Claude Code and other agents wire Calldata into a backend with very little code: define commands, build a backend, send commands, all in one or two calls.
Maintainers
Readme
@calldatasdk/claude
Tiny, AI-friendly helpers for Calldata Network. Nothing wild, just useful: a small set of functions that let Claude Code (or any agent, or any human) wire Calldata into a backend with very little code.
Built on @calldatasdk/sdk (client) and @calldatasdk/server (backend). ethers
v6 is a peer dependency.
npm install @calldatasdk/claude ethersA backend in a few lines
import { app, str, startBackend } from '@calldatasdk/claude';
const board = app({
namespace: 'board',
controlAddress: '0xAppInbox...',
commands: {
post: {
args: { text: str({ max: 280 }) },
handler: (ctx) => console.log(ctx.signer, 'said', ctx.args.text),
},
},
});
const sub = startBackend({ rpcUrl: process.env.RPC!, apps: [board], openMode: true });
// later: await sub.stop();Sending a command
import { createClient } from '@calldatasdk/claude';
const client = createClient({ rpcUrl: process.env.RPC!, privateKey: process.env.PK! });
const hash = await client.send('0xAppInbox...', 'post', { text: 'gm, on chain' });What you get
app(spec)/command(spec), define a command language with no boilerplate.schema(fields)withstr(),num(),bool(), inline validators, no schema library.startBackend({ rpcUrl, apps }), provider + relayer + interpreter in one call. Returns{ stop() }.createClient({ rpcUrl, privateKey }),.send(controlAddress, cmd, args)returns the tx hash.- Re-exports
encodeEnvelope,decodeEnvelope,encodeCommandData,decodeCommandData.
Designed so an AI assistant can scaffold a full Calldata integration from a short
prompt. The real protocol lives in @calldatasdk/sdk and @calldatasdk/server.
Learn more at calldata.network. MIT licensed.
