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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@witnessco/client

v0.5.0

Published

Typescript SDK for Witness

Downloads

1,708

Readme

Witness Client

Features

Witness Client: A client for interacting with Witness.

  • Fetch-based client built on OpenAPI specification
  • Supports customizing fetch function for different environments
  • Configurable with API key and custom RPC URL
  • Verifies proofs against the chain

Usage

bun add @witnessco/client
import { WitnessClient } from '@witnessco/client'

// Instantiate a new client, default params should suffice for now.
const witness = new WitnessClient()

// Unique string, so we get an unseen leafHash.
const sampleString = `Check the chain! @ ${Date.now()}`
const leafHash = witness.hash(sampleString)

console.log(`Posting leaf hash ${leafHash}`)
await witness.postLeaf(leafHash)
console.log('Waiting for onchain inclusion (may take up to 10min)')
await witness.waitForCheckpointedLeafHash(leafHash)

// Get the timestamp for the leaf.
const timestamp = await witness.getTimestampForLeafHash(leafHash)
console.log(`Leaf ${leafHash} was timestamped at ${timestamp}`)

// Get and verify proof.
const proof = await witness.getProofForLeafHash(leafHash)
const verified = await witness.verifyProofChain(proof)
console.log(`Proof verified: ${verified}`)

See this repl for a live example.

Contract Deployments

Canonical deployments for Witness.sol are available as follows:

| Chain ID | Deployment Address | | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | Mainnet (1) | 0x0000000e143f453f45B2E1cCaDc0f3CE21c2F06a | | Base (8453) | 0x0000000e143f453f45B2E1cCaDc0f3CE21c2F06a | | Optimism (10) | 0x0000000e143f453f45B2E1cCaDc0f3CE21c2F06a | | Sepolia (11155111) | 0x00000008bcf12Eeb9E4162687D6D251f0F4e7FC2 | | Base Sepolia (84532) | 0x0000000159C8253802551eEaf8b475db1A50d712 | | Optimism Sepolia (11155420) | 0x0000000a3fa5CFe56b202F376cCa7334c93aEB8b | | Arbitrum Sepolia (421614) | 0x00000006399970c8bdad606abD03b1712974E4eA | | Gnosis Chiado (10200) | 0x000000031C0d9df77F390CED953219E561B67089 |

See the contracts-core repo for more details.

More Info

See docs.witness.co for more background on Witness, or the contracts-core repo for more details on the contracts.

Built With