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

@wttp/core

v1.0.1

Published

Core contracts, interfaces, and TypeScript types for the Web3 Transfer Protocol (WTTP).

Readme

WTTP Core

Version: 0.1.0
Core contracts, interfaces, and TypeScript types for the Web3 Transfer Protocol (WTTP).

Overview

WTTP Core provides the foundational contracts and type definitions used across the WTTP ecosystem. This package serves as the base dependency for all WTTP implementations including sites, gateways, and client applications.

Features

  • Complete Type Definitions: All WTTP protocol structures and interfaces
  • Interface Contracts: Standard interfaces for Site, Gateway, Storage, and Permissions
  • TypeChain Types: Generated TypeScript types for seamless web3 integration
  • ESP Integration: Built-in support for External Service Provider data points

Installation

# Install from npm
npm install wttp-core

# Or install the organizational scoped package
npm install @tw3/wttp-core

Usage

Import Solidity Interfaces

import "wttp-core/contracts/interfaces/IWTTPSite.sol";
import "wttp-core/contracts/interfaces/WTTPTypes.sol";

contract MyWTTPImplementation {
    using WTTPTypes for WTTPTypes.RequestLine;
    
    function processRequest(WTTPTypes.HEADRequest memory request) external {
        // Your implementation here
    }
}

Import TypeScript Types

import { 
  RequestLine, 
  HEADRequest, 
  HEADResponse,
  Method,
  artifacts,
  IWTTPSite__factory
} from "wttp-core";

// Use types in your TypeScript application
const request: HEADRequest = {
  requestLine: {
    protocol: "WTTP/3.0",
    path: "/index.html",
    method: Method.HEAD
  },
  ifModifiedSince: 0,
  ifNoneMatch: "0x0000000000000000000000000000000000000000000000000000000000000000"
};

// Access contract artifacts
const siteABI = artifacts.IWTTPSite.abi;

// Connect to contracts
const site = IWTTPSite__factory.connect(siteAddress, provider);

Working with WTTP Sites

import { ethers } from 'ethers';
import { IWTTPSite__factory, Method } from 'wttp-core';

async function querySiteContent(siteAddress: string, path: string) {
  const provider = new ethers.JsonRpcProvider('your-rpc-url');
  const site = IWTTPSite__factory.connect(siteAddress, provider);
  
  const response = await site.HEAD({
    requestLine: {
      protocol: "WTTP/3.0",
      path: path,
      method: Method.HEAD
    },
    ifModifiedSince: 0,
    ifNoneMatch: "0x0000000000000000000000000000000000000000000000000000000000000000"
  });
  
  console.log('Content metadata:', {
    statusCode: response.responseLine.code,
    mimeType: response.metadata.mimeType,
    size: response.metadata.size.toString()
  });
}

Package Contents

  • contracts/interfaces/: Core Solidity interface definitions
    • IWTTPSite.sol - Site interface for content serving
    • IWTTPGateway.sol - Gateway interface for routing and ranges
    • IWTTPStorage.sol - Storage interface for content management
    • IWTTPPermissions.sol - Permissions interface for access control
    • WTTPTypes.sol - Complete protocol type definitions
  • typechain-types/: Generated TypeScript type definitions
  • artifacts/: Compiled contract artifacts
  • dist/: Built package with CJS, ESM, and TypeScript declarations

Related Packages

  • @tw3/wttp-sites - WTTP Site contract implementations
  • @tw3/wttp-gateway - WTTP Gateway contract implementations
  • @tw3/wttp-client - Client libraries for WTTP interaction
  • @tw3/esp - External Service Provider framework (dependency)

License

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.

Contributing

Please read our Contributing Guidelines before submitting pull requests.

Support