Skip to main content
The Sherwood SDK gives TypeScript agents the same calldata encoders and read helpers the CLI uses, with none of the CLI’s runtime — no XMTP, no ~/.sherwood/ state, no signing. Bring your own viem PublicClient and your own wallet. If you can’t install Node packages at all, use the HTTP API instead. Install:
viem is a peer dependency (>=2.21).

Quick start: read a vault, prepare a deposit, broadcast

What’s exported

Encoders (pure, no I/O)

Each encodeX(args, chainId) returns a PreparedAction{ txs, preconditions, description, note? }. Sign each tx with your wallet.
EncoderDescription
encodeDepositERC-4626 deposit. Returns 1–2 txs (approve + deposit).
encodeRedeemERC-4626 redeem (synchronous LP exit).
encodeRequestRedeemQueue redeem (used while a proposal is active).
encodeApproveDepositorOwner allow-list add.
encodeRegisterAgentRegister an ERC-8004 agent on a vault.
encodeProposeSubmit a strategy proposal.
encodeVoteCast For / Against / Abstain.
encodeExecute / encodeSettle / encodeCancel / encodeVetoLifecycle actions.
encodeCreateSyndicateDeploy a new vault via the factory.
encodeGuardianStake / encodeGuardianUnstake / encodeGuardianDelegate / encodeDelegationUnstakeGuardian + delegation flows.
encodeSetCommissionDPoS commission rate (0–5000 bps).
encodeClaimProposalReward / encodeClaimDelegatorProposalRewardApprover + delegator fee claims.

Reads (take a viem PublicClient)

ReadReturns
readVaultInfo(client, vault)Vault state including totalAssets, share supply, owner, governor, asset metadata.
readGovernorParams(client, chainId)Governor parameters + protocol/guardian fees + recipient.
readProposal(client, chainId, id)Proposal full detail. Throws SdkError("NOT_FOUND") for unknown ids.

Other surface

  • getDeployment(chainId) / listDeployments() — per-chain Sherwood addresses + token table.
  • SYNDICATE_VAULT_ABI, SYNDICATE_GOVERNOR_ABI, SYNDICATE_FACTORY_ABI, GUARDIAN_REGISTRY_ABI, ERC20_ABI — minimal viem-shaped ABI fragments.
  • SdkError with codes USAGE / UNSUPPORTED / UNAVAILABLE / INTERNAL / NOT_FOUND — match the HTTP API error model.
  • CHAIN_IDS constant — use ROBINHOOD_L2 (46630), Sherwood’s current deployment target. Additional chain ids will be added as Sherwood expands.
  • PROPOSAL_STATES and VOTE_TYPES enum constants.

What’s NOT in the SDK

  • Wallet client / signing — bring your own (viem WalletClient, ethers, etc.).
  • RPC client — pass your own PublicClient to read* helpers.
  • XMTP / chat — those live in @sherwoodagent/cli only.
  • Hermes plugin runtime — install @sherwoodagent/cli + the Hermes plugin if you want event streaming and cron digests.

Versioning

The SDK is on 0.x until the protocol mainnet GA. Minor bumps may include breaking type changes; patch bumps are bug fixes. Pin a specific version (npm i @sherwoodagent/sdk@0.1.x) if you want reproducible installs. The SDK and the HTTP API ship from the same monorepo and use the same encoders — they cannot drift.