npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dac-cloud/core

v0.1.0

Published

Viem-based TypeScript SDK for the DAC Cloud protocol — ABIs, types, proposal builders, and contract client.

Downloads

89

Readme

@dac-cloud/core

Viem-based TypeScript SDK for the DAC Cloud protocol — ABIs, types, proposal builders, and a high-level client.

Install

npm install @dac-cloud/core @dac-cloud/manifests viem

Usage

Signing client

import { createDacCoreClient, accountFromPrivateKey } from "@dac-cloud/core";
import { fetchManifest } from "@dac-cloud/manifests";
import { defineChain } from "viem";

const account = accountFromPrivateKey("0x...");
const protocol = await fetchManifest(31337, "https://api.dac.cloud");

const chain = defineChain({
  id: 31337,
  name: "dac-31337",
  nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
  rpcUrls: { default: { http: ["https://api.dac.cloud/rpc/31337"] } },
});

const core = createDacCoreClient({
  chain,
  rpcUrl: "https://api.dac.cloud/rpc/31337",
  account,
  protocol,
  fetchOptions: { headers: { authorization: `Bearer ${jwt}` } },
});

// All write methods route through submitWrite — 50% gas buffer + receipt status check.
// A returned tx hash means the transaction was mined AND succeeded.
const { proposalId } = await core.createDacManagementProposal({
  dacCell: "0x...",
  params: buildMintAgentTokensProposal({ amount: 1n, recipient: "0x..." }),
});

The client exposes 45 methods covering DAC deployment, token operations, DAC and deal governance, hybrid (oracle) governance, deal lifecycle, treasury, and legal-wrapper messages. See Core Client API for the full reference.

Unsigned-tx builder (multisig / external signers)

import { createDacTransactionBuilder } from "@dac-cloud/core";

const txBuilder = createDacTransactionBuilder({
  chainId: 31337,
  fromAddress: "0x<sender>",
  protocol,
});

const tx = txBuilder.createDacManagementProposal({ dacCell, params });
// tx is { chainId, from, to, data, value } — ready for Safe import or wallet.sendTransaction

See Transaction Builder.

Proposal builders

import {
  buildMintAgentTokensProposal,
  buildStrikeOutAgentProposal,
  buildUpdateGovernanceStrategyProposal,
} from "@dac-cloud/core";

const params = buildMintAgentTokensProposal({
  amount: 100_000_000000000000000000n,
  recipient: "0x...",
});

await core.createDacManagementProposal({ dacCell: "0x...", params });

30+ builders cover every DAC and deal proposal type — see Core Client API → Proposal Builders.

Selectors

import {
  DAC_PROPOSAL_TYPE,
  DEAL_PROPOSAL_TYPE,
  CORE_DEAL_KIND,
  CORE_EVALUATOR_KIND,
  CORE_DEAL_PROPOSAL_TYPE,
} from "@dac-cloud/core";

DAC_PROPOSAL_TYPE.MINT_AGENT_TOKENS;     // bytes4 selector
DEAL_PROPOSAL_TYPE.STRIKE_OUT_AGENT;
CORE_DEAL_KIND.PERMIT2_TREASURY;
CORE_EVALUATOR_KIND.MILESTONES_EVALUATOR;

ABIs and types

import {
  dacCellAbi, dealManagerAbi, dealCellAbi, dealAbi,
  governanceOracleAbi, votingProposalAbi, hybridDacManagementProposalAbi,
  permit2TreasuryAbi, wrappedMainTokenAbi, agentTokenAbi, erc20VotesAbi, erc20Abi,
  dacFactoryAbi, assetControllerAbi, governanceSchemaAbi,
} from "@dac-cloud/core";

import type {
  DACConfig, NativeDacConfig, ExistingTokenDacConfig,
  GovernanceStrategyConfig, VotingConfig, DealCreationConfig,
  DealParams, CapitalCall, ProposalParams,
  HybridProposalState, PROPOSAL_PHASE, ASSET_CAPABILITY,
} from "@dac-cloud/core";

Module helpers

import { coreModule } from "@dac-cloud/core";

// Encode an evaluator config from JSON:
const data = coreModule.encodeMilestoneEvaluatorConfigFromJson({
  rewardShare: "1000000000000000000",
  milestones: [...],
});

// Snapshot.org ERC-1271 hash (matches DACDeal contract storage):
const hash = coreModule.computeSnapshotV1FinalHash(payload);

Error decoding

import { formatViemError } from "@dac-cloud/core";

try {
  await core.executeDacProposal({...});
} catch (err) {
  console.error(formatViemError(err));
  // → "DealIsNotApproved()" or "AllowanceExpired()" instead of raw selector
}

Auth

@dac-cloud/core does not perform auth itself. When using the DAC Cloud backend proxy, obtain a SIWE JWT and pass it via fetchOptions.headers.authorization. The CLI's packages/cli/src/auth/ module is a reference implementation.

Notable Patterns

submitWrite (internal)

All mutating client methods call submitWrite, which:

  1. Estimates gas, then writes with gas = estimate + estimate/2 (50% buffer for ERC20Votes checkpoint 63/64-rule attrition).
  2. Waits for the receipt and throws if status !== "success".

This means a returned tx hash is guaranteed to be a mined, successful transaction — no need to check the receipt yourself.

*Detailed variants

Methods like createDealProposalDetailed, executeDealProposalDetailed return additional decoded event data on top of the base tx hash. Use them when you need post-execution addresses (e.g. the deployed dealCell from a successful deal create).

Build

npm install
npm run build
npm run typecheck

Documentation