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

@steamlink/types

v0.0.1

Published

Shared branded types and the canonical `NexusError` taxonomy for the Nexus SDK.

Readme

@steamlink/types

Shared branded types and the canonical NexusError taxonomy for the Nexus SDK.

What it is

Nexus is a fully onchain, turn-based game engine SDK for Base. @steamlink/types is its dependency-free base package: it holds the branded primitive types (addresses, hex, token amounts), the Base chain constants, and the one canonical NexusError / error-code taxonomy that every other @steamlink/* package imports. Defining errors and primitives once here keeps the whole SDK typed end to end.

Install

npm install @steamlink/types
pnpm add @steamlink/types
# or
yarn add @steamlink/types

What's inside

Branded primitive types (branded.ts) — nominal at compile time, plain strings/bigints at runtime:

  • Types: Hex, Address, Bytes32, TokenAmount, TokenSymbol
  • Validators / constructors: asHex, asAddress, isAddress, asBytes32, asTokenAmount

Chain constants (chain.ts) — Base only:

  • CHAINS (config for base and base-sepolia, including canonical USDC addresses)
  • ChainKey type, isChainKey guard, chainConfig lookup

Errors (errors.ts) — the canonical error surface:

  • NexusError class with code, retryable, context, txHash, plus toJSON() and the static guards NexusError.is / NexusError.has
  • NEXUS_ERROR_CODES (the full code list) and the NexusErrorCode union — e.g. NOT_YOUR_TURN, BUDGET_EXCEEDED, DELEGATION_EXPIRED, TARGET_MISMATCH, PAYMENT_REQUIRED, RNG_PENDING, INTERNAL
  • NexusErrorOptions for constructor options
  • codeFromRevert — maps an on-chain enforcer revert string to a NexusErrorCode

Usage

Construct and narrow a branded type:

import { asAddress, type Address } from "@steamlink/types";

const player: Address = asAddress("0x036CbD53842c5426634e7929541eC2318f3dCF7e");
// throws TypeError if the input isn't a 20-byte 0x address

Throw and handle a typed error:

import { NexusError } from "@steamlink/types";

try {
  throw new NexusError("NOT_YOUR_TURN", "It is not your turn to move.");
} catch (e) {
  if (NexusError.has(e, "NOT_YOUR_TURN")) {
    // narrowed to NexusError with code "NOT_YOUR_TURN"
    console.log(e.code, e.retryable);
  }
}

Part of Nexus

Peer packages: @steamlink/core, @steamlink/react, @steamlink/server, @steamlink/relayer, @steamlink/secrets, @steamlink/cli. Base only.