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

@dootfoundation/client

v1.0.11

Published

Doot client to handle o1js compatible data feeds For The Mina Protocol.

Readme

Doot Oracle Client

Get real-time cryptocurrency prices with zero-knowledge proofs on the Mina blockchain.

What is Doot?

Doot provides verified price data for 10 major cryptocurrencies using zero-knowledge proofs. Your app gets fast, reliable prices with automatic fallback across multiple sources.

Quick Start

npm install @dootfoundation/client
import { Client } from '@dootfoundation/client';

const client = new Client('your-api-key');
const price = await client.getData('bitcoin');

console.log(`Bitcoin: $${price.price_data.price}`);

zkApp-CLI Usage

When using in zkApp-CLI projects, you may need to add @ts-ignore for TypeScript compilation:

import dotenv from 'dotenv';
dotenv.config();

// @ts-ignore
import { Client } from '@dootfoundation/client';

const client = new Client(process.env.DOOT_API_KEY);
const price = await client.getData('bitcoin');

This is only a TypeScript compilation issue - the package works perfectly at runtime in zkApp-CLI environments.

Supported Tokens

  • bitcoin - Bitcoin (BTC)
  • ethereum - Ethereum (ETH)
  • mina - Mina Protocol (MINA)
  • solana - Solana (SOL)
  • chainlink - Chainlink (LINK)
  • ripple - XRP (XRP)
  • dogecoin - Dogecoin (DOGE)
  • polygon - Polygon (MATIC)
  • avalanche - Avalanche (AVAX)
  • cardano - Cardano (ADA)

How It Works

Doot uses a 3-layer fallback system:

  1. API (fastest, ~100ms) - Direct from Doot servers
  2. L2 (fast, ~10-30s) - Zeko Layer 2 blockchain
  3. L1 (secure, ~30-60s) - Mina mainnet blockchain

If one source fails, it automatically tries the next one.

API Methods

getData(token)

Smart fallback through all sources (recommended)

const price = await client.getData('ethereum');

getFromAPI(token)

Get price directly from API (requires valid key)

const price = await client.getFromAPI('bitcoin');

getFromL2(token)

Get price from Zeko L2 blockchain

const price = await client.getFromL2('solana');

getFromL1(token)

Get price from Mina L1 blockchain

const price = await client.getFromL1('mina');

isKeyValid()

Check if your API key works

const valid = await client.isKeyValid();

validtokens

List of supported tokens

import { validtokens } from '@dootfoundation/client';
console.log(validtokens); // ['bitcoin', 'ethereum', ...]

Response Format

All methods return the same format:

{
  source: 'API',           // Which source provided the data
  fromAPI: true,           // Boolean flags for source
  fromL2: false,
  fromL1: false,
  price_data: {
    token: 'bitcoin',
    price: '65432.12',     // Price as string
    decimals: '10',        // Decimal places
    aggregationTimestamp: '1640995200000',
    signature: 'ABC123...', // ZK proof signature
    oracle: 'B62q...'      // Oracle public key
  },
  proof_data: '{...}'      // Zero-knowledge proof data
}

Get an API Key

  1. Visit doot.foundation/dashboard
  2. Sign up for a free account
  3. Generate your API key
  4. Start building!

Examples

Basic Price Fetching

import { Client } from '@dootfoundation/client';

const client = new Client('your-api-key');

// Get Bitcoin price with fallback
const btc = await client.getData('bitcoin');
console.log(`BTC: $${btc.price_data.price}`);

// Get multiple prices
const tokens = ['bitcoin', 'ethereum', 'solana'];
for (const token of tokens) {
  const price = await client.getData(token);
  console.log(`${token}: $${price.price_data.price}`);
}

Using in a Trading Bot

import { Client } from '@dootfoundation/client';

const client = new Client(process.env.DOOT_API_KEY);

async function checkPrices() {
  try {
    const eth = await client.getData('ethereum');
    const btc = await client.getData('bitcoin');

    const ethPrice = parseFloat(eth.price_data.price);
    const btcPrice = parseFloat(btc.price_data.price);

    console.log(`ETH/BTC ratio: ${(ethPrice / btcPrice).toFixed(4)}`);
  } catch (error) {
    console.error('Price fetch failed:', error.message);
  }
}

setInterval(checkPrices, 60000); // Check every minute

Environment Variables

# .env file
DOOT_API_KEY=your-api-key-here
import dotenv from 'dotenv';
dotenv.config();

const client = new Client(process.env.DOOT_API_KEY);

Error Handling

try {
  const price = await client.getData('bitcoin');
  console.log('Success:', price);
} catch (error) {
  if (error.message.includes('Invalid token')) {
    console.log('Token not supported');
  } else if (error.message.includes('401')) {
    console.log('Invalid API key');
  } else {
    console.log('Network or service error');
  }
}

Requirements

  • Node.js 18+
  • Internet connection
  • API key for fastest access (free at doot.foundation)

No Setup Required

This package works in any Node.js environment. No special blockchain setup needed - just install and use!

Support

License

ISC License - see LICENSE.md file for details.