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

@woof-software/comet-sdk-wagmi

v4.0.2

Published

Wagmi-based augmentation of `@woof-software/comet-sdk` that exports (and optionally injects) wagmi-based fetch methods.

Readme

@woof-software/comet-sdk-wagmi

Description

comet-sdk-wagmi is a TypeScript library that extends @woof-software/comet-sdk with wagmi/viem-based contract wrappers, fetchers, and utilities. It enables seamless interaction with Comet protocol entities and DeFi analytics in React/TypeScript dApps, supporting multicall, user/market analytics, and DeFi operations.

Key Features

  • Wagmi-based contract wrappers for Comet, ERC20, Bulker, ConfigController, and more
  • Augmented fetchers for user, market, collateral, and protocol data (multichain-ready)
  • Type-safe, composable classes for all protocol entities
  • High-level wrappers for user and admin operations (supply, borrow, approve, migrate, etc.)
  • Utility functions for formatting, multicall, and address management
  • Full compatibility with @wagmi/core, viem, @woof-software/comet-sdk, and @woof-software/subgraph-sdk

Installation

Before installing this package, make sure you have the following peer dependencies installed:

pnpm add \
  @woof-software/comet-sdk \
  @woof-software/subgraph-sdk \
  @wagmi/core \
  viem

Then:

pnpm add @woof-software/comet-sdk-wagmi

Quickstart

Configure wagmi

import { createConfig, http } from "@wagmi/core";
import { arbitrum, mainnet } from "@wagmi/core/chains";

const wagmiConfig = createConfig({
  chains: [mainnet, arbitrum],
  transports: {
    [mainnet.id]: http(),
    [arbitrum.id]: http(),
  },
});

Or use the built-in config:

import { wagmiConfig } from "@woof-software/comet-sdk-wagmi";

Fetch protocol data

All main protocol entities are extended with wagmi-based fetchers:

import { Market, User, Collateral, Curve, UserMarket, SandboxController, ConfigController } from "@woof-software/comet-sdk-wagmi";

// Fetch a single market
const market = await Market.fetchMarket("0xCometAddress", sepolia.id, wagmiConfig);

// Fetch all markets
const markets = await Market.fetchMarkets(
    {
      [arbitrum.id]: [
        "0xCometAddress1" as Address,
        "0xCometAddress2" as Address,
      ]
    },
    config
);

// Fetch a user
const user = await User.fetch("0xUserAddress", "URL_Subgraph");

// Fetch user active markets
const activeMarkets = await User.fetchActiveMarkets("0xUserAddress", "URL_Subgraph");

// Fetch collaterals
const collaterals = await Collateral.fetch("0xCometAddress", sepolia.id);

// Fetch curves
const curves = await Curve.fetch("0xCometAddress", sepolia.id);

// Fetch user market data
const userMarket = await UserMarket.fetchUserMarket("0xCometAddress", "0xUserAddress", sepolia.id, wagmiConfig);

// Fetch sandbox controller
const sandbox = await SandboxController.fetch("0xControllerAddress", sepolia.id, wagmiConfig);

// Fetch config controller
const config = await ConfigController.fetch("0xControllerAddress", sepolia.id, wagmiConfig);

// Fetch sandbox Base
const base = await SandboxController.fetchBase("0xCometAddress", sepolia.id, wagmiConfig);

Mock fetchers

For testing, you can use the fetchMock/fetchMocks methods:

const mockMarket = await Market.fetchMarketMock();
const mockUser = await User.fetchMock();
const mockCollaterals = await Collateral.fetchMocks();
const mockCurves = await Curve.fetchMocks();
const mockBase = await Base.fetchMock();

API Reference

  • Entities with fetchers:
    • Market.fetchMarket, Market.fetchMarkets, Market.fetchMarketMock
    • User.fetch, User.fetchActiveMarkets, User.fetchMock
    • Collateral.fetch, Collateral.fetchMocks
    • Curve.fetch, Curve.fetchMocks
    • UserMarket.fetchUserMarket, UserMarket.fetchUserMarkets
    • SandboxController.fetch
    • ConfigController.fetch
  • Other exports:
    • abis, constants, config, contracts, utils, wrappers

Utilities

  • FormattingUtils — formatting for numbers, tokens, percentages, addresses
  • WagmiUtils — multicall result helper, etc
import { FormattingUtils } from "@woof-software/comet-sdk-wagmi";

console.log(FormattingUtils.formatTokenValue(1234567890123456789n, 18)); // "1.234567890123456789"

Config & ABI

  • All contract ABIs exported
  • Chain, address, and subgraph config exports

API Structure

  • @woof-software/comet-sdk-wagmi/augment — augmented entities and fetchers
  • @woof-software/comet-sdk-wagmi/contracts — contract wrappers
  • @woof-software/comet-sdk-wagmi/wrappers — high-level operation wrappers
  • @woof-software/comet-sdk-wagmi/utils — utilities
  • @woof-software/comet-sdk-wagmi/config — addresses, chains, subgraph URLs
  • @woof-software/comet-sdk-wagmi/abis — all supported contract ABIs