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

@attestia/types

v0.2.1

Published

Shared domain types for the Attestia stack

Downloads

446

Readme

@attestia/types

Part of Attestia -- financial truth infrastructure for the decentralized world.

Shared domain types for the entire Attestia stack. Zero runtime dependencies. Pure TypeScript contracts.

npm version License: MIT


At a Glance

  • Defines the canonical types used across all 14 Attestia packages
  • Intent lifecycle: declared -> approved -> executing -> executed -> verified
  • Financial primitives: Money (string amounts), AccountRef, LedgerEntry
  • Multi-chain references: ChainRef, BlockRef, TokenRef, OnChainEvent
  • Solana-specific extensions: SolanaOnChainEvent, SolanaSlotRef, SolanaCommitment
  • Event architecture: DomainEvent with full causation/correlation tracking
  • 12 runtime type guards for safe validation at system boundaries
  • Zero runtime dependencies -- pure type contracts with guards

Installation

npm install @attestia/types

Usage

Financial primitives

import type { Money, AccountRef, LedgerEntry } from "@attestia/types";

const payment: Money = {
  amount: "1000.00",
  currency: "USDC",
  decimals: 6,
};

const treasury: AccountRef = {
  id: "treasury-main",
  type: "asset",
  name: "Main Treasury",
};

Intent lifecycle

import type { Intent, IntentStatus } from "@attestia/types";

const transfer: Intent = {
  id: "intent-001",
  status: "declared",
  kind: "transfer",
  description: "Pay vendor invoice #1234",
  declaredBy: "ops-admin",
  declaredAt: new Date().toISOString(),
  params: { to: "0xabc...", amount: "500.00", currency: "USDC" },
};

Chain references

import type { ChainRef, OnChainEvent, BlockRef } from "@attestia/types";

const ethereum: ChainRef = {
  chainId: "eip155:1",
  name: "Ethereum Mainnet",
  family: "evm",
};

Runtime type guards

import { isMoney, isIntent, isOnChainEvent } from "@attestia/types";

function processInput(data: unknown) {
  if (isMoney(data)) {
    console.log(`${data.amount} ${data.currency}`);
  }
  if (isIntent(data)) {
    console.log(`Intent ${data.id} is ${data.status}`);
  }
}

API

Types

| Export | Description | |--------|-------------| | Money | Precise monetary amount (string-based, currency-explicit) | | Currency | Currency identifier (token symbols, ISO 4217) | | AccountRef | Reference to a ledger account (asset, liability, income, expense, equity) | | LedgerEntry | A single line in the ledger with debit/credit type | | Intent | A proposed financial action with lifecycle state | | IntentStatus | Lifecycle states: declared, approved, rejected, executing, executed, verified, failed | | IntentDeclaration / IntentApproval / IntentExecution / IntentVerification | Lifecycle event records | | ChainRef / BlockRef / TokenRef | Chain-agnostic blockchain references | | OnChainEvent | An observed on-chain event (read-only) | | SolanaOnChainEvent | Solana-specific event with slot, programId, signature | | SolanaSlotRef / SolanaCommitment | Solana slot and commitment primitives | | DomainEvent | Append-only event with full metadata (actor, causation, correlation) | | EventMetadata | Metadata common to all domain events |

Type Guards

| Guard | Narrows to | |-------|------------| | isMoney(value) | Money | | isAccountRef(value) | AccountRef | | isLedgerEntry(value) | LedgerEntry | | isIntent(value) | Intent | | isIntentStatus(value) | IntentStatus | | isDomainEvent(value) | DomainEvent | | isChainRef(value) | ChainRef | | isBlockRef(value) | BlockRef | | isTokenRef(value) | TokenRef | | isOnChainEvent(value) | OnChainEvent | | isSolanaOnChainEvent(value) | SolanaOnChainEvent | | isEventMetadata(value) | EventMetadata |

Ecosystem

This package is the foundation for all Attestia packages:

| Package | Role | |---------|------| | @attestia/ledger | Double-entry accounting engine | | @attestia/registrum | Constitutional governance layer | | @attestia/chain-observer | Multi-chain observation (EVM, XRPL, Solana) | | @attestia/vault | Intent management and approval workflows | | @attestia/treasury | Treasury operations | | @attestia/reconciler | Cross-system reconciliation | | @attestia/witness | Cryptographic witnessing | | @attestia/proof | Proof generation and verification | | @attestia/verify | Verification primitives | | @attestia/event-store | Append-only event persistence | | @attestia/sdk | Developer SDK | | @attestia/node | Attestia node runtime | | @attestia/demo | Interactive demonstration |

Docs

| Document | Description | |----------|-------------| | Architecture | System architecture overview | | Intent Lifecycle | How intents flow through the system | | Contributing | Contribution guidelines |

License

MIT