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

@vetro-protocol/treasury

v1.0.0

Published

Vetro Protocol treasury actions for viem.

Readme

@vetro-protocol/treasury

Vetro Protocol treasury read actions for viem clients. The treasury holds the underlying assets backing a gateway's pegged token (e.g. the USDT backing VUSD); this package exposes the read-only surface needed to inspect that backing.

Installation

pnpm add @vetro-protocol/treasury viem

Overview

  • Read-only — no wallet actions, no events. The treasury is administered separately; consumers query it.
  • getWhitelistedTokens lists every underlying asset the treasury accepts.
  • getTokenConfig / getPrice return the per-token configuration and oracle price (denominated in the gateway's peg unit; convert to USD via the matching Gateway.pegBaseSymbol).
  • getWithdrawable returns how much of a given token can be withdrawn given the current state.

Usage

import { getPrice, getWhitelistedTokens } from "@vetro-protocol/treasury";
import { createPublicClient, http } from "viem";
import { hemi } from "viem/chains";

const publicClient = createPublicClient({ chain: hemi, transport: http() });

const treasuryAddress = "0x..."; // from getTreasury() on the matching gateway

const tokens = await getWhitelistedTokens(publicClient, {
  address: treasuryAddress,
});

const price = await getPrice(publicClient, {
  address: treasuryAddress,
  token: tokens[0],
});

The same actions are also available via the .extend() factory (treasuryPublicActions()) for callers who prefer viem's extension pattern.

API

  • Public actions (reads):
    • getPrice(client, params) — oracle price for a whitelisted token, in the treasury's peg unit.
    • getTokenConfig(client, params) — per-token configuration struct.
    • getWhitelistedTokens(client, params) — full list of accepted underlying tokens.
    • getWithdrawable(client, params) — current withdrawable amount for a token.
  • treasuryPublicActions() — viem extension factory that wires the same actions onto a client via .extend().
  • treasuryAbi — the minimal ABI subset used by the package.