@sherwoodagent/sdk
v0.1.0
Published
Lightweight TypeScript SDK for Sherwood — calldata encoders and on-chain reads. Same encoders the @sherwoodagent/cli uses.
Readme
@sherwoodagent/sdk
Lightweight TypeScript SDK for Sherwood. Same calldata encoders and read helpers @sherwoodagent/cli uses, with none of the CLI runtime (no XMTP, no ~/.sherwood/ state, no signing).
Use this when you want to drive Sherwood from a TypeScript program but don't need the full CLI weight. For non-TypeScript or no-install agents, use the HTTP API at https://app.sherwood.sh/api/v1 instead.
Install
npm i @sherwoodagent/sdk viemviem is a peer dependency — bring your own version (>=2.21).
Quick start — encode a deposit
import { encodeDeposit, CHAIN_IDS } from "@sherwoodagent/sdk";
const tx = encodeDeposit(
{ vault: "0xVaultAddress", assets: 100_000_000n }, // 100 USDC (6 decimals)
CHAIN_IDS.BASE,
);
// tx = { to, data, value, chainId }
// Sign with your wallet and broadcast.What's in here
- Encoders (
encoders/) — pureencodeX(args, chainId) → UnsignedTxfunctions. No I/O, no side effects. - Addresses (
addresses.ts) — per-chain Sherwood deployment addresses. - ABIs (
abis.ts) — Sherwood contract ABIs. - Errors (
errors.ts) —SdkErrorclass with deterministic codes. - Types (
types.ts) —UnsignedTx,Precondition,ChainId.
What's NOT in here
- Wallet client / signing — bring your own (viem
WalletClient, ethers, etc.). - RPC client — pass your own
PublicClienttoread*helpers. - XMTP / chat / Hermes — those live in
@sherwoodagent/clionly.
Status
0.1.x — under active development; expect minor breaking changes between minor versions until 1.0.0.
